1 #ifndef __STM32F4_SDIO_SD_LLD_H__
2 #define __STM32F4_SDIO_SD_LLD_H__
22 #include "stm32f4xx.h"
24 #define SD_DETECT_USE 1
26 #define SD_DETECT_PIN GPIO_Pin_11
27 #define SD_DETECT_GPIO_PORT GPIOI
28 #define SD_DETECT_GPIO_CLK RCC_AHB1Periph_GPIOI
31 #define SDIO_FIFO_ADDRESS ((uint32_t)0x40012C80)
35 #define SDIO_INIT_CLK_DIV ((uint8_t)0x76)
39 #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x0)
41 #define SD_SDIO_DMA DMA2
42 #define SD_SDIO_DMA_CLK RCC_AHB1Periph_DMA2
44 #define SD_SDIO_DMA_STREAM3 3
45 //#define SD_SDIO_DMA_STREAM6 6
47 #ifdef SD_SDIO_DMA_STREAM3
48 #define SD_SDIO_DMA_STREAM DMA2_Stream3
49 #define SD_SDIO_DMA_CHANNEL DMA_Channel_4
50 #define SD_SDIO_DMA_FLAG_FEIF DMA_FLAG_FEIF3
51 #define SD_SDIO_DMA_FLAG_DMEIF DMA_FLAG_DMEIF3
52 #define SD_SDIO_DMA_FLAG_TEIF DMA_FLAG_TEIF3
53 #define SD_SDIO_DMA_FLAG_HTIF DMA_FLAG_HTIF3
54 #define SD_SDIO_DMA_FLAG_TCIF DMA_FLAG_TCIF3
55 #define SD_SDIO_DMA_IRQn DMA2_Stream3_IRQn
56 #define SD_SDIO_DMA_IRQHANDLER DMA2_Stream3_IRQHandler
57 #elif defined SD_SDIO_DMA_STREAM6
58 #define SD_SDIO_DMA_STREAM DMA2_Stream6
59 #define SD_SDIO_DMA_CHANNEL DMA_Channel_4
60 #define SD_SDIO_DMA_FLAG_FEIF DMA_FLAG_FEIF6
61 #define SD_SDIO_DMA_FLAG_DMEIF DMA_FLAG_DMEIF6
62 #define SD_SDIO_DMA_FLAG_TEIF DMA_FLAG_TEIF6
63 #define SD_SDIO_DMA_FLAG_HTIF DMA_FLAG_HTIF6
64 #define SD_SDIO_DMA_FLAG_TCIF DMA_FLAG_TCIF6
65 #define SD_SDIO_DMA_IRQn DMA2_Stream6_IRQn
66 #define SD_SDIO_DMA_IRQHANDLER DMA2_Stream6_IRQHandler
void SD_LowLevel_DeInit(void)
DeInitializes the SDIO interface. Disable SDIO Clock, Set Power State to OFF, DeInitializes the SDIO...
void SD_LowLevel_Init(void)
Initializes the SD Card and put it into StandBy State (Ready for data transfer).
void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize)
Configures the DMA2 Channel4 for SDIO Rx request.
void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize)
Configures the DMA2 Channel4 for SDIO Tx request.