20 #include "stm32f4xx.h"
51 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10
54 GPIO_InitStructure.
GPIO_PuPd = GPIO_PuPd_NOPULL;
58 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_2;
62 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_12;
97 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10
101 GPIO_InitStructure.
GPIO_OType = GPIO_OType_PP;
102 GPIO_InitStructure.
GPIO_PuPd = GPIO_PuPd_UP;
106 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_2;
110 GPIO_InitStructure.
GPIO_Pin = GPIO_Pin_12;
111 GPIO_InitStructure.
GPIO_PuPd = GPIO_PuPd_NOPULL;
118 GPIO_InitStructure.
GPIO_PuPd = GPIO_PuPd_UP;
141 SD_SDIO_DMA_FLAG_FEIF | SD_SDIO_DMA_FLAG_DMEIF
142 | SD_SDIO_DMA_FLAG_TEIF | SD_SDIO_DMA_FLAG_HTIF
143 | SD_SDIO_DMA_FLAG_TCIF );
146 DMA_Cmd(SD_SDIO_DMA_STREAM, DISABLE);
151 SDDMA_InitStructure.
DMA_Channel = SD_SDIO_DMA_CHANNEL;
154 SDDMA_InitStructure.
DMA_DIR = DMA_DIR_MemoryToPeripheral;
160 SDDMA_InitStructure.
DMA_Mode = DMA_Mode_Normal;
161 SDDMA_InitStructure.
DMA_Priority = DMA_Priority_VeryHigh;
166 DMA_Init(SD_SDIO_DMA_STREAM, &SDDMA_InitStructure);
171 DMA_Cmd(SD_SDIO_DMA_STREAM, ENABLE);
187 SD_SDIO_DMA_FLAG_FEIF | SD_SDIO_DMA_FLAG_DMEIF
188 | SD_SDIO_DMA_FLAG_TEIF | SD_SDIO_DMA_FLAG_HTIF
189 | SD_SDIO_DMA_FLAG_TCIF );
192 DMA_Cmd(SD_SDIO_DMA_STREAM, DISABLE);
197 SDDMA_InitStructure.
DMA_Channel = SD_SDIO_DMA_CHANNEL;
200 SDDMA_InitStructure.
DMA_DIR = DMA_DIR_PeripheralToMemory;
206 SDDMA_InitStructure.
DMA_Mode = DMA_Mode_Normal;
207 SDDMA_InitStructure.
DMA_Priority = DMA_Priority_VeryHigh;
212 DMA_Init(SD_SDIO_DMA_STREAM, &SDDMA_InitStructure);
217 DMA_Cmd(SD_SDIO_DMA_STREAM, ENABLE);
#define SD_DETECT_GPIO_PORT
void DMA_FlowControllerConfig(DMA_Stream_TypeDef *DMAy_Streamx, uint32_t DMA_FlowCtrl)
Configures, when the DMAy Streamx is disabled, the flow controller for the next transactions (Periphe...
void NVIC_Init(NVIC_InitTypeDef *NVIC_InitStruct)
Initializes the NVIC peripheral according to the specified parameters in the NVIC_InitStruct.
uint32_t DMA_PeripheralBurst
uint32_t DMA_PeripheralDataSize
GPIOOType_TypeDef GPIO_OType
uint8_t NVIC_IRQChannelPreemptionPriority
void DMA_DeInit(DMA_Stream_TypeDef *DMAy_Streamx)
Deinitialize the DMAy Streamx registers to their default reset values.
void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
Enables or disables the High Speed APB (APB2) peripheral clock.
void DMA_ClearFlag(DMA_Stream_TypeDef *DMAy_Streamx, uint32_t DMA_FLAG)
Clears the DMAy Streamx's pending flags.
void DMA_ITConfig(DMA_Stream_TypeDef *DMAy_Streamx, uint32_t DMA_IT, FunctionalState NewState)
Enables or disables the specified DMAy Streamx interrupts.
uint32_t DMA_PeripheralBaseAddr
void SD_LowLevel_DeInit(void)
DeInitializes the SDIO interface. Disable SDIO Clock, Set Power State to OFF, DeInitializes the SDIO...
void GPIO_PinAFConfig(GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
Changes the mapping of the specified pin.
This file contains all the functions prototypes for the SD Card stm324xg_eval_sdio_sd driver firmware...
void SDIO_IRQHandler(void)
SDIO IRQ Handler.
GPIOSpeed_TypeDef GPIO_Speed
void SD_LowLevel_Init(void)
Initializes the SD Card and put it into StandBy State (Ready for data transfer).
GPIOPuPd_TypeDef GPIO_PuPd
NVIC Init Structure definition.
uint32_t DMA_MemoryDataSize
DMA Init structure definition.
FunctionalState NVIC_IRQChannelCmd
void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize)
Configures the DMA2 Channel4 for SDIO Rx request.
void GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_InitStruct)
Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.
uint32_t DMA_PeripheralInc
void SD_SDIO_DMA_IRQHANDLER(void)
SDIO DMA IRQ Handler.
uint8_t NVIC_IRQChannelSubPriority
void RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)
Enables or disables the AHB1 peripheral clock.
void DMA_Cmd(DMA_Stream_TypeDef *DMAy_Streamx, FunctionalState NewState)
Enables or disables the specified DMAy Streamx.
GPIOMode_TypeDef GPIO_Mode
void SDIO_DeInit(void)
Deinitializes the SDIO peripheral registers to their default reset values.
GPIO Init structure definition.
void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize)
Configures the DMA2 Channel4 for SDIO Tx request.
void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup)
Configures the priority grouping: pre-emption priority and subpriority.
void SDIO_SetPowerState(uint32_t SDIO_PowerState)
Sets the power status of the controller.
void DMA_Init(DMA_Stream_TypeDef *DMAy_Streamx, DMA_InitTypeDef *DMA_InitStruct)
Initializes the DMAy Streamx according to the specified parameters in the DMA_InitStruct structure...
uint32_t DMA_FIFOThreshold
#define NVIC_PriorityGroup_4
SD_Error SD_ProcessIRQSrc(void)
Allows to process all the interrupts that are high.
void SDIO_ClockCmd(FunctionalState NewState)
Enables or disables the SDIO Clock.
void SD_ProcessDMAIRQ(void)
This function waits until the SDIO DMA data transfer is finished.
uint32_t DMA_Memory0BaseAddr