device handler partly working
This commit is contained in:
parent
5cbe18caa6
commit
5717a83e9e
@ -24,11 +24,6 @@
|
|||||||
#include "fsfw_hal/stm32h7/spi/SpiComIF.h"
|
#include "fsfw_hal/stm32h7/spi/SpiComIF.h"
|
||||||
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
||||||
|
|
||||||
namespace spi {
|
|
||||||
SPI_TypeDef spiDriver = {};
|
|
||||||
SPI_HandleTypeDef spiHandle = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args) {
|
void ObjectFactory::produce(void* args) {
|
||||||
@ -70,9 +65,8 @@ void ObjectFactory::produce(void* args) {
|
|||||||
|
|
||||||
#if OBSW_PERFORM_L3GD20H_TEST == 1
|
#if OBSW_PERFORM_L3GD20H_TEST == 1
|
||||||
|
|
||||||
new SpiComIF(objects::SPI_COM_IF, &spi::spiDriver, &spi::spiHandle,
|
new SpiComIF(objects::SPI_COM_IF, spi::TransferModes::POLLING);
|
||||||
spi::TransferModes::POLLING);
|
auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, SPI1, 3900000, spi::SpiModes::MODE_3,
|
||||||
auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, 3900000, spi::SpiModes::MODE_3,
|
|
||||||
GPIO_PIN_14, GPIOD, 32);
|
GPIO_PIN_14, GPIOD, 32);
|
||||||
auto gyroDevice = new GyroHandlerL3GD20H(objects::SPI_DEVICE_TEST, objects::SPI_COM_IF,
|
auto gyroDevice = new GyroHandlerL3GD20H(objects::SPI_DEVICE_TEST, objects::SPI_COM_IF,
|
||||||
spiCookie);
|
spiCookie);
|
||||||
|
@ -22,13 +22,17 @@ ReturnValue_t STM32TestTask::performPeriodicAction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t STM32TestTask::performOneShotAction() {
|
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;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void STM32TestTask::performSpiL3gd20hTest() {
|
void STM32TestTask::performSpiL3gd20hTest() {
|
||||||
SPI_HandleTypeDef spiHandle = {};
|
SPI_HandleTypeDef spiHandle = {};
|
||||||
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::DMA);
|
GyroL3GD20H gyroDevice(&spiHandle, spi::TransferModes::POLLING);
|
||||||
gyroDevice.initialize();
|
gyroDevice.initialize();
|
||||||
gyroDevice.performOperation();
|
gyroDevice.performOperation();
|
||||||
}
|
}
|
||||||
|
2
fsfw_hal
2
fsfw_hal
@ -1 +1 @@
|
|||||||
Subproject commit 04166f87d82f3729b4462437677bae9105c1c88e
|
Subproject commit 5c40ca9ae85b59fd1f19115e2d02bae6df03dde7
|
Reference in New Issue
Block a user