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

Embed: (wiki syntax)

« Back to documentation index

USBEndpoint Class Reference

USBEndpoint Class Reference

USBEndpoint class. More...

#include <USBEndpoint.h>

Public Member Functions

 USBEndpoint ()
 Constructor.
void init (HCED *hced, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir, uint32_t size, uint8_t ep_number, HCTD *td_list[2])
 Initialize an endpoint.
void setNextToken (uint32_t token)
 Set next token.
void queueEndpoint (USBEndpoint *endpoint)
 Queue an endpoint.
USB_TYPE queueTransfer ()
 Queue a transfer on the endpoint.
void unqueueTransfer (volatile HCTD *td)
 Unqueue a transfer from the endpoint.
template<typename T >
void attach (T *tptr, void(T::*mptr)(void))
 Attach a member function to call when a transfer is finished.
void attach (void(*fptr)(void))
 Attach a callback called when a transfer is finished.
void call ()
 Call the handler associted to the end of a transfer.

Detailed Description

USBEndpoint class.

Definition at line 29 of file USBEndpoint.h.


Constructor & Destructor Documentation

USBEndpoint (  )

Constructor.

Definition at line 35 of file USBEndpoint.h.


Member Function Documentation

void attach ( T *  tptr,
void(T::*)(void)  mptr 
)

Attach a member function to call when a transfer is finished.

Parameters:
tptrpointer to the object to call the member function on
mptrpointer to the member function to be called

Definition at line 90 of file USBEndpoint.h.

void attach ( void(*)(void)  fptr )

Attach a callback called when a transfer is finished.

Parameters:
fptrfunction pointer

Definition at line 101 of file USBEndpoint.h.

void call (  )

Call the handler associted to the end of a transfer.

Definition at line 110 of file USBEndpoint.h.

void init ( HCED *  hced,
ENDPOINT_TYPE  type,
ENDPOINT_DIRECTION  dir,
uint32_t  size,
uint8_t  ep_number,
HCTD *  td_list[2] 
)

Initialize an endpoint.

Parameters:
hcedhced associated to the endpoint
typeendpoint type
direndpoint direction
sizeendpoint size
ep_numberendpoint number
td_listarray of two allocated transfer descriptors

Definition at line 21 of file USBEndpoint.cpp.

void queueEndpoint ( USBEndpoint endpoint )

Queue an endpoint.

Parameters:
endpointendpoint which will be queued in the linked list

Definition at line 158 of file USBEndpoint.cpp.

USB_TYPE queueTransfer (  )

Queue a transfer on the endpoint.

Definition at line 134 of file USBEndpoint.cpp.

void setNextToken ( uint32_t  token )

Set next token.

Warning: only useful for the control endpoint

Parameters:
tokenIN, OUT or SETUP token

Definition at line 82 of file USBEndpoint.cpp.

void unqueueTransfer ( volatile HCTD *  td )

Unqueue a transfer from the endpoint.

Parameters:
tdhctd which will be unqueued

Definition at line 147 of file USBEndpoint.cpp.