PD Buddy Sink Firmware
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

board.c 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
  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. /*
  14. * This file has been automatically generated using ChibiStudio board
  15. * generator plugin. Do not edit manually.
  16. */
  17. #include "hal.h"
  18. #if HAL_USE_PAL || defined(__DOXYGEN__)
  19. /**
  20. * @brief PAL setup.
  21. * @details Digital I/O ports static configuration as defined in @p board.h.
  22. * This variable is used by the HAL when initializing the PAL driver.
  23. */
  24. const PALConfig pal_default_config = {
  25. #if STM32_HAS_GPIOA
  26. {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
  27. VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
  28. #endif
  29. #if STM32_HAS_GPIOB
  30. {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
  31. VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
  32. #endif
  33. #if STM32_HAS_GPIOC
  34. {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
  35. VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
  36. #endif
  37. #if STM32_HAS_GPIOD
  38. {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
  39. VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
  40. #endif
  41. #if STM32_HAS_GPIOE
  42. {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
  43. VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
  44. #endif
  45. #if STM32_HAS_GPIOF
  46. {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
  47. VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
  48. #endif
  49. #if STM32_HAS_GPIOG
  50. {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
  51. VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
  52. #endif
  53. #if STM32_HAS_GPIOH
  54. {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
  55. VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
  56. #endif
  57. #if STM32_HAS_GPIOI
  58. {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
  59. VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
  60. #endif
  61. };
  62. #endif
  63. /**
  64. * @brief Early initialization code.
  65. * @details This initialization must be performed just after stack setup
  66. * and before any other initialization.
  67. */
  68. void __early_init(void) {
  69. stm32_clock_init();
  70. }
  71. #if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
  72. /**
  73. * @brief MMC_SPI card detection.
  74. */
  75. bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
  76. (void)mmcp;
  77. /* TODO: Fill the implementation.*/
  78. return true;
  79. }
  80. /**
  81. * @brief MMC_SPI card write protection detection.
  82. */
  83. bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
  84. (void)mmcp;
  85. /* TODO: Fill the implementation.*/
  86. return false;
  87. }
  88. #endif
  89. /**
  90. * @brief Board-specific initialization code.
  91. * @todo Add your board-specific code, if any.
  92. */
  93. void boardInit(void) {
  94. }