diff options
| author | Keith Packard <keithp@keithp.com> | 2013-04-25 21:25:12 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-02-08 22:03:04 -0800 | 
| commit | 80edc09b124b5a4ee36c863cfbeba348f77b5124 (patch) | |
| tree | ca6e3f4b5d7311cadfd23cd50343e9063edb20b4 | |
| parent | 32199c778da71e94c7d620de07609dd8c8cf5c18 (diff) | |
altos/fox: Add MRAM and SD card drivers
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | src/fox1ihu/Makefile | 8 | ||||
| -rw-r--r-- | src/fox1ihu/ao_fox1ihu.c | 3 | ||||
| -rw-r--r-- | src/fox1ihu/ao_pins.h | 22 | 
3 files changed, 27 insertions, 6 deletions
diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index d702cca8..aa5c6b4a 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -15,6 +15,9 @@ INC = \  	ao_storage.h \  	ao_task.h \  	stm32l.h \ +	ao_sdcard.h \ +	ao_bufio.h \ +	ao_fat.h \  	Makefile  #PROFILE=ao_profile.c @@ -45,7 +48,10 @@ ALTOS_SRC = \  	ao_adc_stm.c \  	ao_data.c \  	ao_storage.c \ -	ao_m25.c \ +	ao_mr25.c \ +	ao_sdcard.c \ +	ao_bufio.c \ +	ao_fat.c \  	ao_watchdog.c  PRODUCT=Fox1IHU-v1 diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c index 5bbad328..2e1a2fdf 100644 --- a/src/fox1ihu/ao_fox1ihu.c +++ b/src/fox1ihu/ao_fox1ihu.c @@ -19,6 +19,7 @@  #include <ao_exti.h>  #include <ao_watchdog.h>  #include <ao_storage.h> +#include <ao_fat.h>  int  main(void) @@ -48,6 +49,8 @@ main(void)  	ao_watchdog_init(); +	ao_fat_init(); +  	ao_start_scheduler();  	return 0;  } diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h index f901a96b..028360a5 100644 --- a/src/fox1ihu/ao_pins.h +++ b/src/fox1ihu/ao_pins.h @@ -70,10 +70,13 @@  #define SPI_1_PA5_PA6_PA7	0  #define SPI_1_PB3_PB4_PB5	0  #define SPI_1_PE13_PE14_PE15	1	/* */ +#define SPI_1_OSPEEDR		STM_OSPEEDR_10MHz -#define HAS_SPI_2		0 +#define HAS_SPI_2		1  #define SPI_2_PB13_PB14_PB15	1	/* */  #define SPI_2_PD1_PD3_PD4	0 +#define SPI_2_OSPEEDR		STM_OSPEEDR_10MHz +#define HAS_STORAGE_DEBUG	1  #define SPI_2_PORT		(&stm_gpiob)  #define SPI_2_SCK_PIN		13 @@ -252,9 +255,18 @@ struct ao_adc {  /* MRAM device */ -#define M25_MAX_CHIPS		1 -#define AO_M25_SPI_CS_PORT	(&stm_gpiod) -#define AO_M25_SPI_CS_MASK	(1 << 0) -#define AO_M25_SPI_BUS		AO_SPI_2_PB13_PB14_PB15 +#define AO_MR25_SPI_CS_PORT	(&stm_gpiod) +#define AO_MR25_SPI_CS_PIN	0 +#define AO_MR25_SPI_BUS		AO_SPI_2_PB13_PB14_PB15 + +/* SD card */ + +#define AO_SDCARD_SPI_CS_PORT	(&stm_gpiod) +#define AO_SDCARD_SPI_CS_PIN	1 +#define AO_SDCARD_SPI_BUS	AO_SPI_2_PB13_PB14_PB15 +#define AO_SDCARD_SPI_PORT	(&stm_gpiob) +#define AO_SDCARD_SPI_SCK_PIN	13 +#define AO_SDCARD_SPI_MISO_PIN	14 +#define AO_SDCARD_SPI_MOSI_PIN	15  #endif /* _AO_PINS_H_ */  | 
