Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison stm32_eval.h @ 49:ace431a0d0f5
Add SDIO code poached from STM. Use FatFS to read from SD card.
LFN doesn't work reliably so it's disabled for now.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Wed, 03 Apr 2013 23:34:20 +1030 |
parents | |
children | d7207a9d3c3b |
comparison
equal
deleted
inserted
replaced
48:2f336d212c74 | 49:ace431a0d0f5 |
---|---|
1 /* SDIO Intialization divisor (400KHz max) */ | |
2 #define SDIO_INIT_CLK_DIV ((uint8_t)0xb2) | |
3 /* SDIO Data Transfer Frequency (25MHz max) */ | |
4 #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x01) | |
5 | |
6 #undef SD_HAVE_DETECT | |
7 | |
8 /* Going to 4 bit mode gives CRC errors */ | |
9 #define SD_NO_4BIT | |
10 //#define SD_DMA_MODE ((uint32_t)0x00000000) | |
11 #define SD_POLLING_MODE ((uint32_t)0x00000002) | |
12 | |
13 /* No idea if this is for all SD cards. The one I have has 1024 byte blocks but 512 byte reads work | |
14 * Note that SD_ReadBlock forces blocksize to be 512 and divides the address by 512 but only for SDIO_HIGH_CAPACITY_SD_CARD's | |
15 */ | |
16 #define SD_BLOCK_SIZE 512 | |
17 | |
18 void SD_LowLevel_DeInit(void); | |
19 void SD_LowLevel_Init(void); | |
20 void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize); | |
21 void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize); | |
22 |