mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
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:
@@ -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; // 12-bit 1.8V ADC
|
||||
}
|
||||
|
||||
uint32_t px4_arch_adc_dn_fullcount()
|
||||
{
|
||||
return 1 << 12; // 12 bit ADC
|
||||
|
||||
Reference in New Issue
Block a user