open gpio by label test on te0720
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;
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user