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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * PD Buddy - USB Power Delivery for everyone
  3. * Copyright (C) 2017 Clayton G. Hobbs <clay@lakeserv.net>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
  20. Licensed under the Apache License, Version 2.0 (the "License");
  21. you may not use this file except in compliance with the License.
  22. You may obtain a copy of the License at
  23. http://www.apache.org/licenses/LICENSE-2.0
  24. Unless required by applicable law or agreed to in writing, software
  25. distributed under the License is distributed on an "AS IS" BASIS,
  26. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  27. See the License for the specific language governing permissions and
  28. limitations under the License.
  29. */
  30. /*
  31. * This file has been automatically generated using ChibiStudio board
  32. * generator plugin. Do not edit manually.
  33. */
  34. #include "hal.h"
  35. #if HAL_USE_PAL || defined(__DOXYGEN__)
  36. /**
  37. * @brief PAL setup.
  38. * @details Digital I/O ports static configuration as defined in @p board.h.
  39. * This variable is used by the HAL when initializing the PAL driver.
  40. */
  41. const PALConfig pal_default_config = {
  42. #if STM32_HAS_GPIOA
  43. {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
  44. VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
  45. #endif
  46. #if STM32_HAS_GPIOB
  47. {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
  48. VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
  49. #endif
  50. #if STM32_HAS_GPIOC
  51. {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
  52. VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
  53. #endif
  54. #if STM32_HAS_GPIOD
  55. {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
  56. VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
  57. #endif
  58. #if STM32_HAS_GPIOE
  59. {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
  60. VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
  61. #endif
  62. #if STM32_HAS_GPIOF
  63. {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
  64. VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
  65. #endif
  66. #if STM32_HAS_GPIOG
  67. {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
  68. VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
  69. #endif
  70. #if STM32_HAS_GPIOH
  71. {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
  72. VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
  73. #endif
  74. #if STM32_HAS_GPIOI
  75. {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
  76. VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
  77. #endif
  78. };
  79. #endif
  80. /**
  81. * @brief Early initialization code.
  82. * @details This initialization must be performed just after stack setup
  83. * and before any other initialization.
  84. */
  85. void __early_init(void) {
  86. stm32_clock_init();
  87. }
  88. #if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
  89. /**
  90. * @brief MMC_SPI card detection.
  91. */
  92. bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
  93. (void)mmcp;
  94. /* TODO: Fill the implementation.*/
  95. return true;
  96. }
  97. /**
  98. * @brief MMC_SPI card write protection detection.
  99. */
  100. bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
  101. (void)mmcp;
  102. /* TODO: Fill the implementation.*/
  103. return false;
  104. }
  105. #endif
  106. /**
  107. * @brief Board-specific initialization code.
  108. * @todo Add your board-specific code, if any.
  109. */
  110. void boardInit(void) {
  111. }