1#ifndef __PHAL_G4_USART_PRIV_H__
2#define __PHAL_G4_USART_PRIV_H__
7#include "stm32g474xx.h"
G4 DMA Peripheral public API implementation.
PHAL_USART_Idx_t
Definition usart.h:6
A configured DMA transfer: fixed wiring + chosen parameters.
Definition dma.h:77
Fixed hardware wiring for one peripheral + direction's DMA use.
Definition dma_wiring.h:64
Definition usart_priv.h:10
const PHAL_DMA_Wiring_t * tx_wiring
Definition usart_priv.h:17
uint32_t rcc_enable_msk
Definition usart_priv.h:12
const PHAL_DMA_Wiring_t * rx_wiring
Definition usart_priv.h:18
USART_TypeDef * periph
Definition usart_priv.h:15
volatile uint32_t * rcc_reset_rg
Definition usart_priv.h:13
IRQn_Type irq
Definition usart_priv.h:16
uint32_t rcc_reset_msk
Definition usart_priv.h:14
volatile uint32_t * rcc_enable_rg
Definition usart_priv.h:11
void PHAL_USART_priv_clearIdle(USART_TypeDef *periph)
Clear the IDLE flag alone (write-1-to-clear).
Definition usart_priv.c:178
bool PHAL_USART_priv_txCompleteActive(USART_TypeDef *periph)
Definition usart_priv.c:144
bool PHAL_USART_priv_idleActive(const USART_TypeDef *periph)
return true if the IDLE-line flag is set (an RX frame just completed).
Definition usart_priv.c:174
void PHAL_USART_priv_stopRx(USART_TypeDef *periph)
Disable the receiver and its DMA request line (CR1.RE, CR3.DMAR).
Definition usart_priv.c:157
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.
Definition usart_priv.c:91
void PHAL_USART_priv_finishTx(USART_TypeDef *periph)
Acknowledge transmission-complete: disable TCIE and clear ISR.TC.
Definition usart_priv.c:131
void PHAL_USART_priv_enableIrq(PHAL_USART_Idx_t periph_idx)
Enable the USART global interrupt (carries IDLE and TC)
Definition usart_priv.c:182
void PHAL_USART_priv_startRx(USART_TypeDef *periph)
Enable the receiver and its DMA request line (CR1.RE, CR3.DMAR).
Definition usart_priv.c:148
void PHAL_USART_priv_startTx(USART_TypeDef *periph)
Definition usart_priv.c:115
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.
Definition usart_priv.c:57
USART_TypeDef * PHAL_USART_priv_periph(PHAL_USART_Idx_t periph_idx)
Get the peripheral instance for a slot (used by the interrupt handlers)
Definition usart_priv.c:53
void PHAL_USART_priv_flushRx(USART_TypeDef *periph)
Discard anything sitting in RDR and clear IDLE plus every RX error flag.
Definition usart_priv.c:166