PER Firmware
Loading...
Searching...
No Matches
usart_priv.c File Reference
Include dependency graph for usart_priv.c:

Functions

static uint32_t enterCritical (void)
 
static void exitCritical (uint32_t previous_interrupt_mask)
 
USART_TypeDef * PHAL_USART_priv_periph (PHAL_USART_Idx_t periph_idx)
 Get the peripheral instance for a slot (used by the interrupt handlers)
 
void PHAL_USART_priv_configure (PHAL_USART_Idx_t periph_idx, uint32_t baud_rate, uint32_t clock_rate)
 Enable the clock, program 8N1 + baud, and enable the USART + TX-DMA interrupts.
 
void PHAL_USART_priv_buildDma (PHAL_USART_Idx_t periph_idx, PHAL_DMA_Handle_t *tx_dma, PHAL_DMA_Handle_t *rx_dma)
 Fill the TX and RX DMA handles from the hardware map.
 
void PHAL_USART_priv_startTx (USART_TypeDef *periph)
 
void PHAL_USART_priv_finishTx (USART_TypeDef *periph)
 Acknowledge transmission-complete: disable TCIE and clear ISR.TC.
 
bool PHAL_USART_priv_txCompleteActive (USART_TypeDef *periph)
 
void PHAL_USART_priv_startRx (USART_TypeDef *periph)
 Enable the receiver and its DMA request line (CR1.RE, CR3.DMAR).
 
void PHAL_USART_priv_stopRx (USART_TypeDef *periph)
 Disable the receiver and its DMA request line (CR1.RE, CR3.DMAR).
 
void PHAL_USART_priv_flushRx (USART_TypeDef *periph)
 Discard anything sitting in RDR and clear IDLE plus every RX error flag.
 
bool PHAL_USART_priv_idleActive (const USART_TypeDef *periph)
 return true if the IDLE-line flag is set (an RX frame just completed).
 
void PHAL_USART_priv_clearIdle (USART_TypeDef *periph)
 Clear the IDLE flag alone (write-1-to-clear).
 
void PHAL_USART_priv_enableIrq (PHAL_USART_Idx_t periph_idx)
 Enable the USART global interrupt (carries IDLE and TC)
 

Variables

static const PHAL_USART_HwMap_t USART_MAP [NUM_USART]
 
static constexpr uint32_t USART_PRIV_RX_FLAG_CLEAR_MSK
 

Function Documentation

◆ enterCritical()

static uint32_t enterCritical ( void )
inlinestatic
Here is the caller graph for this function:

◆ exitCritical()

static void exitCritical ( uint32_t previous_interrupt_mask)
inlinestatic
Here is the caller graph for this function:

◆ PHAL_USART_priv_buildDma()

void PHAL_USART_priv_buildDma ( PHAL_USART_Idx_t periph_idx,
PHAL_DMA_Handle_t * tx_dma,
PHAL_DMA_Handle_t * rx_dma )

Fill the TX and RX DMA handles from the hardware map.

Here is the caller graph for this function:

◆ PHAL_USART_priv_clearIdle()

void PHAL_USART_priv_clearIdle ( USART_TypeDef * periph)

Clear the IDLE flag alone (write-1-to-clear).

Here is the caller graph for this function:

◆ PHAL_USART_priv_configure()

void PHAL_USART_priv_configure ( PHAL_USART_Idx_t periph_idx,
uint32_t baud_rate,
uint32_t clock_rate )

Enable the clock, program 8N1 + baud, and enable the USART + TX-DMA interrupts.

Here is the caller graph for this function:

◆ PHAL_USART_priv_enableIrq()

void PHAL_USART_priv_enableIrq ( PHAL_USART_Idx_t periph_idx)

Enable the USART global interrupt (carries IDLE and TC)

Here is the caller graph for this function:

◆ PHAL_USART_priv_finishTx()

void PHAL_USART_priv_finishTx ( USART_TypeDef * periph)

Acknowledge transmission-complete: disable TCIE and clear ISR.TC.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_USART_priv_flushRx()

void PHAL_USART_priv_flushRx ( USART_TypeDef * periph)

Discard anything sitting in RDR and clear IDLE plus every RX error flag.

Here is the caller graph for this function:

◆ PHAL_USART_priv_idleActive()

bool PHAL_USART_priv_idleActive ( const USART_TypeDef * periph)

return true if the IDLE-line flag is set (an RX frame just completed).

Here is the caller graph for this function:

◆ PHAL_USART_priv_periph()

USART_TypeDef * PHAL_USART_priv_periph ( PHAL_USART_Idx_t periph_idx)

Get the peripheral instance for a slot (used by the interrupt handlers)

Here is the caller graph for this function:

◆ PHAL_USART_priv_startRx()

void PHAL_USART_priv_startRx ( USART_TypeDef * periph)

Enable the receiver and its DMA request line (CR1.RE, CR3.DMAR).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_USART_priv_startTx()

void PHAL_USART_priv_startTx ( USART_TypeDef * periph)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_USART_priv_stopRx()

void PHAL_USART_priv_stopRx ( USART_TypeDef * periph)

Disable the receiver and its DMA request line (CR1.RE, CR3.DMAR).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_USART_priv_txCompleteActive()

bool PHAL_USART_priv_txCompleteActive ( USART_TypeDef * periph)
Here is the caller graph for this function:

Variable Documentation

◆ USART_MAP

const PHAL_USART_HwMap_t USART_MAP[NUM_USART]
static

◆ USART_PRIV_RX_FLAG_CLEAR_MSK

uint32_t USART_PRIV_RX_FLAG_CLEAR_MSK
staticconstexpr
Initial value:
=
USART_ICR_IDLECF | USART_ICR_ORECF | USART_ICR_NECF
| USART_ICR_FECF | USART_ICR_PECF