device handler partly working

This commit is contained in:
Robin Müller 2021-06-10 12:06:51 +02:00
parent 5cbe18caa6
commit 5717a83e9e
No known key found for this signature in database
GPG Key ID: BE6480244DFE612C
3 changed files with 9 additions and 11 deletions

View File

@ -24,11 +24,6 @@
#include "fsfw_hal/stm32h7/spi/SpiComIF.h"
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
namespace spi {
SPI_TypeDef spiDriver = {};
SPI_HandleTypeDef spiHandle = {};
}
#endif
void ObjectFactory::produce(void* args) {
@ -70,9 +65,8 @@ void ObjectFactory::produce(void* args) {
#if OBSW_PERFORM_L3GD20H_TEST == 1
new SpiComIF(objects::SPI_COM_IF, &spi::spiDriver, &spi::spiHandle,
spi::TransferModes::POLLING);
auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, 3900000, spi::SpiModes::MODE_3,
new SpiComIF(objects::SPI_COM_IF, spi::TransferModes::POLLING);
auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, SPI1, 3900000, spi::SpiModes::MODE_3,
GPIO_PIN_14, GPIOD, 32);
auto gyroDevice = new GyroHandlerL3GD20H(objects::SPI_DEVICE_TEST, objects::SPI_COM_IF,
spiCookie);

View File

@ -22,13 +22,17 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
}
ReturnValue_t STM32TestTask::performOneShotAction() {
// performSpiL3gd20hTest();
// Might be confusing but if this is defined to 1, the real device handler is tested and we
// should not mess with the SPI bus
#if OBSW_PERFORM_L3GD20H_TEST == 0
performSpiL3gd20hTest();
#endif
return HasReturnvaluesIF::RETURN_OK;
}
void STM32TestTask::performSpiL3gd20hTest() {
SPI_HandleTypeDef spiHandle = {};
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::DMA);
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::POLLING);
gyroDevice.initialize();
gyroDevice.performOperation();
}

@ -1 +1 @@
Subproject commit 04166f87d82f3729b4462437677bae9105c1c88e
Subproject commit 5c40ca9ae85b59fd1f19115e2d02bae6df03dde7