uart isolator switch handling

This commit is contained in:
Jakob Meier
2022-03-28 09:08:11 +02:00
parent e2c9bece05
commit 758c4e6f4f
11 changed files with 75 additions and 45 deletions

View File

@ -12,10 +12,9 @@
#include "OBSWConfig.h"
PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, LinuxLibgpioIF* gpioComIF,
gpioId_t uartIsolatorSwitch)
CookieIF* comCookie,
Gpio uartIsolatorSwitch)
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
gpioComIF(gpioComIF),
uartIsolatorSwitch(uartIsolatorSwitch),
hkset(this),
bootStatusReport(this),
@ -50,9 +49,13 @@ void PlocSupervisorHandler::doStartUp() {
#else
setMode(_MODE_TO_ON);
#endif
uartIsolatorSwitch.pullHigh();
}
void PlocSupervisorHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
void PlocSupervisorHandler::doShutDown() {
setMode(_MODE_POWER_DOWN);
uartIsolatorSwitch.pullLow();
}
ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;