[hal] Add systemcore duty cycle (#7682)

This commit is contained in:
Thad House
2025-01-15 11:57:31 -08:00
committed by GitHub
parent 24d6e87447
commit 58cb395d76
17 changed files with 138 additions and 233 deletions

View File

@@ -96,6 +96,17 @@ int32_t SmartIo::GetDigitalInput(bool* value) {
return 0;
}
int32_t SmartIo::GetPwmInputMicroseconds(uint16_t* microseconds) {
if (currentMode != SmartIoMode::PwmInput) {
return INCOMPATIBLE_STATE;
}
int val = getSubscriber.Get();
*microseconds = val;
return 0;
}
int32_t SmartIo::SetPwmOutputPeriod(PwmOutputPeriod period) {
if (currentMode != SmartIoMode::PwmOutput) {
return INCOMPATIBLE_STATE;