USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.
Dependencies: FATFileSystem mbed-rtos
Dependents: BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more
USBHALHost Class Reference
USBHALHost class. More...
#include <USBHALHost.h>
Inherited by USBHost.
Protected Member Functions | |
USBHALHost () | |
Constructor init variables and memory where will be stored HCCA, ED and TD. | |
void | init () |
Initialize host controller. | |
void | resetRootHub () |
reset the root hub | |
uint32_t | controlHeadED () |
return the value contained in the control HEAD ED register | |
uint32_t | bulkHeadED () |
return the value contained in the bulk HEAD ED register | |
uint32_t | interruptHeadED () |
return the value of the head interrupt ED contained in the HCCA | |
void | updateControlHeadED (uint32_t addr) |
Update the head ED for control transfers. | |
void | updateBulkHeadED (uint32_t addr) |
Update the head ED for bulk transfers. | |
void | updateInterruptHeadED (uint32_t addr) |
Update the head ED for interrupt transfers. | |
void | enableList (ENDPOINT_TYPE type) |
Enable List for the specified endpoint type. | |
bool | disableList (ENDPOINT_TYPE type) |
Disable List for the specified endpoint type. | |
virtual void | deviceConnected (int hub, int port, bool lowSpeed, USBHostHub *hub_parent=NULL)=0 |
Virtual method called when a device has been connected. | |
virtual void | deviceDisconnected (int hub, int port, USBHostHub *hub_parent, volatile uint32_t addr)=0 |
Virtual method called when a device has been disconnected. | |
virtual void | transferCompleted (volatile uint32_t addr)=0 |
Virtual method called when a transfer has been completed. | |
volatile uint8_t * | getED () |
Find a memory section for a new ED. | |
volatile uint8_t * | getTD () |
Find a memory section for a new TD. | |
void | freeED (volatile uint8_t *ed) |
Release a previous memory section reserved for an ED. | |
void | freeTD (volatile uint8_t *td) |
Release a previous memory section reserved for an TD. |
Detailed Description
USBHALHost class.
Definition at line 28 of file USBHALHost.h.
Constructor & Destructor Documentation
USBHALHost | ( | ) | [protected] |
Constructor init variables and memory where will be stored HCCA, ED and TD.
Member Function Documentation
uint32_t bulkHeadED | ( | ) | [protected] |
return the value contained in the bulk HEAD ED register
- Returns:
- address of the bulk head ED
uint32_t controlHeadED | ( | ) | [protected] |
return the value contained in the control HEAD ED register
- Returns:
- address of the control Head ED
virtual void deviceConnected | ( | int | hub, |
int | port, | ||
bool | lowSpeed, | ||
USBHostHub * | hub_parent = NULL |
||
) | [protected, pure virtual] |
Virtual method called when a device has been connected.
- Parameters:
-
hub hub number of the device port port number of the device lowSpeed 1 if low speed, 0 otherwise hub_parent reference to the hub where the device is connected (NULL if the hub parent is the root hub)
Implemented in USBHost.
virtual void deviceDisconnected | ( | int | hub, |
int | port, | ||
USBHostHub * | hub_parent, | ||
volatile uint32_t | addr | ||
) | [protected, pure virtual] |
Virtual method called when a device has been disconnected.
- Parameters:
-
hub hub number of the device port port number of the device hub_parent reference to the hub where the device is connected (NULL if the hub parent is the root hub) addr list of the TDs which have been completed to dequeue freed TDs
Implemented in USBHost.
bool disableList | ( | ENDPOINT_TYPE | type ) | [protected] |
Disable List for the specified endpoint type.
- Parameters:
-
type disable the list of ENDPOINT_TYPE type
void enableList | ( | ENDPOINT_TYPE | type ) | [protected] |
Enable List for the specified endpoint type.
- Parameters:
-
type enable the list of ENDPOINT_TYPE type
void freeED | ( | volatile uint8_t * | ed ) | [protected] |
Release a previous memory section reserved for an ED.
- Parameters:
-
ed address of the ED
void freeTD | ( | volatile uint8_t * | td ) | [protected] |
Release a previous memory section reserved for an TD.
- Parameters:
-
td address of the TD
volatile uint8_t* getED | ( | ) | [protected] |
Find a memory section for a new ED.
- Returns:
- the address of the new ED
volatile uint8_t* getTD | ( | ) | [protected] |
Find a memory section for a new TD.
- Returns:
- the address of the new TD
void init | ( | ) | [protected] |
Initialize host controller.
Enable USB interrupts. This part is not in the constructor because, this function calls a virtual method if a device is already connected
uint32_t interruptHeadED | ( | ) | [protected] |
return the value of the head interrupt ED contained in the HCCA
- Returns:
- address of the head interrupt ED contained in the HCCA
void resetRootHub | ( | ) | [protected] |
reset the root hub
virtual void transferCompleted | ( | volatile uint32_t | addr ) | [protected, pure virtual] |
Virtual method called when a transfer has been completed.
- Parameters:
-
addr list of the TDs which have been completed
Implemented in USBHost.
void updateBulkHeadED | ( | uint32_t | addr ) | [protected] |
Update the head ED for bulk transfers.
void updateControlHeadED | ( | uint32_t | addr ) | [protected] |
Update the head ED for control transfers.
void updateInterruptHeadED | ( | uint32_t | addr ) | [protected] |
Update the head ED for interrupt transfers.
Generated on Tue Jul 12 2022 13:32:26 by 1.7.2