2015-05-19 02:43 PM
My STM32F103 USB-HID device needs to know, if the host it is connected to is either powered on (S0) or in S3 (STR), S4 (STD) or S5 (SoftOff). How does it detect this reliably?
I am using the STM32_USB-FS-Device_Lib_V4.0.0. So far I tried it with SOF_Callback in usb_istr.c, which resets a counter, which is counting up, and as long as this couter is low, I assume the host is active. However this is not 100% reliably. Is there a more elegant way? And especially a very reliable one? This is needed for a IR remote control receiver, which should only trigger the power button of the host, if the host is down. #usb