Functions | |
bool | tusbh_cdc_serial_is_mounted (uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT |
Check if device support CDC Serial interface or not. More... | |
bool | tusbh_cdc_is_busy (uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN_UNUSED_RESULT |
Check if the interface is currently busy or not. More... | |
tusb_error_t | tusbh_cdc_send (uint8_t dev_addr, void const *p_data, uint32_t length, bool is_notify) |
Perform USB OUT transfer to device. More... | |
tusb_error_t | tusbh_cdc_receive (uint8_t dev_addr, void *p_buffer, uint32_t length, bool is_notify) |
Perform USB IN transfer to get data from device. More... | |
void | tusbh_cdc_mounted_cb (uint8_t dev_addr) |
Callback function that will be invoked when a device with CDC Abstract Control Model interface is mounted. More... | |
void | tusbh_cdc_unmounted_cb (uint8_t dev_addr) |
Callback function that will be invoked when a device with CDC Abstract Control Model interface is unmounted. More... | |
void | tusbh_cdc_xfer_isr (uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes) |
Callback function that is invoked when an transferring event occurred. More... | |
bool tusbh_cdc_is_busy | ( | uint8_t | dev_addr, |
cdc_pipeid_t | pipeid | ||
) |
Check if the interface is currently busy or not.
[in] | dev_addr | device address |
[in] | pipeid | value from cdc_pipeid_t to indicate target pipe. |
true | if the interface is busy, meaning the stack is still transferring/waiting data from/to device |
false | if the interface is not busy, meaning the stack successfully transferred data from/to device |
void tusbh_cdc_mounted_cb | ( | uint8_t | dev_addr | ) |
Callback function that will be invoked when a device with CDC Abstract Control Model interface is mounted.
[in] | dev_addr | Address of newly mounted device |
tusb_error_t tusbh_cdc_receive | ( | uint8_t | dev_addr, |
void * | p_buffer, | ||
uint32_t | length, | ||
bool | is_notify | ||
) |
Perform USB IN transfer to get data from device.
[in] | dev_addr | device address |
[in] | p_buffer | Buffer containing received data. Must be accessible by USB controller (see TUSB_CFG_ATTR_USBRAM) |
[in] | length | Number of bytes to be transferred via USB bus |
TUSB_ERROR_NONE | on success |
TUSB_ERROR_INTERFACE_IS_BUSY | if the interface is already transferring data with device |
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 tusbh_cdc_send | ( | uint8_t | dev_addr, |
void const * | p_data, | ||
uint32_t | length, | ||
bool | is_notify | ||
) |
Perform USB OUT transfer to device.
[in] | dev_addr | device address |
[in] | p_data | Buffer containing data. Must be accessible by USB controller (see TUSB_CFG_ATTR_USBRAM) |
[in] | length | Number of bytes to be transferred via USB bus |
TUSB_ERROR_NONE | on success |
TUSB_ERROR_INTERFACE_IS_BUSY | if the interface is already transferring data with device |
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 |
bool tusbh_cdc_serial_is_mounted | ( | uint8_t | dev_addr | ) |
Check if device support CDC Serial interface or not.
[in] | dev_addr | device address |
true | if device supports |
false | if device does not support or is not mounted |
void tusbh_cdc_unmounted_cb | ( | uint8_t | dev_addr | ) |
Callback function that will be invoked when a device with CDC Abstract Control Model interface is unmounted.
[in] | dev_addr | Address of newly unmounted device |
void tusbh_cdc_xfer_isr | ( | uint8_t | dev_addr, |
tusb_event_t | event, | ||
cdc_pipeid_t | pipe_id, | ||
uint32_t | xferred_bytes | ||
) |
Callback function that is invoked when an transferring event occurred.
[in] | dev_addr | Address of device |
[in] | event | an value from tusb_event_t |
[in] | pipe_id | value from cdc_pipeid_t indicate the pipe |
[in] | xferred_bytes | Number of bytes transferred via USB bus |