[hal] Add systemcore analog input (#7681)

This commit is contained in:
Thad House
2025-01-14 11:30:44 -08:00
committed by GitHub
parent afbaa43539
commit 45d7549ca9
3 changed files with 97 additions and 8 deletions

View File

@@ -141,4 +141,16 @@ int32_t SmartIo::GetPwmMicroseconds(uint16_t* microseconds) {
return 0;
}
int32_t SmartIo::GetAnalogInput(uint16_t* value) {
if (currentMode != SmartIoMode::AnalogInput) {
return INCOMPATIBLE_STATE;
}
int val = getSubscriber.Get();
*value = val;
return 0;
}
} // namespace hal