logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

config.h (2918B)


  1. /* Copyright 2022 David Hoelscher, customMK
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. // Bonsai C4 includes Vbus sensing; derived designs that use PA9 for other purposes
  18. // may disable Vbus sensing with #define BOARD_OTG_NOVBUSSENS 1
  19. #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
  20. # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
  21. #endif
  22. // FRAM configuration
  23. #ifndef EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN
  24. # define EEPROM_SPI_MB85RS64V
  25. # define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOA, 0)
  26. # define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8 // 96MHz / 8 = 12MHz; max supported by MB85R64 is 20MHz
  27. #endif
  28. // External flash configuration
  29. #ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN
  30. # define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOB, 12)
  31. # define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 2 // 48MHz; max supported by W25Q128JV is 133MHz
  32. # define EXTERNAL_FLASH_BYTE_COUNT (16 * 1024 * 1024) //128Mbit or 16MByte
  33. # define EXTERNAL_FLASH_PAGE_SIZE 256
  34. # define EXTERNAL_FLASH_SPI_TIMEOUT 200000 //datasheet max is 200 seconds for flash chip erase
  35. #endif
  36. // SPI Configuration (needed for FRAM and FLASH)
  37. #ifndef SPI_DRIVER
  38. # define SPI_DRIVER SPID1
  39. #endif
  40. #ifndef SPI_SCK_PIN
  41. # define SPI_SCK_PIN PAL_LINE(GPIOB, 3)
  42. #endif
  43. #ifndef SPI_MOSI_PIN
  44. # define SPI_MOSI_PIN PAL_LINE(GPIOB, 5)
  45. #endif
  46. #ifndef SPI_MISO_PIN
  47. # define SPI_MISO_PIN PAL_LINE(GPIOB, 4)
  48. #endif
  49. // I2C Configuration
  50. #ifdef CONVERT_TO_BONSAI_C4
  51. # ifndef I2C1_SCL_PIN
  52. # define I2C1_SCL_PIN PAL_LINE(GPIOB, 6)
  53. # endif
  54. # ifndef I2C1_SDA_PIN
  55. # define I2C1_SDA_PIN PAL_LINE(GPIOB, 9)
  56. # endif
  57. #endif
  58. // WS2812-style LED control on pin A10
  59. #ifdef WS2812_PWM
  60. # ifndef WS2812_DI_PIN
  61. # define WS2812_DI_PIN PAL_LINE(GPIOA, 10)
  62. # endif
  63. # ifndef WS2812_PWM_DRIVER
  64. # define WS2812_PWM_DRIVER PWMD1
  65. # endif
  66. # ifndef WS2812_PWM_CHANNEL
  67. # define WS2812_PWM_CHANNEL 3
  68. # endif
  69. # ifndef WS2812_PWM_PAL_MODE
  70. # define WS2812_PWM_PAL_MODE 1
  71. # endif
  72. # ifndef WS2812_PWM_DMA_STREAM
  73. # define WS2812_PWM_DMA_STREAM STM32_DMA2_STREAM5
  74. # endif
  75. # ifndef WS2812_PWM_DMA_CHANNEL
  76. # define WS2812_PWM_DMA_CHANNEL 6
  77. # endif
  78. #endif
  79. #ifndef USB_VBUS_PIN
  80. # define USB_VBUS_PIN PAL_LINE(GPIOA, 9)
  81. #endif