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

Go to the source code of this file.

Classes

struct  free_block_t
 
struct  TU_ATTR_PACKED
 AUDIO Channel Cluster Descriptor (4.1) More...
 
union  hw_fifo_t
 
struct  hcd_data_t
 

Typedefs

typedef struct TU_ATTR_PACKED hw_addr_t
 
typedef struct TU_ATTR_PACKED hw_endpoint_t
 
typedef struct TU_ATTR_PACKED pipe_state_t
 
typedef struct TU_ATTR_PACKED pipe_addr_t
 

Functions

 _Pragma ("GCC diagnostic ignored \"-Waddress-of-packed-member\"")
 
static free_block_tfind_containing_block (free_block_t *beg, free_block_t *end, uint_fast16_t addr)
 
static int update_free_block_list (free_block_t *blks, unsigned num, uint_fast16_t addr, uint_fast16_t size)
 
static unsigned free_block_size (free_block_t const *blk)
 
static unsigned find_free_memory (uint_fast16_t size_in_log2_minus3)
 
static volatile hw_endpoint_tedpt_regs (unsigned epnum_minus1)
 
static unsigned find_pipe (uint_fast8_t dev_addr, uint_fast8_t ep_addr)
 
static void pipe_write_packet (void *buf, volatile void *fifo, unsigned len)
 
static void pipe_read_packet (void *buf, volatile void *fifo, unsigned len)
 
static bool edpt0_xfer_out (void)
 
static bool edpt0_xfer_in (void)
 
static bool edpt0_xfer (uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *buffer, uint16_t buflen)
 
static bool pipe_xfer_out (uint_fast8_t pipenum)
 
static bool pipe_xfer_in (uint_fast8_t pipenum)
 
static bool edpt_xfer (uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *buffer, uint16_t buflen)
 
static void process_ep0 (uint8_t rhport)
 
static void process_pipe_tx (uint8_t rhport, uint_fast8_t pipenum)
 
static void process_pipe_rx (uint8_t rhport, uint_fast8_t pipenum)
 
bool hcd_init (uint8_t rhport, const tusb_rhport_init_t *rh_init)
 
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_setup_send (uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
 
bool hcd_edpt_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const *ep_desc)
 
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 dev_addr, uint8_t ep_addr)
 
void hcd_int_handler (uint8_t rhport, bool in_isr)
 

Variables

static hcd_data_t _hcd
 

Typedef Documentation

◆ hw_addr_t

typedef struct TU_ATTR_PACKED hw_addr_t

◆ hw_endpoint_t

typedef struct TU_ATTR_PACKED hw_endpoint_t

◆ pipe_addr_t

typedef struct TU_ATTR_PACKED pipe_addr_t

◆ pipe_state_t

typedef struct TU_ATTR_PACKED pipe_state_t

Function Documentation

◆ _Pragma()

_Pragma ( "GCC diagnostic ignored \"-Waddress-of-packed-member\""  )

◆ edpt0_xfer()

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

Definition at line 318 of file hcd_musb.c.

◆ edpt0_xfer_in()

static bool edpt0_xfer_in ( void  )
static

Definition at line 296 of file hcd_musb.c.

◆ edpt0_xfer_out()

static bool edpt0_xfer_out ( void  )
static

Definition at line 275 of file hcd_musb.c.

◆ edpt_regs()

static volatile hw_endpoint_t * edpt_regs ( unsigned  epnum_minus1)
inlinestatic

Definition at line 220 of file hcd_musb.c.

◆ edpt_xfer()

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

Definition at line 392 of file hcd_musb.c.

◆ find_containing_block()

static free_block_t * find_containing_block ( free_block_t beg,
free_block_t end,
uint_fast16_t  addr 
)
inlinestatic

Definition at line 122 of file hcd_musb.c.

◆ find_free_memory()

static unsigned find_free_memory ( uint_fast16_t  size_in_log2_minus3)
static

