extended spi core

This commit is contained in:
2021-06-03 14:38:34 +02:00
parent dc6327b909
commit 21414c3594
4 changed files with 95 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#include "stm32h7xx_spi_dma_msp.h"
#include "spiConf.h"
#include "../spi/spiDefinitions.h"
#include "../spi/spiCore.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
@ -21,6 +22,7 @@ GyroL3GD20H::GyroL3GD20H(SPI_HandleTypeDef *spiHandle): spiHandle(spiHandle) {
ReturnValue_t GyroL3GD20H::initialize() {
// Configure the SPI peripheral
spiHandle->Instance = SPI1;
uint32_t test = HAL_RCC_GetHCLKFreq();
spiHandle->Init.BaudRatePrescaler = spi::getPrescaler(HAL_RCC_GetHCLKFreq(), 3900000);
spiHandle->Init.Direction = SPI_DIRECTION_2LINES;
spi::assignSpiMode(spi::SpiModes::MODE_3, spiHandle);