![]() |
Open FFBoard
Open source force feedback firmware
|
Go to the source code of this file.
Classes | |
struct | TU_ATTR_PACKED |
AUDIO Channel Cluster Descriptor (4.1) More... | |
struct | max3421_ep_t |
struct | max3421_ep_t::TU_ATTR_PACKED |
struct | max3421_data_t |
Typedefs | |
typedef struct TU_ATTR_PACKED | hxfr_bm_t |
Enumerations | |
enum | { CMDBYTE_WRITE = 0x02 } |
enum | { RCVVFIFO_ADDR = 1u << 3 , SNDFIFO_ADDR = 2u << 3 , SUDFIFO_ADDR = 4u << 3 , RCVBC_ADDR = 6u << 3 , SNDBC_ADDR = 7u << 3 , USBIRQ_ADDR = 13u << 3 , USBIEN_ADDR = 14u << 3 , USBCTL_ADDR = 15u << 3 , CPUCTL_ADDR = 16u << 3 , PINCTL_ADDR = 17u << 3 , REVISION_ADDR = 18u << 3 , IOPINS1_ADDR = 20u << 3 , IOPINS2_ADDR = 21u << 3 , GPINIRQ_ADDR = 22u << 3 , GPINIEN_ADDR = 23u << 3 , GPINPOL_ADDR = 24u << 3 , HIRQ_ADDR = 25u << 3 , HIEN_ADDR = 26u << 3 , MODE_ADDR = 27u << 3 , PERADDR_ADDR = 28u << 3 , HCTL_ADDR = 29u << 3 , HXFR_ADDR = 30u << 3 , HRSL_ADDR = 31u << 3 } |
enum | { USBIRQ_OSCOK_IRQ = 1u << 0 , USBIRQ_NOVBUS_IRQ = 1u << 5 , USBIRQ_VBUS_IRQ = 1u << 6 } |
enum | { USBCTL_PWRDOWN = 1u << 4 , USBCTL_CHIPRES = 1u << 5 } |
enum | { CPUCTL_IE = 1u << 0 , CPUCTL_PULSEWID0 = 1u << 6 , CPUCTL_PULSEWID1 = 1u << 7 } |
enum | { PINCTL_GPXA = 1u << 0 , PINCTL_GPXB = 1u << 1 , PINCTL_POSINT = 1u << 2 , PINCTL_INTLEVEL = 1u << 3 , PINCTL_FDUPSPI = 1u << 4 } |
enum | { HIRQ_BUSEVENT_IRQ = 1u << 0 , HIRQ_RWU_IRQ = 1u << 1 , HIRQ_RCVDAV_IRQ = 1u << 2 , HIRQ_SNDBAV_IRQ = 1u << 3 , HIRQ_SUSDN_IRQ = 1u << 4 , HIRQ_CONDET_IRQ = 1u << 5 , HIRQ_FRAME_IRQ = 1u << 6 , HIRQ_HXFRDN_IRQ = 1u << 7 } |
enum | { MODE_HOST = 1u << 0 , MODE_LOWSPEED = 1u << 1 , MODE_HUBPRE = 1u << 2 , MODE_SOFKAENAB = 1u << 3 , MODE_SEPIRQ = 1u << 4 , MODE_DELAYISO = 1u << 5 , MODE_DMPULLDN = 1u << 6 , MODE_DPPULLDN = 1u << 7 } |
enum | { HCTL_BUSRST = 1u << 0 , HCTL_FRMRST = 1u << 1 , HCTL_SAMPLEBUS = 1u << 2 , HCTL_SIGRSM = 1u << 3 , HCTL_RCVTOG0 = 1u << 4 , HCTL_RCVTOG1 = 1u << 5 , HCTL_SNDTOG0 = 1u << 6 , HCTL_SNDTOG1 = 1u << 7 } |
enum | { HXFR_EPNUM_MASK = 0x0f , HXFR_SETUP = 1u << 4 , HXFR_OUT_NIN = 1u << 5 , HXFR_ISO = 1u << 6 , HXFR_HS = 1u << 7 } |
enum | { HRSL_RESULT_MASK = 0x0f , HRSL_RCVTOGRD = 1u << 4 , HRSL_SNDTOGRD = 1u << 5 , HRSL_KSTATUS = 1u << 6 , HRSL_JSTATUS = 1u << 7 } |
enum | { HRSL_SUCCESS = 0 , HRSL_BUSY , HRSL_BAD_REQ , HRSL_UNDEF , HRSL_NAK , HRSL_STALL , HRSL_TOG_ERR , HRSL_WRONG_PID , HRSL_BAD_BYTECOUNT , HRSL_PID_ERR , HRSL_PKT_ERR , HRSL_CRC_ERR , HRSL_K_ERR , HRSL_J_ERR , HRSL_TIMEOUT , HRSL_BABBLE } |
enum | { DEFAULT_HIEN = HIRQ_CONDET_IRQ | HIRQ_FRAME_IRQ | HIRQ_HXFRDN_IRQ | HIRQ_RCVDAV_IRQ } |
enum | { MAX_NAK_DEFAULT = 1 } |
enum | { EP_STATE_IDLE = 0 , EP_STATE_COMPLETE = 1 , EP_STATE_ABORTING = 2 , EP_STATE_ATTEMPT_1 = 3 , EP_STATE_ATTEMPT_MAX = 15 } |
Functions | |
TU_VERIFY_STATIC (sizeof(hxfr_bm_t)==1, "size is not correct") | |
TU_VERIFY_STATIC (sizeof(max3421_ep_t)==12, "size is not correct") | |
void | tuh_max3421_spi_cs_api (uint8_t rhport, bool active) |
bool | tuh_max3421_spi_xfer_api (uint8_t rhport, uint8_t const *tx_buf, uint8_t *rx_buf, size_t xfer_bytes) |
void | tuh_max3421_int_api (uint8_t rhport, bool enabled) |
uint8_t | tuh_max3421_reg_read (uint8_t rhport, uint8_t reg, bool in_isr) |
bool | tuh_max3421_reg_write (uint8_t rhport, uint8_t reg, uint8_t data, bool in_isr) |
static void | max3421_spi_lock (uint8_t rhport, bool in_isr) |
static void | max3421_spi_unlock (uint8_t rhport, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | hirq_write (uint8_t rhport, uint8_t data, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | hien_write (uint8_t rhport, uint8_t data, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | mode_write (uint8_t rhport, uint8_t data, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | peraddr_write (uint8_t rhport, uint8_t data, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | hxfr_write (uint8_t rhport, uint8_t data, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | sndbc_write (uint8_t rhport, uint8_t data, bool in_isr) |
static void | hwfifo_write (uint8_t rhport, uint8_t reg, const uint8_t *buffer, uint8_t len, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | hwfifo_send (uint8_t rhport, const uint8_t *buffer, uint8_t len, bool in_isr) |
static TU_ATTR_ALWAYS_INLINE void | hwfifo_setup (uint8_t rhport, const uint8_t *buffer, bool in_isr) |
static void | hwfifo_receive (uint8_t rhport, uint8_t *buffer, uint16_t len, bool in_isr) |
static max3421_ep_t * | find_ep_not_addr0 (uint8_t daddr, uint8_t ep_num, uint8_t ep_dir) |
static TU_ATTR_ALWAYS_INLINE max3421_ep_t * | allocate_ep (void) |
static TU_ATTR_ALWAYS_INLINE max3421_ep_t * | find_opened_ep (uint8_t daddr, uint8_t ep_num, uint8_t ep_dir) |
static void | free_ep (uint8_t daddr) |
static TU_ATTR_ALWAYS_INLINE bool | is_ep_pending (max3421_ep_t const *ep) |
static max3421_ep_t * | find_next_pending_ep (max3421_ep_t *cur_ep) |
bool | hcd_configure (uint8_t rhport, uint32_t cfg_id, const void *cfg_param) |
bool | hcd_init (uint8_t rhport, const tusb_rhport_init_t *rh_init) |
bool | hcd_deinit (uint8_t rhport) |
void | hcd_int_enable (uint8_t rhport) |
void | hcd_int_disable (uint8_t rhport) |
uint32_t | hcd_frame_number (uint8_t rhport) |
bool | hcd_port_connect_status (uint8_t rhport) |
void | hcd_port_reset (uint8_t rhport) |
void | hcd_port_reset_end (uint8_t rhport) |
tusb_speed_t | hcd_port_speed_get (uint8_t rhport) |
void | hcd_device_close (uint8_t rhport, uint8_t dev_addr) |
bool | hcd_edpt_open (uint8_t rhport, uint8_t daddr, tusb_desc_endpoint_t const *ep_desc) |
static void | xact_out (uint8_t rhport, max3421_ep_t *ep, bool switch_ep, bool in_isr) |
static void | xact_in (uint8_t rhport, max3421_ep_t *ep, bool switch_ep, bool in_isr) |
static void | xact_setup (uint8_t rhport, max3421_ep_t *ep, bool in_isr) |
static void | xact_generic (uint8_t rhport, max3421_ep_t *ep, bool switch_ep, bool in_isr) |
bool | hcd_edpt_xfer (uint8_t rhport, uint8_t daddr, uint8_t ep_addr, uint8_t *buffer, uint16_t buflen) |
bool | hcd_edpt_abort_xfer (uint8_t rhport, uint8_t daddr, uint8_t ep_addr) |
bool | hcd_setup_send (uint8_t rhport, uint8_t daddr, uint8_t const setup_packet[8]) |
bool | hcd_edpt_clear_stall (uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) |
static void | handle_connect_irq (uint8_t rhport, bool in_isr) |
static void | xfer_complete_isr (uint8_t rhport, max3421_ep_t *ep, xfer_result_t result, uint8_t hrsl, bool in_isr) |
static void | handle_xfer_done (uint8_t rhport, bool in_isr) |
void | print_hirq (uint8_t hirq) |
void | hcd_int_handler (uint8_t rhport, bool in_isr) |
Variables | |
static max3421_data_t | _hcd_data |
static tuh_configure_max3421_t | _tuh_cfg |
typedef struct TU_ATTR_PACKED hxfr_bm_t |
anonymous enum |
Enumerator | |
---|---|
CMDBYTE_WRITE |
Definition at line 42 of file hcd_max3421.c.
anonymous enum |
Definition at line 46 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
USBIRQ_OSCOK_IRQ | |
USBIRQ_NOVBUS_IRQ | |
USBIRQ_VBUS_IRQ |
Definition at line 73 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
USBCTL_PWRDOWN | |
USBCTL_CHIPRES |
Definition at line 79 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
CPUCTL_IE | |
CPUCTL_PULSEWID0 | |
CPUCTL_PULSEWID1 |
Definition at line 84 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
PINCTL_GPXA | |
PINCTL_GPXB | |
PINCTL_POSINT | |
PINCTL_INTLEVEL | |
PINCTL_FDUPSPI |
Definition at line 90 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
HIRQ_BUSEVENT_IRQ | |
HIRQ_RWU_IRQ | |
HIRQ_RCVDAV_IRQ | |
HIRQ_SNDBAV_IRQ | |
HIRQ_SUSDN_IRQ | |
HIRQ_CONDET_IRQ | |
HIRQ_FRAME_IRQ | |
HIRQ_HXFRDN_IRQ |
Definition at line 98 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
MODE_HOST | |
MODE_LOWSPEED | |
MODE_HUBPRE | |
MODE_SOFKAENAB | |
MODE_SEPIRQ | |
MODE_DELAYISO | |
MODE_DMPULLDN | |
MODE_DPPULLDN |
Definition at line 109 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
HCTL_BUSRST | |
HCTL_FRMRST | |
HCTL_SAMPLEBUS | |
HCTL_SIGRSM | |
HCTL_RCVTOG0 | |
HCTL_RCVTOG1 | |
HCTL_SNDTOG0 | |
HCTL_SNDTOG1 |
Definition at line 120 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
HXFR_EPNUM_MASK | |
HXFR_SETUP | |
HXFR_OUT_NIN | |
HXFR_ISO | |
HXFR_HS |
Definition at line 131 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
HRSL_RESULT_MASK | |
HRSL_RCVTOGRD | |
HRSL_SNDTOGRD | |
HRSL_KSTATUS | |
HRSL_JSTATUS |
Definition at line 139 of file hcd_max3421.c.
anonymous enum |
Definition at line 147 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_HIEN |
Definition at line 166 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
MAX_NAK_DEFAULT |
Definition at line 170 of file hcd_max3421.c.
anonymous enum |
Enumerator | |
---|---|
EP_STATE_IDLE | |
EP_STATE_COMPLETE | |
EP_STATE_ABORTING | |
EP_STATE_ATTEMPT_1 | |
EP_STATE_ATTEMPT_MAX |
Definition at line 174 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 427 of file hcd_max3421.c.
|
static |
Definition at line 413 of file hcd_max3421.c.
|
static |
Definition at line 459 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 431 of file hcd_max3421.c.
|
static |
Definition at line 440 of file hcd_max3421.c.
|
static |
Definition at line 809 of file hcd_max3421.c.
|
static |
Definition at line 878 of file hcd_max3421.c.
bool hcd_configure | ( | uint8_t | rhport, |
uint32_t | cfg_id, | ||
const void * | cfg_param | ||
) |
Definition at line 486 of file hcd_max3421.c.
bool hcd_deinit | ( | uint8_t | rhport | ) |
Definition at line 551 of file hcd_max3421.c.
void hcd_device_close | ( | uint8_t | rhport, |
uint8_t | dev_addr | ||
) |
Definition at line 615 of file hcd_max3421.c.
bool hcd_edpt_abort_xfer | ( | uint8_t | rhport, |
uint8_t | daddr, | ||
uint8_t | ep_addr | ||
) |
Definition at line 759 of file hcd_max3421.c.
bool hcd_edpt_clear_stall | ( | uint8_t | rhport, |
uint8_t | dev_addr, | ||
uint8_t | ep_addr | ||
) |
Definition at line 797 of file hcd_max3421.c.
bool hcd_edpt_open | ( | uint8_t | rhport, |
uint8_t | daddr, | ||
tusb_desc_endpoint_t const * | ep_desc | ||
) |
Definition at line 625 of file hcd_max3421.c.
bool hcd_edpt_xfer | ( | uint8_t | rhport, |
uint8_t | daddr, | ||
uint8_t | ep_addr, | ||
uint8_t * | buffer, | ||
uint16_t | buflen | ||
) |
Definition at line 733 of file hcd_max3421.c.
uint32_t hcd_frame_number | ( | uint8_t | rhport | ) |
Definition at line 582 of file hcd_max3421.c.
bool hcd_init | ( | uint8_t | rhport, |
const tusb_rhport_init_t * | rh_init | ||
) |
Definition at line 497 of file hcd_max3421.c.
void hcd_int_disable | ( | uint8_t | rhport | ) |
Definition at line 577 of file hcd_max3421.c.
void hcd_int_enable | ( | uint8_t | rhport | ) |
Definition at line 571 of file hcd_max3421.c.
void hcd_int_handler | ( | uint8_t | rhport, |
bool | in_isr | ||
) |
Definition at line 1002 of file hcd_max3421.c.
bool hcd_port_connect_status | ( | uint8_t | rhport | ) |
Definition at line 592 of file hcd_max3421.c.
void hcd_port_reset | ( | uint8_t | rhport | ) |
Definition at line 599 of file hcd_max3421.c.
void hcd_port_reset_end | ( | uint8_t | rhport | ) |
Definition at line 604 of file hcd_max3421.c.
tusb_speed_t hcd_port_speed_get | ( | uint8_t | rhport | ) |
Definition at line 609 of file hcd_max3421.c.
bool hcd_setup_send | ( | uint8_t | rhport, |
uint8_t | daddr, | ||
uint8_t const | setup_packet[8] | ||
) |
Definition at line 775 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 341 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 335 of file hcd_max3421.c.
|
static |
Definition at line 396 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 385 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 392 of file hcd_max3421.c.
|
static |
Definition at line 371 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 358 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 450 of file hcd_max3421.c.
|
static |
Definition at line 284 of file hcd_max3421.c.
|
static |
Definition at line 295 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 346 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 351 of file hcd_max3421.c.
void print_hirq | ( | uint8_t | hirq | ) |
Definition at line 983 of file hcd_max3421.c.
|
inlinestatic |
Definition at line 363 of file hcd_max3421.c.
TU_VERIFY_STATIC | ( | sizeof(hxfr_bm_t) | = =1 , |
"size is not correct" | |||
) |
TU_VERIFY_STATIC | ( | sizeof(max3421_ep_t) | = =12 , |
"size is not correct" | |||
) |
void tuh_max3421_int_api | ( | uint8_t | rhport, |
bool | enabled | ||
) |
uint8_t tuh_max3421_reg_read | ( | uint8_t | rhport, |
uint8_t | reg, | ||
bool | in_isr | ||
) |
Definition at line 306 of file hcd_max3421.c.
bool tuh_max3421_reg_write | ( | uint8_t | rhport, |
uint8_t | reg, | ||
uint8_t | data, | ||
bool | in_isr | ||
) |
Definition at line 318 of file hcd_max3421.c.
void tuh_max3421_spi_cs_api | ( | uint8_t | rhport, |
bool | active | ||
) |
bool tuh_max3421_spi_xfer_api | ( | uint8_t | rhport, |
uint8_t const * | tx_buf, | ||
uint8_t * | rx_buf, | ||
size_t | xfer_bytes | ||
) |
|
static |
Definition at line 708 of file hcd_max3421.c.
|
static |
Definition at line 690 of file hcd_max3421.c.
|
static |
Definition at line 669 of file hcd_max3421.c.
|
static |
Definition at line 702 of file hcd_max3421.c.
|
static |
Definition at line 854 of file hcd_max3421.c.
|
static |
Definition at line 246 of file hcd_max3421.c.
|
static |
Definition at line 249 of file hcd_max3421.c.