- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to know how to determine when a software client (like teraterm in windows or screen in linux/macintosh) connects to the PSOC5 USB configured as a USBUart device using the standard Cypress provided USB Drivers in windows and the generic drivers in Linux/Macintosh.
The following example code:
/* Host can send double SET_INTERFACE request. */
if (0u != USBUART_IsConfigurationChanged())
{
/* Initialize IN endpoints when device is configured. */
if (0u != USBUART_GetConfiguration())
{
/* Enumeration is done, enable OUT endpoint to receive data
* from host. */
USBUART_CDC_Init();
}
}
if(0 != USBUART_GetConfiguration()){
/* Check for input data from host. */
if (0u != USBUART_DataIsReady()){
......
}
Only lets you know when the USB is enumerated and the endpoints are established. This is ages before the Software program connects (in CPU time).
I have tried reading the DataSheet for the USBFS/USBUart module, and searched the automatically generated code, but I have not been able to determine what interrupts/signals/data are given to the PSOC when a software program connects to the USB port.
I would like to generate a sign-on message through the USB Serial port so the connecting program (or user) knows the device is alive and ready.
Can someone help?
Thank You!
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the function Cy_USB_Dev_CDC_IsLineChanged to find out if anything changed. It would return a value different then zero when connecting, disconnecting or changing the COM settings in the terminal emulator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the function Cy_USB_Dev_CDC_IsLineChanged to find out if anything changed. It would return a value different then zero when connecting, disconnecting or changing the COM settings in the terminal emulator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That function morphs into USBUART_IsLineChanged() if you name your USBFS component USBUART.
It appears to work well.
I looked through the auto-generated code, but never saw where it was written to in memory, but I did not delve into the component.
Thanks!