STM32F0xx Standard Peripherals Firmware Library: SPI_DataExchangeInterrupt

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library
SPI_DataExchangeInterrupt

Functions

static TestStatus Buffercmp (uint8_t *pBuffer1, uint8_t *pBuffer2, uint16_t BufferLength, uint8_t DataMask)
 Compares two buffers.
static void Fill_Buffer (uint8_t *pBuffer, uint16_t BufferLength)
 Fills buffer.
uint8_t GetVar_NbrOfData (void)
 Returns NbrOfDataToTransfer value.
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.
void SPI1_IRQHandler (void)
 This function handles SPI interrupt request.
static void SPI_Config (void)
 Configures the SPI Peripheral.
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.

Variables

__IO uint8_t CmdReceived
__IO uint8_t CmdReceived = 0x00
__IO uint8_t CmdStatus
__IO uint8_t CmdStatus = 0x00
__IO uint8_t CmdTransmitted
__IO uint8_t CmdTransmitted = 0x00
__IO uint8_t Counter = 0x00
__IO JOYState_TypeDef PressedButton = JOY_NONE
__IO uint8_t Rx_Idx
__IO uint8_t Rx_Idx = 0x00
uint8_t RxBuffer [RXBUFFERSIZE]
uint8_t RxBuffer []
SPI_InitTypeDef SPI_InitStructure
__IO uint32_t TimeOut
__IO uint32_t TimeOut = 0x0
__IO uint8_t Tx_Idx
__IO uint8_t Tx_Idx = 0x00
uint8_t TxBuffer []
uint8_t TxBuffer [] = "SPI Interrupt Example: Communication between two SPI using Interrupts"

Function Documentation

static TestStatus Buffercmp ( uint8_t *  pBuffer1,
uint8_t *  pBuffer2,
uint16_t  BufferLength,
uint8_t  DataMask 
) [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 485 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/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 506 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.

Referenced by main().

uint8_t GetVar_NbrOfData ( void  )

Returns NbrOfDataToTransfer value.

Parameters:
None
Return values:
TxBuffer Size (NbrOfDataToTransfer1).

Definition at line 386 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.

Referenced by main(), SPI1_IRQHandler(), and USARTx_IRQHandler().

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 78 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/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 74 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.

References Buffercmp(), CMD_ACK, CMD_DOWN, CMD_LEFT, CMD_RIGHT, CMD_SEL, CMD_UP, CmdReceived, CmdStatus, CmdTransmitted, DATA_SIZE, FAILED, Fill_Buffer(), PASSED, PressedButton, Read_Joystick(), Rx_Idx, RxBuffer, SPI_Config(), SPI_DATAMASK, SPI_InitStructure, SPIx, SysTickConfig(), TimeOut, TimeOut_UserCallback(), Tx_Idx, TxBuffer, TXBUFFERSIZE, and USER_TIMEOUT.

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 69 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

Definition at line 100 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/stm32f0xx_it.c.

void SPI1_IRQHandler ( void  )

This function handles SPI interrupt request.

This function handles SPI1 global interrupt request.

Parameters:
None
Return values:
None

Definition at line 136 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/stm32f0xx_it.c.

References CmdReceived, CmdStatus, CmdTransmitted, GetVar_NbrOfData(), I2S_Buffer_Rx, I2S_Buffer_Tx, Rx_Idx, RxBuffer, RxIdx, SPIx, Tx_Idx, TxBuffer, and TxIdx.

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 91 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 109 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/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 465 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/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 396 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.

Referenced by main().


Variable Documentation

__IO uint8_t CmdReceived = 0x00
__IO uint8_t CmdStatus = 0x00
__IO JOYState_TypeDef PressedButton = JOY_NONE
__IO uint8_t Rx_Idx = 0x00
uint8_t RxBuffer[]
__IO uint8_t Tx_Idx = 0x00
uint8_t TxBuffer[]
uint8_t TxBuffer[] = "SPI Interrupt Example: Communication between two SPI using Interrupts"
STM32L1xx Standard Peripherals Library: Footer

 

 

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