![]() |
Open FFBoard
Open source force feedback firmware
|
Go to the source code of this file.
Classes | |
struct | cdch_interface_t |
struct | cdch_serial_driver_t |
Enumerations | |
enum | { SERIAL_DRIVER_ACM = 0 , SERIAL_DRIVER_FTDI , SERIAL_DRIVER_CP210X , SERIAL_DRIVER_CH34X , SERIAL_DRIVER_COUNT } |
enum | { CONFIG_ACM_SET_CONTROL_LINE_STATE = 0 , CONFIG_ACM_SET_LINE_CODING , CONFIG_ACM_COMPLETE } |
enum | { CONFIG_FTDI_RESET = 0 , CONFIG_FTDI_MODEM_CTRL , CONFIG_FTDI_SET_BAUDRATE , CONFIG_FTDI_SET_DATA , CONFIG_FTDI_COMPLETE } |
enum | { CONFIG_CP210X_IFC_ENABLE = 0 , CONFIG_CP210X_SET_BAUDRATE , CONFIG_CP210X_SET_LINE_CTL , CONFIG_CP210X_SET_DTR_RTS , CONFIG_CP210X_COMPLETE } |
enum | { CONFIG_CH34X_READ_VERSION = 0 , CONFIG_CH34X_SERIAL_INIT , CONFIG_CH34X_SPECIAL_REG_WRITE , CONFIG_CH34X_FLOW_CONTROL , CONFIG_CH34X_MODEM_CONTROL , CONFIG_CH34X_COMPLETE } |
Functions | |
static bool | acm_open (uint8_t daddr, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
static void | acm_process_config (tuh_xfer_t *xfer) |
static bool | acm_set_baudrate (cdch_interface_t *p_cdc, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | acm_set_data_format (cdch_interface_t *p_cdc, uint8_t stop_bits, uint8_t parity, uint8_t data_bits, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | acm_set_line_coding (cdch_interface_t *p_cdc, cdc_line_coding_t const *line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | acm_set_control_line_state (cdch_interface_t *p_cdc, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ftdi_open (uint8_t daddr, const tusb_desc_interface_t *itf_desc, uint16_t max_len) |
static void | ftdi_process_config (tuh_xfer_t *xfer) |
static bool | ftdi_sio_set_baudrate (cdch_interface_t *p_cdc, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ftdi_set_data_format (cdch_interface_t *p_cdc, uint8_t stop_bits, uint8_t parity, uint8_t data_bits, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ftdi_set_line_coding (cdch_interface_t *p_cdc, cdc_line_coding_t const *line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ftdi_sio_set_modem_ctrl (cdch_interface_t *p_cdc, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | cp210x_open (uint8_t daddr, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
static void | cp210x_process_config (tuh_xfer_t *xfer) |
static bool | cp210x_set_baudrate (cdch_interface_t *p_cdc, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | cp210x_set_data_format (cdch_interface_t *p_cdc, uint8_t stop_bits, uint8_t parity, uint8_t data_bits, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | cp210x_set_line_coding (cdch_interface_t *p_cdc, cdc_line_coding_t const *line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | cp210x_set_modem_ctrl (cdch_interface_t *p_cdc, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_open (uint8_t daddr, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
static void | ch34x_process_config (tuh_xfer_t *xfer) |
static bool | ch34x_set_baudrate (cdch_interface_t *p_cdc, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_set_data_format (cdch_interface_t *p_cdc, uint8_t stop_bits, uint8_t parity, uint8_t data_bits, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_set_line_coding (cdch_interface_t *p_cdc, cdc_line_coding_t const *line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_set_modem_ctrl (cdch_interface_t *p_cdc, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
TU_VERIFY_STATIC (TU_ARRAY_SIZE(serial_drivers)==SERIAL_DRIVER_COUNT, "Serial driver count mismatch") | |
static cdch_interface_t * | get_itf (uint8_t idx) |
static uint8_t | get_idx_by_ep_addr (uint8_t daddr, uint8_t ep_addr) |
static cdch_interface_t * | make_new_itf (uint8_t daddr, tusb_desc_interface_t const *itf_desc) |
static bool | open_ep_stream_pair (cdch_interface_t *p_cdc, tusb_desc_endpoint_t const *desc_ep) |
static void | set_config_complete (cdch_interface_t *p_cdc, uint8_t idx, uint8_t itf_num) |
static void | cdch_internal_control_complete (tuh_xfer_t *xfer) |
uint8_t | tuh_cdc_itf_get_index (uint8_t daddr, uint8_t itf_num) |
bool | tuh_cdc_itf_get_info (uint8_t idx, tuh_itf_info_t *info) |
bool | tuh_cdc_mounted (uint8_t idx) |
bool | tuh_cdc_get_dtr (uint8_t idx) |
bool | tuh_cdc_get_rts (uint8_t idx) |
bool | tuh_cdc_get_local_line_coding (uint8_t idx, cdc_line_coding_t *line_coding) |
uint32_t | tuh_cdc_write (uint8_t idx, void const *buffer, uint32_t bufsize) |
uint32_t | tuh_cdc_write_flush (uint8_t idx) |
bool | tuh_cdc_write_clear (uint8_t idx) |
uint32_t | tuh_cdc_write_available (uint8_t idx) |
uint32_t | tuh_cdc_read (uint8_t idx, void *buffer, uint32_t bufsize) |
uint32_t | tuh_cdc_read_available (uint8_t idx) |
bool | tuh_cdc_peek (uint8_t idx, uint8_t *ch) |
bool | tuh_cdc_read_clear (uint8_t idx) |
static void | process_internal_control_complete (tuh_xfer_t *xfer, uint8_t itf_num) |
bool | tuh_cdc_set_control_line_state (uint8_t idx, uint16_t line_state, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
bool | tuh_cdc_set_baudrate (uint8_t idx, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
bool | tuh_cdc_set_data_format (uint8_t idx, uint8_t stop_bits, uint8_t parity, uint8_t data_bits, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
bool | tuh_cdc_set_line_coding (uint8_t idx, cdc_line_coding_t const *line_coding, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
bool | cdch_init (void) |
bool | cdch_deinit (void) |
void | cdch_close (uint8_t daddr) |
bool | cdch_xfer_cb (uint8_t daddr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes) |
bool | cdch_open (uint8_t rhport, uint8_t daddr, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
bool | cdch_set_config (uint8_t daddr, uint8_t itf_num) |
static bool | ftdi_sio_set_request (cdch_interface_t *p_cdc, uint8_t command, uint16_t value, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ftdi_sio_reset (cdch_interface_t *p_cdc, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static uint32_t | ftdi_232bm_baud_base_to_divisor (uint32_t baud, uint32_t base) |
static uint32_t | ftdi_232bm_baud_to_divisor (uint32_t baud) |
static bool | cp210x_set_request (cdch_interface_t *p_cdc, uint8_t command, uint16_t value, uint8_t *buffer, uint16_t length, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | cp210x_ifc_enable (cdch_interface_t *p_cdc, uint16_t enabled, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static uint8_t | ch34x_get_lcr (uint8_t stop_bits, uint8_t parity, uint8_t data_bits) |
static uint16_t | ch34x_get_divisor_prescaler (uint32_t baval) |
static bool | ch34x_set_request (cdch_interface_t *p_cdc, uint8_t direction, uint8_t request, uint16_t value, uint16_t index, uint8_t *buffer, uint16_t length, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_control_out (cdch_interface_t *p_cdc, uint8_t request, uint16_t value, uint16_t index, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_control_in (cdch_interface_t *p_cdc, uint8_t request, uint16_t value, uint16_t index, uint8_t *buffer, uint16_t buffersize, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_write_reg (cdch_interface_t *p_cdc, uint16_t reg, uint16_t reg_value, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static bool | ch34x_write_reg_baudrate (cdch_interface_t *p_cdc, uint32_t baudrate, tuh_xfer_cb_t complete_cb, uintptr_t user_data) |
static void | ch34x_control_complete (tuh_xfer_t *xfer) |
static void | ch34x_set_line_coding_stage1_complete (tuh_xfer_t *xfer) |
Variables | |
static CFG_TUH_MEM_SECTION cdch_interface_t | cdch_data [CFG_TUH_CDC] |
static uint16_t const | ftdi_vid_pid_list [][2] = {CFG_TUH_CDC_FTDI_VID_PID_LIST} |
static uint16_t const | cp210x_vid_pid_list [][2] = {CFG_TUH_CDC_CP210X_VID_PID_LIST} |
static uint16_t const | ch34x_vid_pid_list [][2] = {CFG_TUH_CDC_CH34X_VID_PID_LIST} |
static const cdch_serial_driver_t | serial_drivers [] |
anonymous enum |
Enumerator | |
---|---|
SERIAL_DRIVER_ACM | |
SERIAL_DRIVER_FTDI | |
SERIAL_DRIVER_CP210X | |
SERIAL_DRIVER_CH34X | |
SERIAL_DRIVER_COUNT |
Definition at line 145 of file cdc_host.c.
anonymous enum |
Enumerator | |
---|---|
CONFIG_ACM_SET_CONTROL_LINE_STATE | |
CONFIG_ACM_SET_LINE_CODING | |
CONFIG_ACM_COMPLETE |
Definition at line 795 of file cdc_host.c.
anonymous enum |
Enumerator | |
---|---|
CONFIG_FTDI_RESET | |
CONFIG_FTDI_MODEM_CTRL | |
CONFIG_FTDI_SET_BAUDRATE | |
CONFIG_FTDI_SET_DATA | |
CONFIG_FTDI_COMPLETE |
Definition at line 971 of file cdc_host.c.
anonymous enum |
Enumerator | |
---|---|
CONFIG_CP210X_IFC_ENABLE | |
CONFIG_CP210X_SET_BAUDRATE | |
CONFIG_CP210X_SET_LINE_CTL | |
CONFIG_CP210X_SET_DTR_RTS | |
CONFIG_CP210X_COMPLETE |
Definition at line 1152 of file cdc_host.c.
anonymous enum |
Enumerator | |
---|---|
CONFIG_CH34X_READ_VERSION | |
CONFIG_CH34X_SERIAL_INIT | |
CONFIG_CH34X_SPECIAL_REG_WRITE | |
CONFIG_CH34X_FLOW_CONTROL | |
CONFIG_CH34X_MODEM_CONTROL | |
CONFIG_CH34X_COMPLETE |
Definition at line 1484 of file cdc_host.c.
|
static |
Definition at line 801 of file cdc_host.c.
|
static |
Definition at line 845 of file cdc_host.c.
|
static |
Definition at line 959 of file cdc_host.c.
|
static |
Definition at line 882 of file cdc_host.c.
|
static |
Definition at line 946 of file cdc_host.c.
|
static |
Definition at line 913 of file cdc_host.c.
void cdch_close | ( | uint8_t | daddr | ) |
Definition at line 650 of file cdc_host.c.
bool cdch_deinit | ( | void | ) |
Definition at line 641 of file cdc_host.c.
bool cdch_init | ( | void | ) |
Definition at line 624 of file cdc_host.c.
|
static |
Definition at line 520 of file cdc_host.c.
bool cdch_open | ( | uint8_t | rhport, |
uint8_t | daddr, | ||
tusb_desc_interface_t const * | itf_desc, | ||
uint16_t | max_len | ||
) |
Definition at line 733 of file cdc_host.c.
bool cdch_set_config | ( | uint8_t | daddr, |
uint8_t | itf_num | ||
) |
Definition at line 772 of file cdc_host.c.
bool cdch_xfer_cb | ( | uint8_t | daddr, |
uint8_t | ep_addr, | ||
xfer_result_t | event, | ||
uint32_t | xferred_bytes | ||
) |
Definition at line 668 of file cdc_host.c.
|
static |
Definition at line 1380 of file cdc_host.c.
|
inlinestatic |
Definition at line 1352 of file cdc_host.c.
|
inlinestatic |
Definition at line 1347 of file cdc_host.c.
|
static |
Definition at line 1581 of file cdc_host.c.
|
static |
Definition at line 1630 of file cdc_host.c.
|
static |
Definition at line 1493 of file cdc_host.c.
|
static |
Definition at line 1519 of file cdc_host.c.
|
static |
Definition at line 1398 of file cdc_host.c.
|
static |
Definition at line 1385 of file cdc_host.c.
|
static |
Definition at line 1429 of file cdc_host.c.
|
static |
Definition at line 1407 of file cdc_host.c.
|
static |
Definition at line 1464 of file cdc_host.c.
|
static |
Definition at line 1311 of file cdc_host.c.
|
inlinestatic |
Definition at line 1358 of file cdc_host.c.
|
static |
Definition at line 1368 of file cdc_host.c.
|
static |
Definition at line 1211 of file cdc_host.c.
|
static |
Definition at line 1160 of file cdc_host.c.
|
static |
Definition at line 1251 of file cdc_host.c.
|
static |
Definition at line 1224 of file cdc_host.c.
|
static |
Definition at line 1232 of file cdc_host.c.
|
static |
Definition at line 1215 of file cdc_host.c.
|
static |
Definition at line 1244 of file cdc_host.c.
|
static |
Definition at line 1178 of file cdc_host.c.
|
static |
Definition at line 1056 of file cdc_host.c.
|
static |
Definition at line 1076 of file cdc_host.c.
|
static |
Definition at line 979 of file cdc_host.c.
|
static |
Definition at line 1092 of file cdc_host.c.
|
static |
Definition at line 1027 of file cdc_host.c.
|
static |
Definition at line 1039 of file cdc_host.c.
|
static |
Definition at line 1023 of file cdc_host.c.
|
static |
Definition at line 1080 of file cdc_host.c.
|
static |
Definition at line 1048 of file cdc_host.c.
|
static |
Definition at line 998 of file cdc_host.c.
|
inlinestatic |
Definition at line 240 of file cdc_host.c.
|
inlinestatic |
Definition at line 233 of file cdc_host.c.
|
static |
Definition at line 252 of file cdc_host.c.
|
static |
Definition at line 715 of file cdc_host.c.
|
static |
Definition at line 406 of file cdc_host.c.
|
static |
Definition at line 760 of file cdc_host.c.
TU_VERIFY_STATIC | ( | TU_ARRAY_SIZE(serial_drivers) | = =SERIAL_DRIVER_COUNT , |
"Serial driver count mismatch" | |||
) |
bool tuh_cdc_get_dtr | ( | uint8_t | idx | ) |
Definition at line 313 of file cdc_host.c.
bool tuh_cdc_get_local_line_coding | ( | uint8_t | idx, |
cdc_line_coding_t * | line_coding | ||
) |
Definition at line 327 of file cdc_host.c.
bool tuh_cdc_get_rts | ( | uint8_t | idx | ) |
Definition at line 320 of file cdc_host.c.
uint8_t tuh_cdc_itf_get_index | ( | uint8_t | daddr, |
uint8_t | itf_num | ||
) |
Definition at line 276 of file cdc_host.c.
bool tuh_cdc_itf_get_info | ( | uint8_t | idx, |
tuh_itf_info_t * | info | ||
) |
Definition at line 285 of file cdc_host.c.
bool tuh_cdc_mounted | ( | uint8_t | idx | ) |
Definition at line 307 of file cdc_host.c.
bool tuh_cdc_peek | ( | uint8_t | idx, |
uint8_t * | ch | ||
) |
Definition at line 386 of file cdc_host.c.
uint32_t tuh_cdc_read | ( | uint8_t | idx, |
void * | buffer, | ||
uint32_t | bufsize | ||
) |
Definition at line 372 of file cdc_host.c.
uint32_t tuh_cdc_read_available | ( | uint8_t | idx | ) |
Definition at line 379 of file cdc_host.c.
bool tuh_cdc_read_clear | ( | uint8_t | idx | ) |
Definition at line 393 of file cdc_host.c.
bool tuh_cdc_set_baudrate | ( | uint8_t | idx, |
uint32_t | baudrate, | ||
tuh_xfer_cb_t | complete_cb, | ||
uintptr_t | user_data | ||
) |
Definition at line 548 of file cdc_host.c.
bool tuh_cdc_set_control_line_state | ( | uint8_t | idx, |
uint16_t | line_state, | ||
tuh_xfer_cb_t | complete_cb, | ||
uintptr_t | user_data | ||
) |
Definition at line 525 of file cdc_host.c.
bool tuh_cdc_set_data_format | ( | uint8_t | idx, |
uint8_t | stop_bits, | ||
uint8_t | parity, | ||
uint8_t | data_bits, | ||
tuh_xfer_cb_t | complete_cb, | ||
uintptr_t | user_data | ||
) |
Definition at line 571 of file cdc_host.c.
bool tuh_cdc_set_line_coding | ( | uint8_t | idx, |
cdc_line_coding_t const * | line_coding, | ||
tuh_xfer_cb_t | complete_cb, | ||
uintptr_t | user_data | ||
) |
Definition at line 597 of file cdc_host.c.
uint32_t tuh_cdc_write | ( | uint8_t | idx, |
void const * | buffer, | ||
uint32_t | bufsize | ||
) |
Definition at line 340 of file cdc_host.c.
uint32_t tuh_cdc_write_available | ( | uint8_t | idx | ) |
Definition at line 361 of file cdc_host.c.
bool tuh_cdc_write_clear | ( | uint8_t | idx | ) |
Definition at line 354 of file cdc_host.c.
uint32_t tuh_cdc_write_flush | ( | uint8_t | idx | ) |
Definition at line 347 of file cdc_host.c.
|
static |
Definition at line 84 of file cdc_host.c.
|
static |
Definition at line 133 of file cdc_host.c.
|
static |
Definition at line 118 of file cdc_host.c.
|
static |
Definition at line 103 of file cdc_host.c.
|
static |
Definition at line 175 of file cdc_host.c.