sdio_rp2350_config.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Configuration for RP2350_SDIO library */
  2. #pragma once
  3. #include "BlueSCSI_platform.h"
  4. #include <BlueSCSI_log.h>
  5. // #define SDIO_BREAKPOINT_ON_ERROR
  6. // #define BLUESCSI_DEBUG_SDIO
  7. // SDIO error messages are logged only to debug log, because normally
  8. // the problem can be reported through SCSI status.
  9. #ifdef SDIO_BREAKPOINT_ON_ERROR
  10. #define SDIO_ERRMSG(txt, arg1, arg2) do{dbgmsg(txt, " ", (uint32_t)(arg1), " ", (uint32_t)(arg2)); asm("bkpt");} while(0)
  11. #else
  12. #define SDIO_ERRMSG(txt, arg1, arg2) dbgmsg(txt, " ", (uint32_t)(arg1), " ", (uint32_t)(arg2))
  13. #endif
  14. // SDIO debug messages are normally disabled because they are very verbose
  15. #ifdef BLUESCSI_DEBUG_SDIO
  16. #define SDIO_DBGMSG(txt, arg1, arg2) dbgmsg(txt, " ", (uint32_t)(arg1), " ", (uint32_t)(arg2))
  17. #endif
  18. // PIO block to use
  19. #define SDIO_PIO pio1
  20. #define SDIO_SM 0
  21. // GPIO configuration
  22. #define SDIO_GPIO_FUNC GPIO_FUNC_PIO1
  23. #define SDIO_GPIO_SLEW GPIO_SLEW_RATE_FAST
  24. #define SDIO_GPIO_DRIVE GPIO_DRIVE_STRENGTH_8MA
  25. // DMA channels to use
  26. #define SDIO_DMACH_A 4
  27. #define SDIO_DMACH_B 5
  28. #define SDIO_DMAIRQ_IDX 1
  29. #define SDIO_DMAIRQ DMA_IRQ_1
  30. #define SDIO_DEFAULT_SPEED SDIO_HIGHSPEED_OVERCLOCK
  31. #define SDIO_MAX_CLOCK_RATE_EXCEED_PERCENT 15
  32. // GPIO pins come from platform header
  33. // #define SDIO_CLK 34
  34. // #define SDIO_CMD 35
  35. // #define SDIO_D0 36
  36. // #define SDIO_D1 37
  37. // #define SDIO_D2 38
  38. // #define SDIO_D3 39
  39. // #define SDIO_PIO_IOBASE 16