Open FFBoard
Open source force feedback firmware
tusb.c File Reference

Go to the source code of this file.

Functions

TU_ATTR_WEAK void tusb_time_delay_ms_api (uint32_t ms)
 
bool tusb_rhport_init (uint8_t rhport, const tusb_rhport_init_t *rh_init)
 
bool tusb_inited (void)
 
void tusb_int_handler (uint8_t rhport, bool in_isr)
 
uint8_t const * tu_desc_find (uint8_t const *desc, uint8_t const *end, uint8_t byte1)
 
uint8_t const * tu_desc_find2 (uint8_t const *desc, uint8_t const *end, uint8_t byte1, uint8_t byte2)
 
uint8_t const * tu_desc_find3 (uint8_t const *desc, uint8_t const *end, uint8_t byte1, uint8_t byte2, uint8_t byte3)
 
bool tu_edpt_claim (tu_edpt_state_t *ep_state, osal_mutex_t mutex)
 
bool tu_edpt_release (tu_edpt_state_t *ep_state, osal_mutex_t mutex)
 
bool tu_edpt_validate (tusb_desc_endpoint_t const *desc_ep, tusb_speed_t speed)
 
void tu_edpt_bind_driver (uint8_t ep2drv[][2], tusb_desc_interface_t const *desc_itf, uint16_t desc_len, uint8_t driver_id)
 
uint16_t tu_desc_get_interface_total_len (tusb_desc_interface_t const *desc_itf, uint8_t itf_count, uint16_t max_len)
 
bool tu_edpt_stream_init (tu_edpt_stream_t *s, bool is_host, bool is_tx, bool overwritable, void *ff_buf, uint16_t ff_bufsize, uint8_t *ep_buf, uint16_t ep_bufsize)
 
bool tu_edpt_stream_deinit (tu_edpt_stream_t *s)
 
static TU_ATTR_ALWAYS_INLINE bool stream_claim (uint8_t hwid, tu_edpt_stream_t *s)
 
static TU_ATTR_ALWAYS_INLINE bool stream_xfer (uint8_t hwid, tu_edpt_stream_t *s, uint16_t count)
 
static TU_ATTR_ALWAYS_INLINE bool stream_release (uint8_t hwid, tu_edpt_stream_t *s)
 
bool tu_edpt_stream_write_zlp_if_needed (uint8_t hwid, tu_edpt_stream_t *s, uint32_t last_xferred_bytes)
 
uint32_t tu_edpt_stream_write_xfer (uint8_t hwid, tu_edpt_stream_t *s)
 
uint32_t tu_edpt_stream_write (uint8_t hwid, tu_edpt_stream_t *s, void const *buffer, uint32_t bufsize)
 
uint32_t tu_edpt_stream_write_available (uint8_t hwid, tu_edpt_stream_t *s)
 
uint32_t tu_edpt_stream_read_xfer (uint8_t hwid, tu_edpt_stream_t *s)
 
uint32_t tu_edpt_stream_read (uint8_t hwid, tu_edpt_stream_t *s, void *buffer, uint32_t bufsize)
 
static void dump_str_line (uint8_t const *buf, uint16_t count)
 
void tu_print_mem (void const *buf, uint32_t count, uint8_t indent)
 

Variables

tusb_role_t _tusb_rhport_role [TUP_USBIP_CONTROLLER_NUM] = { TUSB_ROLE_INVALID }
 
char const *const tu_str_speed [] = {"Full", "Low", "High"}
 
char const *const tu_str_std_request []
 
char const *const tu_str_xfer_result []
 

Function Documentation

◆ dump_str_line()

static void dump_str_line ( uint8_t const *  buf,
uint16_t  count 
)
static

Definition at line 497 of file tusb.c.

◆ stream_claim()

static TU_ATTR_ALWAYS_INLINE bool stream_claim ( uint8_t  hwid,
tu_edpt_stream_t s 
)
inlinestatic

Definition at line 311 of file tusb.c.

◆ stream_release()

static TU_ATTR_ALWAYS_INLINE bool stream_release ( uint8_t  hwid,
tu_edpt_stream_t s 
)
inlinestatic

Definition at line 337 of file tusb.c.

◆ stream_xfer()

static TU_ATTR_ALWAYS_INLINE bool stream_xfer ( uint8_t  hwid,
tu_edpt_stream_t s,
uint16_t  count 
)
inlinestatic

Definition at line 324 of file tusb.c.

◆ tu_desc_find()

uint8_t const * tu_desc_find ( uint8_t const *  desc,
uint8_t const *  end,
uint8_t  byte1 
)

Definition at line 143 of file tusb.c.

◆ tu_desc_find2()

uint8_t const * tu_desc_find2 ( uint8_t const *  desc,
uint8_t const *  end,
uint8_t  byte1,
uint8_t  byte2 
)

Definition at line 151 of file tusb.c.

◆ tu_desc_find3()

uint8_t const * tu_desc_find3 ( uint8_t const *  desc,
uint8_t const *  end,
uint8_t  byte1,
uint8_t  byte2,
uint8_t  byte3 
)

