added link library gpiod

This commit is contained in:
Robin Müller 2021-02-22 12:57:41 +01:00 committed by Robin Mueller
parent b75113b084
commit 7f969a47d6
5 changed files with 29 additions and 5 deletions

View File

@ -1,17 +1,20 @@
#include "ObjectFactory.h"
#include <bsp_rpi/boardtest/SpiTest.h>
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include <objects/systemObjectList.h>
#include <OBSWConfig.h>
#include <tmtc/apid.h>
#include <tmtc/pusIds.h>
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
#include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h>
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
#include <linux/boardtest/LibgpiodTest.h>
#include <linux/gpio/GpioCookie.h>
#include <linux/gpio/LinuxLibgpioIF.h>
#include <mission/core/GenericFactory.h>
#include <mission/utility/TmFunnel.h>
@ -45,4 +48,10 @@ void ObjectFactory::produce(){
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
new SpiTest(objects::SPI_TEST);
new LinuxLibgpioIF(objects::GPIO_IF);
#if RPI_TEST_GPIO == 1
GpioCookie* gpioCookie = new GpioCookie();
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
#endif
}

View File

@ -0,0 +1,8 @@
#ifndef BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
#define BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
#define RPI_TEST_GPIO 1
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */

View File

@ -6,6 +6,11 @@
#ifndef FSFWCONFIG_OBSWCONFIG_H_
#define FSFWCONFIG_OBSWCONFIG_H_
#ifdef RASPBERRY_PI
#include <rpi_config.h>
#endif
#include "OBSWVersion.h"
#define TEST_LIBGPIOD 0
/* These defines should be disabled for mission code but are useful for
@ -18,8 +23,6 @@ debugging. */
#define PDU1_DEBUG 0
#define PDU2_DEBUG 0
#include "OBSWVersion.h"
#ifdef __cplusplus
#include "objects/systemObjectList.h"

View File

@ -24,7 +24,7 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
ReturnValue_t result;
switch(testCase) {
case(testCase == TestCases::READ): {
case(TestCases::READ): {
result = gpioInterface->readGpio(gpioIds::Test_ID, &gpioState);
if (result != RETURN_OK) {
sif::debug << "LibgpiodTest::performPeriodicAction: Failed to read gpio "
@ -37,7 +37,7 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() {
}
break;
}
case(testCase == TestCases::LOOPBACK): {
case(TestCases::LOOPBACK): {
}
}

View File

@ -3,6 +3,10 @@ target_sources(${TARGET_NAME} PUBLIC
LinuxLibgpioIF.cpp
)
target_link_libraries(${TARGET_NAME} PUBLIC
gpiod
)