altos/stm-demo: Set up for dumping eeprom
authorKeith Packard <keithp@keithp.com>
Sun, 5 Aug 2018 00:45:30 +0000 (08:45 +0800)
committerKeith Packard <keithp@keithp.com>
Sun, 5 Aug 2018 01:04:19 +0000 (09:04 +0800)
This is used to dump an eeprom wired to the stm demo board.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm-demo/Makefile
src/stm-demo/ao_demo.c
src/stm-demo/ao_pins.h

index 869fb32..d4569c1 100644 (file)
@@ -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 \
index db432c2..f6c8e3d 100644 (file)
@@ -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);
 
index 233537d..2b4c5ab 100644 (file)
 #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_ */