L3DG20H device handler tested
This commit is contained in:
@ -3,8 +3,6 @@
|
||||
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/OBSWConfig.h>
|
||||
#include <fsfwconfig/pollingsequence/PollingSequenceFactory.h>
|
||||
|
||||
#include <mission/utility/InitMission.h>
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
@ -14,6 +12,7 @@
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <fsfwconfig/pollingsequence/pollingSequenceFactory.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,23 +1,25 @@
|
||||
#include "ObjectFactory.h"
|
||||
#include <bsp_rpi/gpio/GPIORPi.h>
|
||||
|
||||
#include <objects/systemObjectList.h>
|
||||
#include <devices/addresses.h>
|
||||
#include <devices/gpioIds.h>
|
||||
#include <OBSWConfig.h>
|
||||
#include <tmtc/apid.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/devices/addresses.h>
|
||||
#include <fsfwconfig/devices/gpioIds.h>
|
||||
#include <fsfwconfig/OBSWConfig.h>
|
||||
#include <fsfwconfig/tmtc/apid.h>
|
||||
#include <fsfwconfig/tmtc/pusIds.h>
|
||||
#include <fsfwconfig/devices/spi.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 <linux/spi/SpiComIF.h>
|
||||
|
||||
#include <mission/core/GenericFactory.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <mission/devices/MGMHandlerLIS3MDL.h>
|
||||
#include <mission/devices/MGMHandlerRM3100.h>
|
||||
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
@ -26,8 +28,8 @@
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <linux/spi/SpiComIF.h>
|
||||
#include <mission/devices/MGMHandlerRM3100.h>
|
||||
#include <mission/devices/GyroL3GD20Handler.h>
|
||||
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
@ -99,16 +101,23 @@ void ObjectFactory::produce(){
|
||||
gpioIF->addGpios(gpioCookieAcsBoard);
|
||||
|
||||
std::string spiDev = "/dev/spidev0.0";
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, 24,
|
||||
spi::SpiMode::MODE_3, 3'900'000);
|
||||
SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
|
||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, 16,
|
||||
spi::SpiMode::MODE_3, 976'000);
|
||||
|
||||
spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
|
||||
objects::SPI_COM_IF, spiCookie);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
|
||||
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev,
|
||||
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
||||
spiCookie);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
|
||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
||||
}
|
||||
|
@ -7,8 +7,8 @@
|
||||
#define RPI_LOOPBACK_TEST_GPIO 0
|
||||
|
||||
/* Only one of those 2 should be enabled! */
|
||||
#define RPI_ADD_SPI_TEST 1
|
||||
#define RPI_TEST_ACS_BOARD 0
|
||||
#define RPI_ADD_SPI_TEST 0
|
||||
#define RPI_TEST_ACS_BOARD 1
|
||||
|
||||
/* Adapt these values accordingly */
|
||||
namespace gpio {
|
||||
|
Reference in New Issue
Block a user