USBHost library

Dependencies:   FATFileSystem

Dependents:   Project RoboticsCatAndMouse_HumanDriver RoboticsCatAndMouse_AutonomousDriver

Fork of USBHost by mbed official

Embed: (wiki syntax)

« Back to documentation index

USBHALHost Class Reference

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.

Definition at line 46 of file USBHALHost.cpp.


Member Function Documentation

uint32_t bulkHeadED (  ) [protected]

return the value contained in the bulk HEAD ED register

Returns:
address of the bulk head ED

Definition at line 138 of file USBHALHost.cpp.

uint32_t controlHeadED (  ) [protected]

return the value contained in the control HEAD ED register

Returns:
address of the control Head ED

Definition at line 134 of file USBHALHost.cpp.

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:
hubhub number of the device
portport number of the device
lowSpeed1 if low speed, 0 otherwise
hub_parentreference 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:
hubhub number of the device
portport number of the device
hub_parentreference to the hub where the device is connected (NULL if the hub parent is the root hub)
addrlist 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:
typedisable the list of ENDPOINT_TYPE type

Definition at line 179 of file USBHALHost.cpp.

void enableList ( ENDPOINT_TYPE  type ) [protected]

Enable List for the specified endpoint type.

Parameters:
typeenable the list of ENDPOINT_TYPE type

Definition at line 160 of file USBHALHost.cpp.

void freeED ( volatile uint8_t *  ed ) [protected]

Release a previous memory section reserved for an ED.

Parameters:
edaddress of the ED

Definition at line 236 of file USBHALHost.cpp.

void freeTD ( volatile uint8_t *  td ) [protected]

Release a previous memory section reserved for an TD.

Parameters:
tdaddress of the TD

Definition at line 242 of file USBHALHost.cpp.

volatile uint8_t * getED (  ) [protected]

Find a memory section for a new ED.

Returns:
the address of the new ED

Definition at line 212 of file USBHALHost.cpp.

volatile uint8_t * getTD (  ) [protected]

Find a memory section for a new TD.

Returns:
the address of the new TD

Definition at line 223 of file USBHALHost.cpp.

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

Definition at line 58 of file USBHALHost.cpp.

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

Definition at line 142 of file USBHALHost.cpp.

void resetRootHub (  ) [protected]

reset the root hub

Definition at line 249 of file USBHALHost.cpp.

virtual void transferCompleted ( volatile uint32_t  addr ) [protected, pure virtual]

Virtual method called when a transfer has been completed.

Parameters:
addrlist of the TDs which have been completed

Implemented in USBHost.

void updateBulkHeadED ( uint32_t  addr ) [protected]

Update the head ED for bulk transfers.

Definition at line 146 of file USBHALHost.cpp.

void updateControlHeadED ( uint32_t  addr ) [protected]

Update the head ED for control transfers.

Definition at line 151 of file USBHALHost.cpp.

void updateInterruptHeadED ( uint32_t  addr ) [protected]

Update the head ED for interrupt transfers.

Definition at line 155 of file USBHALHost.cpp.