USART_DMA_Interrupt
[STM32F10x_StdPeriph_Examples]

Defines

#define countof(a)   (sizeof(a) / sizeof(*(a)))
#define TxBufferSize1   (countof(TxBuffer1) - 1)
#define TxBufferSize2   (countof(TxBuffer2) - 1)

Enumerations

enum  TestStatus {
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED
}

Functions

TestStatus Buffercmp (uint8_t *pBuffer1, uint8_t *pBuffer2, uint16_t BufferLength)
 Compares two buffers.
void BusFault_Handler (void)
 This function handles Bus Fault exception.
void DebugMon_Handler (void)
 This function handles Debug Monitor exception.
void DMA_Configuration (void)
 Configures the DMA.
void GPIO_Configuration (void)
 Configures the different GPIO ports.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void MemManage_Handler (void)
 This function handles Memory Manage exception.
void NMI_Handler (void)
 This function handles NMI exception.
void NVIC_Configuration (void)
 Configures the nested vectored interrupt controller.
void PendSV_Handler (void)
 This function handles PendSV_Handler exception.
void RCC_Configuration (void)
 Configures the different system clocks.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.
void UsageFault_Handler (void)
 This function handles Usage Fault exception.
void USART2_IRQHandler (void)
 This function handles USART2 global interrupt request.
void USART3_IRQHandler (void)
 This function handles USART3 global interrupt request.

Variables

uint32_t index = 0
uint8_t NbrOfDataToRead
uint8_t NbrOfDataToRead = TxBufferSize1
uint8_t RxBuffer1 [TxBufferSize2]
uint8_t RxBuffer2 []
uint8_t RxBuffer2 [TxBufferSize1]
uint8_t RxCounter = 0
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
uint8_t TxBuffer1 [] = "USART DMA Interrupt: USARTy -> USARTz using DMA Tx and Rx Flag"
uint8_t TxBuffer2 [] = "USART DMA Interrupt: USARTz -> USARTy using DMA Tx and Rx Interrupt"
USART_InitTypeDef USART_InitStructure

Define Documentation

#define countof (  )     (sizeof(a) / sizeof(*(a)))
#define TxBufferSize1   (countof(TxBuffer1) - 1)
#define TxBufferSize2   (countof(TxBuffer2) - 1)

Enumeration Type Documentation

enum TestStatus
Enumerator:
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 

Definition at line 34 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/main.c.


Function Documentation

TestStatus Buffercmp ( uint8_t *  pBuffer1,
uint8_t *  pBuffer2,
uint16_t  BufferLength 
)

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 288 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 89 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 124 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void DMA_Configuration ( void   ) 
void GPIO_Configuration ( void   ) 
void HardFault_Handler ( void   ) 

This function handles Hard Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 63 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

int main ( void   ) 
void MemManage_Handler ( void   ) 

This function handles Memory Manage exception.

Parameters:
None 
Return values:
None 

Definition at line 76 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void NMI_Handler ( void   ) 

This function handles NMI exception.

Parameters:
None 
Return values:
None 

Definition at line 54 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void NVIC_Configuration ( void   ) 
void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 133 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 172 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/main.c.

References ENABLE, RCC_AHBPeriph_DMA1, RCC_AHBPeriphClockCmd(), RCC_APB1PeriphClockCmd(), RCC_APB2Periph_AFIO, and RCC_APB2PeriphClockCmd().

void SVC_Handler ( void   ) 

This function handles SVCall exception.

Parameters:
None 
Return values:
None 

Definition at line 115 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 142 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 102 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

void USART2_IRQHandler ( void   ) 

This function handles USART2 global interrupt request.

Parameters:
None 
Return values:
None 

Definition at line 155 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

References DISABLE, NbrOfDataToRead, RESET, RxBuffer2, RxCounter, USART2, USART_GetITStatus(), USART_IT_RXNE, USART_ITConfig(), and USART_ReceiveData().

void USART3_IRQHandler ( void   ) 

This function handles USART3 global interrupt request.

Parameters:
None 
Return values:
None 

Definition at line 175 of file STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c.

References DISABLE, NbrOfDataToRead, RESET, RxBuffer2, RxCounter, USART3, USART_GetITStatus(), USART_IT_RXNE, USART_ITConfig(), and USART_ReceiveData().


Variable Documentation

uint32_t index = 0
uint8_t NbrOfDataToRead
uint8_t NbrOfDataToRead = TxBufferSize1
uint8_t RxBuffer1[TxBufferSize2]
uint8_t RxBuffer2[]
uint8_t RxBuffer2[TxBufferSize1]
uint8_t RxCounter = 0
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
uint8_t TxBuffer1[] = "USART DMA Interrupt: USARTy -> USARTz using DMA Tx and Rx Flag"
uint8_t TxBuffer2[] = "USART DMA Interrupt: USARTz -> USARTy using DMA Tx and Rx Interrupt"
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32