SDIO_Example
[STM32F10x_StdPeriph_Examples]

Defines

#define BLOCK_SIZE   512
#define MULTI_BUFFER_SIZE   (BLOCK_SIZE * NUMBER_OF_BLOCKS)
#define NUMBER_OF_BLOCKS   2

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, uint32_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.
TestStatus eBuffercmp (uint8_t *pBuffer, uint32_t BufferLength)
 Checks if a buffer has all its values are equal to zero.
void Fill_Buffer (uint8_t *pBuffer, uint32_t BufferLength, uint32_t Offset)
 Fills buffer with user predefined data.
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 NVIC_Configuration (void)
 Configures SDIO IRQ channel.
void PendSV_Handler (void)
 This function handles PendSV_Handler exception.
void SDIO_IRQHandler (void)
 This function handles SDIO global interrupt request.
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

uint8_t Buffer_Block_Rx [BLOCK_SIZE]
uint8_t Buffer_Block_Tx [BLOCK_SIZE]
uint8_t Buffer_MultiBlock_Rx [MULTI_BUFFER_SIZE]
uint8_t Buffer_MultiBlock_Tx [MULTI_BUFFER_SIZE]
volatile TestStatus EraseStatus = FAILED
SD_CardInfo SDCardInfo
SD_Error Status = SD_OK
volatile TestStatus TransferStatus1 = FAILED
volatile TestStatus TransferStatus2 = FAILED

Define Documentation

#define BLOCK_SIZE   512

Definition at line 37 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

#define MULTI_BUFFER_SIZE   (BLOCK_SIZE * NUMBER_OF_BLOCKS)

Definition at line 40 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

#define NUMBER_OF_BLOCKS   2

Definition at line 39 of file STM32F10x_StdPeriph_Examples/SDIO/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 34 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.


Function Documentation

TestStatus Buffercmp ( uint8_t *  pBuffer1,
uint8_t *  pBuffer2,
uint32_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 171 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 84 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 108 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

TestStatus eBuffercmp ( uint8_t *  pBuffer,
uint32_t  BufferLength 
)

Checks if a buffer has all its values are equal to zero.

Parameters:
pBuffer,: buffer to be compared.
BufferLength,: buffer's length
Return values:
PASSED,: pBuffer values are zero FAILED: At least one value from pBuffer buffer is diffrent from zero.

Definition at line 212 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

References FAILED, and PASSED.

Referenced by main().

void Fill_Buffer ( uint8_t *  pBuffer,
uint32_t  BufferLength,
uint32_t  Offset 
)

Fills buffer with user predefined data.

Parameters:
pBuffer,: pointer on the Buffer to fill
BufferLength,: size of the buffer to fill
Offset,: first value to fill on the Buffer
Return values:
None 

Definition at line 194 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

References index.

void HardFault_Handler ( void   ) 

This function handles Hard Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 60 of file STM32F10x_StdPeriph_Examples/SDIO/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 63 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

References BLOCK_SIZE, Buffer_Block_Rx, Buffer_Block_Tx, Buffer_MultiBlock_Rx, Buffer_MultiBlock_Tx, Buffercmp(), eBuffercmp(), EraseStatus, Fill_Buffer(), MULTI_BUFFER_SIZE, NUMBER_OF_BLOCKS, NVIC_Configuration(), SD_Erase(), SD_Init(), SD_OK, SD_ReadBlock(), SD_ReadMultiBlocks(), SD_WriteBlock(), SD_WriteMultiBlocks(), Status, 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/SDIO/stm32f10x_it.c.

void NMI_Handler ( void   ) 

This function handles NMI exception.

Parameters:
None 
Return values:
None 

Definition at line 51 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

void NVIC_Configuration ( void   ) 
void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 126 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

void SDIO_IRQHandler ( void   ) 

This function handles SDIO global interrupt request.

Parameters:
None 
Return values:
None 

Definition at line 148 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

References SD_ProcessIRQSrc().

void SVC_Handler ( void   ) 

This function handles SVCall exception.

Parameters:
None 
Return values:
None 

Definition at line 117 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 135 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 96 of file STM32F10x_StdPeriph_Examples/SDIO/stm32f10x_it.c.


Variable Documentation

uint8_t Buffer_Block_Rx[BLOCK_SIZE]

Definition at line 45 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

uint8_t Buffer_Block_Tx[BLOCK_SIZE]

Definition at line 45 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

uint8_t Buffer_MultiBlock_Rx[MULTI_BUFFER_SIZE]

Definition at line 46 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

uint8_t Buffer_MultiBlock_Tx[MULTI_BUFFER_SIZE]

Definition at line 46 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

volatile TestStatus EraseStatus = FAILED

Definition at line 47 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main().

Definition at line 44 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

SD_Error Status = SD_OK

Definition at line 48 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

Referenced by main(), and SD_GetStatus().

volatile TestStatus TransferStatus1 = FAILED

Definition at line 47 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

volatile TestStatus TransferStatus2 = FAILED

Definition at line 47 of file STM32F10x_StdPeriph_Examples/SDIO/main.c.

STM32F10x Standard Peripherals Library: Footer

 

 

 

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