STM32F0xx Standard Peripherals Firmware Library
|
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:
-
Tx Buffer 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.
static void SPI_Config | ( | void | ) | [static] |
Configures the SPI Peripheral.
- Parameters:
-
None
- Return values:
-
None
Definition at line 410 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
References GPIO_InitStructure, NVIC_InitStructure, SPI_DATASIZE, SPI_InitStructure, SPIx, SPIx_CLK, SPIx_IRQn, SPIx_MISO_AF, SPIx_MISO_GPIO_CLK, SPIx_MISO_GPIO_PORT, SPIx_MISO_PIN, SPIx_MISO_SOURCE, SPIx_MOSI_AF, SPIx_MOSI_GPIO_CLK, SPIx_MOSI_GPIO_PORT, SPIx_MOSI_PIN, SPIx_MOSI_SOURCE, SPIx_SCK_AF, SPIx_SCK_GPIO_CLK, SPIx_SCK_GPIO_PORT, SPIx_SCK_PIN, and SPIx_SCK_SOURCE.
Referenced by main().
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.
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 |
Definition at line 53 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t CmdReceived = 0x00 |
Definition at line 53 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t CmdStatus |
Definition at line 54 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t CmdStatus = 0x00 |
Definition at line 54 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t CmdTransmitted |
Definition at line 52 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t CmdTransmitted = 0x00 |
Definition at line 52 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t Counter = 0x00 |
Definition at line 54 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/stm32f0xx_it.c.
__IO JOYState_TypeDef PressedButton = JOY_NONE |
Definition at line 51 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
__IO uint8_t Rx_Idx |
Definition at line 48 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t Rx_Idx = 0x00 |
Definition at line 48 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
uint8_t RxBuffer[RXBUFFERSIZE] |
Definition at line 46 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
uint8_t RxBuffer[] |
Definition at line 41 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_TwoBoards/main.c.
SPI_InitTypeDef SPI_InitStructure |
Definition at line 43 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
__IO uint32_t TimeOut |
Definition at line 48 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_TwoBoards/stm32f0xx_it.c.
__IO uint32_t TimeOut = 0x0 |
Definition at line 55 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
__IO uint8_t Tx_Idx |
Definition at line 49 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
__IO uint8_t Tx_Idx = 0x00 |
Definition at line 49 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.
Referenced by main(), and SPI1_IRQHandler().
uint8_t TxBuffer[] |
Definition at line 40 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_TwoBoards/main.c.
uint8_t TxBuffer[] = "SPI Interrupt Example: Communication between two SPI using Interrupts" |
Definition at line 45 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeInterrupt/main.c.