LPC11U68 - PC shutdown detection for USB HID

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC11U68 - PC shutdown detection for USB HID

Jump to solution
963 Views
MaksymDevX
Contributor I

Hi,

We are on FW development for USB HID keyboard with LPC11U68 as the core. We need to detect when PC has been shutdown or suspended/resumed. 

For suspend/resume USB_Suspend_Event, USB_Resume_Event and USB_WakeUpCfg ROM API callbacks are used and everything works fine with it.

On shutdown case, when PC keeps USB ports powered, USB_Suspend_Event and instant USB_Resume_Event callbacks called.

DCON bit of DEVCMDSTAT register remains 1 and DSUS is 0. Other bits are not changed during runtime except DEV_ADDR.

So I can not see the way to detect if the host is online or not. How can it be done, please help

Best Regards, Maksym Naumchuk

Labels (3)
0 Kudos
1 Solution
909 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Maksym

The suspend state is entered when a USB bus is in the idle state for a certain amount of time.

You can monitor VBUS state as you mentioned by reading DCON_C register, however, if the PC is still powering USB port there is physically nothing telling the USB device that the PC is in shutdown state. Therefore, you can check if the device is disconnected, suspended or lost power but there is no specific event when PC is shutdown.

Best regards,

Felipe

View solution in original post

2 Replies
910 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Maksym

The suspend state is entered when a USB bus is in the idle state for a certain amount of time.

You can monitor VBUS state as you mentioned by reading DCON_C register, however, if the PC is still powering USB port there is physically nothing telling the USB device that the PC is in shutdown state. Therefore, you can check if the device is disconnected, suspended or lost power but there is no specific event when PC is shutdown.

Best regards,

Felipe

927 Views
MaksymDevX
Contributor I

Hi, little update.

On another PC during shutdown procedure USB_WakeUpCfg event with parameter 1 called, then USB_Suspend_Event. Which is not logical...

Thanks

0 Kudos