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
USBDeviceConnected Class Reference
USBDeviceConnected class. More...
#include <USBDeviceConnected.h>
Public Member Functions | |
USBDeviceConnected () | |
Constructor. | |
bool | addEndpoint (uint8_t intf_nb, USBEndpoint *ep) |
Attach an USBEndpoint to this device. | |
USBEndpoint * | getEndpoint (uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir, uint8_t index=0) |
Retrieve an USBEndpoint by its TYPE and DIRECTION. | |
USBEndpoint * | getEndpoint (uint8_t intf_nb, uint8_t index) |
Retrieve an USBEndpoint by its index. | |
bool | addInterface (uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) |
Add a new interface to this device. | |
INTERFACE * | getInterface (uint8_t index) |
Get a specific interface. | |
template<typename T > | |
void | onDisconnect (uint8_t intf_nb, T *tptr, void(T::*mptr)(void)) |
Attach a member function to call when a the device has been disconnected. | |
void | onDisconnect (uint8_t intf_nb, void(*fn)(void)) |
Attach a callback called when the device has been disconnected. | |
void | disconnect () |
Disconnect the device by calling a callback function registered by a driver. |
Detailed Description
USBDeviceConnected class.
Definition at line 42 of file USBDeviceConnected.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 20 of file USBDeviceConnected.cpp.
Member Function Documentation
bool addEndpoint | ( | uint8_t | intf_nb, |
USBEndpoint * | ep | ||
) |
Attach an USBEndpoint to this device.
- Parameters:
-
intf_nb interface number ep pointeur on the USBEndpoint which will be attached
- Returns:
- true if successful, false otherwise
Definition at line 72 of file USBDeviceConnected.cpp.
bool addInterface | ( | uint8_t | intf_nb, |
uint8_t | intf_class, | ||
uint8_t | intf_subclass, | ||
uint8_t | intf_protocol | ||
) |
Add a new interface to this device.
- Parameters:
-
intf_nb interface number intf_class interface class intf_subclass interface subclass intf_protocol interface protocol
- Returns:
- true if successful, false otherwise
Definition at line 60 of file USBDeviceConnected.cpp.
void disconnect | ( | ) |
Disconnect the device by calling a callback function registered by a driver.
Definition at line 95 of file USBDeviceConnected.cpp.
USBEndpoint * getEndpoint | ( | uint8_t | intf_nb, |
ENDPOINT_TYPE | type, | ||
ENDPOINT_DIRECTION | dir, | ||
uint8_t | index = 0 |
||
) |
Retrieve an USBEndpoint by its TYPE and DIRECTION.
- Parameters:
-
intf_nb the interface on which to lookup the USBEndpoint type type of the USBEndpoint looked for dir direction of the USBEndpoint looked for index the index of the USBEndpoint whitin the interface
- Returns:
- pointer on the USBEndpoint if found, NULL otherwise
Definition at line 103 of file USBDeviceConnected.cpp.
USBEndpoint * getEndpoint | ( | uint8_t | intf_nb, |
uint8_t | index | ||
) |
Retrieve an USBEndpoint by its index.
- Parameters:
-
intf_nb interface number index index of the USBEndpoint
- Returns:
- pointer on the USBEndpoint if found, NULL otherwise
Definition at line 119 of file USBDeviceConnected.cpp.
INTERFACE * getInterface | ( | uint8_t | index ) |
Get a specific interface.
- Parameters:
-
index index of the interface to be fetched
- Returns:
- interface
Definition at line 50 of file USBDeviceConnected.cpp.
void onDisconnect | ( | uint8_t | intf_nb, |
void(*)(void) | fn | ||
) |
Attach a callback called when the device has been disconnected.
- Parameters:
-
intf_nb interface number fn function pointer
Definition at line 119 of file USBDeviceConnected.h.
void onDisconnect | ( | uint8_t | intf_nb, |
T * | tptr, | ||
void(T::*)(void) | mptr | ||
) |
Attach a member function to call when a the device has been disconnected.
- Parameters:
-
intf_nb interface number tptr pointer to the object to call the member function on mptr pointer to the member function to be called
Definition at line 107 of file USBDeviceConnected.h.
Generated on Tue Jul 12 2022 13:32:26 by 1.7.2