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.

142 lines
3.9 KiB

  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. #ifndef _BOARD_H_
  14. #define _BOARD_H_
  15. /*
  16. * Board identifier.
  17. */
  18. #define BOARD_JM60
  19. #define BOARD_NAME "ErgoDox STM32 Keyboard"
  20. /*
  21. * Board frequencies.
  22. */
  23. #define STM32_LSECLK 0
  24. #define STM32_HSECLK 8000000
  25. /*
  26. * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
  27. *
  28. * Only xB (128KB Flash) is defined, but it's identical to the
  29. * x8 version (64KB Flash) except for the Flash region size in the
  30. * linker script. For x8 parts use xB here and change to the x8 linker
  31. * script in the project Makefile.
  32. */
  33. #define STM32F103xB
  34. /*
  35. * IO pins assignments
  36. *
  37. * numbering is sorted by onboard/connectors, as from the schematics in
  38. * http://www.vcc-gnd.com/read.php?tid=369
  39. */
  40. /* on-board */
  41. #define GPIOA_USBDM 11 // pin 8
  42. #define GPIOA_USBDP 12 // pin 9
  43. #define GPIOC_OSC32_IN 14
  44. #define GPIOC_OSC32_OUT 15
  45. /*
  46. * I/O ports initial setup, this configuration is established soon after reset
  47. * in the initialization code.
  48. *
  49. * The digits have the following meaning:
  50. * 0 - Analog input.
  51. * 1 - Push Pull output 10MHz.
  52. * 2 - Push Pull output 2MHz.
  53. * 3 - Push Pull output 50MHz.
  54. * 4 - Digital input.
  55. * 5 - Open Drain output 10MHz.
  56. * 6 - Open Drain output 2MHz.
  57. * 7 - Open Drain output 50MHz.
  58. * 8 - Digital input with PullUp or PullDown resistor depending on ODR.
  59. * 9 - Alternate Push Pull output 10MHz.
  60. * A - Alternate Push Pull output 2MHz.
  61. * B - Alternate Push Pull output 50MHz.
  62. * C - Reserved.
  63. * D - Alternate Open Drain output 10MHz.
  64. * E - Alternate Open Drain output 2MHz.
  65. * F - Alternate Open Drain output 50MHz.
  66. * Please refer to the STM32 Reference Manual for details.
  67. */
  68. /*
  69. * Port A setup.
  70. * Everything input with pull-up except:
  71. */
  72. #define VAL_GPIOACRL 0x88888888 /* PA7...PA0 */
  73. #define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */
  74. #define VAL_GPIOAODR 0xFFFFFFFF
  75. /*
  76. * Port B setup.
  77. * Everything input with pull-up except:
  78. */
  79. #define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
  80. #define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
  81. #define VAL_GPIOBODR 0xFFFFFFFF
  82. /*
  83. * Port C setup.
  84. * Everything input with pull-up except:
  85. */
  86. #define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
  87. #define VAL_GPIOCCRH 0x88888888 /* PC15...PC8 */
  88. #define VAL_GPIOCODR 0xFFFFFFFF
  89. /*
  90. * Port D setup.
  91. * Everything input with pull-up except:
  92. * PD0 - Normal input (XTAL).
  93. * PD1 - Normal input (XTAL).
  94. */
  95. #define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
  96. #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
  97. #define VAL_GPIODODR 0xFFFFFFFF
  98. /*
  99. * Port E setup.
  100. * Everything input with pull-up except:
  101. */
  102. #define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
  103. #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
  104. #define VAL_GPIOEODR 0xFFFFFFFF
  105. /*
  106. * USB bus activation macro, required by the USB driver.
  107. */
  108. #define usb_lld_connect_bus(usbp) /* always connected */
  109. /*
  110. * USB bus de-activation macro, required by the USB driver.
  111. */
  112. #define usb_lld_disconnect_bus(usbp) /* always connected */
  113. #if !defined(_FROM_ASM_)
  114. #ifdef __cplusplus
  115. extern "C" {
  116. #endif
  117. void boardInit(void);
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* _FROM_ASM_ */
  122. #endif /* _BOARD_H_ */