mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
kinetis: Allow per-board config of ADC ref
ADC reference can be external pin or internal VREF module on most Kinetis CPUs.
This commit is contained in:
parent
2b7dc32035
commit
b61eeb9fe0
@ -132,6 +132,13 @@ static const adc_conf_t adc_config[] = {
|
||||
};
|
||||
|
||||
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
|
||||
/*
|
||||
* K22F ADC reference settings:
|
||||
* 0: VREFH/VREFL external pin pair
|
||||
* 1: VREF_OUT internal 1.2 V reference (VREF module must be enabled)
|
||||
* 2-3: reserved
|
||||
*/
|
||||
#define ADC_REF_SETTING 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -126,6 +126,13 @@ static const adc_conf_t adc_config[] = {
|
||||
};
|
||||
|
||||
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
|
||||
/*
|
||||
* K64F ADC reference settings:
|
||||
* 0: VREFH/VREFL external pin pair
|
||||
* 1: VREF_OUT internal 1.2 V reference (VREF module must be enabled)
|
||||
* 2-3: reserved
|
||||
*/
|
||||
#define ADC_REF_SETTING 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -183,6 +183,13 @@ static const adc_conf_t adc_config[] = {
|
||||
};
|
||||
|
||||
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
|
||||
/*
|
||||
* K60D ADC reference settings:
|
||||
* 0: VREFH/VREFL external pin pair
|
||||
* 1: VREF_OUT internal 1.2 V reference (VREF module must be enabled)
|
||||
* 2-3: reserved
|
||||
*/
|
||||
#define ADC_REF_SETTING 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -141,6 +141,12 @@ static const adc_conf_t adc_config[] = {
|
||||
};
|
||||
|
||||
#define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
|
||||
/*
|
||||
* KW2xD ADC reference settings:
|
||||
* 0: VREFH/VREFL external pin pair
|
||||
* 1-3: reserved
|
||||
*/
|
||||
#define ADC_REF_SETTING 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -196,7 +196,7 @@ int adc_init(adc_t line)
|
||||
/* select ADxxb channels, longest sample time (20 extra ADC cycles) */
|
||||
dev(line)->CFG2 = ADC_CFG2_MUXSEL_MASK | ADC_CFG2_ADLSTS(0);
|
||||
/* select software trigger, external ref pins */
|
||||
dev(line)->SC2 = ADC_SC2_REFSEL(0);
|
||||
dev(line)->SC2 = ADC_SC2_REFSEL(ADC_REF_SETTING);
|
||||
/* select hardware average over 32 samples */
|
||||
dev(line)->SC3 = ADC_SC3_AVGE_MASK | ADC_SC3_AVGS(3);
|
||||
/* set an (arbitrary) input channel, single-ended mode */
|
||||
|
Loading…
Reference in New Issue
Block a user