From 50c6d796e0dbb69289f95c826e6b542e538fc5de Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 5 Aug 2018 08:45:30 +0800 Subject: [PATCH] altos/stm-demo: Set up for dumping eeprom This is used to dump an eeprom wired to the stm demo board. Signed-off-by: Keith Packard --- src/stm-demo/Makefile | 2 ++ src/stm-demo/ao_demo.c | 3 ++- src/stm-demo/ao_pins.h | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/stm-demo/Makefile b/src/stm-demo/Makefile index 869fb32f..d4569c1a 100644 --- a/src/stm-demo/Makefile +++ b/src/stm-demo/Makefile @@ -30,6 +30,8 @@ ALTOS_SRC = \ ao_lcd_stm.c \ ao_lcd_font.c \ ao_mutex.c \ + ao_storage.c \ + ao_m25.c \ ao_dma_stm.c \ ao_spi_stm.c \ ao_adc_stm.c \ diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c index db432c2a..f6c8e3df 100644 --- a/src/stm-demo/ao_demo.c +++ b/src/stm-demo/ao_demo.c @@ -223,11 +223,12 @@ main(void) ao_cmd_init(); // ao_lcd_stm_init(); // ao_lcd_font_init(); -// ao_spi_init(); + ao_spi_init(); // ao_i2c_init(); // ao_exti_init(); // ao_quadrature_init(); // ao_button_init(); + ao_storage_init(); // ao_timer_set_adc_interval(100); diff --git a/src/stm-demo/ao_pins.h b/src/stm-demo/ao_pins.h index 233537df..2b4c5ab0 100644 --- a/src/stm-demo/ao_pins.h +++ b/src/stm-demo/ao_pins.h @@ -59,11 +59,14 @@ #define SERIAL_3_PC10_PC11 0 #define SERIAL_3_PD8_PD9 1 -#define HAS_SPI_1 1 +#define HAS_SPI_1 0 #define SPI_1_PB3_PB4_PB5 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 /* Flash, Companion, Radio */ +#define SPI_2_PD1_PD3_PD4 0 +#define SPI_2_OSPEEDR STM_OSPEEDR_10MHz #define HAS_USB 1 #define HAS_BEEP 0 @@ -200,4 +203,11 @@ struct ao_adc { #define AO_TICK_TYPE uint32_t #define AO_TICK_SIGNED int32_t +#define M25_MAX_CHIPS 1 +#define AO_M25_SPI_CS_PORT (&stm_gpiob) +#define AO_M25_SPI_CS_MASK (1 << 12) +#define AO_M25_SPI_BUS AO_SPI_2_PB13_PB14_PB15 + +#define AO_LOG_FORMAT AO_LOG_FORMAT_TELEMEGA + #endif /* _AO_PINS_H_ */ -- 2.30.2