From 61edd439397597959728f0e18d7e949549c2a159 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Sun, 12 May 2024 00:16:01 -0600 Subject: [PATCH] snapshot --- src/fctester-v0.1/Makefile | 3 ++- src/fctester-v0.1/ao_fctester.c | 2 ++ src/fctester-v0.1/ao_pins.h | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/fctester-v0.1/Makefile b/src/fctester-v0.1/Makefile index bd6f350d..8606521c 100644 --- a/src/fctester-v0.1/Makefile +++ b/src/fctester-v0.1/Makefile @@ -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 diff --git a/src/fctester-v0.1/ao_fctester.c b/src/fctester-v0.1/ao_fctester.c index 4835e68a..27ed0dd7 100644 --- a/src/fctester-v0.1/ao_fctester.c +++ b/src/fctester-v0.1/ao_fctester.c @@ -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 diff --git a/src/fctester-v0.1/ao_pins.h b/src/fctester-v0.1/ao_pins.h index 18088a39..47afcc3c 100644 --- a/src/fctester-v0.1/ao_pins.h +++ b/src/fctester-v0.1/ao_pins.h @@ -86,6 +86,24 @@ #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 */ -- 2.47.2