- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Following is a fragment of the generated source.
Should I call my code (e.g giving a semaphore) between the bold lines ?
Thank you,
Zvika
.....
#if (USBUART_SOF_ISR_ACTIVE)
/*******************************************************************************
* Function Name: USBUART_SOF_ISR
****************************************************************************//**
*
* Start of Frame Interrupt Service Routine.
*
*
*******************************************************************************/
CY_ISR(USBUART_SOF_ISR)
{
#ifdef USBUART_SOF_ISR_ENTRY_CALLBACK
USBUART_SOF_ISR_EntryCallback();
#endif /* (USBUART_SOF_ISR_ENTRY_CALLBACK) */
/* `#START SOF_USER_CODE` Place your code here */
/* `#END` */
USBUART_ClearSieInterruptSource(USBUART_INTR_SIE_SOF_INTR);
#ifdef USBUART_SOF_ISR_EXIT_CALLBACK
USBUART_SOF_ISR_ExitCallback();
#endif /* (USBUART_SOF_ISR_EXIT_CALLBACK) */
}
#endif /* (USBUART_SOF_ISR_ACTIVE) */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do that, but then your changes are lost on a clean build.
Better is to use
USBUART_StartEx(&YourISR);
in your main function (with your ISR routine defined with CY_ISR).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for your reply.
In USBUART.h there is no declaration for USBUART_StartEx (...)
I tried to call this routine but got a link error.
I'm using Creator 4.0
Best regards,
Zvika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank yo very much for your reply !
I'v noticed that the SOF ISR is called a lot (>1000) even if not a single character is sent from PC to the PSOC.
Can you tell why ?
I want to trigger a task (e.g with Semaphore) upon one or more characters sent to PSOC.
Thank you,
Zvika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.