ADC driver report back vref alone with sample count (#14136)

* Introduce "px4_arch_adc_reference_v"

* Revert "Introduce "px4_arch_adc_reference_v""

This reverts commit 93691fbbd55a1b8da8c190e225b318067d90399b.

* use structure to return sample count and vref at the same time

* Revert "use structure to return sample count and vref at the same time"

This reverts commit 9cfd1c173cda51495f766a3f678c2202d67725fd.

* Revert "Revert "Introduce "px4_arch_adc_reference_v"""

This reverts commit edb7f7603e4471163ffb0fc6fc62ad2e30336e91.

* fix missed reference

* remove unecessary channel specific vref

* Update src/drivers/drv_adc.h

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

* Update src/drivers/drv_adc.h

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

* Introduce BOARD_ADC_POS_REF_V

Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
This commit is contained in:
SalimTerryLi
2020-02-21 22:52:46 +08:00
committed by GitHub
parent e0d6f94318
commit 77a9135036
12 changed files with 54 additions and 1 deletions
+5
View File
@@ -92,6 +92,11 @@ uint32_t px4_arch_adc_sample(uint32_t base_address, unsigned channel)
return atoi(buffer);
}
float px4_arch_adc_reference_v()
{
return BOARD_ADC_POS_REF_V;
}
uint32_t px4_arch_adc_dn_fullcount()
{
return 1 << 12; // 12 bit ADC
+1
View File
@@ -73,6 +73,7 @@
// A4 - ADC2 (ADC port)
// A5 - ADC3 (ADC port)
#define ADC_CHANNELS (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5)
#define BOARD_ADC_POS_REF_V (4.096f) // TODO: need confirmation
#define ADC_BATTERY_VOLTAGE_CHANNEL 2
#define ADC_BATTERY_CURRENT_CHANNEL 3