28#ifndef _TUSB_PRIVATE_H_
29#define _TUSB_PRIVATE_H_
39 volatile uint8_t busy : 1;
40 volatile uint8_t stalled : 1;
41 volatile uint8_t claimed : 1;
54 uint16_t ep_packetsize;
63 OSAL_MUTEX_DEF(ff_mutex);
75void tu_edpt_bind_driver(uint8_t ep2drv[][2],
tusb_desc_interface_t const* p_desc, uint16_t desc_len, uint8_t driver_id);
78uint16_t tu_desc_get_interface_total_len(
tusb_desc_interface_t const* desc_itf, uint8_t itf_count, uint16_t max_len);
91bool tu_edpt_stream_init(
tu_edpt_stream_t* s,
bool is_host,
bool is_tx,
bool overwritable,
92 void* ff_buf, uint16_t ff_bufsize, uint8_t* ep_buf, uint16_t ep_bufsize);
96TU_ATTR_ALWAYS_INLINE
static inline
99 tu_fifo_clear(&s->ff);
101 s->ep_addr = desc_ep->bEndpointAddress;
102 s->ep_packetsize = tu_edpt_packet_size(desc_ep);
105TU_ATTR_ALWAYS_INLINE
static inline
113TU_ATTR_ALWAYS_INLINE
static inline
116 return tu_fifo_clear(&s->ff);
124uint32_t tu_edpt_stream_write(
tu_edpt_stream_t* s,
void const *buffer, uint32_t bufsize);
130bool tu_edpt_stream_write_zlp_if_needed(
tu_edpt_stream_t* s, uint32_t last_xferred_bytes);
133TU_ATTR_ALWAYS_INLINE
static inline
136 return (uint32_t) tu_fifo_remaining(&s->ff);
144uint32_t tu_edpt_stream_read(
tu_edpt_stream_t* s,
void* buffer, uint32_t bufsize);
150TU_ATTR_ALWAYS_INLINE
static inline
151void tu_edpt_stream_read_xfer_complete(
tu_edpt_stream_t* s, uint32_t xferred_bytes) {
152 tu_fifo_write_n(&s->ff, s->ep_buf, (uint16_t) xferred_bytes);
156TU_ATTR_ALWAYS_INLINE
static inline
157void tu_edpt_stream_read_xfer_complete_offset(
tu_edpt_stream_t* s, uint32_t xferred_bytes, uint32_t skip_offset) {
158 if (skip_offset < xferred_bytes) {
159 tu_fifo_write_n(&s->ff, s->ep_buf + skip_offset, (uint16_t) (xferred_bytes - skip_offset));
164TU_ATTR_ALWAYS_INLINE
static inline
166 return (uint32_t) tu_fifo_count(&s->ff);
169TU_ATTR_ALWAYS_INLINE
static inline
171 return tu_fifo_peek(&s->ff, ch);
tusb_speed_t
defined base on EHCI specs value for Endpoint Speed
Definition tusb_types.h:48
AUDIO Channel Cluster Descriptor (4.1)
Definition audio.h:647
Definition tusb_private.h:44
Definition tusb_fifo.h:108