![]() |
Internal variables to manage the USB host stack | |
| |
typedef void(* | USBH_sof_timeout_callback_t )(void) |
Type of callback on a SOF timeout. | |
uint8_t | USBH_sof_timeout |
Number of SOF remaining before call USBH_sof_timeout_callback callback. | |
#define | UHC_ENUM_NB_TRY 4 |
Maximum try to enumerate a device. | |
#define | UHC_USB_ADD_NOT_VALID 0xFF |
Entry point of all devices connected on USB tree. | |
#define | UHC_DEVICE_ENUM_ADD 1 |
USB address of the USB device under enumeration process. | |
#define | USBH_dev_enum (&USBH_device_root) |
Device under enumeration process. | |
#define | USBH_power_running 0 |
Total power of the devices connected. | |
#define | UHC_NB_UHI (sizeof(USBH_uhis)/sizeof(USBH_uhis[0])) |
Number of UHI available. | |
Callbacks used by USB Host Driver (UHD) to notify events | |
| |
void | USBH_notify_connection (bool b_plug) |
Notify device connection or disconnection. | |
void | USBH_notify_sof (bool b_micro) |
Notify each start of frame sent by driver. | |
void | USBH_notify_resume (void) |
Notify that a resume bus occurs A resume can occur after a downstream or an upstream resume. | |
Functions to control the USB host stack | |
| |
void | USBH_start (void) |
Starts the host mode. | |
void | USBH_stop (bool b_id_stop) |
Stops the host mode. | |
void | USBH_suspend (bool b_remotewakeup) |
Suspends a USB line. | |
bool | USBH_is_suspend (void) |
Test if the suspend state is enabled on the USB line. | |
void | USBH_resume (void) |
Resumes the USB line. | |
User functions to manage the devices | |
| |
uint8_t | USBH_get_device_number (void) |
Returns the number of connected devices. | |
char * | USBH_dev_get_string_manufacturer (USBH_device_t *dev) |
Gets the USB string manufacturer from a USB device. | |
char * | USBH_dev_get_string_product (USBH_device_t *dev) |
Gets the USB string product from a USB device. | |
char * | USBH_dev_get_string_serial (USBH_device_t *dev) |
Gets the USB string serial from a USB device. | |
char * | USBH_dev_get_string (USBH_device_t *dev, uint8_t str_id) |
Gets a USB string from a USB device. | |
uint16_t | USBH_dev_get_power (USBH_device_t *dev) |
Gets the maximum consumption of a device (mA). | |
USBH_Speed_t | USBH_dev_get_speed (USBH_device_t *dev) |
Returns the current device speed. | |
bool | USBH_dev_is_high_speed_support (USBH_device_t *dev) |
Tests if the device supports the USB high speed This function can wait the end of a setup request and the timing can be long (1ms to 5s). Thus, do not call it in an interrupt routine. | |
void | USBHS_SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) |
void | USBHS_SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) |
Internal implementation
uint16_t USBH_dev_get_power | ( | USBH_device_t * | dev | ) |
USBH_Speed_t USBH_dev_get_speed | ( | USBH_device_t * | dev | ) |
char* USBH_dev_get_string | ( | USBH_device_t * | dev, | |
uint8_t | str_id | |||
) |
Gets a USB string from a USB device.
This function waits the end of setup requests and the timing can be long (3ms to 15s). Thus, do not call it in an interrupt routine. This function allocates a buffer which must be free by user application.
dev | Device to request | |
str_id | String ID requested |
Definition at line 1205 of file USBH.c.
char* USBH_dev_get_string_manufacturer | ( | USBH_device_t * | dev | ) |
Gets the USB string manufacturer from a USB device.
This function waits the end of setup requests and the timing can be long (3ms to 15s). Thus, do not call it in an interrupt routine. This function allocates a buffer which must be free by user application.
dev | Device to request |
Definition at line 1178 of file USBH.c.
char* USBH_dev_get_string_product | ( | USBH_device_t * | dev | ) |
Gets the USB string product from a USB device.
This function waits the end of setup requests and the timing can be long (3ms to 15s). Thus, do not call it in an interrupt routine. This function allocates a buffer which must be free by user application.
dev | Device to request |
Definition at line 1187 of file USBH.c.
char* USBH_dev_get_string_serial | ( | USBH_device_t * | dev | ) |
Gets the USB string serial from a USB device.
This function waits the end of setup requests and the timing can be long (3ms to 15s). Thus, do not call it in an interrupt routine. This function allocates a buffer which must be free by user application.
dev | Device to request |
Definition at line 1196 of file USBH.c.
bool USBH_dev_is_high_speed_support | ( | USBH_device_t * | dev | ) |
Tests if the device supports the USB high speed This function can wait the end of a setup request and the timing can be long (1ms to 5s). Thus, do not call it in an interrupt routine.
dev | Device to request |
Definition at line 1289 of file USBH.c.
uint8_t USBH_get_device_number | ( | void | ) |
bool USBH_is_suspend | ( | void | ) |
void USBH_notify_connection | ( | bool | b_plug | ) |
void USBH_notify_sof | ( | bool | b_micro | ) |
void USBH_stop | ( | bool | b_id_stop | ) |