Changes to enable SPI4, SPI5 and SPI6

This commit is contained in:
pchmura4 2024-02-26 19:17:07 +01:00 committed by rusefillc
parent 8bd5e5c6f5
commit 881a8905d4
4 changed files with 21 additions and 6 deletions

View File

@ -346,6 +346,7 @@ typedef enum __attribute__ ((__packed__)) {
SPI_DEVICE_4 = 4,
// we seem to have zero SPI5 code
SPI_DEVICE_5 = 5,
SPI_DEVICE_6 = 6,
} spi_device_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -102,6 +102,12 @@ static void initSpiModules() {
if (engineConfiguration->is_enabled_spi_4) {
turnOnSpi(SPI_DEVICE_4);
}
if (engineConfiguration->is_enabled_spi_5) {
turnOnSpi(SPI_DEVICE_5);
}
if (engineConfiguration->is_enabled_spi_6) {
turnOnSpi(SPI_DEVICE_6);
}
}
/**
@ -285,6 +291,14 @@ void applyNewHardwareSettings() {
stopSpi(SPI_DEVICE_4);
}
if (isConfigurationChanged(is_enabled_spi_5)) {
stopSpi(SPI_DEVICE_5);
}
if (isConfigurationChanged(is_enabled_spi_6)) {
stopSpi(SPI_DEVICE_6);
}
if (isPinOrModeChanged(clutchUpPin, clutchUpPinMode)) {
// bug? duplication with stopSwitchPins?
efiSetPadUnused(activeConfiguration.clutchUpPin);

View File

@ -297,15 +297,15 @@
#endif
#ifndef STM32_SPI_USE_SPI4
#define STM32_SPI_USE_SPI4 FALSE
#define STM32_SPI_USE_SPI4 TRUE
#endif
#ifndef STM32_SPI_USE_SPI5
#define STM32_SPI_USE_SPI5 FALSE
#define STM32_SPI_USE_SPI5 TRUE
#endif
#ifndef STM32_SPI_USE_SPI6
#define STM32_SPI_USE_SPI6 FALSE
#define STM32_SPI_USE_SPI6 TRUE
#endif
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)

View File

@ -422,9 +422,9 @@
#define STM32_SPI_USE_SPI1 TRUE
#define STM32_SPI_USE_SPI2 TRUE
#define STM32_SPI_USE_SPI3 TRUE
#define STM32_SPI_USE_SPI4 FALSE
#define STM32_SPI_USE_SPI5 FALSE
#define STM32_SPI_USE_SPI6 FALSE
#define STM32_SPI_USE_SPI4 TRUE
#define STM32_SPI_USE_SPI5 TRUE
#define STM32_SPI_USE_SPI6 TRUE
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY