USART_HalfDuplex
[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 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 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.

Variables

uint32_t NbrOfDataToRead1 = TxBufferSize2
uint32_t NbrOfDataToRead2 = TxBufferSize1
uint8_t RxBuffer1 [TxBufferSize2]
uint8_t RxBuffer2 [TxBufferSize1]
uint8_t RxCounter1 = 0
uint8_t RxCounter2 = 0
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
uint8_t TxBuffer1 [] = "USART Half Duplex: USARTy -> USARTz using HalfDuplex mode"
uint8_t TxBuffer2 [] = "USART Half Duplex: USARTz -> USARTy using HalfDuplex mode"
uint8_t TxCounter1 = 0
uint8_t TxCounter2 = 0
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/HalfDuplex/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 227 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 85 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 120 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void GPIO_Configuration ( void   ) 
void HardFault_Handler ( void   ) 

This function handles Hard Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 59 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

int main ( void   ) 
void MemManage_Handler ( void   ) 

This function handles Memory Manage exception.

Parameters:
None 
Return values:
None 

Definition at line 72 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void NMI_Handler ( void   ) 

This function handles NMI exception.

Parameters:
None 
Return values:
None 

Definition at line 50 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 129 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 173 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

References ENABLE, 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 111 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 138 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 98 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/stm32f10x_it.c.


Variable Documentation

uint32_t NbrOfDataToRead1 = TxBufferSize2
uint32_t NbrOfDataToRead2 = TxBufferSize1

Definition at line 50 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

Referenced by main().

uint8_t RxBuffer1[TxBufferSize2]
uint8_t RxBuffer2[TxBufferSize1]
uint8_t RxCounter1 = 0

Definition at line 51 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

Referenced by main(), and USARTy_IRQHandler().

uint8_t RxCounter2 = 0

Definition at line 52 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

Referenced by main(), and USARTz_IRQHandler().

volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
uint8_t TxBuffer1[] = "USART Half Duplex: USARTy -> USARTz using HalfDuplex mode"
uint8_t TxBuffer2[] = "USART Half Duplex: USARTz -> USARTy using HalfDuplex mode"
uint8_t TxCounter1 = 0

Definition at line 51 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

Referenced by main(), and USARTy_IRQHandler().

uint8_t TxCounter2 = 0

Definition at line 52 of file STM32F10x_StdPeriph_Examples/USART/HalfDuplex/main.c.

Referenced by main(), and USARTz_IRQHandler().

STM32F10x Standard Peripherals Library: Footer

 

 

 

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