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

Go to the source code of this file.

Enumerations

enum  { IMR_ATTACHED }
 

Functions

static TU_ATTR_ALWAYS_INLINE uint32_t dma_get_addr (uint8_t rhport, bool is_rx)
 
static void dma_init (uint8_t rhport, bool is_rx)
 
static TU_ATTR_ALWAYS_INLINE void dma_start (uint8_t rhport, bool is_rx, void const *buf, uint16_t len)
 
static TU_ATTR_ALWAYS_INLINE void dma_stop (uint8_t rhport, bool is_rx)
 
static TU_ATTR_ALWAYS_INLINE bool dma_enabled (uint8_t rhport, bool is_rx)
 
static TU_ATTR_ALWAYS_INLINE void dma_tx_start (uint8_t rhport, void const *buf, uint16_t len)
 
static TU_ATTR_ALWAYS_INLINE void dma_tx_stop (uint8_t rhport)
 
bool tcd_init (uint8_t rhport, uint32_t port_type)
 
void tcd_int_enable (uint8_t rhport)
 
void tcd_int_disable (uint8_t rhport)
 
bool tcd_msg_receive (uint8_t rhport, uint8_t *buffer, uint16_t total_bytes)
 
bool tcd_msg_send (uint8_t rhport, uint8_t const *buffer, uint16_t total_bytes)
 
void tcd_int_handler (uint8_t rhport)
 

Variables

static uint8_t const * _rx_buf
 
static uint8_t const * _tx_pending_buf
 
static uint16_t _tx_pending_bytes
 
static uint16_t _tx_xferring_bytes
 
static pd_header_t _good_crc
 
static const uint32_t _dma_addr_arr [TUP_TYPEC_RHPORTS_NUM][2] = CFG_TUC_STM32_DMA
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IMR_ATTACHED 

Definition at line 43 of file typec_stm32.c.

Function Documentation

◆ dma_enabled()

static TU_ATTR_ALWAYS_INLINE bool dma_enabled ( uint8_t  rhport,
bool  is_rx 
)
inlinestatic

Definition at line 147 of file typec_stm32.c.

◆ dma_get_addr()

static TU_ATTR_ALWAYS_INLINE uint32_t dma_get_addr ( uint8_t  rhport,
bool  is_rx 
)
inlinestatic

Definition at line 89 of file typec_stm32.c.

◆ dma_init()

static void dma_init ( uint8_t  rhport,
bool  is_rx 
)
static

Definition at line 93 of file typec_stm32.c.

◆ dma_start()

static TU_ATTR_ALWAYS_INLINE void dma_start ( uint8_t  rhport,
bool  is_rx,
void const *  buf,
uint16_t  len 
)
inlinestatic

Definition at line 134 of file typec_stm32.c.

◆ dma_stop()

static TU_ATTR_ALWAYS_INLINE void dma_stop ( uint8_t  rhport,
bool  is_rx 
)
inlinestatic

Definition at line 142 of file typec_stm32.c.

◆ dma_tx_start()

static TU_ATTR_ALWAYS_INLINE void dma_tx_start ( uint8_t  rhport,
void const *  buf,
uint16_t  len 
)
inlinestatic

Definition at line 152 of file typec_stm32.c.

◆ dma_tx_stop()

static TU_ATTR_ALWAYS_INLINE void dma_tx_stop ( uint8_t  rhport)
inlinestatic

Definition at line 159 of file typec_stm32.c.

◆ tcd_init()

bool tcd_init ( uint8_t  rhport,
uint32_t  port_type 
)

Definition at line 167 of file typec_stm32.c.

◆ tcd_int_disable()

void tcd_int_disable ( uint8_t  rhport)

Definition at line 208 of file typec_stm32.c.

◆ tcd_int_enable()

void tcd_int_enable ( uint8_t  rhport)

Definition at line 202 of file typec_stm32.c.

◆ tcd_int_handler()

void tcd_int_handler ( uint8_t  rhport)

Definition at line 238 of file typec_stm32.c.

◆ tcd_msg_receive()

bool tcd_msg_receive ( uint8_t  rhport,
uint8_t *  buffer,
uint16_t  total_bytes 
)

Definition at line 213 of file typec_stm32.c.

◆ tcd_msg_send()

bool tcd_msg_send ( uint8_t  rhport,
uint8_t const *  buffer,
uint16_t  total_bytes 
)

Definition at line 219 of file typec_stm32.c.

Variable Documentation

◆ _dma_addr_arr

const uint32_t _dma_addr_arr[TUP_TYPEC_RHPORTS_NUM][2] = CFG_TUC_STM32_DMA
static

Definition at line 87 of file typec_stm32.c.

◆ _good_crc

pd_header_t _good_crc
static
Initial value:
= {
.msg_type = PD_CTRL_GOOD_CRC,
.data_role = 0,
.specs_rev = PD_REV_20,
.power_role = 0,
.msg_id = 0,
.n_data_obj = 0,
.extended = 0
}
@ PD_CTRL_GOOD_CRC
Definition: pd_types.h:54
@ PD_REV_20
Definition: pd_types.h:101

Definition at line 70 of file typec_stm32.c.

◆ _rx_buf

uint8_t const* _rx_buf
static

Definition at line 65 of file typec_stm32.c.

◆ _tx_pending_buf

uint8_t const* _tx_pending_buf
static

Definition at line 66 of file typec_stm32.c.

◆ _tx_pending_bytes

uint16_t _tx_pending_bytes
static

Definition at line 67 of file typec_stm32.c.

◆ _tx_xferring_bytes

uint16_t _tx_xferring_bytes
static

Definition at line 68 of file typec_stm32.c.