added link library gpiod
This commit is contained in:
parent
b75113b084
commit
7f969a47d6
@ -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
|
||||
}
|
||||
|
8
bsp_rpi/boardconfig/rpi_config.h
Normal file
8
bsp_rpi/boardconfig/rpi_config.h
Normal 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_ */
|
@ -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"
|
||||
|
@ -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): {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,10 @@ target_sources(${TARGET_NAME} PUBLIC
|
||||
LinuxLibgpioIF.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PUBLIC
|
||||
gpiod
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user