logo

qmk_firmware

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

board.c (2119B)


  1. /*
  2. ChibiOS Driver element - Copyright (C) 2019 /u/KeepItUnder
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #include "hal.h"
  14. #if HAL_USE_PAL || defined(__DOXYGEN__)
  15. /**
  16. * @brief PAL setup.
  17. * @details Digital I/O ports static configuration as defined in @p board.h.
  18. * This variable is used by the HAL when initializing the PAL driver.
  19. */
  20. const PALConfig pal_default_config = {
  21. # if NUC123_HAS_GPIOA
  22. {VAL_GPIOA_PMD, VAL_GPIOA_OFFD, VAL_GPIOA_DMASK, VAL_GPIOA_DBEN, VAL_GPIOA_IMD, VAL_GPIOA_IEN, VAL_GPIOA_ISRC, VAL_GPIOA_DOUT},
  23. # endif
  24. # if NUC123_HAS_GPIOB
  25. {VAL_GPIOB_PMD, VAL_GPIOB_OFFD, VAL_GPIOB_DMASK, VAL_GPIOB_DBEN, VAL_GPIOB_IMD, VAL_GPIOB_IEN, VAL_GPIOB_ISRC, VAL_GPIOB_DOUT},
  26. # endif
  27. # if NUC123_HAS_GPIOC
  28. {VAL_GPIOC_PMD, VAL_GPIOC_OFFD, VAL_GPIOC_DMASK, VAL_GPIOC_DBEN, VAL_GPIOC_IMD, VAL_GPIOC_IEN, VAL_GPIOC_ISRC, VAL_GPIOC_DOUT},
  29. # endif
  30. # if NUC123_HAS_GPIOD
  31. {VAL_GPIOD_PMD, VAL_GPIOD_OFFD, VAL_GPIOD_DMASK, VAL_GPIOD_DBEN, VAL_GPIOD_IMD, VAL_GPIOD_IEN, VAL_GPIOD_ISRC, VAL_GPIOD_DOUT},
  32. # endif
  33. # if NUC123_HAS_GPIOF
  34. {VAL_GPIOF_PMD, VAL_GPIOF_OFFD, VAL_GPIOF_DMASK, VAL_GPIOF_DBEN, VAL_GPIOF_IMD, VAL_GPIOF_IEN, VAL_GPIOF_ISRC, VAL_GPIOF_DOUT},
  35. # endif
  36. };
  37. #endif
  38. /**
  39. * @brief Early initialization code.
  40. * @details This initialization must be performed just after stack setup
  41. * and before any other initialization.
  42. */
  43. void __early_init(void) {
  44. NUC123_clock_init();
  45. }
  46. /**
  47. * @brief Board-specific initialization code.
  48. * @todo Add your board-specific code, if any.
  49. */
  50. void boardInit(void) {}