1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 18:13:49 +01:00

boards/kinetis-based: beautify ADC configuration

This commit is contained in:
Hauke Petersen 2017-07-13 19:00:13 +02:00
parent 61bf5f2197
commit 6e967f9776
3 changed files with 49 additions and 35 deletions

View File

@ -99,17 +99,16 @@ static const uart_conf_t uart_config[] = {
/** @} */ /** @} */
/** /**
* @name ADC configuration * @name ADC configuration
* @{ * @{
*/ */
static const adc_conf_t adc_config[] = { static const adc_conf_t adc_config[] = {
/* dev, pin, channel */ { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 10), .chan = 14 },
{ ADC0, GPIO_PIN(PORT_B, 10), 14 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_B, 11), .chan = 15 },
{ ADC0, GPIO_PIN(PORT_B, 11), 15 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_C, 11), .chan = 7 },
{ ADC0, GPIO_PIN(PORT_C, 11), 7 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_C, 10), .chan = 6 },
{ ADC0, GPIO_PIN(PORT_C, 10), 6 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_C, 8), .chan = 4 },
{ ADC0, GPIO_PIN(PORT_C, 8), 4 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_C, 9), .chan = 5 }
{ ADC0, GPIO_PIN(PORT_C, 9), 5 },
}; };
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0])) #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))

View File

@ -128,28 +128,44 @@ static const uart_conf_t uart_config[] = {
/** @} */ /** @} */
/** /**
* @name ADC configuration * @name ADC configuration
* @{ * @{
*/ */
static const adc_conf_t adc_config[] = { static const adc_conf_t adc_config[] = {
/* dev, pin, channel */ /* internal: temperature sensor */
[ 0] = { ADC1, GPIO_UNDEF, 26 }, /* internal: temperature sensor */ [ 0] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 26 },
[ 1] = { ADC1, GPIO_UNDEF, 27 }, /* internal: band gap */ /* internal: band gap */
[ 2] = { ADC1, GPIO_UNDEF, 29 }, /* internal: V_REFSH */ [ 1] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 27 },
[ 3] = { ADC1, GPIO_UNDEF, 30 }, /* internal: V_REFSL */ /* internal: V_REFSH */
[ 4] = { ADC1, GPIO_UNDEF, 23 }, /* internal: DAC0 module output level */ [ 2] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 29 },
[ 5] = { ADC1, GPIO_UNDEF, 18 }, /* internal: VREF module output level */ /* internal: V_REFSL */
[ 6] = { ADC1, GPIO_UNDEF, 0 }, /* on board connection to Mulle Vbat/2 on PGA1_DP pin */ [ 3] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 30 },
[ 7] = { ADC1, GPIO_UNDEF, 19 }, /* on board connection to Mulle Vchr/2 on PGA1_DM pin */ /* internal: DAC0 module output level */
[ 8] = { ADC0, GPIO_UNDEF, 0 }, /* expansion port PGA0_DP pin */ [ 4] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 23 },
[ 9] = { ADC0, GPIO_UNDEF, 19 }, /* expansion port PGA0_DM pin */ /* internal: VREF module output level */
[10] = { ADC1, GPIO_PIN(PORT_A, 17), 17 }, /* expansion port PTA17 */ [ 5] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 18 },
[11] = { ADC1, GPIO_PIN(PORT_B, 0), 8 }, /* expansion port PTB0 */ /* on board connection to Mulle Vbat/2 on PGA1_DP pin */
[12] = { ADC0, GPIO_PIN(PORT_C, 0), 14 }, /* expansion port PTC0 */ [ 6] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 0 },
[13] = { ADC1, GPIO_PIN(PORT_C, 8), 4 }, /* expansion port PTC8 */ /* on board connection to Mulle Vchr/2 on PGA1_DM pin */
[14] = { ADC1, GPIO_PIN(PORT_C, 9), 5 }, /* expansion port PTC9 */ [ 7] = { .dev = ADC1, .pin = GPIO_UNDEF, .chan = 19 },
[15] = { ADC1, GPIO_PIN(PORT_C, 10), 6 }, /* expansion port PTC10 */ /* expansion port PGA0_DP pin */
[16] = { ADC1, GPIO_PIN(PORT_C, 11), 7 }, /* expansion port PTC11 */ [ 8] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 0 },
/* expansion port PGA0_DM pin */
[ 9] = { .dev = ADC0, .pin = GPIO_UNDEF, .chan = 19 },
/* expansion port PTA17 */
[10] = { .dev = ADC1, .pin = GPIO_PIN(PORT_A, 17), .chan = 17 },
/* expansion port PTB0 */
[11] = { .dev = ADC1, .pin = GPIO_PIN(PORT_B, 0), .chan = 8 },
/* expansion port PTC0 */
[12] = { .dev = ADC0, .pin = GPIO_PIN(PORT_C, 0), .chan = 14 },
/* expansion port PTC8 */
[13] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 8), .chan = 4 },
/* expansion port PTC9 */
[14] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 9), .chan = 5 },
/* expansion port PTC10 */
[15] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 10), .chan = 6 },
/* expansion port PTC11 */
[16] = { .dev = ADC1, .pin = GPIO_PIN(PORT_C, 11), .chan = 7 }
}; };
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0])) #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))

View File

@ -114,17 +114,16 @@ static const uart_conf_t uart_config[] = {
/** @} */ /** @} */
/** /**
* @name ADC configuration * @name ADC configuration
* @{ * @{
*/ */
static const adc_conf_t adc_config[] = { static const adc_conf_t adc_config[] = {
/* dev, pin, channel */ { .dev = ADC0, .pin = GPIO_PIN(PORT_E, 2), .chan = 1 },
{ ADC0, GPIO_PIN(PORT_E, 2), 1 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_E, 3), .chan = 1 },
{ ADC0, GPIO_PIN(PORT_E, 3), 1 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_D, 7), .chan = 22 },
{ ADC0, GPIO_PIN(PORT_D, 7), 22 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_D, 5), .chan = 6 },
{ ADC0, GPIO_PIN(PORT_D, 5), 6 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_E, 0), .chan = 10 },
{ ADC0, GPIO_PIN(PORT_E, 0), 10 }, { .dev = ADC0, .pin = GPIO_PIN(PORT_E, 1), .chan = 11 }
{ ADC0, GPIO_PIN(PORT_E, 1), 11 },
}; };
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0])) #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))