diff --git a/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp b/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp index 051be344..d1fdd1e5 100644 --- a/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp +++ b/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp @@ -4,7 +4,7 @@ #include "fsfw_hal/stm32h7/spi/spiDefinitions.h" #include "fsfw_hal/stm32h7/spi/spiCore.h" #include "fsfw_hal/stm32h7/spi/spiInterrupts.h" -#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h" +#include "fsfw_hal/stm32h7/spi/stm32h743zi.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/serviceinterface/ServiceInterface.h" @@ -33,20 +33,20 @@ GyroL3GD20H::GyroL3GD20H(SPI_HandleTypeDef *spiHandle, spi::TransferModes transf mspCfg = new spi::MspDmaConfigStruct(); auto typedCfg = dynamic_cast(mspCfg); spi::setDmaHandles(txDmaHandle, rxDmaHandle); - spi::h743zi::standardDmaCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS, + stm32h7::h743zi::standardDmaCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS, IrqPriorities::HIGHEST_FREERTOS, IrqPriorities::HIGHEST_FREERTOS); spi::setSpiDmaMspFunctions(typedCfg); } else if(transferMode == spi::TransferModes::INTERRUPT) { mspCfg = new spi::MspIrqConfigStruct(); auto typedCfg = dynamic_cast(mspCfg); - spi::h743zi::standardInterruptCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS); + stm32h7::h743zi::standardInterruptCfg(*typedCfg, IrqPriorities::HIGHEST_FREERTOS); spi::setSpiIrqMspFunctions(typedCfg); } else if(transferMode == spi::TransferModes::POLLING) { mspCfg = new spi::MspPollingConfigStruct(); auto typedCfg = dynamic_cast(mspCfg); - spi::h743zi::standardPollingCfg(*typedCfg); + stm32h7::h743zi::standardPollingCfg(*typedCfg); spi::setSpiPollingMspFunctions(typedCfg); } diff --git a/hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt index e28c35aa..aa5541bc 100644 --- a/hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt +++ b/hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt @@ -5,5 +5,5 @@ target_sources(${LIB_FSFW_NAME} PRIVATE mspInit.cpp SpiCookie.cpp SpiComIF.cpp - stm32h743ziSpi.cpp + stm32h743zi.cpp ) diff --git a/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp b/hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.cpp similarity index 88% rename from hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp rename to hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.cpp index 8247d002..1bafccd5 100644 --- a/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.cpp @@ -1,4 +1,4 @@ -#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h" +#include "fsfw_hal/stm32h7/spi/stm32h743zi.h" #include "fsfw_hal/stm32h7/spi/spiCore.h" #include "fsfw_hal/stm32h7/spi/spiInterrupts.h" @@ -22,7 +22,7 @@ void spiDmaClockEnableWrapper() { __HAL_RCC_DMA2_CLK_ENABLE(); } -void spi::h743zi::standardPollingCfg(MspPollingConfigStruct& cfg) { +void stm32h7::h743zi::standardPollingCfg(spi::MspPollingConfigStruct& cfg) { cfg.setupCb = &spiSetupWrapper; cfg.cleanupCb = &spiCleanUpWrapper; cfg.sck.port = GPIOA; @@ -36,13 +36,13 @@ void spi::h743zi::standardPollingCfg(MspPollingConfigStruct& cfg) { cfg.miso.altFnc = GPIO_AF5_SPI1; } -void spi::h743zi::standardInterruptCfg(MspIrqConfigStruct& cfg, IrqPriorities spiIrqPrio, +void stm32h7::h743zi::standardInterruptCfg(spi::MspIrqConfigStruct& cfg, IrqPriorities spiIrqPrio, IrqPriorities spiSubprio) { // High, but works on FreeRTOS as well (priorities range from 0 to 15) cfg.preEmptPriority = spiIrqPrio; cfg.subpriority = spiSubprio; cfg.spiIrqNumber = SPI1_IRQn; - cfg.spiBus = SpiBus::SPI_1; + cfg.spiBus = spi::SpiBus::SPI_1; user_handler_t spiUserHandler = nullptr; user_args_t spiUserArgs = nullptr; getSpiUserHandler(spi::SpiBus::SPI_1, &spiUserHandler, &spiUserArgs); @@ -55,7 +55,7 @@ void spi::h743zi::standardInterruptCfg(MspIrqConfigStruct& cfg, IrqPriorities sp standardPollingCfg(cfg); } -void spi::h743zi::standardDmaCfg(MspDmaConfigStruct& cfg, IrqPriorities spiIrqPrio, +void stm32h7::h743zi::standardDmaCfg(spi::MspDmaConfigStruct& cfg, IrqPriorities spiIrqPrio, IrqPriorities txIrqPrio, IrqPriorities rxIrqPrio, IrqPriorities spiSubprio, IrqPriorities txSubprio, IrqPriorities rxSubprio) { cfg.dmaClkEnableWrapper = &spiDmaClockEnableWrapper; diff --git a/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.h b/hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.h similarity index 64% rename from hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.h rename to hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.h index 87689add..daa95554 100644 --- a/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.h +++ b/hal/src/fsfw_hal/stm32h7/spi/stm32h743zi.h @@ -3,21 +3,20 @@ #include "mspInit.h" -namespace spi { +namespace stm32h7 { namespace h743zi { -void standardPollingCfg(MspPollingConfigStruct& cfg); -void standardInterruptCfg(MspIrqConfigStruct& cfg, IrqPriorities spiIrqPrio, +void standardPollingCfg(spi::MspPollingConfigStruct& cfg); +void standardInterruptCfg(spi::MspIrqConfigStruct& cfg, IrqPriorities spiIrqPrio, IrqPriorities spiSubprio = HIGHEST); -void standardDmaCfg(MspDmaConfigStruct& cfg, IrqPriorities spiIrqPrio, +void standardDmaCfg(spi::MspDmaConfigStruct& cfg, IrqPriorities spiIrqPrio, IrqPriorities txIrqPrio, IrqPriorities rxIrqPrio, IrqPriorities spiSubprio = HIGHEST, IrqPriorities txSubPrio = HIGHEST, IrqPriorities rxSubprio = HIGHEST); + } } - - #endif /* FSFW_HAL_STM32H7_SPI_STM32H743ZISPI_H_ */