USBUART_episr.c: Calling callback upon interrupt

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ZvVe_2582751
Level 1
Level 1
5 replies posted Welcome! 5 questions asked

Hello,

In the sample USBFS_UART01 sample, one of the automatically generated sources is:

USBUART_episr.c

I want that my callback will be called upon an interrupt.

Should I modify USBUART_episr.c ?

I also added:

USBUART_EnableSofInt (); to main.c right after:

USBUART_Start

In general, how can I connect a specified interrupt in a device to my code ?

Thank you,

Zvika

0 Likes
1 Solution

Hi,

Even when there is no active data transmission, the host uses Start of Frame (SOF) tokens to keep devices out of a suspend state.

In the ISR of particular EP you can use API "USBFS_GetEPCount()" which returns the current byte count from the specified USBFS endpoint.

It is dependent on your firmware that you write in callback.

View solution in original post

0 Likes
5 Replies