From: Keith Packard Date: Thu, 21 Mar 2013 17:16:35 +0000 (-0700) Subject: altos/fox: Enable M25 driver for MRAM. X-Git-Tag: 1.8.6~1^2~89 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=f517aa5e042af8dd7fd36be47e4b196f212e79b0 altos/fox: Enable M25 driver for MRAM. The M25 driver can also talk to the MRAM chip, with a few adjustments Signed-off-by: Keith Packard --- diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index 94315e79..d702cca8 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -11,6 +11,8 @@ INC = \ ao_arch_funcs.h \ ao_pins.h \ ao_product.h \ + ao_watchdog.h \ + ao_storage.h \ ao_task.h \ stm32l.h \ Makefile @@ -42,6 +44,8 @@ ALTOS_SRC = \ ao_exti_stm.c \ ao_adc_stm.c \ ao_data.c \ + ao_storage.c \ + ao_m25.c \ ao_watchdog.c PRODUCT=Fox1IHU-v1 diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c index 9f7821f7..5bbad328 100644 --- a/src/fox1ihu/ao_fox1ihu.c +++ b/src/fox1ihu/ao_fox1ihu.c @@ -17,8 +17,8 @@ #include #include -#include -#include +#include +#include int main(void) @@ -44,6 +44,8 @@ main(void) ao_usb_init(); + ao_storage_init(); + ao_watchdog_init(); ao_start_scheduler(); diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h index e73ef63a..f901a96b 100644 --- a/src/fox1ihu/ao_pins.h +++ b/src/fox1ihu/ao_pins.h @@ -250,4 +250,11 @@ struct ao_adc { #define AO_WATCHDOG_PORT (&stm_gpiod) #define AO_WATCHDOG_BIT 3 +/* 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 + #endif /* _AO_PINS_H_ */