diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/diskio.h | 1 | ||||
-rw-r--r-- | include/spi.h | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/diskio.h b/include/diskio.h index f5ba3e0..f7a764c 100644 --- a/include/diskio.h +++ b/include/diskio.h @@ -45,6 +45,7 @@ void disk_timerproc (void); #define STA_NOINIT 0x01 /* Drive not initialized */ #define STA_NODISK 0x02 /* No medium in the drive */ #define STA_PROTECT 0x04 /* Write protected */ +#define STA_FAST 0x08 /* Fast SPI clock */ /* Command code for disk_ioctrl() */ diff --git a/include/spi.h b/include/spi.h index 04ea726..6358f62 100644 --- a/include/spi.h +++ b/include/spi.h @@ -27,10 +27,11 @@ #define SPI_SET_SPEED_F_128 do {SPCR = (1<<SPE) | (1<<MSTR) | (1<<SPR1) | (1<<SPR0); SPSR = (0<<SPI2X); } while(0) /** switch to fast SPI Clock */ -#define SPISetFastClock() SPI_SET_SPEED_F_2 -#define SPISetSlowClock() SPI_SET_SPEED_F_8 -#define SPISetMMCInitClock() SPI_SET_SPEED_F_64 +#define SPISetFastClock() SPI_SET_SPEED_F_2 +#define SPISetSlowClock() SPI_SET_SPEED_F_8 +#define SPISetMMCInitClock() SPI_SET_SPEED_F_64 +#define SPI_OFF() do { SPCR = 0; } while(0) static inline void spi_wait() { loop_until_bit_is_set(SPSR,SPIF); |