summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-08-05 08:45:30 +0800
committerKeith Packard <keithp@keithp.com>2018-08-05 09:04:19 +0800
commit50c6d796e0dbb69289f95c826e6b542e538fc5de (patch)
treeccafd5d6d4329ed7af368be3cb22cf838bbedf07
parent327b765962d397efd4c45b6209c9225a4d23ba1d (diff)
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 <keithp@keithp.com>
-rw-r--r--src/stm-demo/Makefile2
-rw-r--r--src/stm-demo/ao_demo.c3
-rw-r--r--src/stm-demo/ao_pins.h14
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_ */