board.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #if HAL_USE_PAL || defined(__DOXYGEN__)
  15. /* Initial setup of all defined pads, the list is terminated by a {-1, 0, 0}.*/
  16. static const spc_siu_init_t spc_siu_init[] = {
  17. {PCR(PORT5, P5_ESCI_A_TX), PAL_HIGH, PAL_MODE_INPUT_ALTERNATE_PRIMARY},
  18. {PCR(PORT5, P5_ESCI_A_RX), PAL_HIGH, PAL_MODE_INPUT_ALTERNATE_PRIMARY},
  19. {PCR(PORT11, P11_BUTTON1), PAL_LOW, PAL_MODE_INPUT},
  20. {PCR(PORT11, P11_BUTTON2), PAL_LOW, PAL_MODE_INPUT},
  21. {PCR(PORT11, P11_BUTTON3), PAL_LOW, PAL_MODE_INPUT},
  22. {PCR(PORT11, P11_BUTTON4), PAL_LOW, PAL_MODE_INPUT},
  23. {PCR(PORT11, P11_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
  24. {PCR(PORT11, P11_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
  25. {PCR(PORT11, P11_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
  26. {PCR(PORT11, P11_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
  27. {-1, 0, 0}
  28. };
  29. /**
  30. * @brief PAL setup.
  31. */
  32. const PALConfig pal_default_config = {
  33. spc_siu_init
  34. };
  35. #endif
  36. /*
  37. * Early initialization code.
  38. * This initialization must be performed just after stack setup and before
  39. * any other initialization.
  40. */
  41. void __early_init(void) {
  42. spc_clock_init();
  43. }
  44. /*
  45. * Board-specific initialization code.
  46. */
  47. void boardInit(void) {
  48. }