SPI_DMA
[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 (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

DMA_InitTypeDef DMA_InitStructure
GPIO_InitTypeDef GPIO_InitStructure
SPI_InitTypeDef SPI_InitStructure
uint8_t SPI_MASTER_Buffer_Tx [BufferSize]
uint8_t SPI_SLAVE_Buffer_Rx [BufferSize]
volatile TestStatus TransferStatus = FAILED
__IO uint8_t TxIdx = 0

Define Documentation

#define BufferSize   32

Definition at line 38 of file STM32F10x_StdPeriph_Examples/SPI/DMA/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 35 of file STM32F10x_StdPeriph_Examples/SPI/DMA/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 235 of file STM32F10x_StdPeriph_Examples/SPI/DMA/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/DMA/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/DMA/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/DMA/stm32f10x_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_stm32f10x_xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f10x.c file

Definition at line 69 of file STM32F10x_StdPeriph_Examples/SPI/DMA/main.c.

References Buffercmp(), BufferSize, DMA_InitTypeDef::DMA_BufferSize, DMA_Cmd(), DMA_DeInit(), DMA_InitTypeDef::DMA_DIR, DMA_DIR_PeripheralSRC, DMA_GetFlagStatus(), DMA_Init(), DMA_InitTypeDef::DMA_M2M, DMA_M2M_Disable, DMA_InitTypeDef::DMA_MemoryBaseAddr, DMA_InitTypeDef::DMA_MemoryDataSize, DMA_MemoryDataSize_Byte, DMA_InitTypeDef::DMA_MemoryInc, DMA_MemoryInc_Enable, DMA_InitTypeDef::DMA_Mode, DMA_Mode_Normal, DMA_InitTypeDef::DMA_PeripheralBaseAddr, DMA_InitTypeDef::DMA_PeripheralDataSize, DMA_PeripheralDataSize_Byte, DMA_InitTypeDef::DMA_PeripheralInc, DMA_PeripheralInc_Disable, DMA_InitTypeDef::DMA_Priority, DMA_Priority_VeryHigh, ENABLE, GPIO_Configuration(), RCC_Configuration(), RESET, SPI_InitTypeDef::SPI_BaudRatePrescaler, SPI_BaudRatePrescaler_4, SPI_Cmd(), SPI_InitTypeDef::SPI_CPHA, SPI_CPHA_1Edge, SPI_InitTypeDef::SPI_CPOL, SPI_CPOL_High, SPI_InitTypeDef::SPI_CRCPolynomial, SPI_InitTypeDef::SPI_DataSize, SPI_DataSize_8b, SPI_InitTypeDef::SPI_Direction, SPI_Direction_1Line_Rx, SPI_Direction_1Line_Tx, SPI_InitTypeDef::SPI_FirstBit, SPI_FirstBit_MSB, SPI_I2S_DMACmd(), SPI_I2S_DMAReq_Rx, SPI_I2S_FLAG_TXE, SPI_I2S_GetFlagStatus(), SPI_I2S_SendData(), SPI_Init(), SPI_MASTER_Buffer_Tx, SPI_InitTypeDef::SPI_Mode, SPI_Mode_Master, SPI_Mode_Slave, SPI_InitTypeDef::SPI_NSS, SPI_NSS_Hard, SPI_SLAVE_Buffer_Rx, SPI_SSOutputCmd(), TransferStatus, and TxIdx.

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

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 158 of file STM32F10x_StdPeriph_Examples/SPI/DMA/main.c.

References ENABLE, RCC_AHBPeriphClockCmd(), 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/DMA/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/DMA/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/DMA/stm32f10x_it.c.


Variable Documentation

Definition at line 43 of file STM32F10x_StdPeriph_Examples/SPI/DMA/main.c.

Definition at line 44 of file STM32F10x_StdPeriph_Examples/SPI/DMA/main.c.

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

uint8_t SPI_MASTER_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 46 of file STM32F10x_StdPeriph_Examples/SPI/DMA/main.c.

uint8_t SPI_SLAVE_Buffer_Rx[BufferSize]

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

volatile TestStatus TransferStatus = FAILED

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

__IO uint8_t TxIdx = 0

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

STM32F10x Standard Peripherals Library: Footer

 

 

 

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