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

Go to the source code of this file.

Classes

struct  ehci_data_t
 

Functions

CFG_TUH_MEM_SECTION TU_ATTR_ALIGNED (4096)
 
static void print_intr (uint32_t intr)
 
TU_ATTR_WEAK bool hcd_dcache_clean (void const *addr, uint32_t data_size)
 
TU_ATTR_WEAK bool hcd_dcache_invalidate (void const *addr, uint32_t data_size)
 
TU_ATTR_WEAK bool hcd_dcache_clean_invalidate (void const *addr, uint32_t data_size)
 
static TU_ATTR_ALWAYS_INLINE ehci_qhd_tqhd_control (uint8_t dev_addr)
 
static TU_ATTR_ALWAYS_INLINE ehci_qhd_tqhd_next (ehci_qhd_t const *p_qhd)
 
static TU_ATTR_ALWAYS_INLINE ehci_qhd_tqhd_find_free (void)
 
static ehci_qhd_tqhd_get_from_addr (uint8_t dev_addr, uint8_t ep_addr)
 
static void qhd_init (ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t const *ep_desc)
 
static void qhd_attach_qtd (ehci_qhd_t *qhd, ehci_qtd_t *qtd)
 
static void qhd_remove_qtd (ehci_qhd_t *qhd)
 
static TU_ATTR_ALWAYS_INLINE ehci_qtd_tqtd_control (uint8_t dev_addr)
 
static TU_ATTR_ALWAYS_INLINE ehci_qtd_tqtd_find_free (void)
 
static void qtd_init (ehci_qtd_t *qtd, void const *buffer, uint16_t total_bytes)
 
static TU_ATTR_ALWAYS_INLINE ehci_link_tlist_get_period_head (uint8_t rhport, uint32_t interval_ms)
 
static TU_ATTR_ALWAYS_INLINE ehci_qhd_tlist_get_async_head (uint8_t rhport)
 
static TU_ATTR_ALWAYS_INLINE void list_insert (ehci_link_t *current, ehci_link_t *new, uint8_t new_type)
 
static TU_ATTR_ALWAYS_INLINE ehci_link_tlist_next (ehci_link_t const *p_link)
 
static void list_remove_qhd_by_daddr (ehci_link_t *list_head, uint8_t dev_addr)
 
static void ehci_disable_schedule (ehci_registers_t *regs, bool is_period)
 
static void ehci_enable_schedule (ehci_registers_t *regs, bool is_period)
 
uint32_t hcd_frame_number (uint8_t rhport)
 
void hcd_port_reset (uint8_t rhport)
 
void hcd_port_reset_end (uint8_t rhport)
 
bool hcd_port_connect_status (uint8_t rhport)
 
tusb_speed_t hcd_port_speed_get (uint8_t rhport)
 
void hcd_device_close (uint8_t rhport, uint8_t daddr)
 
static void init_periodic_list (uint8_t rhport)
 
bool ehci_init (uint8_t rhport, uint32_t capability_reg, uint32_t operatial_reg)
 
static void ehci_stop (uint8_t rhport)
 
bool hcd_edpt_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const *ep_desc)
 
