board.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. #ifndef _BOARD_H_
  14. #define _BOARD_H_
  15. /*
  16. * Setup for the STMicroelectronics STM3210C-EVAL evaluation board.
  17. */
  18. #define GPIOD_LED1 7
  19. #define GPIOD_LED2 13
  20. #define GPIOD_LED3 3
  21. #define GPIOD_LED4 4
  22. /*
  23. * Board identifier.
  24. */
  25. #define BOARD_ST_STM3210C_EVAL
  26. #define BOARD_NAME "ST STM3210C-EVAL"
  27. /*
  28. * Board frequencies.
  29. */
  30. #define STM32_LSECLK 32768
  31. #define STM32_HSECLK 25000000
  32. /*
  33. * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
  34. */
  35. #define STM32F107xC
  36. /*
  37. * IO pins assignments.
  38. * *********************TO BE COMPLETED*********************
  39. */
  40. /*
  41. * I/O ports initial setup, this configuration is established soon after reset
  42. * in the initialization code.
  43. *
  44. * The digits have the following meaning:
  45. * 0 - Analog input.
  46. * 1 - Push Pull output 10MHz.
  47. * 2 - Push Pull output 2MHz.
  48. * 3 - Push Pull output 50MHz.
  49. * 4 - Digital input.
  50. * 5 - Open Drain output 10MHz.
  51. * 6 - Open Drain output 2MHz.
  52. * 7 - Open Drain output 50MHz.
  53. * 8 - Digital input with PullUp or PullDown resistor depending on ODR.
  54. * 9 - Alternate Push Pull output 10MHz.
  55. * A - Alternate Push Pull output 2MHz.
  56. * B - Alternate Push Pull output 50MHz.
  57. * C - Reserved.
  58. * D - Alternate Open Drain output 10MHz.
  59. * E - Alternate Open Drain output 2MHz.
  60. * F - Alternate Open Drain output 50MHz.
  61. * Please refer to the STM32 Reference Manual for details.
  62. */
  63. /*
  64. * Port A setup.
  65. * Everything input except:
  66. */
  67. #define VAL_GPIOACRL 0x44444444 /* PA7...PA0 */
  68. #define VAL_GPIOACRH 0x44444444 /* PA15...PA8 */
  69. #define VAL_GPIOAODR 0xFFFFFFFF
  70. /*
  71. * Port B setup.
  72. * Everything input except:
  73. */
  74. #define VAL_GPIOBCRL 0x44444444 /* PB7...PB0 */
  75. #define VAL_GPIOBCRH 0x44444444 /* PB15...PB8 */
  76. #define VAL_GPIOBODR 0xFFFFFFFF
  77. /*
  78. * Port C setup.
  79. * Everything input except:
  80. */
  81. #define VAL_GPIOCCRL 0x44444444 /* PC7...PC0 */
  82. #define VAL_GPIOCCRH 0x44444444 /* PC15...PC8 */
  83. #define VAL_GPIOCODR 0xFFFFFFFF
  84. /*
  85. * Port D setup.
  86. * Everything input except:
  87. * PD5 - USART2TX (remapped) AF PP Output
  88. * PD6 - USART2RX (remapped) Digital Input
  89. * PD7 - LED (LD1) PP Output
  90. */
  91. #define VAL_GPIODCRL 0x34B33444 /* PD7...PD0 */
  92. #define VAL_GPIODCRH 0x44344444 /* PD15...PD8 */
  93. #define VAL_GPIODODR 0x0000DF67
  94. /*
  95. * Port E setup.
  96. * Everything input except:
  97. */
  98. #define VAL_GPIOECRL 0x44444444 /* PE7...PE0 */
  99. #define VAL_GPIOECRH 0x44344444 /* PE15...PE8 */
  100. #define VAL_GPIOEODR 0xFFFFFFFF
  101. #if !defined(_FROM_ASM_)
  102. #ifdef __cplusplus
  103. extern "C" {
  104. #endif
  105. void boardInit(void);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #endif /* _FROM_ASM_ */
  110. #endif /* _BOARD_H_ */