eive-obsw/bsp_q7s/callbacks/gnssCallback.cpp

24 lines
704 B
C++
Raw Normal View History

2021-09-07 16:11:02 +02:00
#include "gnssCallback.h"
2022-01-17 15:58:27 +01:00
#include "devices/gpioIds.h"
2022-05-26 11:46:28 +02:00
#include "fsfw/action/HasActionsIF.h"
2021-09-07 16:11:02 +02:00
#include "fsfw/tasks/TaskFactory.h"
2022-07-27 22:02:37 +02:00
ReturnValue_t gps::triggerGpioResetPin(uint8_t gpsId, void* args) {
2022-01-17 15:58:27 +01:00
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
if (args == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if (resetArgs->gpioComIF == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
2022-07-27 22:02:37 +02:00
gpioId_t gpioId = gpioIds::GNSS_0_NRESET;
if (gpsId == 1) {
2022-05-25 10:59:20 +02:00
gpioId = gpioIds::GNSS_1_NRESET;
2022-01-17 15:58:27 +01:00
}
resetArgs->gpioComIF->pullLow(gpioId);
TaskFactory::delayTask(resetArgs->waitPeriodMs);
resetArgs->gpioComIF->pullHigh(gpioId);
return HasReturnvaluesIF::RETURN_OK;
2021-09-07 16:11:02 +02:00
}