DMA_SPI_RAM
[STM32F10x_StdPeriph_Examples]

Defines

#define BufferSize   32
#define CRCPolynomial   7

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 *pBuffer, uint8_t *pBuffer1, 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
SPI_InitTypeDef SPI_InitStructure
uint8_t SPI_MASTER_Buffer_Rx [BufferSize]
uint8_t SPI_MASTER_Buffer_Tx [BufferSize]
volatile uint8_t SPI_MASTERCRCValue = 0
uint8_t SPI_SLAVE_Buffer_Rx [BufferSize]
uint8_t SPI_SLAVE_Buffer_Tx [BufferSize]
volatile uint8_t SPI_SLAVECRCValue = 0
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED

Define Documentation

#define BufferSize   32
#define CRCPolynomial   7

Definition at line 39 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().


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


Function Documentation

TestStatus Buffercmp ( uint8_t *  pBuffer,
uint8_t *  pBuffer1,
uint16_t  BufferLength 
)

Compares two buffers.

Parameters:
pBuffer,pBuffer1,: buffers to be compared.
BufferLength,: buffer's length
Return values:
PASSED,: pBuffer identical to pBuffer1 FAILED: pBuffer differs from pBuffer1

Definition at line 311 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 85 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 120 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/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/DMA/SPI_RAM/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 71 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

References Buffercmp(), BufferSize, CRCPolynomial, DMA_InitTypeDef::DMA_BufferSize, DMA_Cmd(), DMA_DeInit(), DMA_InitTypeDef::DMA_DIR, DMA_DIR_PeripheralDST, 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_High, DMA_Priority_Low, DMA_Priority_Medium, DMA_Priority_VeryHigh, ENABLE, FAILED, GPIO_Configuration(), LED1, LED2, RCC_Configuration(), RESET, SPI_InitTypeDef::SPI_BaudRatePrescaler, SPI_BaudRatePrescaler_8, SPI_CalculateCRC(), SPI_Cmd(), SPI_InitTypeDef::SPI_CPHA, SPI_CPHA_2Edge, SPI_InitTypeDef::SPI_CPOL, SPI_CPOL_Low, SPI_InitTypeDef::SPI_CRCPolynomial, SPI_InitTypeDef::SPI_DataSize, SPI_DataSize_8b, SPI_InitTypeDef::SPI_Direction, SPI_Direction_2Lines_FullDuplex, SPI_InitTypeDef::SPI_FirstBit, SPI_FirstBit_MSB, SPI_FLAG_CRCERR, SPI_I2S_DMACmd(), SPI_I2S_DMAReq_Rx, SPI_I2S_DMAReq_Tx, SPI_I2S_FLAG_RXNE, SPI_I2S_GetFlagStatus(), SPI_I2S_ReceiveData(), SPI_Init(), SPI_MASTER_Buffer_Rx, SPI_MASTER_Buffer_Tx, SPI_MASTERCRCValue, SPI_InitTypeDef::SPI_Mode, SPI_Mode_Master, SPI_Mode_Slave, SPI_InitTypeDef::SPI_NSS, SPI_NSS_Soft, SPI_SLAVE_Buffer_Rx, SPI_SLAVE_Buffer_Tx, SPI_SLAVECRCValue, STM_EVAL_LEDInit(), STM_EVAL_LEDOff(), STM_EVAL_LEDOn(), TransferStatus1, and TransferStatus2.

void MemManage_Handler ( void   ) 

This function handles Memory Manage exception.

Parameters:
None 
Return values:
None 

Definition at line 72 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/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/DMA/SPI_RAM/stm32f10x_it.c.

void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 129 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 244 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/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 111 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 138 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 98 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/stm32f10x_it.c.


Variable Documentation

uint8_t SPI_MASTER_Buffer_Rx[BufferSize]

Definition at line 45 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

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 49 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main(), and SPI1_IRQHandler().

volatile uint8_t SPI_MASTERCRCValue = 0

Definition at line 46 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

uint8_t SPI_SLAVE_Buffer_Rx[BufferSize]

Definition at line 45 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main(), and SPI2_IRQHandler().

uint8_t SPI_SLAVE_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 54 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

volatile uint8_t SPI_SLAVECRCValue = 0

Definition at line 46 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

volatile TestStatus TransferStatus1 = FAILED

Definition at line 47 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

volatile TestStatus TransferStatus2 = FAILED

Definition at line 47 of file STM32F10x_StdPeriph_Examples/DMA/SPI_RAM/main.c.

Referenced by main().

STM32F10x Standard Peripherals Library: Footer

 

 

 

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