]> git.gag.com Git - fw/altos/commitdiff
snapshot fctester
authorBdale Garbee <bdale@gag.com>
Sun, 12 May 2024 06:16:01 +0000 (00:16 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 12 May 2024 06:16:01 +0000 (00:16 -0600)
src/fctester-v0.1/Makefile
src/fctester-v0.1/ao_fctester.c
src/fctester-v0.1/ao_pins.h

index bd6f350d43cdfe298f40074d502d38cecae21391..8606521cf715f48408187e6c3ac42198a663952c 100644 (file)
@@ -19,6 +19,7 @@ INC = \
 ALTOS_SRC = \
        ao_interrupt.c \
        ao_boot_chain.c \
+       ao_data.c \
        ao_product.c \
        ao_romconfig.c \
        ao_mutex.c \
@@ -27,7 +28,7 @@ ALTOS_SRC = \
        ao_task.c \
        ao_cmd.c \
        ao_timer_lpc.c \
-       ao_exti_lpc.c \
+       ao_adc_lpc.c \
        ao_usb_lpc.c \
        ao_led_lpc.c
 
index 4835e68a241ab52d2b8fe9dee9a71ca1af71fcf2..27ed0dd79b1a86e8796d9f64bc9347265766e330 100644 (file)
@@ -80,6 +80,8 @@ main(void)
        ao_task_init();
        ao_timer_init();
 
+       ao_adc_init();
+
        ao_usb_init();
 
        ao_led_init();                  // also handles FET switches 
index 18088a39d5b9a752efe56ae03161b3adefffc9c9..47afcc3cd4dce9af881b1fa1787a9336f24ca9ea 100644 (file)
 
 #define LEDS_AVAILABLE         (AO_LED_RED | AO_LED_GREEN | FET_A | FET_B | FET_C | FET_D | FET_E | FET_F)
 
+/*
+ * ADC
+ */
+
+#define HAS_ADC                 1
+
+#define AO_NUM_ADC              1
+#define AO_DATA_RING           4
+
+#define AO_ADC_0                3
+
+struct ao_adc {
+        int16_t         current;
+};
+
+#define AO_ADC_DUMP(p) \
+        printf("tick: %5lu current: %5d\n", (p)->tick, (p)->adc.current)
+
 /* Kludge the SPI driver to not configure any
  * pin for SCK or MOSI
  */