![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Modules | |
| Enhanced Host Controller Interface Driver | |
| Open Host Controller Interface Driver | |
Macros | |
| #define | HCD_ENDPOINT_MAXPACKET_XFER_LEN 0xFFEEFFEE |
| #define | YES 1 |
| #define | NO 0 |
| #define | HCD_MAX_ENDPOINT 8 |
| #define | HC_RESET_TIMEOUT 10 |
| #define | TRANSFER_TIMEOUT_MS 1000 |
| #define | PORT_RESET_PERIOD_MS 100 |
| #define | INTERRUPT_LIST_ENABLE YES |
| #define | ISO_LIST_ENABLE YES |
| #define | hcd_printf(...) |
| #define | assert_status_ok_message(...) |
| #define | ASSERT_STATUS_OK_MESSAGE(sts, message) |
| #define | ASSERT_STATUS_OK(sts) ASSERT_STATUS_OK_MESSAGE(sts, NULL) |
Functions | |
| HCD_STATUS | HcdInitDriver (uint8_t HostID) |
| Initiate host driver. | |
| HCD_STATUS | HcdDeInitDriver (uint8_t HostID) |
| De-initiate host driver. | |
| void | HcdIrqHandler (uint8_t HostID) |
| Interrupt service routine for host mode This function must be called in chip's USB interrupt routine. | |
| HCD_STATUS | HcdRhPortReset (uint8_t HostID) |
| Perform USB bus reset. | |
| HCD_STATUS | HcdRhPortEnable (uint8_t HostID) |
| Turn on 5V USB VBUS. | |
| HCD_STATUS | HcdRhPortDisable (uint8_t HostID) |
| Turn off 5V USB VBUS. | |
| HCD_STATUS | HcdGetDeviceSpeed (uint8_t HostID, HCD_USB_SPEED *DeviceSpeed) |
| Get operation speed of connected device. | |
| uint32_t | HcdGetFrameNumber (uint8_t HostID) |
| Get current frame number. | |
| HCD_STATUS | HcdOpenPipe (uint8_t HostID, uint8_t DeviceAddr, HCD_USB_SPEED DeviceSpeed, uint8_t EndpointNo, HCD_TRANSFER_TYPE TransferType, HCD_TRANSFER_DIR TransferDir, uint16_t MaxPacketSize, uint8_t Interval, uint8_t Mult, uint8_t HSHubDevAddr, uint8_t HSHubPortNum, uint32_t *const PipeHandle) |
| Setup a pipe to connect to device's logical endpoint. | |
| HCD_STATUS | HcdClosePipe (uint32_t PipeHandle) |
| Delete the link between USB host and device's logical endpoint. | |
| HCD_STATUS | HcdCancelTransfer (uint32_t PipeHandle) |
| Cancel a processing transfer. | |
| HCD_STATUS | HcdClearEndpointHalt (uint32_t PipeHandle) |
| Clear stall status for connected endpoint. | |
| HCD_STATUS | HcdControlTransfer (uint32_t PipeHandle, const USB_Request_Header_t *const pDeviceRequest, uint8_t *const buffer) |
| Perform a control transfer. | |
| HCD_STATUS | HcdDataTransfer (uint32_t PipeHandle, uint8_t *const buffer, uint32_t const length, uint16_t *const pActualTransferred) |
| Perform a non-control transfer. | |
| HCD_STATUS | HcdGetPipeStatus (uint32_t PipeHandle) |
| Get current pipe status. | |
| void | HcdSetStreamPacketSize (uint32_t PipeHandle, uint16_t packetsize) |
| Set size of each packet in a continuous data transfer. | |
| #define ASSERT_STATUS_OK | ( | sts | ) | ASSERT_STATUS_OK_MESSAGE(sts, NULL) |
| #define ASSERT_STATUS_OK_MESSAGE | ( | sts, | |
| message | |||
| ) |
| #define HC_RESET_TIMEOUT 10 |
| #define HCD_ENDPOINT_MAXPACKET_XFER_LEN 0xFFEEFFEE |
Used with HcdDataTransfer() to set maximum endpoint size for transfer length
| #define HCD_MAX_ENDPOINT 8 |
| #define INTERRUPT_LIST_ENABLE YES |
| #define ISO_LIST_ENABLE YES |
| #define PORT_RESET_PERIOD_MS 100 |
| #define TRANSFER_TIMEOUT_MS 1000 |
| enum HCD_STATUS |
Declare status/completion code for host processing
| enum HCD_TRANSFER_DIR |
| enum HCD_TRANSFER_TYPE |
| enum HCD_USB_SPEED |
| HCD_STATUS HcdCancelTransfer | ( | uint32_t | PipeHandle | ) |
Cancel a processing transfer.
| PipeHandle | : encoded pipe handle information |
| HCD_STATUS HcdClearEndpointHalt | ( | uint32_t | PipeHandle | ) |
Clear stall status for connected endpoint.
| PipeHandle | : encoded pipe handle information |
| HCD_STATUS HcdClosePipe | ( | uint32_t | PipeHandle | ) |
Delete the link between USB host and device's logical endpoint.
| PipeHandle | : encoded pipe handle information |
| HCD_STATUS HcdControlTransfer | ( | uint32_t | PipeHandle, |
| const USB_Request_Header_t *const | pDeviceRequest, | ||
| uint8_t *const | buffer | ||
| ) |
Perform a control transfer.
| PipeHandle | : encoded pipe handle information |
| pDeviceRequest,: | pointer to USB_Request_Header_t structure |
| buffer | : pointer to share buffer used in data phase |
| HCD_STATUS HcdDataTransfer | ( | uint32_t | PipeHandle, |
| uint8_t *const | buffer, | ||
| uint32_t const | length, | ||
| uint16_t *const | pActualTransferred | ||
| ) |
Perform a non-control transfer.
| PipeHandle | : encoded pipe handle information |
| buffer | : pointer to transferred data buffer |
| length | : size of this transfer |
| pActualTransferred,: | return actual transfer bytes through pointer |
| HCD_STATUS HcdDeInitDriver | ( | uint8_t | HostID | ) |
| HCD_STATUS HcdGetDeviceSpeed | ( | uint8_t | HostID, |
| HCD_USB_SPEED * | DeviceSpeed | ||
| ) |
Get operation speed of connected device.
| HostID | : USB port number |
| DeviceSpeed | : return device speed through pointer of type HCD_USB_SPEED |
| uint32_t HcdGetFrameNumber | ( | uint8_t | HostID | ) |
Get current frame number.
| HostID | : USB port number |
| HCD_STATUS HcdGetPipeStatus | ( | uint32_t | PipeHandle | ) |
Get current pipe status.
| PipeHandle | : encoded pipe handle information |
| HCD_STATUS HcdInitDriver | ( | uint8_t | HostID | ) |
| void HcdIrqHandler | ( | uint8_t | HostID | ) |
Interrupt service routine for host mode This function must be called in chip's USB interrupt routine.
| HostID | : USB port number |
| HCD_STATUS HcdOpenPipe | ( | uint8_t | HostID, |
| uint8_t | DeviceAddr, | ||
| HCD_USB_SPEED | DeviceSpeed, | ||
| uint8_t | EndpointNo, | ||
| HCD_TRANSFER_TYPE | TransferType, | ||
| HCD_TRANSFER_DIR | TransferDir, | ||
| uint16_t | MaxPacketSize, | ||
| uint8_t | Interval, | ||
| uint8_t | Mult, | ||
| uint8_t | HSHubDevAddr, | ||
| uint8_t | HSHubPortNum, | ||
| uint32_t *const | PipeHandle | ||
| ) |
Setup a pipe to connect to device's logical endpoint.
| HostID | : USB port number |
| DeviceAddr | : address of connected device |
| DeviceSpeed | : speed of connected device in format HCD_USB_SPEED |
| EndpointNo | : connected logical endpoint number |
| TransferType | : transfer type of this link in format HCD_TRANSFER_TYPE |
| TransferDir | : direction of this link in format HCD_TRANSFER_DIR |
| MaxPacketSize,: | maximum size of connected endpoint |
| Interval | : polling frequency for this transfer type, only apply for period transfer |
| Mult | : used for isochronous transfer to determine number of packets sent in one transaction |
| HSHubDevAddr | : currently not use this parameter |
| HSHubPortNum | : currently not use this parameter |
| PipeHandle | : pointer to return pipe handle information |
| HCD_STATUS HcdRhPortDisable | ( | uint8_t | HostID | ) |
| HCD_STATUS HcdRhPortEnable | ( | uint8_t | HostID | ) |
| HCD_STATUS HcdRhPortReset | ( | uint8_t | HostID | ) |
| void HcdSetStreamPacketSize | ( | uint32_t | PipeHandle, |
| uint16_t | packetsize | ||
| ) |
Set size of each packet in a continuous data transfer.
| PipeHandle | : encoded pipe handle information |
| packetsize | : packet size |