adding uart isolator switches wip

This commit is contained in:
Jakob Meier
2022-03-27 14:42:20 +02:00
parent 6d04c278c3
commit e2c9bece05
5 changed files with 40 additions and 17 deletions

View File

@ -5,10 +5,17 @@
#include "fsfw/globalfunctions/CRC.h"
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper)
: DeviceHandlerBase(objectId, uartComIFid, comCookie), plocMPSoCHelper(plocMPSoCHelper) {
if (comCookie == NULL) {
sif::error << "PlocMPSoCHandler: Invalid com cookie" << std::endl;
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
LinuxLibgpioIF* gpioComIF, gpioId_t uartIsolatorSwitch)
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
plocMPSoCHelper(plocMPSoCHelper),
gpioComIF(gpioComIF),
uartIsolatorSwitch(uartIsolatorSwitch) {
if (comCookie == nullptr) {
sif::error << "PlocMPSoCHandler: Invalid communication cookie" << std::endl;
}
if (gpioComIF == nullptr) {
sif::error << "PlocMPSoCHandler: Invalid gpio communication interface" << std::endl;
}
eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
}
@ -118,9 +125,13 @@ void PlocMPSoCHandler::doStartUp() {
#else
setMode(_MODE_TO_ON);
#endif
gpioComIF->pullHigh(uartIsolatorSwitch);
}
void PlocMPSoCHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
void PlocMPSoCHandler::doShutDown() {
gpioComIF->pullLow(uartIsolatorSwitch);
setMode(_MODE_POWER_DOWN);
}
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;