I2S_SPI_I2S_Switch
[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 (uint16_t *pBuffer1, uint16_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

ErrorStatus HSEStartUpStatus
__IO uint16_t I2S2_Buffer_Rx [BufferSize]
uint16_t I2S3_Buffer_Tx [BufferSize]
I2S_InitTypeDef I2S_InitStructure
__IO uint8_t RxIdx = 0
__IO uint16_t SPI2_Buffer_Rx [BufferSize]
uint16_t SPI3_Buffer_Tx [BufferSize]
SPI_InitTypeDef SPI_InitStructure
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
volatile TestStatus TransferStatus3 = FAILED
__IO uint8_t TxIdx = 0

Define Documentation

#define BufferSize   32

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/I2S/SPI_I2S_Switch/main.c.


Function Documentation

TestStatus Buffercmp ( uint16_t *  pBuffer1,
uint16_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 401 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/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/I2S/SPI_I2S_Switch/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/I2S/SPI_I2S_Switch/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/I2S/SPI_I2S_Switch/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 75 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/main.c.

References Buffercmp(), BufferSize, ENABLE, GPIO_Configuration(), I2S2_Buffer_Rx, I2S3_Buffer_Tx, I2S_InitTypeDef::I2S_AudioFreq, I2S_AudioFreq_48k, I2S_Cmd(), I2S_InitTypeDef::I2S_CPOL, I2S_CPOL_Low, I2S_InitTypeDef::I2S_DataFormat, I2S_DataFormat_16bextended, I2S_Init(), I2S_InitTypeDef::I2S_MCLKOutput, I2S_MCLKOutput_Disable, I2S_InitTypeDef::I2S_Mode, I2S_Mode_MasterRx, I2S_Mode_MasterTx, I2S_Mode_SlaveRx, I2S_Mode_SlaveTx, I2S_InitTypeDef::I2S_Standard, I2S_Standard_Phillips, RCC_Configuration(), RESET, RxIdx, SPI2, SPI2_Buffer_Rx, SPI3, SPI3_Buffer_Tx, SPI_InitTypeDef::SPI_BaudRatePrescaler, SPI_BaudRatePrescaler_4, 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_16b, SPI_InitTypeDef::SPI_Direction, SPI_Direction_1Line_Tx, SPI_Direction_2Lines_RxOnly, SPI_InitTypeDef::SPI_FirstBit, SPI_FirstBit_MSB, SPI_I2S_DeInit(), SPI_I2S_FLAG_RXNE, SPI_I2S_FLAG_TXE, SPI_I2S_GetFlagStatus(), SPI_I2S_ReceiveData(), SPI_I2S_SendData(), SPI_Init(), SPI_InitTypeDef::SPI_Mode, SPI_Mode_Master, SPI_Mode_Slave, SPI_InitTypeDef::SPI_NSS, SPI_NSS_Soft, TransferStatus1, TransferStatus2, TransferStatus3, 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/I2S/SPI_I2S_Switch/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/I2S/SPI_I2S_Switch/stm32f10x_it.c.

void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 125 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/stm32f10x_it.c.

void RCC_Configuration ( void   ) 
void SVC_Handler ( void   ) 

This function handles SVCall exception.

Parameters:
None 
Return values:
None 

Definition at line 116 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 134 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/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/I2S/SPI_I2S_Switch/stm32f10x_it.c.


Variable Documentation

__IO uint16_t I2S2_Buffer_Rx[BufferSize]
uint16_t I2S3_Buffer_Tx[BufferSize]
Initial value:
 {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
                                  0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
                                  0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
                                  0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
                                  0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
                                  0x3D3E, 0x3F40}

Definition at line 44 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/main.c.

__IO uint8_t RxIdx = 0
__IO uint16_t SPI2_Buffer_Rx[BufferSize]

Definition at line 59 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/main.c.

Referenced by main().

uint16_t SPI3_Buffer_Tx[BufferSize]
Initial value:
 {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C,
                                  0x5D5E, 0x5F60, 0x6162, 0x6364, 0x6566, 0x6768,
                                  0x696A, 0x6B6C, 0x6D6E, 0x6F70, 0x7172, 0x7374,
                                  0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
                                  0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C,
                                  0x8D8E, 0x8F90}

Definition at line 51 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/main.c.

Referenced by main().

volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED
volatile TestStatus TransferStatus3 = FAILED

Definition at line 62 of file STM32F10x_StdPeriph_Examples/I2S/SPI_I2S_Switch/main.c.

Referenced by main().

__IO uint8_t TxIdx = 0
STM32F10x Standard Peripherals Library: Footer

 

 

 

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