File nut/arch/cm3/dev/stm/stm32_usart.c


Included Files


Preprocessor definitions

#define USARTN_RDR

#define USARTN_TDR

#define USARTN_ISR

#define CLEAR_ERRS

#define TXE_SET

#define CLEAR_TC

#define USART_ISR_ORE USART_SR_ORE

#define USART_ISR_NE USART_SR_NE

#define USART_ISR_FE USART_SR_FE

#define USART_ISR_PE USART_SR_PE

#define USART_ISR_TC USART_SR_TC

#define USART_ISR_RXNE USART_SR_RXNE

#define USART_ISR_TXE USART_SR_TXE

#define NutUartIrqEnable

#define NutUartIrqDisable

#define USART_INIT_BAUTRATE USART_INITSPEED

#define Rs485DE_L

#define Rs485DE_H

#define Rs485NRE_L

#define Rs485NRE_H


Local Variables

rx_errors
static uint16_t rx_errors
Used in: Stm32UsartGetStatus()  
  Stm32UsartRxReady()  

tx_aframe
static uint_fast8_t tx_aframe

Used in: Stm32UsartGetStatus()  
  Stm32UsartSetStatus()  

hdpx_control
static uint_fast8_t hdpx_control

Used in: Stm32UsartGetFlowControl()  
  Stm32UsartSetFlowControl()  
  Stm32UsartTxComplete()  
  Stm32UsartTxReady()  
  Stm32UsartTxStart()  

Global Function Stm32UsartGetClockMode()

uint8_t Stm32UsartGetClockMode ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h

Global Function Stm32UsartSetStopBits()

int Stm32UsartSetStopBits ( uint8_t bits )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartDisable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartEnable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartGetStopBits() nut/arch/cm3/dev/stm/stm32_usart.c
Called by: Stm32UsartInit() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartDeinit()

static int Stm32UsartDeinit ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: NutIrqDisable(), NutRegisterIrqHandler(), StmUsartClkEnable()

Local Function Stm32UsartDisable()

static void Stm32UsartDisable ( void )
Calls: CM3BBGET(), _BI32()
Called by: Stm32UsartSetDataBits() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetFlowControl() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetParity() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetSpeed() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetStopBits() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartEnable()

static void Stm32UsartEnable ( void )
Called by: Stm32UsartSetDataBits() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetFlowControl() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetParity() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetSpeed() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetStopBits() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartGetDataBits()

static uint8_t Stm32UsartGetDataBits ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Called by: Stm32UsartSetDataBits() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartGetFlowControl()

static uint32_t Stm32UsartGetFlowControl ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Called by: Stm32UsartSetFlowControl() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: hdpx_control nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartGetParity()

static uint8_t Stm32UsartGetParity ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Called by: Stm32UsartSetParity() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartGetSpeed()

static uint32_t Stm32UsartGetSpeed ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: CM3BBGET(), NutGetCpuClock(), _BI32()

Local Function Stm32UsartGetStatus()

static uint32_t Stm32UsartGetStatus ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Called by: Stm32UsartSetStatus() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: rx_errors nut/arch/cm3/dev/stm/stm32_usart.c
  tx_aframe nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartGetStopBits()

static uint8_t Stm32UsartGetStopBits ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Called by: Stm32UsartSetStopBits() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartInit()

static int Stm32UsartInit ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartSetDataBits() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetParity() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetSpeed() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartSetStopBits() nut/arch/cm3/dev/stm/stm32_usart.c
  NutIrqEnable(), NutRegisterIrqHandler(), StmUsartClkEnable()
References Functions: Stm32UsartInterrupt() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartInterrupt()

static void Stm32UsartInterrupt ( void* arg )
Calls: Stm32UsartRxReady() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartTxComplete() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartTxReady() nut/arch/cm3/dev/stm/stm32_usart.c
  CM3BBGET(), _BI32()
Used in: Stm32UsartInit() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartRxReady()

static void Stm32UsartRxReady ( RINGBUF* rbf )
Calls: NutSelectWakeupFromIrq()
Called by: Stm32UsartInterrupt() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: rx_errors nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartRxStart()

static void Stm32UsartRxStart ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: CM3BBSET(), _BI32()

Local Function Stm32UsartSetClockMode()

static int Stm32UsartSetClockMode ( uint8_t mode )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h

Local Function Stm32UsartSetDataBits()

static int Stm32UsartSetDataBits ( uint8_t bits )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartDisable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartEnable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartGetDataBits() nut/arch/cm3/dev/stm/stm32_usart.c
Called by: Stm32UsartInit() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartSetFlowControl()

static int Stm32UsartSetFlowControl ( uint32_t flags )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartDisable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartEnable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartGetFlowControl() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: hdpx_control nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartSetParity()

static int Stm32UsartSetParity ( uint8_t mode )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartDisable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartEnable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartGetParity() nut/arch/cm3/dev/stm/stm32_usart.c
Called by: Stm32UsartInit() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartSetSpeed()

static int Stm32UsartSetSpeed ( uint32_t rate )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartDisable() nut/arch/cm3/dev/stm/stm32_usart.c
  Stm32UsartEnable() nut/arch/cm3/dev/stm/stm32_usart.c
  CM3BBCLR(), CM3BBGET(), CM3BBSET(), NutGetCpuClock(), _BI32()
Called by: Stm32UsartInit() nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartSetStatus()

static int Stm32UsartSetStatus ( uint32_t flags )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: Stm32UsartGetStatus() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: tx_aframe nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartTxComplete()

static void Stm32UsartTxComplete ( RINGBUF* rbf )
Calls: CM3BBCLR(), CM3BBSET(), NutSelectWakeupFromIrq(), _BI32()
Called by: Stm32UsartInterrupt() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: hdpx_control nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartTxReady()

static void Stm32UsartTxReady ( RINGBUF* rbf )
Calls: CM3BBCLR(), CM3BBSET(), NutSelectWakeupFromIrq(), _BI32()
Called by: Stm32UsartInterrupt() nut/arch/cm3/dev/stm/stm32_usart.c
References Variables: hdpx_control nut/arch/cm3/dev/stm/stm32_usart.c

Local Function Stm32UsartTxStart()

static void Stm32UsartTxStart ( void )
Prototyped in: nut/include/arch/cm3/stm/stm32_usart.h
Calls: CM3BBCLR(), CM3BBSET(), _BI32()
References Variables: hdpx_control nut/arch/cm3/dev/stm/stm32_usart.c