Merge remote-tracking branch 'origin/develop' into mueller/master
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -15,7 +15,7 @@ LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
|
||||
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
|
||||
}
|
||||
gpioInterface->addGpios(gpioCookie);
|
||||
testCase = TestCases::LOOPBACK;
|
||||
testCase = TestCases::BLINK;
|
||||
}
|
||||
|
||||
LibgpiodTest::~LibgpiodTest() {
|
||||
@ -29,7 +29,7 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
||||
case(TestCases::READ): {
|
||||
result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||
<< std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
@ -42,6 +42,38 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
|
||||
case(TestCases::LOOPBACK): {
|
||||
break;
|
||||
}
|
||||
case(TestCases::BLINK): {
|
||||
result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
|
||||
<< std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
if (gpioState == 1) {
|
||||
result = gpioInterface->pullLow(gpioIds::TEST_ID_0);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO low!"
|
||||
<< std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
else if (gpioState == 0) {
|
||||
result = gpioInterface->pullHigh(gpioIds::TEST_ID_0);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO high!"
|
||||
<< std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sif::warning << "LibgpiodTest::performPeriodicAction: Invalid GPIO state" << std::endl;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sif::debug << "LibgpiodTest::performPeriodicAction: Invalid test case" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +88,9 @@ ReturnValue_t LibgpiodTest::performOneShotAction() {
|
||||
case(TestCases::READ): {
|
||||
break;
|
||||
}
|
||||
case(TestCases::BLINK): {
|
||||
break;
|
||||
}
|
||||
case(TestCases::LOOPBACK): {
|
||||
result = gpioInterface->pullHigh(gpioIds::TEST_ID_0);
|
||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
||||
|
@ -14,7 +14,8 @@ class LibgpiodTest: public TestTask {
|
||||
public:
|
||||
enum TestCases {
|
||||
READ = 0,
|
||||
LOOPBACK = 1
|
||||
LOOPBACK = 1,
|
||||
BLINK
|
||||
};
|
||||
|
||||
TestCases testCase;
|
||||
|
@ -299,7 +299,7 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) {
|
||||
void SpiTestClass::acsInit() {
|
||||
GpioCookie* gpioCookie = new GpioCookie();
|
||||
GpiodRegular* gpio = nullptr;
|
||||
#ifdef RASPBERRY_PI
|
||||
#ifdef RASPBERRY_PI
|
||||
std::string rpiGpioName = "gpiochip0";
|
||||
gpio = new GpiodRegular(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3",
|
||||
gpio::Direction::OUT, 1);
|
||||
@ -328,43 +328,43 @@ void SpiTestClass::acsInit() {
|
||||
gpio = new GpiodRegular(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100",
|
||||
gpio::Direction::OUT, 1);
|
||||
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
|
||||
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm0Lis3mdlChipSelect,
|
||||
"MGM_0_LIS3", gpio::Direction::OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegular("MGM_0_LIS3", gpio::Direction::OUT, gpio::HIGH,
|
||||
q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm0Lis3mdlChipSelect);
|
||||
gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
||||
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm1Rm3100ChipSelect,
|
||||
"MGM_1_RM3100", gpio::Direction::OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegular("MGM_1_RM3100", gpio::Direction::OUT, gpio::HIGH,
|
||||
q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm1Rm3100ChipSelect);
|
||||
gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
||||
gpio = new GpiodRegular(q7s::GPIO_MGM2_LIS3_CHIP, mgm2Lis3mdlChipSelect,
|
||||
"MGM_2_LIS3", gpio::Direction::OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegular("MGM_2_LIS3", gpio::Direction::OUT, gpio::HIGH, q7s::GPIO_MGM2_LIS3_LABEL,
|
||||
mgm2Lis3mdlChipSelect);
|
||||
gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
||||
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, mgm3Rm3100ChipSelect,
|
||||
"MGM_3_RM3100", gpio::Direction::OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegular("MGM_3_RM3100", gpio::Direction::OUT, gpio::HIGH,
|
||||
q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm3Rm3100ChipSelect);
|
||||
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);
|
||||
gpio = new GpiodRegular("GYRO_0_ADIS", gpio::Direction::OUT, gpio::HIGH, q7s::GPIO_GYRO_ADIS_LABEL,
|
||||
gyro0AdisChipSelect);
|
||||
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);
|
||||
gpio = new GpiodRegular("GYRO_1_L3G", gpio::Direction::OUT, gpio::HIGH,
|
||||
q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, gyro1L3gd20ChipSelect);
|
||||
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);
|
||||
gpio = new GpiodRegular("GYRO_2_ADIS", gpio::Direction::OUT, gpio::HIGH, q7s::GPIO_GYRO_ADIS_LABEL,
|
||||
gyro2AdisChipSelect);
|
||||
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);
|
||||
gpio = new GpiodRegular("GYRO_3_L3G", gpio::Direction::OUT, gpio::HIGH,
|
||||
q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, gyro3L3gd20ChipSelect);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, 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);
|
||||
gpio = new GpiodRegular("GYRO_0_ENABLE", gpio::OUT, gpio::LOW, q7s::GPIO_FLEX_OBC1F_B0,
|
||||
q7s::GPIO_GYRO_0_ENABLE);
|
||||
gpioCookie->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);
|
||||
gpio = new GpiodRegular("GYRO_2_ENABLE", gpio::OUT, gpio::LOW, q7s::GPIO_3V3_OBC1C,
|
||||
q7s::GPIO_GYRO_2_ENABLE);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_2_ENABLE, gpio);
|
||||
#endif
|
||||
if(gpioIF != nullptr) {
|
||||
#endif
|
||||
if (gpioIF != nullptr) {
|
||||
gpioIF->addGpios(gpioCookie);
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ debugging. */
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_TEST_CODE 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
#define OBSW_ADD_TEST_PST 0
|
||||
#define OBSW_ADD_TEST_TASK 0
|
||||
@ -59,6 +59,7 @@ debugging. */
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_LABEL 0
|
||||
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
|
@ -425,20 +425,20 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
bool enableAside = false;
|
||||
bool enableBside = true;
|
||||
bool enableAside = true;
|
||||
bool enableBside = false;
|
||||
if(enableAside) {
|
||||
// A side
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.4,
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.8,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0,
|
||||
// DeviceHandlerIF::PERFORM_OPERATION);
|
||||
// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2,
|
||||
// DeviceHandlerIF::SEND_WRITE);
|
||||
// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.4,
|
||||
// DeviceHandlerIF::GET_WRITE);
|
||||
// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6,
|
||||
// DeviceHandlerIF::SEND_READ);
|
||||
// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
@ -462,16 +462,16 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4,
|
||||
DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6,
|
||||
DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8,
|
||||
DeviceHandlerIF::GET_READ);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
|
||||
// DeviceHandlerIF::PERFORM_OPERATION);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2,
|
||||
// DeviceHandlerIF::SEND_WRITE);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4,
|
||||
// DeviceHandlerIF::GET_WRITE);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6,
|
||||
// DeviceHandlerIF::SEND_READ);
|
||||
// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8,
|
||||
// DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if(enableBside) {
|
||||
|
Reference in New Issue
Block a user