Functions | |
bool | tusbd_cdc_is_busy (uint8_t coreid, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN_UNUSED_RESULT |
Check if the interface is currently busy or not. More... | |
tusb_error_t | tusbd_cdc_send (uint8_t coreid, void *p_data, uint32_t length, bool is_notify) |
Submit USB transfer. More... | |
tusb_error_t | tusbd_cdc_receive (uint8_t coreid, void *p_buffer, uint32_t length, bool is_notify) |
Submit USB transfer. More... | |
void | tusbd_cdc_mounted_cb (uint8_t coreid) |
Callback function that will be invoked when this interface is mounted (configured) by USB host. More... | |
void | tusbd_cdc_unmounted_cb (uint8_t coreid) |
Callback function that will be invoked when this interface is unmounted (bus reset/unplugged) More... | |
void | tusbd_cdc_xfer_cb (uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes) |
Callback function that is invoked when an completion (error or success) of an USB transfer previously submitted by application (e.g tusbd_cdc_send or tusbd_cdc_send) with is_notify set to true. More... | |
bool tusbd_cdc_is_busy | ( | uint8_t | coreid, |
cdc_pipeid_t | pipeid | ||
) |
Check if the interface is currently busy or not.
[in] | coreid | USB Controller ID |
true | if the interface is busy meaning the stack is still transferring/waiting data from/to host |
false | if the interface is not busy meaning the stack successfully transferred data from/to host |
void tusbd_cdc_mounted_cb | ( | uint8_t | coreid | ) |
Callback function that will be invoked when this interface is mounted (configured) by USB host.
[in] | coreid | USB Controller ID of the interface |
tusb_error_t tusbd_cdc_receive | ( | uint8_t | coreid, |
void * | p_buffer, | ||
uint32_t | length, | ||
bool | is_notify | ||
) |
Submit USB transfer.
[in] | coreid | USB Controller ID |
[in] | p_buffer | application's buffer to receive data. Must be accessible by USB controller (see TUSB_CFG_ATTR_USBRAM) |
[in] | length | number of bytes in p_buffer. |
[in] | is_notify | indicates whether the hardware completion (data transferred through USB bus) will be notified to Application (via tusbd_cdc_xfer_cb) |
TUSB_ERROR_NONE | on success |
TUSB_ERROR_INTERFACE_IS_BUSY | if the interface is busy transferring previous data. |
TUSB_ERROR_DEVICE_NOT_READY | if device is not yet configured (by SET CONFIGURED request) |
TUSB_ERROR_INVALID_PARA | if input parameters are not correct |
tusb_error_t tusbd_cdc_send | ( | uint8_t | coreid, |
void * | p_data, | ||
uint32_t | length, | ||
bool | is_notify | ||
) |
Submit USB transfer.
[in] | coreid | USB Controller ID |
[in] | p_data | buffer containing data from application. Must be accessible by USB controller (see TUSB_CFG_ATTR_USBRAM) |
[in] | length | number of bytes in p_data. |
[in] | is_notify | indicates whether the hardware completion (data transferred through USB bus) will be notified to Application (via tusbd_cdc_xfer_cb) |
TUSB_ERROR_NONE | on success |
TUSB_ERROR_INTERFACE_IS_BUSY | if the interface is busy transferring previous data. |
TUSB_ERROR_DEVICE_NOT_READY | if device is not yet configured (by SET CONFIGURED request) |
TUSB_ERROR_INVALID_PARA | if input parameters are not correct |
void tusbd_cdc_unmounted_cb | ( | uint8_t | coreid | ) |
Callback function that will be invoked when this interface is unmounted (bus reset/unplugged)
[in] | coreid | USB Controller ID of the interface |
void tusbd_cdc_xfer_cb | ( | uint8_t | coreid, |
tusb_event_t | event, | ||
cdc_pipeid_t | pipe_id, | ||
uint32_t | xferred_bytes | ||
) |
Callback function that is invoked when an completion (error or success) of an USB transfer previously submitted by application (e.g tusbd_cdc_send or tusbd_cdc_send) with is_notify set to true.
[in] | coreid | USB Controller ID |
[in] | event | an value from tusb_event_t |
[in] | pipe_id | indicates which pipe of this interface the event occured. |
[in] | xferred_bytes | is actual number of bytes transferred via USB bus. This value in general can be different to the one that previously submitted by application. |