#define HAS_RADIO_RATE 1
#define HAS_TELEMETRY 0
#define HAS_AES 1
+#define HAS_STATIC_TEST 0
#define HAS_SPI_1 0
#define SPI_1_PA5_PA6_PA7 0
*/
#define AO_QUADRATURE_COUNT 1
+#define AO_QUADRATURE_DEBOUNCE 0
+#define AO_QUADRATURE_SINGLE_CODE 1
#define AO_QUADRATURE_0_PORT &stm_gpioe
#define AO_QUADRATURE_0_A 15
#define AO_BUTTON_COUNT 9
#define AO_BUTTON_MODE AO_EXTI_MODE_PULL_UP
-#define AO_BUTTON_MODE_SELECT 0
+#define AO_BUTTON_DRAG_MODE 0
#define AO_BUTTON_0_PORT &stm_gpioe
#define AO_BUTTON_0 1
#define AO_BUTTON_DRAG_SELECT 1
#define AO_BUTTON_1_PORT &stm_gpioe
-#define AO_BUTTON_1 1
+#define AO_BUTTON_1 0
#define AO_BUTTON_SPARE1 2
#define AO_BUTTON_2_PORT &stm_gpiob
#define AO_BUTTON_7_PORT &stm_gpiod
#define AO_BUTTON_7 11
-#define AO_BUTTON_SELECT 8
+#define AO_BUTTON_ENCODER_SELECT 8
#define AO_BUTTON_8_PORT &stm_gpioe
#define AO_BUTTON_8 13
+/* ADC */
+
+struct ao_adc {
+ int16_t v_batt;
+};
+
+#define AO_ADC_DUMP(p) \
+ printf("batt: %5d\n", (p)->v_batt)
+
+#define HAS_ADC_SINGLE 1
+#define HAS_ADC_TEMP 0
+#define HAS_BATTERY_REPORT 1
+
+#define AO_ADC_V_BATT 0
+#define AO_ADC_V_BATT_PORT (&stm_gpioa)
+#define AO_ADC_V_BATT_PIN 0
+
+#define AO_ADC_RCC_AHBENR (1 << STM_RCC_AHBENR_GPIOAEN)
+
+#define AO_ADC_PIN0_PORT AO_ADC_V_BATT_PORT
+#define AO_ADC_PIN0_PIN AO_ADC_V_BATT_PIN
+
+#define AO_ADC_SQ1 AO_ADC_V_BATT
+
+#define AO_NUM_ADC 1
+
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS 15 /* 15k */
+#define AO_BATTERY_DIV_MINUS 27 /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV 33
+
#endif /* _AO_PINS_H_ */