bool hcd_setup_send (uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
 
bool hcd_edpt_xfer (uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *buffer, uint16_t buflen)
 
bool hcd_edpt_abort_xfer (uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr)
 
bool hcd_edpt_clear_stall (uint8_t rhport, uint8_t daddr, uint8_t ep_addr)
 
static TU_ATTR_ALWAYS_INLINE void async_advance_isr (uint8_t rhport)
 
static TU_ATTR_ALWAYS_INLINE void port_connect_status_change_isr (uint8_t rhport)
 
static TU_ATTR_ALWAYS_INLINE void qhd_xfer_complete_isr (ehci_qhd_t *qhd)
 
static TU_ATTR_ALWAYS_INLINE void proccess_async_xfer_isr (ehci_qhd_t *const list_head)
 
static TU_ATTR_ALWAYS_INLINE void process_period_xfer_isr (uint8_t rhport, uint32_t interval_ms)
 
void hcd_int_handler (uint8_t rhport, bool in_isr)
 

Function Documentation

◆ async_advance_isr()

static TU_ATTR_ALWAYS_INLINE void async_advance_isr ( uint8_t  rhport)
inlinestatic

Definition at line 543 of file ehci.c.

◆ ehci_disable_schedule()

static void ehci_disable_schedule ( ehci_registers_t regs,
bool  is_period 
)
static

Definition at line 153 of file ehci.c.

◆ ehci_enable_schedule()

static void ehci_enable_schedule ( ehci_registers_t regs,
bool  is_period 
)
static

Definition at line 164 of file ehci.c.

◆ ehci_init()

bool ehci_init ( uint8_t  rhport,
uint32_t  capability_reg,
uint32_t  operatial_reg 
)

Definition at line 295 of file ehci.c.

◆ ehci_stop()

static void ehci_stop ( uint8_t  rhport)
static

Definition at line 361 of file ehci.c.

◆ hcd_dcache_clean()

TU_ATTR_WEAK bool hcd_dcache_clean ( void const *  addr,
uint32_t  data_size 
)

Definition at line 131 of file ehci.c.

◆ hcd_dcache_clean_invalidate()

TU_ATTR_WEAK bool hcd_dcache_clean_invalidate ( void const *  addr,
uint32_t  data_size 
)

Definition at line 133 of file ehci.c.

◆ hcd_dcache_invalidate()

TU_ATTR_WEAK bool hcd_dcache_invalidate ( void const *  addr,
uint32_t  data_size 
)

Definition at line 132 of file ehci.c.

◆ hcd_device_close()

void hcd_device_close ( uint8_t  rhport,
uint8_t  daddr 
)

Definition at line 237 of file ehci.c.

◆ hcd_edpt_abort_xfer()

bool hcd_edpt_abort_xfer ( uint8_t  rhport,
uint8_t  dev_addr,
uint8_t  ep_addr 
)

Definition at line 493 of file ehci.c.

◆ hcd_edpt_clear_stall()

bool hcd_edpt_clear_stall ( uint8_t  rhport,
uint8_t  daddr,
uint8_t  ep_addr 
)

Definition at line 525 of file ehci.c.

◆ hcd_edpt_open()

bool hcd_edpt_open ( uint8_t  rhport,
uint8_t  dev_addr,
tusb_desc_endpoint_t const *  ep_desc 
)

Definition at line 378 of file ehci.c.

◆ hcd_edpt_xfer()

bool hcd_edpt_xfer ( uint8_t  rhport,
uint8_t  dev_addr,
uint8_t  ep_addr,
uint8_t *  buffer,
uint16_t  buflen 
)

Definition at line 447 of file ehci.c.

◆ hcd_frame_number()

uint32_t hcd_frame_number ( uint8_t  rhport)

Definition at line 179 of file ehci.c.

◆ hcd_int_handler()

void hcd_int_handler ( uint8_t  rhport,
bool  in_isr 
)

Definition at line 659 of file ehci.c.

◆ hcd_port_connect_status()

bool hcd_port_connect_status ( uint8_t  rhport)

Definition at line 224 of file ehci.c.

◆ hcd_port_reset()

void hcd_port_reset ( uint8_t  rhport)

Definition at line 185 of file ehci.c.

◆ hcd_port_reset_end()

void hcd_port_reset_end ( uint8_t  rhport)

Definition at line 207 of file ehci.c.

◆ hcd_port_speed_get()

tusb_speed_t hcd_port_speed_get ( uint8_t  rhport)

Definition at line 230 of file ehci.c.

◆ hcd_setup_send()

bool hcd_setup_send ( uint8_t  rhport,
uint8_t  dev_addr,
uint8_t const  setup_packet[8] 
)

Definition at line 424 of file ehci.c.

◆ init_periodic_list()

static void init_periodic_list ( uint8_t  rhport)
static

Definition at line 256 of file ehci.c.

◆ list_get_async_head()

static TU_ATTR_ALWAYS_INLINE ehci_qhd_t * list_get_async_head ( uint8_t  rhport)
inlinestatic

Definition at line 720 of file ehci.c.

◆ list_get_period_head()

static TU_ATTR_ALWAYS_INLINE ehci_link_t * list_get_period_head ( uint8_t  rhport,
uint32_t  interval_ms 
)
inlinestatic

Definition at line 714 of file ehci.c.

◆ list_insert()

static TU_ATTR_ALWAYS_INLINE void list_insert ( ehci_link_t current,
ehci_link_t new,
uint8_t  new_type 
)
inlinestatic

Definition at line 729 of file ehci.c.

◆ list_next()

static TU_ATTR_ALWAYS_INLINE ehci_link_t * list_next ( ehci_link_t const *  p_link)
inlinestatic

Definition at line 725 of file ehci.c.

◆ list_remove_qhd_by_daddr()

static void list_remove_qhd_by_daddr ( ehci_link_t list_head,
uint8_t  dev_addr 
)
static

Definition at line 736 of file ehci.c.

◆ port_connect_status_change_isr()

static TU_ATTR_ALWAYS_INLINE void port_connect_status_change_isr ( uint8_t  rhport)
inlinestatic

Definition at line 557 of file ehci.c.

◆ print_intr()

static void print_intr ( uint32_t  intr)
inlinestatic

Definition at line 110 of file ehci.c.

◆ proccess_async_xfer_isr()

static TU_ATTR_ALWAYS_INLINE void proccess_async_xfer_isr ( ehci_qhd_t *const  list_head)
inlinestatic

Definition at line 615 of file ehci.c.

◆ process_period_xfer_isr()

static TU_ATTR_ALWAYS_INLINE void process_period_xfer_isr ( uint8_t  rhport,
uint32_t  interval_ms 
)
inlinestatic

Definition at line 626 of file ehci.c.

◆ qhd_attach_qtd()

static void qhd_attach_qtd ( ehci_qhd_t qhd,
ehci_qtd_t qtd 
)
static

Definition at line 890 of file ehci.c.

◆ qhd_control()

static TU_ATTR_ALWAYS_INLINE ehci_qhd_t * qhd_control ( uint8_t  dev_addr)
inlinestatic

Definition at line 779 of file ehci.c.

◆ qhd_find_free()

static TU_ATTR_ALWAYS_INLINE ehci_qhd_t * qhd_find_free ( void  )
inlinestatic

Definition at line 784 of file ehci.c.

◆ qhd_get_from_addr()

static ehci_qhd_t * qhd_get_from_addr ( uint8_t  dev_addr,
uint8_t  ep_addr 
)
static

Definition at line 797 of file ehci.c.

◆ qhd_init()

static void qhd_init ( ehci_qhd_t p_qhd,
uint8_t  dev_addr,
tusb_desc_endpoint_t const *  ep_desc 
)
static

Definition at line 815 of file ehci.c.

◆ qhd_next()

static TU_ATTR_ALWAYS_INLINE ehci_qhd_t * qhd_next ( ehci_qhd_t const *  p_qhd)
inlinestatic

Definition at line 792 of file ehci.c.

◆ qhd_remove_qtd()

static void qhd_remove_qtd ( ehci_qhd_t qhd)
static

Definition at line 902 of file ehci.c.

◆ qhd_xfer_complete_isr()

static TU_ATTR_ALWAYS_INLINE void qhd_xfer_complete_isr ( ehci_qhd_t qhd)
inlinestatic

Definition at line 570 of file ehci.c.

◆ qtd_control()

static TU_ATTR_ALWAYS_INLINE ehci_qtd_t * qtd_control ( uint8_t  dev_addr)
inlinestatic

Definition at line 918 of file ehci.c.

◆ qtd_find_free()

static TU_ATTR_ALWAYS_INLINE ehci_qtd_t * qtd_find_free ( void  )
inlinestatic

Definition at line 922 of file ehci.c.

◆ qtd_init()

static void qtd_init ( ehci_qtd_t qtd,
void const *  buffer,
uint16_t  total_bytes 
)
static

Definition at line 929 of file ehci.c.

◆ TU_ATTR_ALIGNED()

CFG_TUH_MEM_SECTION TU_ATTR_ALIGNED ( 4096  )

Definition at line 90 of file ehci.c.