diff --git a/boards/frdm-k64f/include/periph_conf.h b/boards/frdm-k64f/include/periph_conf.h index bc94d95423..7480d10ed1 100644 --- a/boards/frdm-k64f/include/periph_conf.h +++ b/boards/frdm-k64f/include/periph_conf.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2014 Freie Universität Berlin - * Copyright (C) 2015 PHYTEC Messtechnik GmbH + * 2015 PHYTEC Messtechnik GmbH + * 2023 Hugues Larrive * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more @@ -15,6 +16,7 @@ * @name Peripheral MCU configuration for the FRDM-K64F * * @author Johann Fischer + * @author Hugues Larrive */ #ifndef PERIPH_CONF_H @@ -127,32 +129,94 @@ static const uart_conf_t uart_config[] = { * @{ */ static const adc_conf_t adc_config[] = { - [ 0] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 2), .chan = 12, .avg = ADC_AVG_MAX }, /* PTB2 (Arduino A0) */ - [ 1] = { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 3), .chan = 13, .avg = ADC_AVG_MAX }, /* PTB3 (Arduino A1) */ - [ 2] = { .dev = ADC1, .pin = GPIO_PIN(PORT_B, 10), .chan = 14, .avg = ADC_AVG_MAX }, /* PTB10 (Arduino A2) */ - [ 3] = { .dev = ADC1, .pin = GPIO_PIN(PORT_B, 11), .chan = 15, .avg = ADC_AVG_MAX }, /* PTB11 (Arduino A3) */ - [ 4] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 11), .chan = 7, .avg = ADC_AVG_MAX }, /* PTC11 (Arduino A4) */ - [ 5] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 10), .chan = 6, .avg = ADC_AVG_MAX }, /* PTC10 (Arduino A5) */ - [ 6] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 0, .avg = ADC_AVG_MAX }, /* ADC0_DP0 */ - [ 7] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 19, .avg = ADC_AVG_MAX }, /* ADC0_DM0 */ - [ 8] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = (0 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX }, /* ADC0_DP0 - ADC0_DM0 */ - [ 9] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 0, .avg = ADC_AVG_MAX }, /* ADC1_DP0 */ - [10] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 19, .avg = ADC_AVG_MAX }, /* ADC1_DM0 */ - [11] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = (0 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX }, /* ADC1_DP0 - ADC1_DM0 */ - [12] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 1, .avg = ADC_AVG_MAX }, /* ADC0_DP1 */ - [13] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = 20, .avg = ADC_AVG_MAX }, /* ADC0_DM1 */ - [14] = { .dev = ADC0, .pin = GPIO_UNDEF , .chan = (1 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX }, /* ADC0_DP1 - ADC0_DM1 */ - [15] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 1, .avg = ADC_AVG_MAX }, /* ADC1_DP1 */ - [16] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = 20, .avg = ADC_AVG_MAX }, /* ADC1_DM1 */ - [17] = { .dev = ADC1, .pin = GPIO_UNDEF , .chan = (1 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX }, /* ADC1_DP1 - ADC1_DM1 */ + [ 0] = { /* PTB2 (Arduino A0) */ + .dev = ADC0, .pin = GPIO_PIN(PORT_B, 2), + .chan = 12, .avg = ADC_AVG_MAX + }, + [ 1] = { /* PTB3 (Arduino A1) */ + .dev = ADC0, .pin = GPIO_PIN(PORT_B, 3), + .chan = 13, .avg = ADC_AVG_MAX + }, + [ 2] = { /* PTB10 (Arduino A2) */ + .dev = ADC1, .pin = GPIO_PIN(PORT_B, 10), + .chan = 14, .avg = ADC_AVG_MAX + }, + [ 3] = { /* PTB11 (Arduino A3) */ + .dev = ADC1, .pin = GPIO_PIN(PORT_B, 11), + .chan = 15, .avg = ADC_AVG_MAX + }, + [ 4] = { /* PTC11 (Arduino A4) */ + .dev = ADC1, .pin = GPIO_PIN(PORT_C, 11), + .chan = 7, .avg = ADC_AVG_MAX + }, + [ 5] = { /* PTC10 (Arduino A5) */ + .dev = ADC1, .pin = GPIO_PIN(PORT_C, 10), + .chan = 6, .avg = ADC_AVG_MAX + }, + [ 6] = { /* ADC0_DP0 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = 0, .avg = ADC_AVG_MAX + }, + [ 7] = { /* ADC0_DM0 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = 19, .avg = ADC_AVG_MAX + }, + [ 8] = { /* ADC0_DP0 - ADC0_DM0 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = (0 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX + }, + [ 9] = { /* ADC1_DP0 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = 0, .avg = ADC_AVG_MAX + }, + [10] = { /* ADC1_DM0 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = 19, .avg = ADC_AVG_MAX + }, + [11] = { /* ADC1_DP0 - ADC1_DM0 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = (0 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX + }, + [12] = { /* ADC0_DP1 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = 1, .avg = ADC_AVG_MAX + }, + [13] = { /* ADC0_DM1 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = 20, .avg = ADC_AVG_MAX + }, + [14] = { /* ADC0_DP1 - ADC0_DM1 */ + .dev = ADC0, .pin = GPIO_UNDEF, + .chan = (1 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX + }, + [15] = { /* ADC1_DP1 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = 1, .avg = ADC_AVG_MAX + }, + [16] = { /* ADC1_DM1 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = 20, .avg = ADC_AVG_MAX + }, + [17] = { /* ADC1_DP1 - ADC1_DM1 */ + .dev = ADC1, .pin = GPIO_UNDEF, + .chan = (1 | ADC_SC1_DIFF_MASK), .avg = ADC_AVG_MAX + }, /* 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, .avg = ADC_AVG_NONE }, + /* 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, .avg = ADC_AVG_NONE + }, /* 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, .avg = ADC_AVG_MAX }, + /* 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, .avg = ADC_AVG_MAX + }, }; #define ADC_NUMOF ARRAY_SIZE(adc_config)