Added SpiComIF for the STM32H7. Only tested for the H743ZI board
Added L3GD20 device handler. Device handlers are generic, so we can add them here as well
Tested all 3 transfer modes: Polling, IRQ and DMA. All STM32H7 peripherals offer the same modes, so this ComIF will be an ideal base to implement other communication interfaces.
Only tested with one device
No GpioIF* which would allow custom callbacks. Not worth the effort as long as noone requires it explicitely.. Simple prototyping usually does not require complex decoding logic, SPI chip select are simply driven by dedicated GPIO pins
Bugfixes for the L3GD20H device, conversion was not exactly correct
No ugly macro magic necessary for complete MSP configuration, replaced by proper structs at the price of code size. MSP config struct is deleted automatically by the SpiComIF. Here is the example testing code:
This was a lot more work than expected..
- Added `SpiComIF` for the STM32H7. Only tested for the H743ZI board
- Added L3GD20 device handler. Device handlers are generic, so we can add them here as well
- Tested all 3 transfer modes: Polling, IRQ and DMA. All STM32H7 peripherals offer the same modes, so this ComIF will be an ideal base to implement other communication interfaces.
- Only tested with one device
- No GpioIF* which would allow custom callbacks. Not worth the effort as long as noone requires it explicitely.. Simple prototyping usually does not require complex decoding logic, SPI chip select are simply driven by dedicated GPIO pins
- Bugfixes for the L3GD20H device, conversion was not exactly correct
- No ugly macro magic necessary for complete MSP configuration, replaced by proper structs at the price of code size. MSP config struct is deleted automatically by the `SpiComIF`. Here is the example testing code:
```cpp
spi::MspCfgBase* mspCfg = nullptr;
spi::TransferModes transferMode = spi::TransferModes::DMA;
if(transferMode == spi::TransferModes::POLLING) {
auto typedCfg = new spi::MspPollingConfigStruct();
spi::h743zi::standardPollingCfg(*typedCfg);
mspCfg = typedCfg;
}
else if(transferMode == spi::TransferModes::INTERRUPT) {
auto typedCfg = new spi::MspIrqConfigStruct();
spi::h743zi::standardInterruptCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS);
mspCfg = typedCfg;
}
else if(transferMode == spi::TransferModes::DMA) {
auto typedCfg = new spi::MspDmaConfigStruct();
txHandle = new DMA_HandleTypeDef();
rxHandle = new DMA_HandleTypeDef();
spi::setDmaHandles(txHandle, rxHandle);
spi::h743zi::standardDmaCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS,
IrqPriorities::HIGHEST_FREERTOS, IrqPriorities::HIGHEST_FREERTOS);
mspCfg = typedCfg;
}
new SpiComIF(objects::SPI_COM_IF);
auto spiCookie = new SpiCookie(0, spi::SpiBus::SPI_1, transferMode, mspCfg, 3900000,
spi::SpiModes::MODE_3, GPIO_PIN_14, GPIOD, 32);
auto gyroDevice = new GyroHandlerL3GD20H(objects::SPI_DEVICE_TEST, objects::SPI_COM_IF,
spiCookie);
gyroDevice->setStartUpImmediately();
gyroDevice->setGoNormalModeAtStartup();
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This was a lot more work than expected..
SpiComIFfor the STM32H7. Only tested for the H743ZI boardSpiComIF. Here is the example testing code: