SPI_FullDuplex_SoftNSS
[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 (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 (uint16_t SPIy_Mode, uint16_t SPIz_Mode)
 Configures the different SPIy and SPIz 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 uint8_t k = 0
__IO uint8_t RxIdx = 0
SPI_InitTypeDef SPI_InitStructure
uint8_t SPIy_Buffer_Rx [BufferSize]
uint8_t SPIy_Buffer_Tx [BufferSize]
uint8_t SPIz_Buffer_Rx [BufferSize]
uint8_t SPIz_Buffer_Tx [BufferSize]
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
volatile TestStatus TransferStatus3 = FAILED
volatile TestStatus TransferStatus4 = FAILED
__IO uint8_t TxIdx = 0

Define Documentation

#define BufferSize   32

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/SPI/FullDuplex_SoftNSS/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 291 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/stm32f10x_it.c.

void GPIO_Configuration ( uint16_t  SPIy_Mode,
uint16_t  SPIz_Mode 
)

Configures the different SPIy and SPIz GPIO ports.

Parameters:
SPIy_Mode,: Specifies the SPIy operating mode. This parameter can be:

  • SPIy_Mode_Master
  • SPIy_Mode_Slave
SPIz_Mode,: Specifies the SPIz operating mode. This parameter can be:

  • SPIz_Mode_Master
  • SPIz_Mode_Slave
Return values:
None 

Definition at line 218 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/main.c.

References ENABLE, GPIO_Init(), GPIO_InitStructure, GPIO_InitTypeDef::GPIO_Mode, GPIO_Mode_AF_PP, GPIO_Mode_IN_FLOATING, GPIO_InitTypeDef::GPIO_Pin, GPIO_PinRemapConfig(), GPIO_Remap_SPI3, GPIO_InitTypeDef::GPIO_Speed, GPIO_Speed_50MHz, SPI_Mode_Master, and SPI_Mode_Slave.

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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 185 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/main.c.

References ENABLE, RCC_APB1PeriphClockCmd(), RCC_APB2Periph_AFIO, 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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/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/FullDuplex_SoftNSS/stm32f10x_it.c.


Variable Documentation

__IO uint8_t k = 0

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

Referenced by main().

__IO uint8_t RxIdx = 0
uint8_t SPIy_Buffer_Rx[BufferSize]

Definition at line 52 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/main.c.

Referenced by main().

uint8_t SPIy_Buffer_Tx[BufferSize]
Initial value:
 {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
                                      0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
                                      0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
                                      0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C,
                                      0x1D, 0x1E, 0x1F, 0x20}

Definition at line 42 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/main.c.

Referenced by main().

uint8_t SPIz_Buffer_Rx[BufferSize]

Definition at line 52 of file STM32F10x_StdPeriph_Examples/SPI/FullDuplex_SoftNSS/main.c.

Referenced by main().

uint8_t SPIz_Buffer_Tx[BufferSize]
Initial value:
 {0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
                                      0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E,
                                      0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 
                                      0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
                                      0x6D, 0x6E, 0x6F, 0x70}

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

Referenced by main().

volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
volatile TestStatus TransferStatus3 = FAILED
volatile TestStatus TransferStatus4 = FAILED

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

Referenced by main().

__IO uint8_t TxIdx = 0
STM32F10x Standard Peripherals Library: Footer

 

 

 

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