Definition at line 159 of file tusb.c.

◆ tu_desc_get_interface_total_len()

uint16_t tu_desc_get_interface_total_len ( tusb_desc_interface_t const *  desc_itf,
uint8_t  itf_count,
uint16_t  max_len 
)

Definition at line 251 of file tusb.c.

◆ tu_edpt_bind_driver()

void tu_edpt_bind_driver ( uint8_t  ep2drv[][2],
tusb_desc_interface_t const *  desc_itf,
uint16_t  desc_len,
uint8_t  driver_id 
)

Definition at line 236 of file tusb.c.

◆ tu_edpt_claim()

bool tu_edpt_claim ( tu_edpt_state_t ep_state,
osal_mutex_t  mutex 
)

Definition at line 171 of file tusb.c.

◆ tu_edpt_release()

bool tu_edpt_release ( tu_edpt_state_t ep_state,
osal_mutex_t  mutex 
)

Definition at line 188 of file tusb.c.

◆ tu_edpt_stream_deinit()

bool tu_edpt_stream_deinit ( tu_edpt_stream_t s)

Definition at line 302 of file tusb.c.

◆ tu_edpt_stream_init()

bool tu_edpt_stream_init ( tu_edpt_stream_t s,
bool  is_host,
bool  is_tx,
bool  overwritable,
void *  ff_buf,
uint16_t  ff_bufsize,
uint8_t *  ep_buf,
uint16_t  ep_bufsize 
)

Definition at line 282 of file tusb.c.

◆ tu_edpt_stream_read()

uint32_t tu_edpt_stream_read ( uint8_t  hwid,
tu_edpt_stream_t s,
void *  buffer,
uint32_t  bufsize 
)

Definition at line 461 of file tusb.c.

◆ tu_edpt_stream_read_xfer()

uint32_t tu_edpt_stream_read_xfer ( uint8_t  hwid,
tu_edpt_stream_t s 
)

Definition at line 426 of file tusb.c.

◆ tu_edpt_stream_write()

uint32_t tu_edpt_stream_write ( uint8_t  hwid,
tu_edpt_stream_t s,
void const *  buffer,
uint32_t  bufsize 
)

Definition at line 382 of file tusb.c.

◆ tu_edpt_stream_write_available()

uint32_t tu_edpt_stream_write_available ( uint8_t  hwid,
tu_edpt_stream_t s 
)

Definition at line 405 of file tusb.c.

◆ tu_edpt_stream_write_xfer()

uint32_t tu_edpt_stream_write_xfer ( uint8_t  hwid,
tu_edpt_stream_t s 
)

Definition at line 362 of file tusb.c.

◆ tu_edpt_stream_write_zlp_if_needed()

bool tu_edpt_stream_write_zlp_if_needed ( uint8_t  hwid,
tu_edpt_stream_t s,
uint32_t  last_xferred_bytes 
)

Definition at line 353 of file tusb.c.

◆ tu_edpt_validate()

bool tu_edpt_validate ( tusb_desc_endpoint_t const *  desc_ep,
tusb_speed_t  speed 
)

Definition at line 202 of file tusb.c.

◆ tu_print_mem()

void tu_print_mem ( void const *  buf,
uint32_t  count,
uint8_t  indent 
)

Definition at line 512 of file tusb.c.

◆ tusb_inited()

bool tusb_inited ( void  )

Definition at line 108 of file tusb.c.

◆ tusb_int_handler()

void tusb_int_handler ( uint8_t  rhport,
bool  in_isr 
)

Definition at line 122 of file tusb.c.

◆ tusb_rhport_init()

bool tusb_rhport_init ( uint8_t  rhport,
const tusb_rhport_init_t rh_init 
)

Definition at line 61 of file tusb.c.

◆ tusb_time_delay_ms_api()

TU_ATTR_WEAK void tusb_time_delay_ms_api ( uint32_t  ms)

Definition at line 48 of file tusb.c.

Variable Documentation

◆ _tusb_rhport_role

tusb_role_t _tusb_rhport_role[TUP_USBIP_CONTROLLER_NUM] = { TUSB_ROLE_INVALID }

Definition at line 42 of file tusb.c.

◆ tu_str_speed

char const* const tu_str_speed[] = {"Full", "Low", "High"}

Definition at line 475 of file tusb.c.

◆ tu_str_std_request

char const* const tu_str_std_request[]
Initial value:
= {
"Get Status",
"Clear Feature",
"Reserved",
"Set Feature",
"Reserved",
"Set Address",
"Get Descriptor",
"Set Descriptor",
"Get Configuration",
"Set Configuration",
"Get Interface",
"Set Interface",
"Synch Frame"
}

Definition at line 476 of file tusb.c.

◆ tu_str_xfer_result

char const* const tu_str_xfer_result[]
Initial value:
= {
"OK", "FAILED", "STALLED", "TIMEOUT"
}

Definition at line 492 of file tusb.c.