Assign power switcher to IMTQ and Star Tracker #210

Merged
meierj merged 2 commits from mueller/assign-more-power-switches into develop 2022-04-14 10:13:18 +02:00
2 changed files with 14 additions and 13 deletions

View File

@ -161,6 +161,7 @@ void ObjectFactory::produce(void* args) {
I2cCookie* imtqI2cCookie = I2cCookie* imtqI2cCookie =
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler); static_cast<void>(imtqHandler);
#if OBSW_DEBUG_IMTQ == 1 #if OBSW_DEBUG_IMTQ == 1
imtqHandler->setStartUpImmediately(); imtqHandler->setStartUpImmediately();
@ -187,13 +188,14 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
UartCookie* starTrackerCookie = UartCookie* starTrackerCookie =
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2, startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
UartModes::NON_CANONICAL);
starTrackerCookie->setNoFixedSizeReply(); starTrackerCookie->setNoFixedSizeReply();
StrHelper* strHelper = new StrHelper(objects::STR_HELPER); StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper, auto starTracker =
pcdu::PDU1_CH2_STAR_TRACKER_5V); new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
@ -628,8 +630,8 @@ void ObjectFactory::createSolarArrayDeploymentComponents() {
void ObjectFactory::createSyrlinksComponents() { void ObjectFactory::createSyrlinksComponents() {
UartCookie* syrlinksUartCookie = UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
uart::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven(); syrlinksUartCookie->setParityEven();
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
@ -647,8 +649,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie); gpioComIF->addGpios(mpsocGpioCookie);
auto mpsocCookie = auto mpsocCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
mpsocCookie->setNoFixedSizeReply(); mpsocCookie->setNoFixedSizeReply();
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie,
@ -664,9 +666,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
q7s::UART_PLOC_SUPERVSIOR_DEV, q7s::UART_PLOC_SUPERVSIOR_DEV, uart::PLOC_SUPERVISOR_BAUD,
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),

View File

@ -118,7 +118,7 @@ ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
case (IMTQ::START_ACTUATION_DIPOLE): { case (IMTQ::START_ACTUATION_DIPOLE): {
/* IMTQ expects low byte first */ /* IMTQ expects low byte first */
commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE; commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE;
if(commandData == nullptr) { if (commandData == nullptr) {
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
} }
commandBuffer[1] = commandData[1]; commandBuffer[1] = commandData[1];