board.h 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright 2020 Nick Brassel (tzarc)
  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. #include_next "board.h"
  18. // Force B9 as input to align with qmk defaults
  19. #undef VAL_GPIOB_MODER
  20. #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
  21. PIN_MODE_INPUT(GPIOB_PIN1) | \
  22. PIN_MODE_INPUT(GPIOB_PIN2) | \
  23. PIN_MODE_ALTERNATE(GPIOB_SWO) | \
  24. PIN_MODE_INPUT(GPIOB_PIN4) | \
  25. PIN_MODE_INPUT(GPIOB_PIN5) | \
  26. PIN_MODE_INPUT(GPIOB_LSM303DLHC_SCL) | \
  27. PIN_MODE_INPUT(GPIOB_PIN7) | \
  28. PIN_MODE_INPUT(GPIOB_PIN8) | \
  29. PIN_MODE_INPUT(GPIOB_LSM303DLHC_SDA) | \
  30. PIN_MODE_ALTERNATE(GPIOB_MP45DT02_CLK_IN) |\
  31. PIN_MODE_INPUT(GPIOB_PIN11) | \
  32. PIN_MODE_INPUT(GPIOB_PIN12) | \
  33. PIN_MODE_INPUT(GPIOB_PIN13) | \
  34. PIN_MODE_INPUT(GPIOB_PIN14) | \
  35. PIN_MODE_INPUT(GPIOB_PIN15))
  36. #undef VAL_GPIOB_PUPDR
  37. #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
  38. PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
  39. PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
  40. PIN_PUPDR_PULLUP(GPIOB_SWO) | \
  41. PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
  42. PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
  43. PIN_PUPDR_PULLUP(GPIOB_LSM303DLHC_SCL) |\
  44. PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
  45. PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
  46. PIN_PUPDR_PULLUP(GPIOB_LSM303DLHC_SDA) |\
  47. PIN_PUPDR_FLOATING(GPIOB_MP45DT02_CLK_IN) |\
  48. PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
  49. PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
  50. PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
  51. PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
  52. PIN_PUPDR_PULLUP(GPIOB_PIN15))
  53. #undef VAL_GPIOB_AFRL
  54. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
  55. PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
  56. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  57. PIN_AFIO_AF(GPIOB_SWO, 0U) | \
  58. PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
  59. PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
  60. PIN_AFIO_AF(GPIOB_LSM303DLHC_SCL, 0) | \
  61. PIN_AFIO_AF(GPIOB_PIN7, 0U))
  62. #undef VAL_GPIOB_AFRH
  63. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  64. PIN_AFIO_AF(GPIOB_LSM303DLHC_SDA, 0) | \
  65. PIN_AFIO_AF(GPIOB_MP45DT02_CLK_IN, 5U) |\
  66. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  67. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  68. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  69. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  70. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  71. #undef STM32_HSE_BYPASS