v1.10.0 #220
@ -1207,8 +1207,15 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
|
|||||||
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
||||||
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
||||||
// Create device handler components
|
// Create device handler components
|
||||||
auto plPcduHandler =
|
auto plPcduHandler = new PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF,
|
||||||
PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF);
|
spiCookie, gpioComIF, false);
|
||||||
|
#if OBSW_TEST_PL_PCDU == 1
|
||||||
|
plPcduHandler->setStartUpImmediately();
|
||||||
|
#if OBSW_DEBUG_PL_PCDU == 1
|
||||||
|
plPcduHandler->setToGoToNormalModeImmediately(true);
|
||||||
|
plPcduHandler->enablePeriodicPrintout(true, 5);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||||
|
@ -4,19 +4,18 @@
|
|||||||
0x43400001;THERMAL_CONTROLLER
|
0x43400001;THERMAL_CONTROLLER
|
||||||
0x44120006;MGM_0_LIS3_HANDLER
|
0x44120006;MGM_0_LIS3_HANDLER
|
||||||
0x44120010;GYRO_0_ADIS_HANDLER
|
0x44120010;GYRO_0_ADIS_HANDLER
|
||||||
0x44120032;SUS_1
|
0x44120032;SUS_0
|
||||||
0x44120033;SUS_2
|
0x44120033;SUS_1
|
||||||
0x44120034;SUS_3
|
0x44120034;SUS_2
|
||||||
0x44120035;SUS_4
|
0x44120035;SUS_3
|
||||||
0x44120036;SUS_5
|
0x44120036;SUS_4
|
||||||
0x44120037;SUS_6
|
0x44120037;SUS_5
|
||||||
0x44120038;SUS_7
|
0x44120038;SUS_6
|
||||||
0x44120039;SUS_8
|
0x44120039;SUS_7
|
||||||
0x44120040;SUS_9
|
0x44120040;SUS_8
|
||||||
0x44120041;SUS_10
|
0x44120041;SUS_9
|
||||||
0x44120042;SUS_11
|
0x44120042;SUS_10
|
||||||
0x44120043;SUS_12
|
0x44120043;SUS_11
|
||||||
0x44120044;SUS_13
|
|
||||||
0x44120047;RW1
|
0x44120047;RW1
|
||||||
0x44120107;MGM_1_RM3100_HANDLER
|
0x44120107;MGM_1_RM3100_HANDLER
|
||||||
0x44120111;GYRO_1_L3G_HANDLER
|
0x44120111;GYRO_1_L3G_HANDLER
|
||||||
@ -36,6 +35,7 @@
|
|||||||
0x44250002;PDU2_HANDLER
|
0x44250002;PDU2_HANDLER
|
||||||
0x44250003;ACU_HANDLER
|
0x44250003;ACU_HANDLER
|
||||||
0x44260000;BPX_BATT_HANDLER
|
0x44260000;BPX_BATT_HANDLER
|
||||||
|
0x44300000;PLPCDU_HANDLER
|
||||||
0x443200A5;RAD_SENSOR
|
0x443200A5;RAD_SENSOR
|
||||||
0x44330000;PLOC_UPDATER
|
0x44330000;PLOC_UPDATER
|
||||||
0x44330001;PLOC_MEMORY_DUMPER
|
0x44330001;PLOC_MEMORY_DUMPER
|
||||||
@ -101,6 +101,7 @@
|
|||||||
0x53ffffff;FSFW_OBJECTS_END
|
0x53ffffff;FSFW_OBJECTS_END
|
||||||
0x54000010;SPI_TEST
|
0x54000010;SPI_TEST
|
||||||
0x54000020;UART_TEST
|
0x54000020;UART_TEST
|
||||||
|
0x54000030;I2C_TEST
|
||||||
0x5400AFFE;DUMMY_HANDLER
|
0x5400AFFE;DUMMY_HANDLER
|
||||||
0x5400CAFE;DUMMY_INTERFACE
|
0x5400CAFE;DUMMY_INTERFACE
|
||||||
0x54123456;LIBGPIOD_TEST
|
0x54123456;LIBGPIOD_TEST
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 110 translations.
|
* Contains 111 translations.
|
||||||
* Generated on: 2022-02-03 12:01:36
|
* Generated on: 2022-02-21 17:31:37
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER";
|
|||||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||||
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
||||||
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
||||||
|
const char *SUS_0_STRING = "SUS_0";
|
||||||
const char *SUS_1_STRING = "SUS_1";
|
const char *SUS_1_STRING = "SUS_1";
|
||||||
const char *SUS_2_STRING = "SUS_2";
|
const char *SUS_2_STRING = "SUS_2";
|
||||||
const char *SUS_3_STRING = "SUS_3";
|
const char *SUS_3_STRING = "SUS_3";
|
||||||
@ -23,8 +24,6 @@ const char *SUS_8_STRING = "SUS_8";
|
|||||||
const char *SUS_9_STRING = "SUS_9";
|
const char *SUS_9_STRING = "SUS_9";
|
||||||
const char *SUS_10_STRING = "SUS_10";
|
const char *SUS_10_STRING = "SUS_10";
|
||||||
const char *SUS_11_STRING = "SUS_11";
|
const char *SUS_11_STRING = "SUS_11";
|
||||||
const char *SUS_12_STRING = "SUS_12";
|
|
||||||
const char *SUS_13_STRING = "SUS_13";
|
|
||||||
const char *RW1_STRING = "RW1";
|
const char *RW1_STRING = "RW1";
|
||||||
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
||||||
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
||||||
@ -44,6 +43,7 @@ const char *PDU1_HANDLER_STRING = "PDU1_HANDLER";
|
|||||||
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
||||||
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
||||||
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
||||||
|
const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
|
||||||
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
||||||
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
||||||
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
||||||
@ -109,6 +109,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
|||||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||||
const char *SPI_TEST_STRING = "SPI_TEST";
|
const char *SPI_TEST_STRING = "SPI_TEST";
|
||||||
const char *UART_TEST_STRING = "UART_TEST";
|
const char *UART_TEST_STRING = "UART_TEST";
|
||||||
|
const char *I2C_TEST_STRING = "I2C_TEST";
|
||||||
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||||
@ -132,31 +133,29 @@ const char* translateObject(object_id_t object) {
|
|||||||
case 0x44120010:
|
case 0x44120010:
|
||||||
return GYRO_0_ADIS_HANDLER_STRING;
|
return GYRO_0_ADIS_HANDLER_STRING;
|
||||||
case 0x44120032:
|
case 0x44120032:
|
||||||
return SUS_1_STRING;
|
return SUS_0_STRING;
|
||||||
case 0x44120033:
|
case 0x44120033:
|
||||||
return SUS_2_STRING;
|
return SUS_1_STRING;
|
||||||
case 0x44120034:
|
case 0x44120034:
|
||||||
return SUS_3_STRING;
|
return SUS_2_STRING;
|
||||||
case 0x44120035:
|
case 0x44120035:
|
||||||
return SUS_4_STRING;
|
return SUS_3_STRING;
|
||||||
case 0x44120036:
|
case 0x44120036:
|
||||||
return SUS_5_STRING;
|
return SUS_4_STRING;
|
||||||
case 0x44120037:
|
case 0x44120037:
|
||||||
return SUS_6_STRING;
|
return SUS_5_STRING;
|
||||||
case 0x44120038:
|
case 0x44120038:
|
||||||
return SUS_7_STRING;
|
return SUS_6_STRING;
|
||||||
case 0x44120039:
|
case 0x44120039:
|
||||||
return SUS_8_STRING;
|
return SUS_7_STRING;
|
||||||
case 0x44120040:
|
case 0x44120040:
|
||||||
return SUS_9_STRING;
|
return SUS_8_STRING;
|
||||||
case 0x44120041:
|
case 0x44120041:
|
||||||
return SUS_10_STRING;
|
return SUS_9_STRING;
|
||||||
case 0x44120042:
|
case 0x44120042:
|
||||||
return SUS_11_STRING;
|
return SUS_10_STRING;
|
||||||
case 0x44120043:
|
case 0x44120043:
|
||||||
return SUS_12_STRING;
|
return SUS_11_STRING;
|
||||||
case 0x44120044:
|
|
||||||
return SUS_13_STRING;
|
|
||||||
case 0x44120047:
|
case 0x44120047:
|
||||||
return RW1_STRING;
|
return RW1_STRING;
|
||||||
case 0x44120107:
|
case 0x44120107:
|
||||||
@ -195,6 +194,8 @@ const char* translateObject(object_id_t object) {
|
|||||||
return ACU_HANDLER_STRING;
|
return ACU_HANDLER_STRING;
|
||||||
case 0x44260000:
|
case 0x44260000:
|
||||||
return BPX_BATT_HANDLER_STRING;
|
return BPX_BATT_HANDLER_STRING;
|
||||||
|
case 0x44300000:
|
||||||
|
return PLPCDU_HANDLER_STRING;
|
||||||
case 0x443200A5:
|
case 0x443200A5:
|
||||||
return RAD_SENSOR_STRING;
|
return RAD_SENSOR_STRING;
|
||||||
case 0x44330000:
|
case 0x44330000:
|
||||||
@ -325,6 +326,8 @@ const char* translateObject(object_id_t object) {
|
|||||||
return SPI_TEST_STRING;
|
return SPI_TEST_STRING;
|
||||||
case 0x54000020:
|
case 0x54000020:
|
||||||
return UART_TEST_STRING;
|
return UART_TEST_STRING;
|
||||||
|
case 0x54000030:
|
||||||
|
return I2C_TEST_STRING;
|
||||||
case 0x5400AFFE:
|
case 0x5400AFFE:
|
||||||
return DUMMY_HANDLER_STRING;
|
return DUMMY_HANDLER_STRING;
|
||||||
case 0x5400CAFE:
|
case 0x5400CAFE:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 110 translations.
|
* Contains 111 translations.
|
||||||
* Generated on: 2022-02-03 12:01:36
|
* Generated on: 2022-02-21 17:31:37
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER";
|
|||||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||||
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
||||||
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
||||||
|
const char *SUS_0_STRING = "SUS_0";
|
||||||
const char *SUS_1_STRING = "SUS_1";
|
const char *SUS_1_STRING = "SUS_1";
|
||||||
const char *SUS_2_STRING = "SUS_2";
|
const char *SUS_2_STRING = "SUS_2";
|
||||||
const char *SUS_3_STRING = "SUS_3";
|
const char *SUS_3_STRING = "SUS_3";
|
||||||
@ -23,8 +24,6 @@ const char *SUS_8_STRING = "SUS_8";
|
|||||||
const char *SUS_9_STRING = "SUS_9";
|
const char *SUS_9_STRING = "SUS_9";
|
||||||
const char *SUS_10_STRING = "SUS_10";
|
const char *SUS_10_STRING = "SUS_10";
|
||||||
const char *SUS_11_STRING = "SUS_11";
|
const char *SUS_11_STRING = "SUS_11";
|
||||||
const char *SUS_12_STRING = "SUS_12";
|
|
||||||
const char *SUS_13_STRING = "SUS_13";
|
|
||||||
const char *RW1_STRING = "RW1";
|
const char *RW1_STRING = "RW1";
|
||||||
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
||||||
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
||||||
@ -44,6 +43,7 @@ const char *PDU1_HANDLER_STRING = "PDU1_HANDLER";
|
|||||||
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
||||||
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
||||||
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
||||||
|
const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
|
||||||
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
||||||
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
||||||
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
||||||
@ -109,6 +109,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
|||||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||||
const char *SPI_TEST_STRING = "SPI_TEST";
|
const char *SPI_TEST_STRING = "SPI_TEST";
|
||||||
const char *UART_TEST_STRING = "UART_TEST";
|
const char *UART_TEST_STRING = "UART_TEST";
|
||||||
|
const char *I2C_TEST_STRING = "I2C_TEST";
|
||||||
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||||
@ -117,230 +118,232 @@ const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
|||||||
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
||||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||||
|
|
||||||
const char *translateObject(object_id_t object) {
|
const char* translateObject(object_id_t object) {
|
||||||
switch ((object & 0xFFFFFFFF)) {
|
switch( (object & 0xFFFFFFFF) ) {
|
||||||
case 0x00005060:
|
case 0x00005060:
|
||||||
return P60DOCK_TEST_TASK_STRING;
|
return P60DOCK_TEST_TASK_STRING;
|
||||||
case 0x43000003:
|
case 0x43000003:
|
||||||
return CORE_CONTROLLER_STRING;
|
return CORE_CONTROLLER_STRING;
|
||||||
case 0x43100002:
|
case 0x43100002:
|
||||||
return ACS_CONTROLLER_STRING;
|
return ACS_CONTROLLER_STRING;
|
||||||
case 0x43400001:
|
case 0x43400001:
|
||||||
return THERMAL_CONTROLLER_STRING;
|
return THERMAL_CONTROLLER_STRING;
|
||||||
case 0x44120006:
|
case 0x44120006:
|
||||||
return MGM_0_LIS3_HANDLER_STRING;
|
return MGM_0_LIS3_HANDLER_STRING;
|
||||||
case 0x44120010:
|
case 0x44120010:
|
||||||
return GYRO_0_ADIS_HANDLER_STRING;
|
return GYRO_0_ADIS_HANDLER_STRING;
|
||||||
case 0x44120032:
|
case 0x44120032:
|
||||||
return SUS_1_STRING;
|
return SUS_0_STRING;
|
||||||
case 0x44120033:
|
case 0x44120033:
|
||||||
return SUS_2_STRING;
|
return SUS_1_STRING;
|
||||||
case 0x44120034:
|
case 0x44120034:
|
||||||
return SUS_3_STRING;
|
return SUS_2_STRING;
|
||||||
case 0x44120035:
|
case 0x44120035:
|
||||||
return SUS_4_STRING;
|
return SUS_3_STRING;
|
||||||
case 0x44120036:
|
case 0x44120036:
|
||||||
return SUS_5_STRING;
|
return SUS_4_STRING;
|
||||||
case 0x44120037:
|
case 0x44120037:
|
||||||
return SUS_6_STRING;
|
return SUS_5_STRING;
|
||||||
case 0x44120038:
|
case 0x44120038:
|
||||||
return SUS_7_STRING;
|
return SUS_6_STRING;
|
||||||
case 0x44120039:
|
case 0x44120039:
|
||||||
return SUS_8_STRING;
|
return SUS_7_STRING;
|
||||||
case 0x44120040:
|
case 0x44120040:
|
||||||
return SUS_9_STRING;
|
return SUS_8_STRING;
|
||||||
case 0x44120041:
|
case 0x44120041:
|
||||||
return SUS_10_STRING;
|
return SUS_9_STRING;
|
||||||
case 0x44120042:
|
case 0x44120042:
|
||||||
return SUS_11_STRING;
|
return SUS_10_STRING;
|
||||||
case 0x44120043:
|
case 0x44120043:
|
||||||
return SUS_12_STRING;
|
return SUS_11_STRING;
|
||||||
case 0x44120044:
|
case 0x44120047:
|
||||||
return SUS_13_STRING;
|
return RW1_STRING;
|
||||||
case 0x44120047:
|
case 0x44120107:
|
||||||
return RW1_STRING;
|
return MGM_1_RM3100_HANDLER_STRING;
|
||||||
case 0x44120107:
|
case 0x44120111:
|
||||||
return MGM_1_RM3100_HANDLER_STRING;
|
return GYRO_1_L3G_HANDLER_STRING;
|
||||||
case 0x44120111:
|
case 0x44120148:
|
||||||
return GYRO_1_L3G_HANDLER_STRING;
|
return RW2_STRING;
|
||||||
case 0x44120148:
|
case 0x44120208:
|
||||||
return RW2_STRING;
|
return MGM_2_LIS3_HANDLER_STRING;
|
||||||
case 0x44120208:
|
case 0x44120212:
|
||||||
return MGM_2_LIS3_HANDLER_STRING;
|
return GYRO_2_ADIS_HANDLER_STRING;
|
||||||
case 0x44120212:
|
case 0x44120249:
|
||||||
return GYRO_2_ADIS_HANDLER_STRING;
|
return RW3_STRING;
|
||||||
case 0x44120249:
|
case 0x44120309:
|
||||||
return RW3_STRING;
|
return MGM_3_RM3100_HANDLER_STRING;
|
||||||
case 0x44120309:
|
case 0x44120313:
|
||||||
return MGM_3_RM3100_HANDLER_STRING;
|
return GYRO_3_L3G_HANDLER_STRING;
|
||||||
case 0x44120313:
|
case 0x44120350:
|
||||||
return GYRO_3_L3G_HANDLER_STRING;
|
return RW4_STRING;
|
||||||
case 0x44120350:
|
case 0x44130001:
|
||||||
return RW4_STRING;
|
return STAR_TRACKER_STRING;
|
||||||
case 0x44130001:
|
case 0x44130045:
|
||||||
return STAR_TRACKER_STRING;
|
return GPS_CONTROLLER_STRING;
|
||||||
case 0x44130045:
|
case 0x44140014:
|
||||||
return GPS_CONTROLLER_STRING;
|
return IMTQ_HANDLER_STRING;
|
||||||
case 0x44140014:
|
case 0x442000A1:
|
||||||
return IMTQ_HANDLER_STRING;
|
return PCDU_HANDLER_STRING;
|
||||||
case 0x442000A1:
|
case 0x44250000:
|
||||||
return PCDU_HANDLER_STRING;
|
return P60DOCK_HANDLER_STRING;
|
||||||
case 0x44250000:
|
case 0x44250001:
|
||||||
return P60DOCK_HANDLER_STRING;
|
return PDU1_HANDLER_STRING;
|
||||||
case 0x44250001:
|
case 0x44250002:
|
||||||
return PDU1_HANDLER_STRING;
|
return PDU2_HANDLER_STRING;
|
||||||
case 0x44250002:
|
case 0x44250003:
|
||||||
return PDU2_HANDLER_STRING;
|
return ACU_HANDLER_STRING;
|
||||||
case 0x44250003:
|
case 0x44260000:
|
||||||
return ACU_HANDLER_STRING;
|
return BPX_BATT_HANDLER_STRING;
|
||||||
case 0x44260000:
|
case 0x44300000:
|
||||||
return BPX_BATT_HANDLER_STRING;
|
return PLPCDU_HANDLER_STRING;
|
||||||
case 0x443200A5:
|
case 0x443200A5:
|
||||||
return RAD_SENSOR_STRING;
|
return RAD_SENSOR_STRING;
|
||||||
case 0x44330000:
|
case 0x44330000:
|
||||||
return PLOC_UPDATER_STRING;
|
return PLOC_UPDATER_STRING;
|
||||||
case 0x44330001:
|
case 0x44330001:
|
||||||
return PLOC_MEMORY_DUMPER_STRING;
|
return PLOC_MEMORY_DUMPER_STRING;
|
||||||
case 0x44330002:
|
case 0x44330002:
|
||||||
return STR_HELPER_STRING;
|
return STR_HELPER_STRING;
|
||||||
case 0x44330015:
|
case 0x44330015:
|
||||||
return PLOC_MPSOC_HANDLER_STRING;
|
return PLOC_MPSOC_HANDLER_STRING;
|
||||||
case 0x44330016:
|
case 0x44330016:
|
||||||
return PLOC_SUPERVISOR_HANDLER_STRING;
|
return PLOC_SUPERVISOR_HANDLER_STRING;
|
||||||
case 0x444100A2:
|
case 0x444100A2:
|
||||||
return SOLAR_ARRAY_DEPL_HANDLER_STRING;
|
return SOLAR_ARRAY_DEPL_HANDLER_STRING;
|
||||||
case 0x444100A4:
|
case 0x444100A4:
|
||||||
return HEATER_HANDLER_STRING;
|
return HEATER_HANDLER_STRING;
|
||||||
case 0x44420004:
|
case 0x44420004:
|
||||||
return TMP1075_HANDLER_1_STRING;
|
return TMP1075_HANDLER_1_STRING;
|
||||||
case 0x44420005:
|
case 0x44420005:
|
||||||
return TMP1075_HANDLER_2_STRING;
|
return TMP1075_HANDLER_2_STRING;
|
||||||
case 0x44420016:
|
case 0x44420016:
|
||||||
return RTD_IC_3_STRING;
|
return RTD_IC_3_STRING;
|
||||||
case 0x44420017:
|
case 0x44420017:
|
||||||
return RTD_IC_4_STRING;
|
return RTD_IC_4_STRING;
|
||||||
case 0x44420018:
|
case 0x44420018:
|
||||||
return RTD_IC_5_STRING;
|
return RTD_IC_5_STRING;
|
||||||
case 0x44420019:
|
case 0x44420019:
|
||||||
return RTD_IC_6_STRING;
|
return RTD_IC_6_STRING;
|
||||||
case 0x44420020:
|
case 0x44420020:
|
||||||
return RTD_IC_7_STRING;
|
return RTD_IC_7_STRING;
|
||||||
case 0x44420021:
|
case 0x44420021:
|
||||||
return RTD_IC_8_STRING;
|
return RTD_IC_8_STRING;
|
||||||
case 0x44420022:
|
case 0x44420022:
|
||||||
return RTD_IC_9_STRING;
|
return RTD_IC_9_STRING;
|
||||||
case 0x44420023:
|
case 0x44420023:
|
||||||
return RTD_IC_10_STRING;
|
return RTD_IC_10_STRING;
|
||||||
case 0x44420024:
|
case 0x44420024:
|
||||||
return RTD_IC_11_STRING;
|
return RTD_IC_11_STRING;
|
||||||
case 0x44420025:
|
case 0x44420025:
|
||||||
return RTD_IC_12_STRING;
|
return RTD_IC_12_STRING;
|
||||||
case 0x44420026:
|
case 0x44420026:
|
||||||
return RTD_IC_13_STRING;
|
return RTD_IC_13_STRING;
|
||||||
case 0x44420027:
|
case 0x44420027:
|
||||||
return RTD_IC_14_STRING;
|
return RTD_IC_14_STRING;
|
||||||
case 0x44420028:
|
case 0x44420028:
|
||||||
return RTD_IC_15_STRING;
|
return RTD_IC_15_STRING;
|
||||||
case 0x44420029:
|
case 0x44420029:
|
||||||
return RTD_IC_16_STRING;
|
return RTD_IC_16_STRING;
|
||||||
case 0x44420030:
|
case 0x44420030:
|
||||||
return RTD_IC_17_STRING;
|
return RTD_IC_17_STRING;
|
||||||
case 0x44420031:
|
case 0x44420031:
|
||||||
return RTD_IC_18_STRING;
|
return RTD_IC_18_STRING;
|
||||||
case 0x445300A3:
|
case 0x445300A3:
|
||||||
return SYRLINKS_HK_HANDLER_STRING;
|
return SYRLINKS_HK_HANDLER_STRING;
|
||||||
case 0x49000000:
|
case 0x49000000:
|
||||||
return ARDUINO_COM_IF_STRING;
|
return ARDUINO_COM_IF_STRING;
|
||||||
case 0x49010005:
|
case 0x49010005:
|
||||||
return GPIO_IF_STRING;
|
return GPIO_IF_STRING;
|
||||||
case 0x49020004:
|
case 0x49020004:
|
||||||
return SPI_COM_IF_STRING;
|
return SPI_COM_IF_STRING;
|
||||||
case 0x49030003:
|
case 0x49030003:
|
||||||
return UART_COM_IF_STRING;
|
return UART_COM_IF_STRING;
|
||||||
case 0x49040002:
|
case 0x49040002:
|
||||||
return I2C_COM_IF_STRING;
|
return I2C_COM_IF_STRING;
|
||||||
case 0x49050001:
|
case 0x49050001:
|
||||||
return CSP_COM_IF_STRING;
|
return CSP_COM_IF_STRING;
|
||||||
case 0x50000100:
|
case 0x50000100:
|
||||||
return CCSDS_PACKET_DISTRIBUTOR_STRING;
|
return CCSDS_PACKET_DISTRIBUTOR_STRING;
|
||||||
case 0x50000200:
|
case 0x50000200:
|
||||||
return PUS_PACKET_DISTRIBUTOR_STRING;
|
return PUS_PACKET_DISTRIBUTOR_STRING;
|
||||||
case 0x50000300:
|
case 0x50000300:
|
||||||
return TMTC_BRIDGE_STRING;
|
return TMTC_BRIDGE_STRING;
|
||||||
case 0x50000400:
|
case 0x50000400:
|
||||||
return TMTC_POLLING_TASK_STRING;
|
return TMTC_POLLING_TASK_STRING;
|
||||||
case 0x50000500:
|
case 0x50000500:
|
||||||
return FILE_SYSTEM_HANDLER_STRING;
|
return FILE_SYSTEM_HANDLER_STRING;
|
||||||
case 0x50000600:
|
case 0x50000600:
|
||||||
return PTME_STRING;
|
return PTME_STRING;
|
||||||
case 0x50000700:
|
case 0x50000700:
|
||||||
return PDEC_HANDLER_STRING;
|
return PDEC_HANDLER_STRING;
|
||||||
case 0x50000800:
|
case 0x50000800:
|
||||||
return CCSDS_HANDLER_STRING;
|
return CCSDS_HANDLER_STRING;
|
||||||
case 0x51000500:
|
case 0x51000500:
|
||||||
return PUS_SERVICE_6_STRING;
|
return PUS_SERVICE_6_STRING;
|
||||||
case 0x53000000:
|
case 0x53000000:
|
||||||
return FSFW_OBJECTS_START_STRING;
|
return FSFW_OBJECTS_START_STRING;
|
||||||
case 0x53000001:
|
case 0x53000001:
|
||||||
return PUS_SERVICE_1_VERIFICATION_STRING;
|
return PUS_SERVICE_1_VERIFICATION_STRING;
|
||||||
case 0x53000002:
|
case 0x53000002:
|
||||||
return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
|
return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
|
||||||
case 0x53000003:
|
case 0x53000003:
|
||||||
return PUS_SERVICE_3_HOUSEKEEPING_STRING;
|
return PUS_SERVICE_3_HOUSEKEEPING_STRING;
|
||||||
case 0x53000005:
|
case 0x53000005:
|
||||||
return PUS_SERVICE_5_EVENT_REPORTING_STRING;
|
return PUS_SERVICE_5_EVENT_REPORTING_STRING;
|
||||||
case 0x53000008:
|
case 0x53000008:
|
||||||
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
||||||
case 0x53000009:
|
case 0x53000009:
|
||||||
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
||||||
case 0x53000017:
|
case 0x53000017:
|
||||||
return PUS_SERVICE_17_TEST_STRING;
|
return PUS_SERVICE_17_TEST_STRING;
|
||||||
case 0x53000020:
|
case 0x53000020:
|
||||||
return PUS_SERVICE_20_PARAMETERS_STRING;
|
return PUS_SERVICE_20_PARAMETERS_STRING;
|
||||||
case 0x53000200:
|
case 0x53000200:
|
||||||
return PUS_SERVICE_200_MODE_MGMT_STRING;
|
return PUS_SERVICE_200_MODE_MGMT_STRING;
|
||||||
case 0x53000201:
|
case 0x53000201:
|
||||||
return PUS_SERVICE_201_HEALTH_STRING;
|
return PUS_SERVICE_201_HEALTH_STRING;
|
||||||
case 0x53001000:
|
case 0x53001000:
|
||||||
return CFDP_PACKET_DISTRIBUTOR_STRING;
|
return CFDP_PACKET_DISTRIBUTOR_STRING;
|
||||||
case 0x53010000:
|
case 0x53010000:
|
||||||
return HEALTH_TABLE_STRING;
|
return HEALTH_TABLE_STRING;
|
||||||
case 0x53010100:
|
case 0x53010100:
|
||||||
return MODE_STORE_STRING;
|
return MODE_STORE_STRING;
|
||||||
case 0x53030000:
|
case 0x53030000:
|
||||||
return EVENT_MANAGER_STRING;
|
return EVENT_MANAGER_STRING;
|
||||||
case 0x53040000:
|
case 0x53040000:
|
||||||
return INTERNAL_ERROR_REPORTER_STRING;
|
return INTERNAL_ERROR_REPORTER_STRING;
|
||||||
case 0x534f0100:
|
case 0x534f0100:
|
||||||
return TC_STORE_STRING;
|
return TC_STORE_STRING;
|
||||||
case 0x534f0200:
|
case 0x534f0200:
|
||||||
return TM_STORE_STRING;
|
return TM_STORE_STRING;
|
||||||
case 0x534f0300:
|
case 0x534f0300:
|
||||||
return IPC_STORE_STRING;
|
return IPC_STORE_STRING;
|
||||||
case 0x53500010:
|
case 0x53500010:
|
||||||
return TIME_STAMPER_STRING;
|
return TIME_STAMPER_STRING;
|
||||||
case 0x53ffffff:
|
case 0x53ffffff:
|
||||||
return FSFW_OBJECTS_END_STRING;
|
return FSFW_OBJECTS_END_STRING;
|
||||||
case 0x54000010:
|
case 0x54000010:
|
||||||
return SPI_TEST_STRING;
|
return SPI_TEST_STRING;
|
||||||
case 0x54000020:
|
case 0x54000020:
|
||||||
return UART_TEST_STRING;
|
return UART_TEST_STRING;
|
||||||
case 0x5400AFFE:
|
case 0x54000030:
|
||||||
return DUMMY_HANDLER_STRING;
|
return I2C_TEST_STRING;
|
||||||
case 0x5400CAFE:
|
case 0x5400AFFE:
|
||||||
return DUMMY_INTERFACE_STRING;
|
return DUMMY_HANDLER_STRING;
|
||||||
case 0x54123456:
|
case 0x5400CAFE:
|
||||||
return LIBGPIOD_TEST_STRING;
|
return DUMMY_INTERFACE_STRING;
|
||||||
case 0x54694269:
|
case 0x54123456:
|
||||||
return TEST_TASK_STRING;
|
return LIBGPIOD_TEST_STRING;
|
||||||
case 0x73000100:
|
case 0x54694269:
|
||||||
return TM_FUNNEL_STRING;
|
return TEST_TASK_STRING;
|
||||||
case 0x73500000:
|
case 0x73000100:
|
||||||
return CCSDS_IP_CORE_BRIDGE_STRING;
|
return TM_FUNNEL_STRING;
|
||||||
case 0xFFFFFFFF:
|
case 0x73500000:
|
||||||
return NO_OBJECT_STRING;
|
return CCSDS_IP_CORE_BRIDGE_STRING;
|
||||||
default:
|
case 0xFFFFFFFF:
|
||||||
return "UNKNOWN_OBJECT";
|
return NO_OBJECT_STRING;
|
||||||
}
|
default:
|
||||||
return 0;
|
return "UNKNOWN_OBJECT";
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,11 @@
|
|||||||
#include "devices/gpioIds.h"
|
#include "devices/gpioIds.h"
|
||||||
|
|
||||||
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
||||||
GpioIF* gpioIF)
|
GpioIF* gpioIF, bool periodicPrintout)
|
||||||
: DeviceHandlerBase(objectId, comIF, cookie), adcSet(this), gpioIF(gpioIF) {}
|
: DeviceHandlerBase(objectId, comIF, cookie),
|
||||||
|
adcSet(this),
|
||||||
|
periodicPrintout(periodicPrintout),
|
||||||
|
gpioIF(gpioIF) {}
|
||||||
|
|
||||||
void PayloadPcduHandler::doStartUp() {
|
void PayloadPcduHandler::doStartUp() {
|
||||||
if ((state != States::PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
if ((state != States::PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
||||||
@ -25,7 +28,7 @@ void PayloadPcduHandler::doStartUp() {
|
|||||||
if (transitionOk) {
|
if (transitionOk) {
|
||||||
transitionOk = false;
|
transitionOk = false;
|
||||||
// We are now in ON mode
|
// We are now in ON mode
|
||||||
setMode(MODE_ON);
|
startTransition(MODE_NORMAL, 0);
|
||||||
adcState = AdcStates::BOOT_DELAY;
|
adcState = AdcStates::BOOT_DELAY;
|
||||||
// The ADC can now be read. If the values are not close to zero, we should not allow
|
// The ADC can now be read. If the values are not close to zero, we should not allow
|
||||||
// transition
|
// transition
|
||||||
@ -36,18 +39,183 @@ void PayloadPcduHandler::doStartUp() {
|
|||||||
|
|
||||||
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||||
if (mode == _MODE_TO_NORMAL) {
|
if (mode == _MODE_TO_NORMAL) {
|
||||||
if (adcState == AdcStates::BOOT_DELAY) {
|
stateMachineToNormal();
|
||||||
if (adcCountdown.hasTimedOut()) {
|
}
|
||||||
adcState = AdcStates::SEND_SETUP;
|
}
|
||||||
adcCmdExecuted = false;
|
|
||||||
}
|
void PayloadPcduHandler::doShutDown() {}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
switch (adcState) {
|
||||||
|
case (AdcStates::SEND_SETUP): {
|
||||||
|
*id = plpcdu::SETUP_CMD;
|
||||||
|
buildCommandFromCommand(*id, nullptr, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (adcState == AdcStates::SEND_SETUP) {
|
case (AdcStates::NORMAL): {
|
||||||
if (adcCmdExecuted) {
|
*id = plpcdu::READ_WITH_TEMP;
|
||||||
adcState = AdcStates::NORMAL;
|
buildCommandFromCommand(*id, nullptr, 0);
|
||||||
adcCmdExecuted = false;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
if (adcState == AdcStates::SEND_SETUP) {
|
||||||
|
*id = plpcdu::SETUP_CMD;
|
||||||
|
buildCommandFromCommand(*id, nullptr, 0);
|
||||||
|
}
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::fillCommandAndReplyMap() {
|
||||||
|
insertInCommandAndReplyMap(plpcdu::READ_CMD, 2, &adcSet);
|
||||||
|
insertInCommandAndReplyMap(plpcdu::READ_TEMP, 1, &adcSet);
|
||||||
|
insertInCommandAndReplyMap(plpcdu::READ_WITH_TEMP, 1, &adcSet);
|
||||||
|
insertInCommandAndReplyMap(plpcdu::SETUP_CMD, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||||
|
const uint8_t* commandData,
|
||||||
|
size_t commandDataLen) {
|
||||||
|
switch (deviceCommand) {
|
||||||
|
case (plpcdu::SETUP_CMD): {
|
||||||
|
cmdBuf[0] = plpcdu::SETUP_BYTE;
|
||||||
|
rawPacket = cmdBuf.data();
|
||||||
|
rawPacketLen = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (plpcdu::READ_CMD): {
|
||||||
|
max1227::prepareExternallyClockedRead0ToN(cmdBuf.data(), plpcdu::CHANNEL_N, rawPacketLen);
|
||||||
|
rawPacket = cmdBuf.data();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (plpcdu::READ_TEMP): {
|
||||||
|
max1227::prepareExternallyClockedTemperatureRead(cmdBuf.data(), rawPacketLen);
|
||||||
|
rawPacket = cmdBuf.data();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (plpcdu::READ_WITH_TEMP): {
|
||||||
|
size_t sz = 0;
|
||||||
|
max1227::prepareExternallyClockedRead0ToN(cmdBuf.data(), plpcdu::CHANNEL_N, sz);
|
||||||
|
max1227::prepareExternallyClockedTemperatureRead(cmdBuf.data() + sz, sz);
|
||||||
|
rawPacketLen = sz;
|
||||||
|
rawPacket = cmdBuf.data();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||||
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||||
|
// SPI is full duplex
|
||||||
|
*foundId = getPendingCommand();
|
||||||
|
*foundLen = remainingSize;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||||
|
const uint8_t* packet) {
|
||||||
|
using namespace plpcdu;
|
||||||
|
switch (id) {
|
||||||
|
case (SETUP_CMD): {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (READ_TEMP): {
|
||||||
|
uint8_t tempStartIdx = TEMP_REPLY_SIZE - 2;
|
||||||
|
adcSet.tempC.value =
|
||||||
|
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (READ_CMD): {
|
||||||
|
PoolReadGuard pg(&adcSet);
|
||||||
|
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return pg.getReadResult();
|
||||||
|
}
|
||||||
|
handleExtConvRead(packet);
|
||||||
|
handlePrintout();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (READ_WITH_TEMP): {
|
||||||
|
PoolReadGuard pg(&adcSet);
|
||||||
|
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return pg.getReadResult();
|
||||||
|
}
|
||||||
|
handleExtConvRead(packet);
|
||||||
|
uint8_t tempStartIdx = ADC_REPLY_SIZE + TEMP_REPLY_SIZE - 2;
|
||||||
|
adcSet.tempC.value =
|
||||||
|
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
||||||
|
handlePrintout();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||||
|
// 20 minutes transition delay is allowed
|
||||||
|
return 20 * 60 * 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
|
LocalDataPoolManager& poolManager) {
|
||||||
|
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::CHANNEL_VEC, &channelValues);
|
||||||
|
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, &tempC);
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::setToGoToNormalModeImmediately(bool enable) {
|
||||||
|
this->goToNormalMode = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::handleExtConvRead(const uint8_t* bufStart) {
|
||||||
|
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||||
|
adcSet.channels[idx] = bufStart[idx * 2 + 1] << 8 | bufStart[idx * 2 + 2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::handlePrintout() {
|
||||||
|
if (periodicPrintout) {
|
||||||
|
if (opDivider.checkAndIncrement()) {
|
||||||
|
sif::info << "PL PCDU ADC hex [" << std::hex << std::setw(4);
|
||||||
|
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||||
|
sif::info << std::setfill('0') << adcSet.channels[idx];
|
||||||
|
if (idx < 11) {
|
||||||
|
sif::info << ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sif::info << "] | T[C] " << std::dec << adcSet.tempC.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::enablePeriodicPrintout(bool enable, uint8_t divider) {
|
||||||
|
this->periodicPrintout = enable;
|
||||||
|
opDivider.setDivider(divider);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::stateMachineToNormal() {
|
||||||
|
if (adcState == AdcStates::BOOT_DELAY) {
|
||||||
|
if (adcCountdown.hasTimedOut()) {
|
||||||
|
adcState = AdcStates::SEND_SETUP;
|
||||||
|
adcCmdExecuted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (adcState == AdcStates::SEND_SETUP) {
|
||||||
|
if (adcCmdExecuted) {
|
||||||
|
adcState = AdcStates::NORMAL;
|
||||||
|
setMode(MODE_NORMAL, plpcdu::NORMAL_ADC_ONLY);
|
||||||
|
adcCmdExecuted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (submode == plpcdu::NORMAL_ALL_ON) {
|
||||||
if (state == States::ON_TRANS_ADC_CLOSE_ZERO) {
|
if (state == States::ON_TRANS_ADC_CLOSE_ZERO) {
|
||||||
if (not commandExecuted) {
|
if (not commandExecuted) {
|
||||||
countdown.resetTimer();
|
countdown.resetTimer();
|
||||||
@ -128,7 +296,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
// ADC values are ok, 5 seconds have elapsed
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
if (transitionOk and countdown.hasTimedOut()) {
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
state = States::PCDU_ON;
|
state = States::PCDU_ON;
|
||||||
setMode(MODE_NORMAL);
|
setMode(MODE_NORMAL, plpcdu::NORMAL_ALL_ON);
|
||||||
countdown.resetTimer();
|
countdown.resetTimer();
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
transitionOk = false;
|
transitionOk = false;
|
||||||
@ -136,137 +304,3 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PayloadPcduHandler::doShutDown() {}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
|
||||||
switch (adcState) {
|
|
||||||
case (AdcStates::SEND_SETUP): {
|
|
||||||
*id = plpcdu::SETUP_CMD;
|
|
||||||
buildCommandFromCommand(*id, nullptr, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (AdcStates::NORMAL): {
|
|
||||||
*id = plpcdu::READ_WITH_TEMP;
|
|
||||||
buildCommandFromCommand(*id, nullptr, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NOTHING_TO_SEND;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
|
||||||
if (adcState == AdcStates::SEND_SETUP) {
|
|
||||||
*id = plpcdu::SETUP_CMD;
|
|
||||||
buildCommandFromCommand(*id, nullptr, 0);
|
|
||||||
}
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PayloadPcduHandler::fillCommandAndReplyMap() {
|
|
||||||
insertInCommandAndReplyMap(plpcdu::READ_CMD, 2, &adcSet);
|
|
||||||
insertInCommandAndReplyMap(plpcdu::READ_TEMP, 1, &adcSet);
|
|
||||||
insertInCommandAndReplyMap(plpcdu::READ_WITH_TEMP, 1, &adcSet);
|
|
||||||
insertInCommandAndReplyMap(plpcdu::SETUP_CMD, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
|
||||||
const uint8_t* commandData,
|
|
||||||
size_t commandDataLen) {
|
|
||||||
switch (deviceCommand) {
|
|
||||||
case (plpcdu::SETUP_CMD): {
|
|
||||||
cmdBuf[0] = plpcdu::SETUP_BYTE;
|
|
||||||
rawPacket = cmdBuf.data();
|
|
||||||
rawPacketLen = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (plpcdu::READ_CMD): {
|
|
||||||
max1227::prepareExternallyClockedRead0ToN(cmdBuf.data(), plpcdu::CHANNEL_N, rawPacketLen);
|
|
||||||
rawPacket = cmdBuf.data();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (plpcdu::READ_TEMP): {
|
|
||||||
max1227::prepareExternallyClockedTemperatureRead(cmdBuf.data(), rawPacketLen);
|
|
||||||
rawPacket = cmdBuf.data();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (plpcdu::READ_WITH_TEMP): {
|
|
||||||
size_t sz = 0;
|
|
||||||
max1227::prepareExternallyClockedRead0ToN(cmdBuf.data(), plpcdu::CHANNEL_N, sz);
|
|
||||||
max1227::prepareExternallyClockedTemperatureRead(cmdBuf.data() + sz, sz);
|
|
||||||
rawPacketLen = sz;
|
|
||||||
rawPacket = cmdBuf.data();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
|
||||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
|
||||||
// SPI is full duplex
|
|
||||||
*foundId = getPendingCommand();
|
|
||||||
*foundLen = remainingSize;
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|
||||||
const uint8_t* packet) {
|
|
||||||
using namespace plpcdu;
|
|
||||||
switch (id) {
|
|
||||||
case (SETUP_CMD): {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (READ_TEMP): {
|
|
||||||
uint8_t tempStartIdx = TEMP_REPLY_SIZE - 2;
|
|
||||||
adcSet.tempC.value =
|
|
||||||
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (READ_CMD): {
|
|
||||||
PoolReadGuard pg(&adcSet);
|
|
||||||
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return pg.getReadResult();
|
|
||||||
}
|
|
||||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
|
||||||
adcSet.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (READ_WITH_TEMP): {
|
|
||||||
PoolReadGuard pg(&adcSet);
|
|
||||||
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return pg.getReadResult();
|
|
||||||
}
|
|
||||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
|
||||||
adcSet.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2];
|
|
||||||
}
|
|
||||||
uint8_t tempStartIdx = ADC_REPLY_SIZE + TEMP_REPLY_SIZE - 2;
|
|
||||||
adcSet.tempC.value =
|
|
||||||
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
|
||||||
// 20 minutes transition delay is allowed
|
|
||||||
return 20 * 60 * 60;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
||||||
LocalDataPoolManager& poolManager) {
|
|
||||||
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::CHANNEL_VEC, &channelValues);
|
|
||||||
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, &tempC);
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PayloadPcduHandler::setToGoToNormalModeImmediately(bool enable) {
|
|
||||||
this->goToNormalMode = enable;
|
|
||||||
}
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define LINUX_DEVICES_PLPCDUHANDLER_H_
|
#define LINUX_DEVICES_PLPCDUHANDLER_H_
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
|
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||||
#include <fsfw/timemanager/Countdown.h>
|
#include <fsfw/timemanager/Countdown.h>
|
||||||
|
|
||||||
#include "devicedefinitions/payloadPcduDefinitions.h"
|
#include "devicedefinitions/payloadPcduDefinitions.h"
|
||||||
@ -21,11 +22,13 @@
|
|||||||
* - MPA - Medium Power Amplifier
|
* - MPA - Medium Power Amplifier
|
||||||
* - HPA - High Power Amplifier
|
* - HPA - High Power Amplifier
|
||||||
*/
|
*/
|
||||||
class PayloadPcduHandler : DeviceHandlerBase {
|
class PayloadPcduHandler : public DeviceHandlerBase {
|
||||||
public:
|
public:
|
||||||
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF);
|
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF,
|
||||||
|
bool periodicPrintout);
|
||||||
|
|
||||||
void setToGoToNormalModeImmediately(bool enable);
|
void setToGoToNormalModeImmediately(bool enable);
|
||||||
|
void enablePeriodicPrintout(bool enable, uint8_t divider);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class States {
|
enum class States {
|
||||||
@ -61,6 +64,8 @@ class PayloadPcduHandler : DeviceHandlerBase {
|
|||||||
bool transitionOk = false;
|
bool transitionOk = false;
|
||||||
bool commandExecuted = false;
|
bool commandExecuted = false;
|
||||||
bool adcCmdExecuted = false;
|
bool adcCmdExecuted = false;
|
||||||
|
bool periodicPrintout = false;
|
||||||
|
PeriodicOperationDivider opDivider = PeriodicOperationDivider(5);
|
||||||
uint8_t tempReadDivisor = 1;
|
uint8_t tempReadDivisor = 1;
|
||||||
Countdown countdown = Countdown(5000);
|
Countdown countdown = Countdown(5000);
|
||||||
Countdown adcCountdown = Countdown(50);
|
Countdown adcCountdown = Countdown(50);
|
||||||
@ -83,6 +88,10 @@ class PayloadPcduHandler : DeviceHandlerBase {
|
|||||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) override;
|
LocalDataPoolManager& poolManager) override;
|
||||||
|
|
||||||
|
void handleExtConvRead(const uint8_t* bufStart);
|
||||||
|
void handlePrintout();
|
||||||
|
void stateMachineToNormal();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* LINUX_DEVICES_PLPCDUHANDLER_H_ */
|
#endif /* LINUX_DEVICES_PLPCDUHANDLER_H_ */
|
||||||
|
@ -21,6 +21,9 @@ static constexpr DeviceCommandId_t SETUP_CMD = 1;
|
|||||||
static constexpr DeviceCommandId_t READ_TEMP = 2;
|
static constexpr DeviceCommandId_t READ_TEMP = 2;
|
||||||
static constexpr DeviceCommandId_t READ_WITH_TEMP = 3;
|
static constexpr DeviceCommandId_t READ_WITH_TEMP = 3;
|
||||||
|
|
||||||
|
static constexpr Submode_t NORMAL_ADC_ONLY = 0;
|
||||||
|
static constexpr Submode_t NORMAL_ALL_ON = 1;
|
||||||
|
|
||||||
// 12 ADC values * 2 + trailing zero
|
// 12 ADC values * 2 + trailing zero
|
||||||
static constexpr size_t ADC_REPLY_SIZE = 25;
|
static constexpr size_t ADC_REPLY_SIZE = 25;
|
||||||
// Conversion byte + 24 * zero
|
// Conversion byte + 24 * zero
|
||||||
|
Loading…
Reference in New Issue
Block a user