STM32F0xx Standard Peripherals Firmware Library: USART_DataExchangeDMA

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library

Functions

static TestStatus Buffercmp (uint8_t *pBuffer1, uint8_t *pBuffer2, uint16_t BufferLength)
 Compares two buffers.
static void Fill_Buffer (uint8_t *pBuffer, uint16_t BufferLength)
 Fills buffer.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void NMI_Handler (void)
 This function handles NMI exception.
void PendSV_Handler (void)
 This function handles PendSVC exception.
static JOYState_TypeDef Read_Joystick (void)
 Reads key from evaluationboard.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.
static void SysTickConfig (void)
 Configure a SysTick Base time to 10 ms.
static void TimeOut_UserCallback (void)
 Basic management of the timeout situation.
static void USART_Config (void)
 Configures the USART Peripheral.

Variables

uint8_t AckBuffer [0x02] = {0x00, 0x00}
uint8_t CmdBuffer [0x02] = {0x00, 0x00}
__IO uint8_t Counter = 0x00
DMA_InitTypeDef DMA_InitStructure
__IO JOYState_TypeDef PressedButton = JOY_NONE
uint8_t RxBuffer [RXBUFFERSIZE]
__IO uint32_t TimeOut
__IO uint32_t TimeOut = 0x0
uint8_t TxBuffer [] = "USART DMA Example: Communication between two USART using DMA"

Function Documentation

static TestStatus Buffercmp ( uint8_t *  pBuffer1,
uint8_t *  pBuffer2,
uint16_t  BufferLength 
) [static]

Compares two buffers.

Parameters:
pBuffer1,pBuffer2,:buffers to be compared.
BufferLength,:buffer's length
Return values:
PASSED,:pBuffer1 identical to pBuffer2 FAILED: pBuffer1 differs from pBuffer2

Definition at line 623 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

References FAILED, and PASSED.

Referenced by main().

static void Fill_Buffer ( uint8_t *  pBuffer,
uint16_t  BufferLength 
) [static]

Fills buffer.

Parameters:
pBuffer,:pointer on the Buffer to fill
BufferLength,:size of the buffer to fill
Return values:
None

Definition at line 644 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

Referenced by main().

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 69 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

int main ( void  )

Main program.

Parameters:
None
Return values:
None

< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file

Definition at line 69 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

References AckBuffer, Buffercmp(), CMD_ACK, CMD_DOWN, CMD_DOWN_SIZE, CMD_LEFT, CMD_LEFT_SIZE, CMD_RIGHT, CMD_RIGHT_SIZE, CMD_SEL, CMD_SEL_SIZE, CMD_UP, CMD_UP_SIZE, CmdBuffer, DMA_InitStructure, FAILED, Fill_Buffer(), PressedButton, Read_Joystick(), RxBuffer, SysTickConfig(), TimeOut, TimeOut_UserCallback(), TxBuffer, TXBUFFERSIZE, USART_Config(), USARTx, USARTx_RDR_ADDRESS, USARTx_RX_DMA_CHANNEL, USARTx_RX_DMA_FLAG_GL, USARTx_RX_DMA_FLAG_TC, USARTx_TDR_ADDRESS, USARTx_TX_DMA_CHANNEL, USARTx_TX_DMA_FLAG_GL, USARTx_TX_DMA_FLAG_TC, and USER_TIMEOUT.

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 60 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

Definition at line 91 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

static JOYState_TypeDef Read_Joystick ( void  ) [static]

Reads key from evaluationboard.

Parameters:
None
Return values:
ReturnJOY_RIGHT, JOY_LEFT, JOY_SEL, JOY_UP, JOY_DOWN or JOY_NONE

Definition at line 572 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

Referenced by main().

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 82 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 100 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

References Counter, and TimeOut.

static void SysTickConfig ( void  ) [static]

Configure a SysTick Base time to 10 ms.

Parameters:
None
Return values:
None

Definition at line 555 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

References SystemCoreClock.

Referenced by main().

static void TimeOut_UserCallback ( void  ) [static]

Basic management of the timeout situation.

Parameters:
None.
Return values:
None.

Definition at line 474 of file STM32F0xx_StdPeriph_Examples/USART/USART_TwoBoards/DataExchangeDMA/main.c.

Referenced by main().


Variable Documentation

uint8_t AckBuffer[0x02] = {0x00, 0x00}
uint8_t CmdBuffer[0x02] = {0x00, 0x00}
__IO JOYState_TypeDef PressedButton = JOY_NONE
uint8_t TxBuffer[] = "USART DMA Example: Communication between two USART using DMA"
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32