SPI_CRC
[STM32F10x_StdPeriph_Examples]

Defines

#define BufferSize   32

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 (uint16_t *pBuffer1, uint16_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

__IO uint16_t CRC1Value = 0
__IO uint16_t CRC2Value = 0
uint32_t RxIdx = 0
uint16_t SPI1_Buffer_Rx [BufferSize]
uint16_t SPI1_Buffer_Tx [BufferSize]
uint16_t SPI2_Buffer_Rx [BufferSize]
uint16_t SPI2_Buffer_Tx [BufferSize]
SPI_InitTypeDef SPI_InitStructure
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
uint32_t TxIdx = 0

Define Documentation

#define BufferSize   32

Definition at line 36 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.


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 33 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.


Function Documentation

TestStatus Buffercmp ( uint16_t *  pBuffer1,
uint16_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 245 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 83 of file STM32F10x_StdPeriph_Examples/SPI/CRC/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 107 of file STM32F10x_StdPeriph_Examples/SPI/CRC/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/SPI/CRC/stm32f10x_it.c.

int main ( void   ) 
void MemManage_Handler ( void   ) 

This function handles Memory Manage exception.

Parameters:
None 
Return values:
None 

Definition at line 71 of file STM32F10x_StdPeriph_Examples/SPI/CRC/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/SPI/CRC/stm32f10x_it.c.

void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 123 of file STM32F10x_StdPeriph_Examples/SPI/CRC/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 191 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

References ENABLE, RCC_APB1Periph_SPI2, RCC_APB1PeriphClockCmd(), RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB, RCC_APB2Periph_SPI1, RCC_APB2PeriphClockCmd(), RCC_HCLK_Div2, and RCC_PCLK2Config().

void SVC_Handler ( void   ) 

This function handles SVCall exception.

Parameters:
None 
Return values:
None 

Definition at line 115 of file STM32F10x_StdPeriph_Examples/SPI/CRC/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 131 of file STM32F10x_StdPeriph_Examples/SPI/CRC/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 95 of file STM32F10x_StdPeriph_Examples/SPI/CRC/stm32f10x_it.c.


Variable Documentation

__IO uint16_t CRC1Value = 0

Definition at line 55 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

Referenced by main().

__IO uint16_t CRC2Value = 0

Definition at line 55 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

Referenced by main().

uint32_t RxIdx = 0

Definition at line 54 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

uint16_t SPI1_Buffer_Rx[BufferSize]

Definition at line 53 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

Referenced by main().

uint16_t SPI1_Buffer_Tx[BufferSize]
Initial value:
 {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
                                  0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
                                  0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
                                  0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
                                  0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
                                  0x3D3E, 0x3F40}

Definition at line 41 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

Referenced by main().

uint16_t SPI2_Buffer_Rx[BufferSize]

Definition at line 53 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

uint16_t SPI2_Buffer_Tx[BufferSize]
Initial value:
 {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C,
                                  0x5D5E, 0x5F60, 0x6162, 0x6364, 0x6566, 0x6768,
                                  0x696A, 0x6B6C, 0x6D6E, 0x6F70, 0x7172, 0x7374,
                                  0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
                                  0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C,
                                  0x8D8E, 0x8F90}

Definition at line 47 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

Referenced by main().

Definition at line 40 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

volatile TestStatus TransferStatus1 = FAILED

Definition at line 56 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

volatile TestStatus TransferStatus2 = FAILED

Definition at line 56 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

uint32_t TxIdx = 0

Definition at line 54 of file STM32F10x_StdPeriph_Examples/SPI/CRC/main.c.

STM32F10x Standard Peripherals Library: Footer

 

 

 

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