Merge branch 'mueller/master' into meier/max13865pt1000Handler
This commit is contained in:
@ -1,26 +1,4 @@
|
||||
#include "ObjectFactory.h"
|
||||
#include <bsp_rpi/gpio/GPIORPi.h>
|
||||
<<<<<<< HEAD
|
||||
|
||||
#include <objects/systemObjectList.h>
|
||||
#include <devices/addresses.h>
|
||||
#include <devices/gpioIds.h>
|
||||
#include <OBSWConfig.h>
|
||||
#include <tmtc/apid.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include <linux/boardtest/LibgpiodTest.h>
|
||||
#include <linux/boardtest/SpiTestClass.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
#include <linux/spi/SpiCookie.h>
|
||||
|
||||
#include <mission/core/GenericFactory.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <mission/devices/MGMHandlerLIS3MDL.h>
|
||||
|
||||
=======
|
||||
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/devices/addresses.h>
|
||||
@ -32,30 +10,28 @@
|
||||
|
||||
#include <linux/boardtest/LibgpiodTest.h>
|
||||
#include <linux/boardtest/SpiTestClass.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <linux/spi/SpiCookie.h>
|
||||
#include <linux/spi/SpiComIF.h>
|
||||
|
||||
#include <mission/devices/GyroL3GD20Handler.h>
|
||||
#include <mission/core/GenericFactory.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <mission/devices/MGMHandlerLIS3MDL.h>
|
||||
#include <mission/devices/MGMHandlerRM3100.h>
|
||||
|
||||
>>>>>>> develop
|
||||
#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 <fsfw/tasks/TaskFactory.h>
|
||||
<<<<<<< HEAD
|
||||
#include <linux/spi/SpiComIF.h>
|
||||
=======
|
||||
#include <mission/devices/GyroL3GD20Handler.h>
|
||||
|
||||
>>>>>>> develop
|
||||
/* UDP server includes */
|
||||
#include <fsfw/osal/common/UdpTmTcBridge.h>
|
||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <fsfw_hal/linux/rpi/GpioRPi.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
@ -80,10 +56,10 @@ void ObjectFactory::produce(){
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
||||
new UdpTmTcBridge(objects::UDP_BRIDGE,
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR,
|
||||
objects::TM_STORE, objects::TC_STORE);
|
||||
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||
new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||
|
||||
GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF);
|
||||
|
||||
@ -125,14 +101,6 @@ void ObjectFactory::produce(){
|
||||
gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::GYRO_2_L3G_CS, gpio::GYRO_2_BCM_PIN,
|
||||
"GYRO_2_L3G", gpio::Direction::OUT, 1);
|
||||
gpioIF->addGpios(gpioCookieAcsBoard);
|
||||
<<<<<<< HEAD
|
||||
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3,
|
||||
gpioIds::MGM_0_LIS3_CS, "/dev/spidev0.0", 24, spi::SpiMode::MODE_3, 3'900'000);
|
||||
auto mgmHandler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmHandler->setStartUpImmediately();
|
||||
=======
|
||||
|
||||
std::string spiDev = "/dev/spidev0.0";
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
@ -152,7 +120,6 @@ void ObjectFactory::produce(){
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
>>>>>>> develop
|
||||
|
||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
GPIORPi.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
#include "GPIORPi.h"
|
||||
#include <FSFWConfig.h>
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
|
||||
ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin,
|
||||
std::string consumer, gpio::Direction direction, int initValue) {
|
||||
if(cookie == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
GpiodRegular config;
|
||||
/* Default chipname for Raspberry Pi. There is still gpiochip1 for expansion, but most users
|
||||
will not need this */
|
||||
config.chipname = "gpiochip0";
|
||||
|
||||
config.consumer = consumer;
|
||||
config.direction = direction;
|
||||
config.initValue = initValue;
|
||||
|
||||
/* Sanity check for the BCM pins before assigning it */
|
||||
if(bcmPin > 27) {
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "createRpiGpioConfig: BCM pin " << bcmPin << " invalid!" << std::endl;
|
||||
#else
|
||||
sif::printError("createRpiGpioConfig: BCM pin %d invalid!\n", bcmPin);
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
config.lineNum = bcmPin;
|
||||
cookie->addGpio(gpioId, config);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#ifndef BSP_RPI_GPIO_GPIORPI_H_
|
||||
#define BSP_RPI_GPIO_GPIORPI_H_
|
||||
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <linux/gpio/gpioDefinitions.h>
|
||||
|
||||
class GpioCookie;
|
||||
|
||||
namespace gpio {
|
||||
|
||||
/**
|
||||
* Create a GpioConfig_t. This function does a sanity check on the BCM pin number and fails if the
|
||||
* BCM pin is invalid.
|
||||
* @param cookie Adds the configuration to this cookie directly
|
||||
* @param gpioId ID which identifies the GPIO configuration
|
||||
* @param bcmPin Raspberry Pi BCM pin
|
||||
* @param consumer Information string
|
||||
* @param direction GPIO direction
|
||||
* @param initValue Intial value for output pins, 0 for low, 1 for high
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin,
|
||||
std::string consumer, gpio::Direction direction, int initValue);
|
||||
}
|
||||
|
||||
#endif /* BSP_RPI_GPIO_GPIORPI_H_ */
|
Reference in New Issue
Block a user