30#include "common/tusb_common.h"
34#include "common/tusb_fifo.h"
45 TCD_EVENT_INVALID = 0,
47 TCD_EVENT_RX_COMPLETE,
48 TCD_EVENT_TX_COMPLETE,
62 uint16_t xferred_bytes : 14;
73bool tcd_init(uint8_t rhport, uint32_t port_type);
76void tcd_int_enable (uint8_t rhport);
79void tcd_int_disable(uint8_t rhport);
82void tcd_int_handler(uint8_t rhport);
88bool tcd_msg_receive(uint8_t rhport, uint8_t* buffer, uint16_t total_bytes);
89bool tcd_msg_send(uint8_t rhport, uint8_t
const* buffer, uint16_t total_bytes);
96extern void tcd_event_handler(
tcd_event_t const * event,
bool in_isr);
98TU_ATTR_ALWAYS_INLINE
static inline
99void tcd_event_cc_changed(uint8_t rhport, uint8_t cc1, uint8_t cc2,
bool in_isr) {
102 .event_id = TCD_EVENT_CC_CHANGED,
104 .cc_state = {cc1, cc2 }
108 tcd_event_handler(&event, in_isr);
111TU_ATTR_ALWAYS_INLINE
static inline
112void tcd_event_rx_complete(uint8_t rhport, uint16_t xferred_bytes, uint8_t result,
bool in_isr) {
115 .event_id = TCD_EVENT_RX_COMPLETE,
117 .xferred_bytes = xferred_bytes,
122 tcd_event_handler(&event, in_isr);
125TU_ATTR_ALWAYS_INLINE
static inline
126void tcd_event_tx_complete(uint8_t rhport, uint16_t xferred_bytes, uint8_t result,
bool in_isr) {
129 .event_id = TCD_EVENT_TX_COMPLETE,
131 .xferred_bytes = xferred_bytes,
136 tcd_event_handler(&event, in_isr);
AUDIO Channel Cluster Descriptor (4.1)
Definition audio.h:647