added gps reset callback
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -12,6 +12,6 @@ else()
|
||||
add_subdirectory(gpio)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(memory)
|
||||
add_subdirectory(spiCallbacks)
|
||||
add_subdirectory(callbacks)
|
||||
add_subdirectory(devices)
|
||||
endif()
|
||||
|
@ -1,3 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
rwSpiCallback.cpp
|
||||
gnssCallback.cpp
|
||||
)
|
26
bsp_q7s/callbacks/gnssCallback.cpp
Normal file
26
bsp_q7s/callbacks/gnssCallback.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "gnssCallback.h"
|
||||
#include "devices/gpioIds.h"
|
||||
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
ReturnValue_t gps::triggerGpioResetPin(void *args) {
|
||||
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
|
||||
if(args == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
if (resetArgs->gpioComIF == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
gpioId_t gpioId;
|
||||
if(resetArgs->gnss1) {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
|
||||
}
|
||||
else {
|
||||
gpioId = gpioIds::GNSS_0_NRESET;
|
||||
}
|
||||
resetArgs->gpioComIF->pullLow(gpioId);
|
||||
TaskFactory::delayTask(resetArgs->waitPeriodMs);
|
||||
resetArgs->gpioComIF->pullHigh(gpioId);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
19
bsp_q7s/callbacks/gnssCallback.h
Normal file
19
bsp_q7s/callbacks/gnssCallback.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
|
||||
#define BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
|
||||
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
struct ResetArgs {
|
||||
bool gnss1 = false;
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
uint32_t waitPeriodMs = 100;
|
||||
};
|
||||
|
||||
namespace gps {
|
||||
|
||||
ReturnValue_t triggerGpioResetPin(void* args);
|
||||
|
||||
}
|
||||
|
||||
#endif /* BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ */
|
@ -1,9 +1,10 @@
|
||||
#include <bsp_q7s/spiCallbacks/rwSpiCallback.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <mission/devices/RwHandler.h>
|
||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||
#include <fsfw_hal/linux/UnixFileGuard.h>
|
||||
#include "rwSpiCallback.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "mission/devices/RwHandler.h"
|
||||
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
namespace rwSpiCallback {
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef BSP_Q7S_RW_SPI_CALLBACK_H_
|
||||
#define BSP_Q7S_RW_SPI_CALLBACK_H_
|
||||
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
||||
|
||||
|
||||
namespace rwSpiCallback {
|
@ -9,12 +9,13 @@
|
||||
#include "devices/powerSwitcherList.h"
|
||||
#include "bsp_q7s/gpio/gpioCallbacks.h"
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/spiCallbacks/rwSpiCallback.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/memory/FileSystemHandler.h"
|
||||
#include "bsp_q7s/devices/PlocSupervisorHandler.h"
|
||||
#include "bsp_q7s/devices/PlocUpdater.h"
|
||||
#include "bsp_q7s/devices/PlocMemoryDumper.h"
|
||||
#include "bsp_q7s/callbacks/rwSpiCallback.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
|
||||
#include "linux/devices/HeaterHandler.h"
|
||||
#include "linux/devices/SolarArrayDeploymentHandler.h"
|
||||
@ -82,6 +83,9 @@
|
||||
#include "linux/boardtest/LibgpiodTest.h"
|
||||
#endif
|
||||
|
||||
ResetArgs resetArgsGnss0;
|
||||
ResetArgs resetArgsGnss1;
|
||||
|
||||
void ObjectFactory::setStatics() {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
}
|
||||
@ -427,6 +431,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
||||
"GNSS_1_NRESET", gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
|
||||
|
||||
|
||||
|
||||
// GNSS enable pins must be pulled high
|
||||
|
||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||
@ -485,6 +491,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
|
||||
resetArgsGnss1.gnss1 = true;
|
||||
resetArgsGnss1.gpioComIF = gpioComIF;
|
||||
resetArgsGnss1.waitPeriodMs = 100;
|
||||
resetArgsGnss0.gnss1 = false;
|
||||
resetArgsGnss0.gpioComIF = gpioComIF;
|
||||
resetArgsGnss0.waitPeriodMs = 100;
|
||||
auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV,
|
||||
UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER);
|
||||
uartCookieGps0->setToFlushInput(true);
|
||||
@ -495,9 +507,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
||||
uartCookieGps1->setReadCycles(6);
|
||||
auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF,
|
||||
uartCookieGps0, true);
|
||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
||||
gpsHandler0->setStartUpImmediately();
|
||||
auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF,
|
||||
uartCookieGps1, true);
|
||||
gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1);
|
||||
gpsHandler1->setStartUpImmediately();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user