Merge remote-tracking branch 'origin/mueller/pcdu-switch-callback' into mueller/master
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
rwSpiCallback.cpp
|
||||
gnssCallback.cpp
|
||||
pcduSwitchCb.cpp
|
||||
)
|
||||
|
32
bsp_q7s/callbacks/pcduSwitchCb.cpp
Normal file
32
bsp_q7s/callbacks/pcduSwitchCb.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include "pcduSwitchCb.h"
|
||||
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
|
||||
void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* args) {
|
||||
LinuxLibgpioIF* gpioComIF = reinterpret_cast<LinuxLibgpioIF*>(args);
|
||||
if (gpioComIF == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (pdu == GOMSPACE::Pdu::PDU1) {
|
||||
PDU1::SwitchChannels typedChannel = static_cast<PDU1::SwitchChannels>(channel);
|
||||
if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) {
|
||||
if (state) {
|
||||
gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET);
|
||||
} else {
|
||||
gpioComIF->pullLow(gpioIds::GNSS_0_NRESET);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (pdu == GOMSPACE::Pdu::PDU2) {
|
||||
PDU2::SwitchChannels typedChannel = static_cast<PDU2::SwitchChannels>(channel);
|
||||
if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) {
|
||||
if (state) {
|
||||
gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET);
|
||||
} else {
|
||||
gpioComIF->pullLow(gpioIds::GNSS_1_NRESET);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
14
bsp_q7s/callbacks/pcduSwitchCb.h
Normal file
14
bsp_q7s/callbacks/pcduSwitchCb.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_
|
||||
#define BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||
|
||||
namespace pcdu {
|
||||
|
||||
void switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* args);
|
||||
|
||||
}
|
||||
|
||||
#endif /* BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_ */
|
@ -5,6 +5,7 @@
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
#include "bsp_q7s/callbacks/pcduSwitchCb.h"
|
||||
#include "bsp_q7s/callbacks/rwSpiCallback.h"
|
||||
#include "bsp_q7s/core/CoreController.h"
|
||||
#include "bsp_q7s/devices/PlocMemoryDumper.h"
|
||||
@ -122,13 +123,14 @@ void ObjectFactory::produce(void* args) {
|
||||
#if BOARD_TE0720 == 0
|
||||
new CoreController(objects::CORE_CONTROLLER);
|
||||
|
||||
createPcduComponents();
|
||||
createPcduComponents(gpioComIF);
|
||||
createRadSensorComponent(gpioComIF);
|
||||
createSunSensorComponents(gpioComIF, spiComIF);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
createAcsBoardComponents(gpioComIF, uartComIF);
|
||||
#endif /* OBSW_ADD_ACS_BOARD == 1 */
|
||||
#endif
|
||||
|
||||
createHeaterComponents();
|
||||
createSolarArrayDeploymentComponents();
|
||||
#if OBSW_ADD_SYRLINKS == 1
|
||||
@ -234,7 +236,7 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
||||
#endif
|
||||
}
|
||||
|
||||
void ObjectFactory::createPcduComponents() {
|
||||
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH, addresses::P60DOCK);
|
||||
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
|
||||
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
|
||||
@ -244,8 +246,10 @@ void ObjectFactory::createPcduComponents() {
|
||||
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie);
|
||||
PDU1Handler* pdu1handler =
|
||||
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie);
|
||||
pdu1handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF);
|
||||
PDU2Handler* pdu2handler =
|
||||
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
|
||||
pdu2handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF);
|
||||
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
|
||||
new PCDUHandler(objects::PCDU_HANDLER, 50);
|
||||
|
||||
@ -472,6 +476,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
|
||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
||||
SpiCookie* spiCookie =
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
@ -568,6 +573,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
resetArgsGnss0.waitPeriodMs = 100;
|
||||
auto gpsHandler0 = new GPSHyperionHandler(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
}
|
||||
|
||||
void ObjectFactory::createHeaterComponents() {
|
||||
|
@ -13,7 +13,7 @@ void produce(void* args);
|
||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF);
|
||||
void createTmpComponents();
|
||||
void createPcduComponents();
|
||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF);
|
||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF);
|
||||
|
Reference in New Issue
Block a user