LPC11U68 - PC shutdown detection for USB HID

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC11U68 - PC shutdown detection for USB HID

ソリューションへジャンプ
1,712件の閲覧回数
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

ラベル(3)
0 件の賞賛
返信
1 解決策
1,658件の閲覧回数
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

元の投稿で解決策を見る

2 返答(返信)
1,659件の閲覧回数
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

1,676件の閲覧回数
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 件の賞賛
返信