From 45edfa43bfbd0f410f0b6dcf741ff0506b847ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se> Date: Fri, 10 Aug 2018 15:25:20 +0200 Subject: [PATCH] frdm-k64f: Add configuration for dedicated analog pins These pins have no alternate function in the pin mux so we might as well make them available to applications. These pins are the only pins which provide differential analog input pairs on this board. --- boards/frdm-k64f/include/periph_conf.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/boards/frdm-k64f/include/periph_conf.h b/boards/frdm-k64f/include/periph_conf.h index f44f36eff6..0985498588 100644 --- a/boards/frdm-k64f/include/periph_conf.h +++ b/boards/frdm-k64f/include/periph_conf.h @@ -126,6 +126,26 @@ static const adc_conf_t adc_config[] = { [ 3] = { .dev = ADC1, .pin = GPIO_PIN(PORT_B, 11), .chan = 15 }, /* PTB11 (Arduino A3) */ [ 4] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 11), .chan = 7 }, /* PTC11 (Arduino A4) */ [ 5] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 10), .chan = 6 }, /* PTC10 (Arduino A5) */ + [ 6] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 0 }, /* ADC0_DP0 */ + [ 7] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 19 }, /* ADC0_DM0 */ + [ 8] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = (0 | ADC_SC1_DIFF_MASK) }, /* ADC0_DP0 - ADC0_DM0 */ + [ 9] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 0 }, /* ADC1_DP0 */ + [10] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 19 }, /* ADC1_DM0 */ + [11] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = (0 | ADC_SC1_DIFF_MASK) }, /* ADC1_DP0 - ADC1_DM0 */ + [12] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 1 }, /* ADC0_DP1 */ + [13] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 20 }, /* ADC0_DM1 */ + [14] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = (1 | ADC_SC1_DIFF_MASK) }, /* ADC0_DP1 - ADC0_DM1 */ + [15] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 1 }, /* ADC1_DP1 */ + [16] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 20 }, /* ADC1_DM1 */ + [17] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = (1 | ADC_SC1_DIFF_MASK) }, /* ADC1_DP1 - ADC1_DM1 */ + /* internal: temperature sensor */ + /* The temperature sensor has a very high output impedance, it must not be + * sampled using hardware averaging, or the sampled values will be garbage */ + [18] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 26 }, + /* internal: band gap */ + /* Note: the band gap buffer uses a bit of current and is turned off by default, + * Set PMC->REGSC |= PMC_REGSC_BGBE_MASK before reading or the input will be floating */ + [19] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 27 }, }; #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0])) -- GitLab