acd board tests continued
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:
parent
c67a7ef1d8
commit
3354f2a696
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace pcduSwitches {
|
namespace pcduSwitches {
|
||||||
/* Switches are uint8_t datatype and go from 0 to 255 */
|
/* Switches are uint8_t datatype and go from 0 to 255 */
|
||||||
enum switcherList {
|
enum SwitcherList {
|
||||||
Q7S,
|
Q7S,
|
||||||
PAYLOAD_PCDU_CH1,
|
PAYLOAD_PCDU_CH1,
|
||||||
RW,
|
RW,
|
||||||
@ -22,7 +22,7 @@ namespace pcduSwitches {
|
|||||||
SUS_NOMINAL,
|
SUS_NOMINAL,
|
||||||
SOLAR_CELL_EXP,
|
SOLAR_CELL_EXP,
|
||||||
PLOC,
|
PLOC,
|
||||||
ACS_BORAD_SIDE_A,
|
ACS_BOARD_SIDE_A,
|
||||||
NUMBER_OF_SWITCHES
|
NUMBER_OF_SWITCHES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ static constexpr uint32_t GPIO_RAD_SENSOR_CS = 19; // R18
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
static constexpr char GPIO_FLEX_OBC1F_B1[] = "gpiochip6";
|
static constexpr char GPIO_FLEX_OBC1F_B1[] = "gpiochip6";
|
||||||
static const char* const GPIO_MGM2_LIS3_CHIP = GPIO_FLEX_OBC1F_B1;
|
static const char* const GPIO_MGM2_LIS3_CHIP = GPIO_FLEX_OBC1F_B1;
|
||||||
static constexpr uint32_t GPIO_MGM_2_LIS3_CS = 0;
|
static constexpr uint32_t GPIO_MGM_2_LIS3_CS = 0; // D18
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
/** OBC1C */
|
/** OBC1C */
|
||||||
@ -74,6 +74,7 @@ static constexpr uint32_t GPIO_HEATER_4_PIN = 3;
|
|||||||
static constexpr uint32_t GPIO_HEATER_5_PIN = 0;
|
static constexpr uint32_t GPIO_HEATER_5_PIN = 0;
|
||||||
static constexpr uint32_t GPIO_HEATER_6_PIN = 1;
|
static constexpr uint32_t GPIO_HEATER_6_PIN = 1;
|
||||||
static constexpr uint32_t GPIO_HEATER_7_PIN = 11;
|
static constexpr uint32_t GPIO_HEATER_7_PIN = 11;
|
||||||
|
static constexpr uint32_t GPIO_GYRO_2_ENABLE = 18; // F22
|
||||||
|
|
||||||
static constexpr uint32_t GPIO_SOL_DEPL_SA_0_PIN = 4;
|
static constexpr uint32_t GPIO_SOL_DEPL_SA_0_PIN = 4;
|
||||||
static constexpr uint32_t GPIO_SOL_DEPL_SA_1_PIN = 2;
|
static constexpr uint32_t GPIO_SOL_DEPL_SA_1_PIN = 2;
|
||||||
|
@ -121,7 +121,7 @@ void initmission::initTasks() {
|
|||||||
std::vector<PeriodicTaskIF*> pstTasks;
|
std::vector<PeriodicTaskIF*> pstTasks;
|
||||||
createPstTasks(*factory, missedDeadlineFunc, pstTasks);
|
createPstTasks(*factory, missedDeadlineFunc, pstTasks);
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_TASK == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
std::vector<PeriodicTaskIF*> testTasks;
|
std::vector<PeriodicTaskIF*> testTasks;
|
||||||
createTestTasks(*factory, missedDeadlineFunc, testTasks);
|
createTestTasks(*factory, missedDeadlineFunc, testTasks);
|
||||||
#endif
|
#endif
|
||||||
@ -147,7 +147,7 @@ void initmission::initTasks() {
|
|||||||
|
|
||||||
taskStarter(pstTasks, "PST task vector");
|
taskStarter(pstTasks, "PST task vector");
|
||||||
taskStarter(pusTasks, "PUS task vector");
|
taskStarter(pusTasks, "PUS task vector");
|
||||||
#if OBSW_ADD_TEST_TASK == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
taskStarter(testTasks, "Test task vector");
|
taskStarter(testTasks, "Test task vector");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -97,6 +97,8 @@ void Factory::setStaticFrameworkObjectIds() {
|
|||||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
//DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
|
||||||
|
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||||
// No storage object for now.
|
// No storage object for now.
|
||||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
@ -121,6 +123,7 @@ void ObjectFactory::produce(void* args){
|
|||||||
createPcduComponents();
|
createPcduComponents();
|
||||||
createRadSensorComponent(gpioComIF);
|
createRadSensorComponent(gpioComIF);
|
||||||
createSunSensorComponents(gpioComIF, spiComIF);
|
createSunSensorComponents(gpioComIF, spiComIF);
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_BOARD == 1
|
#if OBSW_ADD_ACS_BOARD == 1
|
||||||
createAcsBoardComponents(gpioComIF, uartComIF);
|
createAcsBoardComponents(gpioComIF, uartComIF);
|
||||||
#endif /* OBSW_ADD_ACS_BOARD == 1 */
|
#endif /* OBSW_ADD_ACS_BOARD == 1 */
|
||||||
@ -183,7 +186,7 @@ void ObjectFactory::produce(void* args){
|
|||||||
|
|
||||||
/* Test Task */
|
/* Test Task */
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
createTestComponents();
|
createTestComponents(gpioComIF);
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
|
|
||||||
new PlocUpdater(objects::PLOC_UPDATER);
|
new PlocUpdater(objects::PLOC_UPDATER);
|
||||||
@ -431,10 +434,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
|||||||
"GNSS_1_NRESET", gpio::OUT, gpio::HIGH);
|
"GNSS_1_NRESET", gpio::OUT, gpio::HIGH);
|
||||||
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
|
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
|
||||||
|
|
||||||
|
// Enable pins must be pulled low for regular operations
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_FLEX_OBC1F_B0, q7s::GPIO_GYRO_0_ENABLE,
|
||||||
|
"GYRO_0_ENABLE", gpio::OUT, gpio::LOW);
|
||||||
|
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_3V3_OBC1C, q7s::GPIO_GYRO_2_ENABLE,
|
||||||
|
"GYRO_2_ENABLE", gpio::OUT, gpio::LOW);
|
||||||
|
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio);
|
||||||
|
|
||||||
|
// TODO: Add enable pins for GPS as soon as new interface board design is finished
|
||||||
// GNSS enable pins must be pulled high
|
|
||||||
|
|
||||||
gpioComIF->addGpios(gpioCookieAcsBoard);
|
gpioComIF->addGpios(gpioCookieAcsBoard);
|
||||||
|
|
||||||
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
std::string spiDev = q7s::SPI_DEFAULT_DEV;
|
||||||
@ -447,7 +455,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
|||||||
spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
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);
|
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
|
auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
|
||||||
objects::SPI_COM_IF, spiCookie);
|
objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_A);
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
mgmRm3100Handler->setStartUpImmediately();
|
||||||
|
|
||||||
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
||||||
@ -459,10 +467,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
|
|||||||
spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
||||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_3_RM3100_HANDLER,
|
mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_3_RM3100_HANDLER,
|
||||||
objects::SPI_COM_IF, spiCookie);
|
objects::SPI_COM_IF, spiCookie, pcduSwitches::SwitcherList::ACS_BOARD_SIDE_B);
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
mgmRm3100Handler->setStartUpImmediately();
|
||||||
|
|
||||||
|
|
||||||
// Commented until ACS board V2 in in clean room again
|
// Commented until ACS board V2 in in clean room again
|
||||||
// Gyro 0 Side A
|
// Gyro 0 Side A
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||||
@ -806,7 +813,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
rw4SpiCookie->setCallbackArgs(rwHandler4);
|
rw4SpiCookie->setCallbackArgs(rwHandler4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createTestComponents() {
|
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||||
|
|
||||||
#if BOARD_TE0720 == 0
|
#if BOARD_TE0720 == 0
|
||||||
new Q7STestTask(objects::TEST_TASK);
|
new Q7STestTask(objects::TEST_TASK);
|
||||||
|
@ -22,7 +22,7 @@ void createSolarArrayDeploymentComponents();
|
|||||||
void createSyrlinksComponents();
|
void createSyrlinksComponents();
|
||||||
void createRtdComponents(LinuxLibgpioIF* gpioComIF);
|
void createRtdComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
|
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
void createTestComponents();
|
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "SpiTestClass.h"
|
#include "SpiTestClass.h"
|
||||||
#include "OBSWConfig.h"
|
|
||||||
|
|
||||||
#include "devices/gpioIds.h"
|
#include "devices/gpioIds.h"
|
||||||
|
|
||||||
@ -20,7 +19,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
|
||||||
SpiTestClass::SpiTestClass(object_id_t objectId, GpioIF* gpioIF): TestTask(objectId),
|
SpiTestClass::SpiTestClass(object_id_t objectId, GpioIF* gpioIF): TestTask(objectId),
|
||||||
gpioIF(gpioIF) {
|
gpioIF(gpioIF) {
|
||||||
if(gpioIF == nullptr) {
|
if(gpioIF == nullptr) {
|
||||||
@ -37,11 +35,11 @@ ReturnValue_t SpiTestClass::performOneShotAction() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(TestModes::MGM_LIS3MDL): {
|
case(TestModes::MGM_LIS3MDL): {
|
||||||
performLis3MdlTest(mgm2Lis3mdlChipSelect);
|
performLis3MdlTest(mgm0Lis3mdlChipSelect);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(TestModes::MGM_RM3100): {
|
case(TestModes::MGM_RM3100): {
|
||||||
performRm3100Test(mgm3Rm3100ChipSelect);
|
performRm3100Test(mgm1Rm3100ChipSelect);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(TestModes::GYRO_L3GD20H): {
|
case(TestModes::GYRO_L3GD20H): {
|
||||||
@ -150,10 +148,10 @@ void SpiTestClass::performRm3100Test(uint8_t mgmId) {
|
|||||||
float fieldStrengthY = rawY * scaleFactor;
|
float fieldStrengthY = rawY * scaleFactor;
|
||||||
float fieldStrengthZ = rawZ * scaleFactor;
|
float fieldStrengthZ = rawZ * scaleFactor;
|
||||||
|
|
||||||
sif::info << "RM3100 measured field strenghts in microtesla:" << std::endl;
|
sif::info << "RM3100 measured field strengths in microtesla:" << std::endl;
|
||||||
sif::info << "Field Strength X: " << fieldStrengthX << " \xC2\xB5T" << std::endl;
|
sif::info << "Field Strength X: " << fieldStrengthX << " uT" << std::endl;
|
||||||
sif::info << "Field Strength Y: " << fieldStrengthY << " \xC2\xB5T" << std::endl;
|
sif::info << "Field Strength Y: " << fieldStrengthY << " uT" << std::endl;
|
||||||
sif::info << "Field Strength Z: " << fieldStrengthZ << " \xC2\xB5T" << std::endl;
|
sif::info << "Field Strength Z: " << fieldStrengthZ << " uT" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) {
|
void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) {
|
||||||
@ -174,8 +172,8 @@ void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) {
|
|||||||
else {
|
else {
|
||||||
currentGpioId = gpioIds::MGM_2_LIS3_CS;
|
currentGpioId = gpioIds::MGM_2_LIS3_CS;
|
||||||
}
|
}
|
||||||
uint32_t spiSpeed = 3'900'000;
|
uint32_t spiSpeed = 10'000'000;
|
||||||
spi::SpiModes spiMode = spi::SpiModes::MODE_3;
|
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||||
#ifdef RASPBERRY_PI
|
#ifdef RASPBERRY_PI
|
||||||
std::string deviceName = "/dev/spidev0.0";
|
std::string deviceName = "/dev/spidev0.0";
|
||||||
#else
|
#else
|
||||||
@ -208,10 +206,10 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) {
|
|||||||
/* Configure all SPI chip selects and pull them high */
|
/* Configure all SPI chip selects and pull them high */
|
||||||
acsInit();
|
acsInit();
|
||||||
|
|
||||||
l3gId = gyro2L3gd20ChipSelect;
|
l3gId = gyro3L3gd20ChipSelect;
|
||||||
|
|
||||||
/* Adapt accordingly */
|
/* Adapt accordingly */
|
||||||
if(l3gId != gyro1L3gd20ChipSelect and l3gId != gyro2L3gd20ChipSelect) {
|
if(l3gId != gyro1L3gd20ChipSelect and l3gId != gyro3L3gd20ChipSelect) {
|
||||||
sif::warning << "SpiTestClass::performLis3MdlTest: Invalid MGM ID!" << std::endl;
|
sif::warning << "SpiTestClass::performLis3MdlTest: Invalid MGM ID!" << std::endl;
|
||||||
}
|
}
|
||||||
gpioId_t currentGpioId = 0;
|
gpioId_t currentGpioId = 0;
|
||||||
@ -331,36 +329,32 @@ void SpiTestClass::acsInit() {
|
|||||||
gpio::Direction::OUT, 1);
|
gpio::Direction::OUT, 1);
|
||||||
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||||
#elif defined(XIPHOS_Q7S)
|
#elif defined(XIPHOS_Q7S)
|
||||||
std::string q7sGpioName5 = "gpiochip5";
|
|
||||||
std::string q7sGpioName6 = "gpiochip6";
|
|
||||||
|
|
||||||
gpio = new GpiodRegular(q7sGpioName5, mgm0Lis3mdlChipSelect, "MGM_0_LIS3",
|
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm0Lis3mdlChipSelect,
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
"MGM_0_LIS3", gpio::Direction::OUT, gpio::HIGH);
|
||||||
gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm1Rm3100ChipSelect,
|
||||||
gpio = new GpiodRegular(q7sGpioName5, mgm1Rm3100ChipSelect, "MGM_1_RM3100",
|
"MGM_1_RM3100", gpio::Direction::OUT, gpio::HIGH);
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_MGM2_LIS3_CHIP, mgm2Lis3mdlChipSelect,
|
||||||
gpio = new GpiodRegular(q7sGpioName5, gyro0AdisChipSelect, "GYRO_0_ADIS",
|
"MGM_2_LIS3", gpio::Direction::OUT, gpio::HIGH);
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegular(q7sGpioName5, gyro1L3gd20ChipSelect, "GYRO_1_L3G",
|
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegular(q7sGpioName5, gyro2L3gd20ChipSelect, "GYRO_2_L3G",
|
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
|
|
||||||
|
|
||||||
gpio = new GpiodRegular(q7sGpioName6, mgm2Lis3mdlChipSelect, "MGM_2_LIS3",
|
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm3Rm3100ChipSelect,
|
||||||
gpio = new GpiodRegular(q7sGpioName5, mgm3Rm3100ChipSelect, "MGM_3_RM3100",
|
"MGM_3_RM3100", gpio::Direction::OUT, gpio::HIGH);
|
||||||
gpio::Direction::OUT, gpio::HIGH);
|
|
||||||
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||||
|
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, gyro0AdisChipSelect,
|
||||||
|
"GYRO_0_ADIS", gpio::Direction::OUT, gpio::HIGH);
|
||||||
|
gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, gyro1L3gd20ChipSelect,
|
||||||
|
"GYRO_1_L3G", gpio::Direction::OUT, gpio::HIGH);
|
||||||
|
gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, gyro2AdisChipSelect,
|
||||||
|
"GYRO_2_ADIS", gpio::Direction::OUT, gpio::HIGH);
|
||||||
|
gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
|
||||||
|
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, gyro3L3gd20ChipSelect,
|
||||||
|
"GYRO_3_L3G", gpio::Direction::OUT, gpio::HIGH);
|
||||||
|
gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
|
||||||
#endif
|
#endif
|
||||||
if(gpioIF != nullptr) {
|
if(gpioIF != nullptr) {
|
||||||
gpioIF->addGpios(gpioCookie);
|
gpioIF->addGpios(gpioCookie);
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#ifndef LINUX_BOARDTEST_SPITESTCLASS_H_
|
#ifndef LINUX_BOARDTEST_SPITESTCLASS_H_
|
||||||
#define LINUX_BOARDTEST_SPITESTCLASS_H_
|
#define LINUX_BOARDTEST_SPITESTCLASS_H_
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
|
||||||
|
#if defined(XIPHOS_Q7S)
|
||||||
|
#include "busConf.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||||
#include <test/testtasks/TestTask.h>
|
#include <test/testtasks/TestTask.h>
|
||||||
@ -47,14 +53,14 @@ private:
|
|||||||
uint8_t mgm2Lis3mdlChipSelect = 17;
|
uint8_t mgm2Lis3mdlChipSelect = 17;
|
||||||
uint8_t mgm3Rm3100ChipSelect = 27;
|
uint8_t mgm3Rm3100ChipSelect = 27;
|
||||||
#elif defined(XIPHOS_Q7S)
|
#elif defined(XIPHOS_Q7S)
|
||||||
uint8_t mgm0Lis3mdlChipSelect = 5;
|
uint8_t mgm0Lis3mdlChipSelect = q7s::GPIO_MGM_0_LIS3_CS;
|
||||||
uint8_t mgm1Rm3100ChipSelect = 17;
|
uint8_t mgm1Rm3100ChipSelect = q7s::GPIO_MGM_1_RM3100_CS;
|
||||||
uint8_t gyro0AdisResetLine = 20;
|
uint8_t gyro0AdisChipSelect = q7s::GPIO_GYRO_0_ADIS_CS;
|
||||||
uint8_t gyro0AdisChipSelect = 21;
|
uint8_t gyro2AdisChipSelect = q7s::GPIO_GYRO_2_ADIS_CS;
|
||||||
uint8_t gyro1L3gd20ChipSelect = 10;
|
uint8_t gyro1L3gd20ChipSelect = q7s::GPIO_GYRO_1_L3G_CS;
|
||||||
uint8_t gyro2L3gd20ChipSelect = 3;
|
uint8_t gyro3L3gd20ChipSelect = q7s::GPIO_GYRO_3_L3G_CS;
|
||||||
uint8_t mgm2Lis3mdlChipSelect = 0;
|
uint8_t mgm2Lis3mdlChipSelect = q7s::GPIO_MGM_2_LIS3_CS;
|
||||||
uint8_t mgm3Rm3100ChipSelect = 23;
|
uint8_t mgm3Rm3100ChipSelect = q7s::GPIO_MGM_3_RM3100_CS;
|
||||||
#else
|
#else
|
||||||
uint8_t mgm0Lis3mdlChipSelect = 0;
|
uint8_t mgm0Lis3mdlChipSelect = 0;
|
||||||
uint8_t mgm1Rm3100ChipSelect = 0;
|
uint8_t mgm1Rm3100ChipSelect = 0;
|
||||||
|
@ -28,6 +28,9 @@ enum gpioId_t {
|
|||||||
GNSS_0_NRESET,
|
GNSS_0_NRESET,
|
||||||
GNSS_1_NRESET,
|
GNSS_1_NRESET,
|
||||||
|
|
||||||
|
GYRO_0_ENABLE,
|
||||||
|
GYRO_2_ENABLE,
|
||||||
|
|
||||||
TEST_ID_0,
|
TEST_ID_0,
|
||||||
TEST_ID_1,
|
TEST_ID_1,
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace pcduSwitches {
|
namespace pcduSwitches {
|
||||||
/* Switches are uint8_t datatype and go from 0 to 255 */
|
/* Switches are uint8_t datatype and go from 0 to 255 */
|
||||||
enum switcherList {
|
enum SwitcherList: uint8_t {
|
||||||
Q7S,
|
Q7S,
|
||||||
PAYLOAD_PCDU_CH1,
|
PAYLOAD_PCDU_CH1,
|
||||||
RW,
|
RW,
|
||||||
@ -22,7 +22,7 @@ namespace pcduSwitches {
|
|||||||
SUS_NOMINAL,
|
SUS_NOMINAL,
|
||||||
SOLAR_CELL_EXP,
|
SOLAR_CELL_EXP,
|
||||||
PLOC,
|
PLOC,
|
||||||
ACS_BORAD_SIDE_A,
|
ACS_BOARD_SIDE_A,
|
||||||
NUMBER_OF_SWITCHES
|
NUMBER_OF_SWITCHES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
|
|
||||||
MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId,
|
MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId,
|
||||||
object_id_t deviceCommunication, CookieIF* comCookie):
|
object_id_t deviceCommunication, CookieIF* comCookie, uint8_t switchId):
|
||||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||||
primaryDataset(this) {
|
primaryDataset(this), switchId(switchId) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
debugDivider = new PeriodicOperationDivider(5);
|
debugDivider = new PeriodicOperationDivider(5);
|
||||||
#endif
|
#endif
|
||||||
@ -300,16 +300,16 @@ ReturnValue_t MGMHandlerRM3100::handleTmrcConfigCommand(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MGMHandlerRM3100::fillCommandAndReplyMap() {
|
void MGMHandlerRM3100::fillCommandAndReplyMap() {
|
||||||
insertInCommandAndReplyMap(RM3100::CONFIGURE_CMM, 1);
|
insertInCommandAndReplyMap(RM3100::CONFIGURE_CMM, 3);
|
||||||
insertInCommandAndReplyMap(RM3100::READ_CMM, 1);
|
insertInCommandAndReplyMap(RM3100::READ_CMM, 3);
|
||||||
|
|
||||||
insertInCommandAndReplyMap(RM3100::CONFIGURE_TMRC, 1);
|
insertInCommandAndReplyMap(RM3100::CONFIGURE_TMRC, 3);
|
||||||
insertInCommandAndReplyMap(RM3100::READ_TMRC, 1);
|
insertInCommandAndReplyMap(RM3100::READ_TMRC, 3);
|
||||||
|
|
||||||
insertInCommandAndReplyMap(RM3100::CONFIGURE_CYCLE_COUNT, 1);
|
insertInCommandAndReplyMap(RM3100::CONFIGURE_CYCLE_COUNT, 3);
|
||||||
insertInCommandAndReplyMap(RM3100::READ_CYCLE_COUNT, 1);
|
insertInCommandAndReplyMap(RM3100::READ_CYCLE_COUNT, 3);
|
||||||
|
|
||||||
insertInCommandAndReplyMap(RM3100::READ_DATA, 1, &primaryDataset);
|
insertInCommandAndReplyMap(RM3100::READ_DATA, 3, &primaryDataset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MGMHandlerRM3100::modeChanged(void) {
|
void MGMHandlerRM3100::modeChanged(void) {
|
||||||
@ -328,6 +328,12 @@ uint32_t MGMHandlerRM3100::getTransitionDelayMs(Mode_t from, Mode_t to) {
|
|||||||
return 10000;
|
return 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t MGMHandlerRM3100::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) {
|
||||||
|
*switches = &switchId;
|
||||||
|
*numberOfSwitches = 1;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) {
|
ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) {
|
||||||
/* Analyze data here. The sensor generates 24 bit signed values so we need to do some bitshift
|
/* Analyze data here. The sensor generates 24 bit signed values so we need to do some bitshift
|
||||||
* trickery here to calculate the raw values first */
|
* trickery here to calculate the raw values first */
|
||||||
@ -345,9 +351,9 @@ ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) {
|
|||||||
sif::info << "MGMHandlerRM3100: Magnetic field strength in"
|
sif::info << "MGMHandlerRM3100: Magnetic field strength in"
|
||||||
" microtesla:" << std::endl;
|
" microtesla:" << std::endl;
|
||||||
/* Set terminal to utf-8 if there is an issue with micro printout. */
|
/* Set terminal to utf-8 if there is an issue with micro printout. */
|
||||||
sif::info << "X: " << fieldStrengthX << " \xC2\xB5T" << std::endl;
|
sif::info << "X: " << fieldStrengthX << " uT" << std::endl;
|
||||||
sif::info << "Y: " << fieldStrengthY << " \xC2\xB5T" << std::endl;
|
sif::info << "Y: " << fieldStrengthY << " uT" << std::endl;
|
||||||
sif::info << "Z: " << fieldStrengthZ << " \xC2\xB5T" << std::endl;
|
sif::info << "Z: " << fieldStrengthZ << " uT" << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define MISSION_DEVICES_MGMRM3100HANDLER_H_
|
#define MISSION_DEVICES_MGMRM3100HANDLER_H_
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
#include "devices/powerSwitcherList.h"
|
||||||
#include "devicedefinitions/MGMHandlerRM3100Definitions.h"
|
#include "devicedefinitions/MGMHandlerRM3100Definitions.h"
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ public:
|
|||||||
SUBSYSTEM_ID::MGM_RM3100, 0x01, severity::INFO);
|
SUBSYSTEM_ID::MGM_RM3100, 0x01, severity::INFO);
|
||||||
|
|
||||||
MGMHandlerRM3100(object_id_t objectId, object_id_t deviceCommunication,
|
MGMHandlerRM3100(object_id_t objectId, object_id_t deviceCommunication,
|
||||||
CookieIF* comCookie);
|
CookieIF* comCookie, uint8_t switchId);
|
||||||
virtual ~MGMHandlerRM3100();
|
virtual ~MGMHandlerRM3100();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -50,6 +51,8 @@ protected:
|
|||||||
DeviceCommandId_t *foundId, size_t *foundLen) override;
|
DeviceCommandId_t *foundId, size_t *foundLen) override;
|
||||||
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id,
|
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id,
|
||||||
const uint8_t *packet) override;
|
const uint8_t *packet) override;
|
||||||
|
ReturnValue_t getSwitches(const uint8_t **switches,
|
||||||
|
uint8_t *numberOfSwitches) override;
|
||||||
|
|
||||||
void fillCommandAndReplyMap() override;
|
void fillCommandAndReplyMap() override;
|
||||||
void modeChanged(void) override;
|
void modeChanged(void) override;
|
||||||
@ -87,6 +90,8 @@ private:
|
|||||||
float scaleFactorY = 1 / RM3100::DEFAULT_GAIN;
|
float scaleFactorY = 1 / RM3100::DEFAULT_GAIN;
|
||||||
float scaleFactorZ = 1 / RM3100::DEFAULT_GAIN;
|
float scaleFactorZ = 1 / RM3100::DEFAULT_GAIN;
|
||||||
|
|
||||||
|
uint8_t switchId;
|
||||||
|
|
||||||
ReturnValue_t handleCycleCountConfigCommand(DeviceCommandId_t deviceCommand,
|
ReturnValue_t handleCycleCountConfigCommand(DeviceCommandId_t deviceCommand,
|
||||||
const uint8_t *commandData,size_t commandDataLen);
|
const uint8_t *commandData,size_t commandDataLen);
|
||||||
ReturnValue_t handleCycleCommand(bool oneCycleValue,
|
ReturnValue_t handleCycleCommand(bool oneCycleValue,
|
||||||
|
@ -93,7 +93,7 @@ void PCDUHandler::initializeSwitchStates() {
|
|||||||
switchStates[pcduSwitches::SUS_NOMINAL] = pcduSwitches::INIT_STATE_SUS_NOMINAL;
|
switchStates[pcduSwitches::SUS_NOMINAL] = pcduSwitches::INIT_STATE_SUS_NOMINAL;
|
||||||
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pcduSwitches::INIT_STATE_SOLAR_CELL_EXP;
|
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pcduSwitches::INIT_STATE_SOLAR_CELL_EXP;
|
||||||
switchStates[pcduSwitches::PLOC] = pcduSwitches::INIT_STATE_PLOC;
|
switchStates[pcduSwitches::PLOC] = pcduSwitches::INIT_STATE_PLOC;
|
||||||
switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_A;
|
switchStates[pcduSwitches::ACS_BOARD_SIDE_A] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_A;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PCDUHandler::readCommandQueue() {
|
void PCDUHandler::readCommandQueue() {
|
||||||
@ -186,7 +186,7 @@ void PCDUHandler::updatePdu1SwitchStates() {
|
|||||||
switchStates[pcduSwitches::SUS_NOMINAL] = pdu1HkTableDataset.voltageOutSUSNominal.value;
|
switchStates[pcduSwitches::SUS_NOMINAL] = pdu1HkTableDataset.voltageOutSUSNominal.value;
|
||||||
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pdu1HkTableDataset.voltageOutSolarCellExp.value;
|
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pdu1HkTableDataset.voltageOutSolarCellExp.value;
|
||||||
switchStates[pcduSwitches::PLOC] = pdu1HkTableDataset.voltageOutPLOC.value;
|
switchStates[pcduSwitches::PLOC] = pdu1HkTableDataset.voltageOutPLOC.value;
|
||||||
switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value;
|
switchStates[pcduSwitches::ACS_BOARD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
|
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 90f85b7dae63e93a3c5686fab9dd0d4a8147e96b
|
Subproject commit d9968031d641249ca0ad62e7c1c19ed22390078c
|
Loading…
Reference in New Issue
Block a user