mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add DMA support to HAL and WPILibC (#2080)
This commit is contained in:
committed by
Peter Johnson
parent
8280b7e3af
commit
82b2170feb
@@ -201,6 +201,14 @@ double HAL_GetAnalogVoltage(HAL_AnalogInputHandle analogPortHandle,
|
||||
return voltage;
|
||||
}
|
||||
|
||||
double HAL_GetAnalogValueToVolts(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t rawValue, int32_t* status) {
|
||||
int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogPortHandle, status);
|
||||
int32_t offset = HAL_GetAnalogOffset(analogPortHandle, status);
|
||||
double voltage = LSBWeight * 1.0e-9 * rawValue - offset * 1.0e-9;
|
||||
return voltage;
|
||||
}
|
||||
|
||||
double HAL_GetAnalogAverageVoltage(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
int32_t value = HAL_GetAnalogAverageValue(analogPortHandle, status);
|
||||
|
||||
Reference in New Issue
Block a user