SPI update, Version bump #22

Merged
meierj merged 52 commits from mueller/spi-com-if-tested into develop 2021-03-04 18:23:43 +01:00
2 changed files with 26 additions and 8 deletions
Showing only changes of commit 86e527882c - Show all commits

View File

@ -13,6 +13,7 @@ LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl; sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl;
} }
gpioInterface->initialize(gpioCookie); gpioInterface->initialize(gpioCookie);
testCase = TestCases::READ;
} }
LibgpiodTest::~LibgpiodTest() { LibgpiodTest::~LibgpiodTest() {
@ -22,6 +23,8 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
int gpioState; int gpioState;
ReturnValue_t result; ReturnValue_t result;
switch(testCase) {
case(testCase == TestCases::READ): {
result = gpioInterface->readGpio(gpioIds::Test_ID, &gpioState); result = gpioInterface->readGpio(gpioIds::Test_ID, &gpioState);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio " sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
@ -32,6 +35,14 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState
<< std::endl; << std::endl;
} }
break;
}
case(testCase == TestCases::LOOPBACK): {
}
}
return RETURN_OK; return RETURN_OK;
} }

View File

@ -12,6 +12,13 @@
*/ */
class LibgpiodTest: public TestTask { class LibgpiodTest: public TestTask {
public: public:
enum TestCases {
READ = 0,
LOOPBACK = 1
};
TestCases testCase;
LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie); LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie);
virtual ~LibgpiodTest(); virtual ~LibgpiodTest();