Skip to content

Commit

Permalink
Updated with better naming of SPI definition
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Jan 5, 2024
1 parent bdff232 commit b9a52c8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion radio/src/targets/common/arm/stm32/diskio_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static const stm32_spi_t _sd_spi_hw = {
.DMA_Channel = SD_SPI_DMA_CHANNEL,
.txDMA_Stream = SD_SPI_DMA_TX_STREAM,
.rxDMA_Stream = SD_SPI_DMA_RX_STREAM,
.useFIFO = true,
.DMA_FIFOMode = LL_DMA_FIFOMODE_ENABLE,
};

static uint32_t _sdcard_sectors;
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/common/arm/stm32/spi_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const stm32_spi_t _flash_spi = {
.DMA_Channel = FLASH_SPI_DMA_CHANNEL,
.txDMA_Stream = FLASH_SPI_DMA_TX_STREAM,
.rxDMA_Stream = FLASH_SPI_DMA_RX_STREAM,
.useFIFO = false,
.DMA_FIFOMode = LL_DMA_FIFOMODE_DISABLE,
};

static SpiFlashDescriptor _flashDescriptor;
Expand Down
5 changes: 1 addition & 4 deletions radio/src/targets/common/arm/stm32/stm32_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ static void _config_dma_streams(const stm32_spi_t* spi)
dmaInit.PeriphOrM2MSrcAddress = (uint32_t)&spi->SPIx->DR;
dmaInit.MemoryOrM2MDstIncMode = LL_DMA_MEMORY_INCREMENT;
dmaInit.Priority = LL_DMA_PRIORITY_VERYHIGH;
if (spi->useFIFO)
dmaInit.FIFOMode = LL_DMA_FIFOMODE_ENABLE;
else
dmaInit.FIFOMode = LL_DMA_FIFOMODE_DISABLE;
dmaInit.FIFOMode = spi->DMA_FIFOMode;
dmaInit.FIFOThreshold = LL_DMA_FIFOTHRESHOLD_FULL;

dmaInit.Direction = LL_DMA_DIRECTION_PERIPH_TO_MEMORY;
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/common/arm/stm32/stm32_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct stm32_spi_t {
uint32_t DMA_Channel;
uint32_t txDMA_Stream;
uint32_t rxDMA_Stream;
bool useFIFO;
uint32_t DMA_FIFOMode;
};

void stm32_spi_enable_clock(SPI_TypeDef *SPIx);
Expand Down

0 comments on commit b9a52c8

Please sign in to comment.