diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-10-05 11:29:34 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-10-29 11:55:06 -0400 |
commit | d9b789113322780a125d1594a9e723e5990f2744 (patch) | |
tree | a5faddb46556b2946f07de0fd1966fb4c0457cfb | |
parent | 97d49105b7643f63a70cb724a0633e36b8746ce1 (diff) | |
download | kutter-d9b789113322780a125d1594a9e723e5990f2744.tar.gz kutter-d9b789113322780a125d1594a9e723e5990f2744.tar.xz kutter-d9b789113322780a125d1594a9e723e5990f2744.zip |
atsam: Support reading chip based temperature sensor on sam4e
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/atsam/sam4e_afec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/atsam/sam4e_afec.c b/src/atsam/sam4e_afec.c index 4c78e958..89508fae 100644 --- a/src/atsam/sam4e_afec.c +++ b/src/atsam/sam4e_afec.c @@ -11,18 +11,22 @@ #include "sam4e.h" // AFEC0 #include "sched.h" // sched_shutdown +#define ADC_TEMPERATURE_PIN 0xfe +DECL_ENUMERATION("pin", "ADC_TEMPERATURE", ADC_TEMPERATURE_PIN); + static const uint8_t afec_pins[] = { //remove first channel, since it offsets the channel number: GPIO('A', 8), GPIO('A', 17), GPIO('A', 18), GPIO('A', 19), GPIO('A', 20), GPIO('B', 0), GPIO('B', 1), GPIO('C', 13), GPIO('C', 15), GPIO('C', 12), GPIO('C', 29), GPIO('C', 30), GPIO('C', 31), GPIO('C', 26), GPIO('C', 27), GPIO('C',0), + ADC_TEMPERATURE_PIN, // AFEC1 GPIO('B', 2), GPIO('B', 3), GPIO('A', 21), GPIO('A', 22), GPIO('C', 1), GPIO('C', 2), GPIO('C', 3), GPIO('C', 4), }; -#define AFEC1_START 15 // The first 15 pins are on afec0 +#define AFEC1_START 16 // The first 16 pins are on afec0 static inline struct gpio_adc pin_to_gpio_adc(uint8_t pin) |