cortexelf-v1: Hook up AS1107 in test mode
[fw/altos] / src / cortexelf-v1 / ao_pins.h
index bc8288cfe2bedd929be881d8117f9a199e9073e8..9721c56de6648aebf02fea22133846b951e0b60d 100644 (file)
@@ -38,7 +38,7 @@
 
 /* Run APB1 at HCLK/1 */
 #define AO_APB1_PRESCALER      1
-#define AO_RCC_CFGR_PPRE1_DIV  STM_RCC_CFGR_PPRE2_DIV_1
+#define AO_RCC_CFGR_PPRE1_DIV  STM_RCC_CFGR_PPRE1_DIV_1
 
 /* Run APB2 at HCLK/1 */
 #define AO_APB2_PRESCALER      1
 #define AO_SDCARD_SPI_MISO_PIN 3
 #define AO_SDCARD_SPI_MOSI_PIN 4
 
+/* Buttons */
+
+#define AO_EVENT       1
+
+#define AO_BUTTON_COUNT                4
+#define AO_BUTTON_MODE         AO_EXTI_MODE_PULL_DOWN
+
+/* INPUT */
+#define AO_BUTTON_0_PORT       (&stm_gpioc)
+#define AO_BUTTON_0            8
+
+/* MP */
+#define AO_BUTTON_1_PORT       (&stm_gpioc)
+#define AO_BUTTON_1            9
+
+/* RUN */
+#define AO_BUTTON_2_PORT       (&stm_gpioc)
+#define AO_BUTTON_2            10
+
+/* LOAD */
+#define AO_BUTTON_3_PORT       (&stm_gpioc)
+#define AO_BUTTON_3            11
+
+/* AS1107 */
+#define AO_AS1107_NUM_DIGITS   8
+
+/* Set the hex digits up for decode, leave the extra leds alone */
+
+#define AO_AS1107_DECODE       ((1 << 7) | \
+                                (1 << 6) | \
+                                (1 << 4) | \
+                                (1 << 3) | \
+                                (1 << 1) | \
+                                (1 << 0))
+
+#define AO_AS1107_SPI_INDEX    AO_SPI_2_PD1_PD3_PD4
+#define AO_AS1107_SPI_SPEED    AO_SPI_SPEED_8MHz
+#define AO_AS1107_CS_PORT      (&stm_gpiod)
+#define AO_AS1107_CS_PIN       0
+
 #endif /* _AO_PINS_H_ */