USB endpoint configuration and status reporting. More...
Data Structures | |
struct | ep_config_t |
Endpoint configuration struct. More... | |
Endpoint configuration | |
enum | ep_type_t { EP_TYPE_CONTROL = 0, EP_TYPE_BULK = 2, EP_TYPE_INTERRUPT = 3, EP_TYPE_ISOCHRONOUS = 1 } |
List of endpoint types. More... | |
enum | ep_direction_t { EP_DIRECTION_OUT = (1 << 0), EP_DIRECTION_IN = (1 << 1), EP_DIRECTION_BIDIR = EP_DIRECTION_IN | EP_DIRECTION_OUT } |
Endpoint directions. More... | |
bool | endpoint_configure (const struct ep_config_t *config) |
Initialise the USB endpoint described by config. More... | |
void | endpoint_init_default (const uint8_t ep_num) |
Default endpoint initialisation function. | |
void | endpoint_deconfigure (const uint8_t ep_num) |
Releases hardware and memory associated with the endpoint memory. | |
uint16_t | endpoint_get_size (const uint8_t ep_num) |
Return the maximum endpoint packet size. | |
Endpoint stall | |
bool | endpoint_stall (const uint8_t ep_num) |
Stall an endpoint. | |
bool | endpoint_clear_stall (const uint8_t ep_num) |
Clear an endpoint stall. | |
bool | endpoint_is_stalled (const uint8_t ep_num) |
Get endpoint stall status. | |
Endpoint DATAx toggle | |
void | endpoint_reset_data_toggle (const uint8_t ep_num) |
Reset the DATAx toggle to DATA0. | |
USB endpoint configuration and status reporting.
enum ep_direction_t |
enum ep_type_t |
List of endpoint types.
Values of these constants corresponds to the bit values used in the USB endpoint descriptors. See Table 9-13 of the USB 2.0 standard.
Enumerator | |
---|---|
EP_TYPE_CONTROL |
Control endpoint. |
EP_TYPE_BULK |
Bulk endpoint. |
EP_TYPE_INTERRUPT |
Interrupt endoint. |
EP_TYPE_ISOCHRONOUS |
Isochronous endpoint. |
bool endpoint_configure | ( | const struct ep_config_t * | config | ) |
Initialise the USB endpoint described by config.
This will allocate the hardware and memory as described by the microcontroller's manual and enable the required interrupts.
true
if the endpoint configuration was succesful, false
otherwise.