merged mueller master
This commit is contained in:
@ -137,6 +137,7 @@ void initmission::initTasks() {
|
||||
|
||||
//TODO: Add handling of missed deadlines
|
||||
/* Polling Sequence Table Default */
|
||||
#if Q7S_ADD_SPI_TEST == 0
|
||||
FixedTimeslotTaskIF * pollingSequenceTableTaskDefault = factory->createFixedTimeslotTask(
|
||||
"PST_TASK_DEFAULT", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0,
|
||||
missedDeadlineFunc);
|
||||
@ -144,6 +145,7 @@ void initmission::initTasks() {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TE0720 == 0
|
||||
FixedTimeslotTaskIF* gomSpacePstTask = factory->
|
||||
@ -155,13 +157,20 @@ void initmission::initTasks() {
|
||||
}
|
||||
#endif
|
||||
|
||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||
"GPIOD_TEST", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||
"TEST_TASK", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
||||
}
|
||||
|
||||
#if Q7S_ADD_SPI_TEST == 1
|
||||
result = testTask->addComponent(objects::SPI_TEST);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST);
|
||||
}
|
||||
#endif
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
#if TE0720 == 1 && TEST_LIBGPIOD == 1
|
||||
result = testTask->addComponent(objects::LIBGPIOD_TEST);
|
||||
@ -178,7 +187,10 @@ void initmission::initTasks() {
|
||||
#if TE0720 == 0
|
||||
gomSpacePstTask->startTask();
|
||||
#endif
|
||||
|
||||
#if Q7S_ADD_SPI_TEST == 0
|
||||
pollingSequenceTableTaskDefault->startTask();
|
||||
#endif
|
||||
|
||||
pusVerification->startTask();
|
||||
pusEvents->startTask();
|
||||
@ -186,6 +198,8 @@ void initmission::initTasks() {
|
||||
pusMedPrio->startTask();
|
||||
pusLowPrio->startTask();
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
testTask->startTask();
|
||||
#endif
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <devices/gpioIds.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
#include <devices/powerSwitcherList.h>
|
||||
#include <devices/spi.h>
|
||||
|
||||
#include <bsp_q7s/devices/HeaterHandler.h>
|
||||
#include <bsp_q7s/devices/SolarArrayDeploymentHandler.h>
|
||||
@ -21,6 +22,9 @@
|
||||
#include <mission/devices/IMTQHandler.h>
|
||||
#include <mission/devices/devicedefinitions/Max31865Definitions.h>
|
||||
#include <mission/devices/SyrlinksHkHandler.h>
|
||||
#include <mission/devices/MGMHandlerLIS3MDL.h>
|
||||
#include <mission/devices/MGMHandlerRM3100.h>
|
||||
#include <mission/devices/GyroL3GD20Handler.h>
|
||||
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
#include <mission/devices/devicedefinitions/SyrlinksDefinitions.h>
|
||||
@ -28,25 +32,26 @@
|
||||
|
||||
#include <linux/csp/CspCookie.h>
|
||||
#include <linux/csp/CspComIF.h>
|
||||
#include <linux/i2c/I2cCookie.h>
|
||||
#include <linux/i2c/I2cComIF.h>
|
||||
#include <linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
|
||||
#include <linux/uart/UartComIF.h>
|
||||
#include <linux/uart/UartCookie.h>
|
||||
#include <linux/spi/SpiComIF.h>
|
||||
#include <linux/spi/SpiCookie.h>
|
||||
|
||||
#include <fsfw_hal/linux/i2c/I2cCookie.h>
|
||||
#include <fsfw_hal/linux/i2c/I2cComIF.h>
|
||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
|
||||
/* UDP server includes */
|
||||
#include <fsfw/osal/common/UdpTmTcBridge.h>
|
||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <linux/boardtest/SpiTestClass.h>
|
||||
|
||||
#if TEST_LIBGPIOD == 1
|
||||
#include <linux/boardtest/LibgpiodTest.h>
|
||||
@ -92,7 +97,21 @@ void ObjectFactory::produce(){
|
||||
new CspComIF(objects::CSP_COM_IF);
|
||||
new I2cComIF(objects::I2C_COM_IF);
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
#if Q7S_ADD_SPI_TEST == 0
|
||||
new SpiComIF(objects::SPI_COM_IF, gpioComIF);
|
||||
#endif
|
||||
|
||||
/* Temperature sensors */
|
||||
Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler(
|
||||
objects::TMP1075_HANDLER_1, objects::I2C_COM_IF,
|
||||
i2cCookieTmp1075tcs1);
|
||||
tmp1075Handler_1->setStartUpImmediately();
|
||||
Tmp1075Handler* tmp1075Handler_2 = new Tmp1075Handler(
|
||||
objects::TMP1075_HANDLER_2, objects::I2C_COM_IF,
|
||||
i2cCookieTmp1075tcs2);
|
||||
tmp1075Handler_2->setStartUpImmediately();
|
||||
|
||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
||||
|
||||
#if TE0720 == 0
|
||||
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH,
|
||||
@ -123,19 +142,68 @@ void ObjectFactory::produce(){
|
||||
// pdu1handler->setModeNormal();
|
||||
// pdu2handler->setModeNormal();
|
||||
// acuhandler->setModeNormal();
|
||||
#endif
|
||||
/* Temperature sensors */
|
||||
Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler(
|
||||
objects::TMP1075_HANDLER_1, objects::I2C_COM_IF,
|
||||
i2cCookieTmp1075tcs1);
|
||||
tmp1075Handler_1->setStartUpImmediately();
|
||||
Tmp1075Handler* tmp1075Handler_2 = new Tmp1075Handler(
|
||||
objects::TMP1075_HANDLER_2, objects::I2C_COM_IF,
|
||||
i2cCookieTmp1075tcs2);
|
||||
tmp1075Handler_2->setStartUpImmediately();
|
||||
(void) p60dockhandler;
|
||||
(void) pdu1handler;
|
||||
(void) pdu2handler;
|
||||
(void) acuhandler;
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
|
||||
GpiodRegular* gpio = nullptr;
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 1, std::string("CS_GYRO_1_ADIS"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 7, std::string("CS_GYRO_2_L3G"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 3, std::string("CS_GYRO_3_L3G"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_L3G_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 5, std::string("CS_MGM_0_LIS3_A"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 17, std::string("CS_MGM_1_RM3100_A"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegular(std::string("gpiochip6"), 0, std::string("CS_MGM_2_LIS3_B"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegular(std::string("gpiochip5"), 10, std::string("CS_MGM_3_RM3100_B"),
|
||||
gpio::OUT, gpio::HIGH);
|
||||
gpioCookieAcsBoard->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||
|
||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||
|
||||
std::string spiDev = "/dev/spidev2.0";
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
|
||||
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler2 = new MGMHandlerLIS3MDL(objects::MGM_2_LIS3_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmLis3Handler2->setStartUpImmediately();
|
||||
|
||||
spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
|
||||
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev,
|
||||
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#endif
|
||||
|
||||
GpioCookie* heaterGpiosCookie = new GpioCookie;
|
||||
#if TE0720 == 0
|
||||
/* Pin H2-11 on stack connector */
|
||||
GpiodRegular* gpioConfigHeater0 = new GpiodRegular(std::string("gpiochip7"), 6,
|
||||
std::string("Heater0"), gpio::OUT, 0);
|
||||
@ -196,6 +264,7 @@ void ObjectFactory::produce(){
|
||||
objects::UART_COM_IF, syrlinksUartCookie);
|
||||
syrlinksHkHandler->setModeNormal();
|
||||
|
||||
#if Q7S_ADD_SPI_TEST == 0
|
||||
GpioCookie* rtdGpioCookie = new GpioCookie;
|
||||
|
||||
gpioCallbacks::initTcsBoardDecoder(gpioComIF);
|
||||
@ -318,17 +387,19 @@ void ObjectFactory::produce(){
|
||||
// rtdIc10->setStartUpImmediately();
|
||||
// rtdIc4->setStartUpImmediately();
|
||||
|
||||
I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE,
|
||||
std::string("/dev/i2c-0"));
|
||||
IMTQHandler* imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
|
||||
imtqHandler->setStartUpImmediately();
|
||||
#endif /* Q7S_ADD_SPI_TEST == 0 */
|
||||
|
||||
#endif
|
||||
#endif /* TE0720 == 0 */
|
||||
|
||||
new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, objects::TM_STORE,
|
||||
objects::TC_STORE);
|
||||
new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||
|
||||
I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE,
|
||||
std::string("/dev/i2c-0"));
|
||||
IMTQHandler* imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
|
||||
imtqHandler->setStartUpImmediately();
|
||||
|
||||
#if TE0720 == 1 && TEST_LIBGPIOD == 1
|
||||
/* Configure MIO0 as input */
|
||||
GpiodRegular gpioConfigMio0(std::string("gpiochip0"), 0,
|
||||
@ -344,4 +415,8 @@ void ObjectFactory::produce(){
|
||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie,
|
||||
objects::PCDU_HANDLER, pcduSwitches::TCS_BOARD_8V_HEATER_IN);
|
||||
#endif
|
||||
|
||||
#if Q7S_ADD_SPI_TEST == 1
|
||||
new SpiTestClass(objects::SPI_TEST, gpioComIF);
|
||||
#endif
|
||||
}
|
||||
|
11
bsp_q7s/boardconfig/q7s_config.h
Normal file
11
bsp_q7s/boardconfig/q7s_config.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_
|
||||
#define BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_
|
||||
|
||||
/* Only one of those 2 should be enabled! */
|
||||
/* Add code for ACS board */
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define Q7S_ADD_SPI_TEST 0
|
||||
|
||||
|
||||
|
||||
#endif /* BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_ */
|
@ -2,7 +2,7 @@
|
||||
#include <fsfwconfig/devices/powerSwitcherList.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <devices/gpioIds.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
|
||||
HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_,
|
||||
CookieIF * gpioCookie_, object_id_t mainLineSwitcherObjectId_, uint8_t mainLineSwitch_) :
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/devicehandlers/CookieIF.h>
|
||||
#include <fsfw/timemanager/Countdown.h>
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
#include <unordered_map>
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <devices/powerSwitcherList.h>
|
||||
#include <devices/gpioIds.h>
|
||||
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
#ifndef MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_
|
||||
#define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_
|
||||
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
@ -11,7 +9,7 @@
|
||||
#include <fsfw/devicehandlers/CookieIF.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/timemanager/Countdown.h>
|
||||
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
#include <unordered_map>
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include <bsp_q7s/gpio/gpioCallbacks.h>
|
||||
#include <fsfwconfig/devices/gpioIds.h>
|
||||
#include <linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include "gpioCallbacks.h"
|
||||
#include <devices/gpioIds.h>
|
||||
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef LINUX_GPIO_GPIOCALLBACKS_H_
|
||||
#define LINUX_GPIO_GPIOCALLBACKS_H_
|
||||
|
||||
#include <linux/gpio/gpioDefinitions.h>
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
|
||||
|
||||
namespace gpioCallbacks {
|
||||
|
Reference in New Issue
Block a user