Merge pull request #2161 from jepler/nrf-analog-reference
nRF: Change analog reference voltage
This commit is contained in:
commit
b5a9ed3688
|
@ -67,8 +67,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
|
||||||
const nrf_saadc_channel_config_t config = {
|
const nrf_saadc_channel_config_t config = {
|
||||||
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
||||||
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
|
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
|
||||||
.gain = NRF_SAADC_GAIN1_6,
|
.gain = NRF_SAADC_GAIN1_4,
|
||||||
.reference = NRF_SAADC_REFERENCE_INTERNAL,
|
.reference = NRF_SAADC_REFERENCE_VDD4,
|
||||||
.acq_time = NRF_SAADC_ACQTIME_3US,
|
.acq_time = NRF_SAADC_ACQTIME_3US,
|
||||||
.mode = NRF_SAADC_MODE_SINGLE_ENDED,
|
.mode = NRF_SAADC_MODE_SINGLE_ENDED,
|
||||||
.burst = NRF_SAADC_BURST_DISABLED,
|
.burst = NRF_SAADC_BURST_DISABLED,
|
||||||
|
@ -108,5 +108,6 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) {
|
float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) {
|
||||||
|
// The nominal VCC voltage
|
||||||
return 3.3f;
|
return 3.3f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue