AnsweredAssumed Answered

LPC1788 lpcusblib里面只对port 1做处理 ,没有对port2做处理

Question asked by chao li on May 15, 2017
Latest reply on Dec 26, 2018 by ulysses fonseca

我在调试lpc1788的usb host部分时候发现 

lpcusblib的ohci.c中只针对 port1 处理没有针对port2 做处理

 

if (IntStatus & HC_INTERRUPT_RootHubStatusChange) { //´¦Àí root hubµÄ״̬¸ü¸Ä ÓÐ
for(;USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_StatusChangeMask;){
/* only 1 port/host --> skip to get the number of ports */ //ÕâÀïÖ»´¦ÀíÁË USB1µÄÇé¿öûÓд¦Àí USB2µÄÇé¿ö ..À¬»ø¿â
if (USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_ConnectStatusChange) {
if (USB_REG(HostID)->RhStatus & HC_RH_STATUS_DeviceRemoteWakeupEnable) { /* means a remote wakeup event */ //Ô¶³Ì»½ÐÑ

}
else {}

USB_REG(HostID)->RhPortStatus1 = HC_RH_PORT_STATUS_ConnectStatusChange; /* clear CSC bit */ //¼ì²âµ½²åÈë »òÕ߰γöʼþ
OHciRhStatusChangeIsr(HostID, USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_CurrentConnectStatus);
}

if (USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_PortEnableStatusChange) {
USB_REG(HostID)->RhPortStatus1 = HC_RH_PORT_STATUS_PortEnableStatusChange; /* clear PESC */ //½«¶Ë¿ÚʹÄÜ
}

if (USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_PortSuspendStatusChange) {
USB_REG(HostID)->RhPortStatus1 = HC_RH_PORT_STATUS_PortSuspendStatusChange; /* clear PSSC */ //¹ÒÆð´Ë¶Ë¿Ú
}

if (USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_OverCurrentIndicatorChange) { /* Over-current handler to avoid physical damage */
USB_REG(HostID)->RhPortStatus1 = HC_RH_PORT_STATUS_OverCurrentIndicatorChange; /* clear OCIC */ //½áÊøʲô ָʾ·û±êÖ¾
}

if (USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_PortResetStatusChange) {
USB_REG(HostID)->RhPortStatus1 = HC_RH_PORT_STATUS_PortResetStatusChange; /* clear PRSC */ //Èí¼þ¸´Î»¶Ë¿Ú
}
}
}

Outcomes