2020-02-25 20:05:48 +01:00
|
|
|
#ifndef FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_CONFIG_H_
|
|
|
|
#define FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_CONFIG_H_
|
|
|
|
|
|
|
|
#include <stm32/stm32f4xx.h>
|
|
|
|
|
|
|
|
//General Definitions
|
|
|
|
//Blocksize: 512 = 2^9 => 9
|
|
|
|
#define BLOCKSIZE 9 //9
|
|
|
|
//Hardware Flow: Prevents over- and underruns.
|
|
|
|
#define HW_FLOW 0 //0
|
|
|
|
//1 bit: !=4
|
|
|
|
//4 bit: 4
|
|
|
|
#define BUSWIDTH 4 //4
|
|
|
|
//Initial Transfer CLK (ca. 400kHz)
|
2020-08-16 19:37:41 +02:00
|
|
|
#define INITCLK 140 //120
|
2020-02-25 20:05:48 +01:00
|
|
|
//Working CLK (Maximum)
|
2020-08-16 19:37:41 +02:00
|
|
|
#define WORKCLK 45 //0
|
2020-02-25 20:05:48 +01:00
|
|
|
//Data Timeout in CLK Cycles
|
|
|
|
#define DTIMEOUT 0x3000 //150
|
|
|
|
//DMA Stream used for TX and RX DMA2 Stream 3 or 6 possible
|
|
|
|
// Currently not used due to possible misalignment of the data buffer.
|
|
|
|
//#define DMASTREAM DMA2_Stream6
|
|
|
|
|
|
|
|
|
|
|
|
/* Port Definitions */
|
|
|
|
|
2020-04-26 21:23:25 +02:00
|
|
|
#define PORTCLKMASK (RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOCEN | RCC_AHB1ENR_GPIOAEN)
|
2020-02-25 20:05:48 +01:00
|
|
|
|
|
|
|
#define ALTFUNC 12
|
|
|
|
|
|
|
|
#define CLKPORT GPIOC
|
|
|
|
#define D0PORT GPIOC
|
|
|
|
#define D1PORT GPIOC
|
|
|
|
#define D2PORT GPIOC
|
|
|
|
#define D3PORT GPIOC
|
|
|
|
#define CMDPORT GPIOD
|
|
|
|
|
|
|
|
#define CLKPIN 12
|
|
|
|
#define D0PIN 8
|
|
|
|
#define D1PIN 9
|
|
|
|
#define D2PIN 10
|
|
|
|
#define D3PIN 11
|
|
|
|
#define CMDPIN 2
|
|
|
|
|
|
|
|
// Write Protection
|
|
|
|
#define SDIO_ENABLE_WRITEPROT 0
|
|
|
|
#define WRITEPROT_PORT GPIOD // Add this port to port clock mask!
|
|
|
|
#define WRITEPROT_PIN 0
|
|
|
|
#define WRITEPROT_PULLUP 0
|
|
|
|
#define WRITEPROT_ACTIVE_LEVEL 0
|
|
|
|
|
|
|
|
// Card inserted pin
|
2020-04-26 21:23:25 +02:00
|
|
|
#define SDIO_ENABLE_INS 1
|
|
|
|
#define INS_PORT GPIOA // Add this port to port clock mask!
|
|
|
|
#define INS_PIN 8
|
|
|
|
#define INS_PULLUP 1
|
2020-02-25 20:05:48 +01:00
|
|
|
#define INS_ACTIVE_LEVEL 0
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_CONFIG_H_ */
|