Definition at line 175 of file hcd_musb.c.

◆ find_pipe()

static unsigned find_pipe ( uint_fast8_t  dev_addr,
uint_fast8_t  ep_addr 
)
static

Definition at line 226 of file hcd_musb.c.

◆ free_block_size()

static unsigned free_block_size ( free_block_t const *  blk)
inlinestatic

Definition at line 170 of file hcd_musb.c.

◆ hcd_device_close()

void hcd_device_close ( uint8_t  rhport,
uint8_t  dev_addr 
)

Definition at line 629 of file hcd_musb.c.

◆ hcd_edpt_abort_xfer()

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

Definition at line 819 of file hcd_musb.c.

◆ hcd_edpt_clear_stall()

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

Definition at line 828 of file hcd_musb.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 713 of file hcd_musb.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 807 of file hcd_musb.c.

◆ hcd_frame_number()

uint32_t hcd_frame_number ( uint8_t  rhport)

Definition at line 582 of file hcd_musb.c.

◆ hcd_init()

bool hcd_init ( uint8_t  rhport,
const tusb_rhport_init_t rh_init 
)

Definition at line 559 of file hcd_musb.c.

◆ hcd_int_disable()

void hcd_int_disable ( uint8_t  rhport)

Definition at line 576 of file hcd_musb.c.

◆ hcd_int_enable()

void hcd_int_enable ( uint8_t  rhport)

Definition at line 570 of file hcd_musb.c.

◆ hcd_int_handler()

void hcd_int_handler ( uint8_t  rhport,
bool  in_isr 
)

Definition at line 844 of file hcd_musb.c.

◆ hcd_port_connect_status()

bool hcd_port_connect_status ( uint8_t  rhport)

Definition at line 595 of file hcd_musb.c.

◆ hcd_port_reset()

void hcd_port_reset ( uint8_t  rhport)

Definition at line 604 of file hcd_musb.c.

◆ hcd_port_reset_end()

void hcd_port_reset_end ( uint8_t  rhport)

Definition at line 614 of file hcd_musb.c.

◆ hcd_port_speed_get()

tusb_speed_t hcd_port_speed_get ( uint8_t  rhport)

Definition at line 619 of file hcd_musb.c.

◆ hcd_setup_send()

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

Definition at line 690 of file hcd_musb.c.

◆ pipe_read_packet()

static void pipe_read_packet ( void *  buf,
volatile void *  fifo,
unsigned  len 
)
static

Definition at line 256 of file hcd_musb.c.

◆ pipe_write_packet()

static void pipe_write_packet ( void *  buf,
volatile void *  fifo,
unsigned  len 
)
static

Definition at line 237 of file hcd_musb.c.

◆ pipe_xfer_in()

static bool pipe_xfer_in ( uint_fast8_t  pipenum)
static

Definition at line 367 of file hcd_musb.c.

◆ pipe_xfer_out()

static bool pipe_xfer_out ( uint_fast8_t  pipenum)
static

Definition at line 346 of file hcd_musb.c.

◆ process_ep0()

static void process_ep0 ( uint8_t  rhport)
static

Definition at line 410 of file hcd_musb.c.

◆ process_pipe_rx()

static void process_pipe_rx ( uint8_t  rhport,
uint_fast8_t  pipenum 
)
static

Definition at line 526 of file hcd_musb.c.

◆ process_pipe_tx()

static void process_pipe_tx ( uint8_t  rhport,
uint_fast8_t  pipenum 
)
static

Definition at line 497 of file hcd_musb.c.

◆ update_free_block_list()

static int update_free_block_list ( free_block_t blks,
unsigned  num,
uint_fast16_t  addr,
uint_fast16_t  size 
)
inlinestatic

Definition at line 129 of file hcd_musb.c.

Variable Documentation

◆ _hcd

hcd_data_t _hcd
static

Definition at line 120 of file hcd_musb.c.