AG903ライブラリリファレンス
Body Source
Usbh_Api_GetPortPower 関数
本文ソース
コピコード
1: uhs_ubit8_t Usbh_Api_GetPortPower(
struct
usbd_usb_deviceinfo
*usbhub,
const
uhs_ubit8_t port_num ) 2: { 3: uhs_status_t retval =
UDI_OK
; 4:
struct
usbh_port_status port_status; 5: uhs_ubit8_t port_power = 0; 6:
struct
usb_hub_info
*hub_info = NULL; 7: 8: port_status.port_status = 0; 9: port_status.port_change_status = 0; 10: 11:
if
( ehci_rh->usbdev == usbhub ) { 12: hub_info = ehci_rh; 13: }
else
{ 14: CORE_REPORT_ERROR(
USBC_ILLEGAL_ERROR
); 15:
return
USBH_RH_PORT_POWER_OFF
; 16: } 17: 18: retval =
Usb_HubApi_GetStatus
( hub_info, &port_status, port_num ); 19:
if
( retval !=
UDI_OK
) { 20: CORE_REPORT_WARNING(
USBC_ILLEGAL_ERROR
); 21:
return
USBH_RH_PORT_POWER_OFF
; 22: } 23: 24:
if
( ( port_status.port_status & PS_PORT_POWER ) == PS_PORT_POWER ) { 25: port_power =
USBH_RH_PORT_POWER_ON
; 26: }
else
{ 27: port_power =
USBH_RH_PORT_POWER_OFF
; 28: } 29: 30:
return
port_power; 31: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.
内容
|
インデックス
|
ホーム