#if (ENABLE_USB2 == 0 ) HCD_STATUS HcdGetDeviceSpeed(uint8_t HostID, HCD_USB_SPEED *DeviceSpeed) { if ( USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_CurrentConnectStatus) {/* If device is connected */ *DeviceSpeed = ( USB_REG(HostID)->RhPortStatus1 & HC_RH_PORT_STATUS_LowSpeedDeviceAttached) ? LOW_SPEED : FULL_SPEED; return HCD_STATUS_OK; } else { return HCD_STATUS_DEVICE_DISCONNECTED; } } #else HCD_STATUS HcdGetDeviceSpeed(uint8_t HostID, HCD_USB_SPEED *DeviceSpeed) { if ( USB_REG(HostID)->RhPortStatus2 & HC_RH_PORT_STATUS_CurrentConnectStatus) {/* If device is connected */ *DeviceSpeed = ( USB_REG(HostID)->RhPortStatus2 & HC_RH_PORT_STATUS_LowSpeedDeviceAttached) ? LOW_SPEED : FULL_SPEED; return HCD_STATUS_OK; } else { return HCD_STATUS_DEVICE_DISCONNECTED; } } #endif |
I would like use USB port 2 as host on LPC1788. Unfortunaly i found there are exist examples only for port1.
I made following changes in original code:
- pin muxing to port2 in HAL_USBInit.
- change USB function to USB_REG(HostID)->StCtrl = 0x00 in HciInitDriver
- replacing USB_REG(HostID)->RhPortStatus1 to USB_REG(HostID)->RhPortStatus2 in all project
but code still not working.
Could you give me some advice how to properly change lpcusblib library?
Thank you in advance.