STM32F0xx Standard Peripherals Firmware Library: SPI_DataExchangeDMA

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library

Functions

static TestStatus Buffercmp (uint8_t *pBuffer1, uint8_t *pBuffer2, uint16_t BufferLength, uint8_t DataMask)
 Compares two buffers.
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.
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 uint32_t CommandReceived = 0x00
__IO uint32_t CommandTransmitted = 0x00
__IO uint8_t Counter = 0x00
DMA_InitTypeDef DMA_InitStructure
__IO uint16_t NumberOfByte = 0x00
__IO uint16_t PrescalerValue = 0
__IO JOYState_TypeDef PressedButton = JOY_NONE
uint8_t RxBuffer [RXBUFFERSIZE]
SPI_InitTypeDef SPI_InitStructure
TIM_OCInitTypeDef TIM_OCInitStructure
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure
__IO uint32_t TimeOut
__IO uint32_t TimeOut = 0x0
uint8_t TxBuffer [] = "SPI DMA Example: Communication between two SPI using DMA"

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 748 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/main.c.

References FAILED, and PASSED.

Referenced by main().

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 69 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/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 75 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/main.c.

References Buffercmp(), CMD_ACK, CMD_DOWN, CMD_DOWN_SIZE, CMD_LEFT, CMD_LEFT_SIZE, CMD_RIGHT, CMD_RIGHT_SIZE, CMD_SEL, CMD_SEL_SIZE, CMD_UP, CMD_UP_SIZE, CommandReceived, CommandTransmitted, DMA_InitStructure, FAILED, Fill_Buffer(), NumberOfByte, PressedButton, Read_Joystick(), RxBuffer, SPI_Config(), SPI_DATAMASK, SPI_InitStructure, SPIx, SPIx_DR_ADDRESS, SPIx_RX_DMA_CHANNEL, SPIx_RX_DMA_FLAG_GL, SPIx_RX_DMA_FLAG_TC, SPIx_TX_DMA_CHANNEL, SPIx_TX_DMA_FLAG_GL, SPIx_TX_DMA_FLAG_TC, SysTickConfig(), TIM_Config(), TimeOut, TimeOut_UserCallback(), TIMx, TIMx_CHANNEL_DMA_CHANNEL, TIMx_CHANNEL_DMA_FLAG_GL, TIMx_DMA_CHANNEL, TxBuffer, TXBUFFERSIZE, and USER_TIMEOUT.

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 60 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

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

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 82 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 100 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/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 728 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/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 714 of file STM32F0xx_StdPeriph_Examples/SPI/SPI_TwoBoards/DataExchangeDMA/main.c.

Referenced by main().


Variable Documentation

__IO uint32_t CommandReceived = 0x00
__IO uint32_t CommandTransmitted = 0x00
__IO uint16_t NumberOfByte = 0x00
__IO uint16_t PrescalerValue = 0
__IO JOYState_TypeDef PressedButton = JOY_NONE
uint8_t RxBuffer[RXBUFFERSIZE]
__IO uint32_t TimeOut = 0x0
uint8_t TxBuffer[] = "SPI DMA Example: Communication between two SPI using DMA"
STM32L1xx Standard Peripherals Library: Footer

 

 

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