board.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 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. #include "hal.h"
  14. /**
  15. * @brief PAL setup.
  16. * @details Digital I/O ports static configuration as defined in @p board.h.
  17. * This variable is used by the HAL when initializing the PAL driver.
  18. */
  19. #if HAL_USE_PAL || defined(__DOXYGEN__)
  20. const PALConfig pal_default_config =
  21. {
  22. {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
  23. {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
  24. {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
  25. {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
  26. {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
  27. {VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH},
  28. {VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH},
  29. };
  30. #endif
  31. /*
  32. * Early initialization code.
  33. * This initialization must be performed just after stack setup and before
  34. * any other initialization.
  35. */
  36. void __early_init(void) {
  37. stm32_clock_init();
  38. }
  39. #if HAL_USE_SDC
  40. /* Board-related functions related to the SDC driver.*/
  41. bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
  42. (void)sdcp;
  43. return !palReadPad(GPIOF, GPIOF_SD_DETECT);
  44. }
  45. bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
  46. (void)sdcp;
  47. return FALSE;
  48. }
  49. #endif
  50. /*
  51. * Board-specific initialization code.
  52. */
  53. void boardInit(void) {
  54. }