refactor: SD card SPI HAL (#3957)

* refactor: SD card SPI driver

* Removed SPI and DMA StdPeriph drivers

* Allow for disabling SPI DMA support

* Disable SPI sdcard CRC support

* Fix 2MHz timer on NV14

* Shared VS1053b driver

* Fix: SPI2 uses PCLK1

* feat: new generic diskio API

* More generic SD_CARD_PRESENT()

* Fixes

* Flush incoming block on token mismatch

* Scratch buffer test

* Incredible hack to re-sync sd card

* fix: SDIO driver
This commit is contained in:
Raphael Coeffic
2023-09-23 19:31:56 +10:00
committed by GitHub
parent 870fe7eca3
commit 87df8a4f2c
61 changed files with 2697 additions and 2628 deletions
+3
View File
@@ -631,6 +631,7 @@
#define SD_SDIO_CLK_DIV(fq) ((48000000 / (fq)) - 2)
#define SD_SDIO_INIT_CLK_DIV SD_SDIO_CLK_DIV(400000)
#define SD_SDIO_TRANSFER_CLK_DIV SD_SDIO_CLK_DIV(24000000)
#define STORAGE_USE_SDIO
// EEPROM
#if defined(PCBX12S) && PCBREV >= 13
@@ -996,6 +997,8 @@
// 2MHz Timer
#define TIMER_2MHz_RCC_APB1Periph RCC_APB1Periph_TIM7
#define TIMER_2MHz_TIMER TIM7
#define TIMER_2MHz_IRQn TIM7_IRQn
#define TIMER_2MHz_IRQHandler TIM7_IRQHandler
// Mixer scheduler timer
#define MIXER_SCHEDULER_TIMER_RCC_APB1Periph RCC_APB1Periph_TIM13