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.

294 lines
9.3 KiB

  1. /* Copyright 2021 QMK
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #if defined(MCU_KINETIS)
  18. // TODO: including this avoids "error: expected identifier before '(' token" errors
  19. // here just to please KINETIS builds...
  20. # include <hal.h>
  21. #endif
  22. /* Include the vendor specific pin defs */
  23. #if __has_include_next("_pin_defs.h")
  24. # include_next "_pin_defs.h"
  25. #endif
  26. #define A0 PAL_LINE(GPIOA, 0)
  27. #define A1 PAL_LINE(GPIOA, 1)
  28. #define A2 PAL_LINE(GPIOA, 2)
  29. #define A3 PAL_LINE(GPIOA, 3)
  30. #define A4 PAL_LINE(GPIOA, 4)
  31. #define A5 PAL_LINE(GPIOA, 5)
  32. #define A6 PAL_LINE(GPIOA, 6)
  33. #define A7 PAL_LINE(GPIOA, 7)
  34. #define A8 PAL_LINE(GPIOA, 8)
  35. #define A9 PAL_LINE(GPIOA, 9)
  36. #define A10 PAL_LINE(GPIOA, 10)
  37. #define A11 PAL_LINE(GPIOA, 11)
  38. #define A12 PAL_LINE(GPIOA, 12)
  39. #define A13 PAL_LINE(GPIOA, 13)
  40. #define A14 PAL_LINE(GPIOA, 14)
  41. #define A15 PAL_LINE(GPIOA, 15)
  42. #define A16 PAL_LINE(GPIOA, 16)
  43. #define A17 PAL_LINE(GPIOA, 17)
  44. #define A18 PAL_LINE(GPIOA, 18)
  45. #define A19 PAL_LINE(GPIOA, 19)
  46. #define A20 PAL_LINE(GPIOA, 20)
  47. #define A21 PAL_LINE(GPIOA, 21)
  48. #define A22 PAL_LINE(GPIOA, 22)
  49. #define A23 PAL_LINE(GPIOA, 23)
  50. #define A24 PAL_LINE(GPIOA, 24)
  51. #define A25 PAL_LINE(GPIOA, 25)
  52. #define A26 PAL_LINE(GPIOA, 26)
  53. #define A27 PAL_LINE(GPIOA, 27)
  54. #define A28 PAL_LINE(GPIOA, 28)
  55. #define A29 PAL_LINE(GPIOA, 29)
  56. #define A30 PAL_LINE(GPIOA, 30)
  57. #define A31 PAL_LINE(GPIOA, 31)
  58. #define A32 PAL_LINE(GPIOA, 32)
  59. #define B0 PAL_LINE(GPIOB, 0)
  60. #define B1 PAL_LINE(GPIOB, 1)
  61. #define B2 PAL_LINE(GPIOB, 2)
  62. #define B3 PAL_LINE(GPIOB, 3)
  63. #define B4 PAL_LINE(GPIOB, 4)
  64. #define B5 PAL_LINE(GPIOB, 5)
  65. #define B6 PAL_LINE(GPIOB, 6)
  66. #define B7 PAL_LINE(GPIOB, 7)
  67. #define B8 PAL_LINE(GPIOB, 8)
  68. #define B9 PAL_LINE(GPIOB, 9)
  69. #define B10 PAL_LINE(GPIOB, 10)
  70. #define B11 PAL_LINE(GPIOB, 11)
  71. #define B12 PAL_LINE(GPIOB, 12)
  72. #define B13 PAL_LINE(GPIOB, 13)
  73. #define B14 PAL_LINE(GPIOB, 14)
  74. #define B15 PAL_LINE(GPIOB, 15)
  75. #define B16 PAL_LINE(GPIOB, 16)
  76. #define B17 PAL_LINE(GPIOB, 17)
  77. #define B18 PAL_LINE(GPIOB, 18)
  78. #define B19 PAL_LINE(GPIOB, 19)
  79. #define B20 PAL_LINE(GPIOB, 20)
  80. #define B21 PAL_LINE(GPIOB, 21)
  81. #define B22 PAL_LINE(GPIOB, 22)
  82. #define B23 PAL_LINE(GPIOB, 23)
  83. #define B24 PAL_LINE(GPIOB, 24)
  84. #define B25 PAL_LINE(GPIOB, 25)
  85. #define B26 PAL_LINE(GPIOB, 26)
  86. #define B27 PAL_LINE(GPIOB, 27)
  87. #define B28 PAL_LINE(GPIOB, 28)
  88. #define B29 PAL_LINE(GPIOB, 29)
  89. #define B30 PAL_LINE(GPIOB, 30)
  90. #define B31 PAL_LINE(GPIOB, 31)
  91. #define B32 PAL_LINE(GPIOB, 32)
  92. #define C0 PAL_LINE(GPIOC, 0)
  93. #define C1 PAL_LINE(GPIOC, 1)
  94. #define C2 PAL_LINE(GPIOC, 2)
  95. #define C3 PAL_LINE(GPIOC, 3)
  96. #define C4 PAL_LINE(GPIOC, 4)
  97. #define C5 PAL_LINE(GPIOC, 5)
  98. #define C6 PAL_LINE(GPIOC, 6)
  99. #define C7 PAL_LINE(GPIOC, 7)
  100. #define C8 PAL_LINE(GPIOC, 8)
  101. #define C9 PAL_LINE(GPIOC, 9)
  102. #define C10 PAL_LINE(GPIOC, 10)
  103. #define C11 PAL_LINE(GPIOC, 11)
  104. #define C12 PAL_LINE(GPIOC, 12)
  105. #define C13 PAL_LINE(GPIOC, 13)
  106. #define C14 PAL_LINE(GPIOC, 14)
  107. #define C15 PAL_LINE(GPIOC, 15)
  108. #define C16 PAL_LINE(GPIOC, 16)
  109. #define C17 PAL_LINE(GPIOC, 17)
  110. #define C18 PAL_LINE(GPIOC, 18)
  111. #define C19 PAL_LINE(GPIOC, 19)
  112. #define C20 PAL_LINE(GPIOC, 20)
  113. #define C21 PAL_LINE(GPIOC, 21)
  114. #define C22 PAL_LINE(GPIOC, 22)
  115. #define C23 PAL_LINE(GPIOC, 23)
  116. #define C24 PAL_LINE(GPIOC, 24)
  117. #define C25 PAL_LINE(GPIOC, 25)
  118. #define C26 PAL_LINE(GPIOC, 26)
  119. #define C27 PAL_LINE(GPIOC, 27)
  120. #define C28 PAL_LINE(GPIOC, 28)
  121. #define C29 PAL_LINE(GPIOC, 29)
  122. #define C30 PAL_LINE(GPIOC, 30)
  123. #define C31 PAL_LINE(GPIOC, 31)
  124. #define C32 PAL_LINE(GPIOC, 32)
  125. #define D0 PAL_LINE(GPIOD, 0)
  126. #define D1 PAL_LINE(GPIOD, 1)
  127. #define D2 PAL_LINE(GPIOD, 2)
  128. #define D3 PAL_LINE(GPIOD, 3)
  129. #define D4 PAL_LINE(GPIOD, 4)
  130. #define D5 PAL_LINE(GPIOD, 5)
  131. #define D6 PAL_LINE(GPIOD, 6)
  132. #define D7 PAL_LINE(GPIOD, 7)
  133. #define D8 PAL_LINE(GPIOD, 8)
  134. #define D9 PAL_LINE(GPIOD, 9)
  135. #define D10 PAL_LINE(GPIOD, 10)
  136. #define D11 PAL_LINE(GPIOD, 11)
  137. #define D12 PAL_LINE(GPIOD, 12)
  138. #define D13 PAL_LINE(GPIOD, 13)
  139. #define D14 PAL_LINE(GPIOD, 14)
  140. #define D15 PAL_LINE(GPIOD, 15)
  141. #define D16 PAL_LINE(GPIOD, 16)
  142. #define D17 PAL_LINE(GPIOD, 17)
  143. #define D18 PAL_LINE(GPIOD, 18)
  144. #define D19 PAL_LINE(GPIOD, 19)
  145. #define D20 PAL_LINE(GPIOD, 20)
  146. #define D21 PAL_LINE(GPIOD, 21)
  147. #define D22 PAL_LINE(GPIOD, 22)
  148. #define D23 PAL_LINE(GPIOD, 23)
  149. #define D24 PAL_LINE(GPIOD, 24)
  150. #define D25 PAL_LINE(GPIOD, 25)
  151. #define D26 PAL_LINE(GPIOD, 26)
  152. #define D27 PAL_LINE(GPIOD, 27)
  153. #define D28 PAL_LINE(GPIOD, 28)
  154. #define D29 PAL_LINE(GPIOD, 29)
  155. #define D30 PAL_LINE(GPIOD, 30)
  156. #define D31 PAL_LINE(GPIOD, 31)
  157. #define D32 PAL_LINE(GPIOD, 32)
  158. #define E0 PAL_LINE(GPIOE, 0)
  159. #define E1 PAL_LINE(GPIOE, 1)
  160. #define E2 PAL_LINE(GPIOE, 2)
  161. #define E3 PAL_LINE(GPIOE, 3)
  162. #define E4 PAL_LINE(GPIOE, 4)
  163. #define E5 PAL_LINE(GPIOE, 5)
  164. #define E6 PAL_LINE(GPIOE, 6)
  165. #define E7 PAL_LINE(GPIOE, 7)
  166. #define E8 PAL_LINE(GPIOE, 8)
  167. #define E9 PAL_LINE(GPIOE, 9)
  168. #define E10 PAL_LINE(GPIOE, 10)
  169. #define E11 PAL_LINE(GPIOE, 11)
  170. #define E12 PAL_LINE(GPIOE, 12)
  171. #define E13 PAL_LINE(GPIOE, 13)
  172. #define E14 PAL_LINE(GPIOE, 14)
  173. #define E15 PAL_LINE(GPIOE, 15)
  174. #define E16 PAL_LINE(GPIOE, 16)
  175. #define E17 PAL_LINE(GPIOE, 17)
  176. #define E18 PAL_LINE(GPIOE, 18)
  177. #define E19 PAL_LINE(GPIOE, 19)
  178. #define E20 PAL_LINE(GPIOE, 20)
  179. #define E21 PAL_LINE(GPIOE, 21)
  180. #define E22 PAL_LINE(GPIOE, 22)
  181. #define E23 PAL_LINE(GPIOE, 23)
  182. #define E24 PAL_LINE(GPIOE, 24)
  183. #define E25 PAL_LINE(GPIOE, 25)
  184. #define E26 PAL_LINE(GPIOE, 26)
  185. #define E27 PAL_LINE(GPIOE, 27)
  186. #define E28 PAL_LINE(GPIOE, 28)
  187. #define E29 PAL_LINE(GPIOE, 29)
  188. #define E30 PAL_LINE(GPIOE, 30)
  189. #define E31 PAL_LINE(GPIOE, 31)
  190. #define E32 PAL_LINE(GPIOE, 32)
  191. #define F0 PAL_LINE(GPIOF, 0)
  192. #define F1 PAL_LINE(GPIOF, 1)
  193. #define F2 PAL_LINE(GPIOF, 2)
  194. #define F3 PAL_LINE(GPIOF, 3)
  195. #define F4 PAL_LINE(GPIOF, 4)
  196. #define F5 PAL_LINE(GPIOF, 5)
  197. #define F6 PAL_LINE(GPIOF, 6)
  198. #define F7 PAL_LINE(GPIOF, 7)
  199. #define F8 PAL_LINE(GPIOF, 8)
  200. #define F9 PAL_LINE(GPIOF, 9)
  201. #define F10 PAL_LINE(GPIOF, 10)
  202. #define F11 PAL_LINE(GPIOF, 11)
  203. #define F12 PAL_LINE(GPIOF, 12)
  204. #define F13 PAL_LINE(GPIOF, 13)
  205. #define F14 PAL_LINE(GPIOF, 14)
  206. #define F15 PAL_LINE(GPIOF, 15)
  207. #define G0 PAL_LINE(GPIOG, 0)
  208. #define G1 PAL_LINE(GPIOG, 1)
  209. #define G2 PAL_LINE(GPIOG, 2)
  210. #define G3 PAL_LINE(GPIOG, 3)
  211. #define G4 PAL_LINE(GPIOG, 4)
  212. #define G5 PAL_LINE(GPIOG, 5)
  213. #define G6 PAL_LINE(GPIOG, 6)
  214. #define G7 PAL_LINE(GPIOG, 7)
  215. #define G8 PAL_LINE(GPIOG, 8)
  216. #define G9 PAL_LINE(GPIOG, 9)
  217. #define G10 PAL_LINE(GPIOG, 10)
  218. #define G11 PAL_LINE(GPIOG, 11)
  219. #define G12 PAL_LINE(GPIOG, 12)
  220. #define G13 PAL_LINE(GPIOG, 13)
  221. #define G14 PAL_LINE(GPIOG, 14)
  222. #define G15 PAL_LINE(GPIOG, 15)
  223. #define H0 PAL_LINE(GPIOH, 0)
  224. #define H1 PAL_LINE(GPIOH, 1)
  225. #define H2 PAL_LINE(GPIOH, 2)
  226. #define H3 PAL_LINE(GPIOH, 3)
  227. #define H4 PAL_LINE(GPIOH, 4)
  228. #define H5 PAL_LINE(GPIOH, 5)
  229. #define H6 PAL_LINE(GPIOH, 6)
  230. #define H7 PAL_LINE(GPIOH, 7)
  231. #define H8 PAL_LINE(GPIOH, 8)
  232. #define H9 PAL_LINE(GPIOH, 9)
  233. #define H10 PAL_LINE(GPIOH, 10)
  234. #define H11 PAL_LINE(GPIOH, 11)
  235. #define H12 PAL_LINE(GPIOH, 12)
  236. #define H13 PAL_LINE(GPIOH, 13)
  237. #define H14 PAL_LINE(GPIOH, 14)
  238. #define H15 PAL_LINE(GPIOH, 15)
  239. #define I0 PAL_LINE(GPIOI, 0)
  240. #define I1 PAL_LINE(GPIOI, 1)
  241. #define I2 PAL_LINE(GPIOI, 2)
  242. #define I3 PAL_LINE(GPIOI, 3)
  243. #define I4 PAL_LINE(GPIOI, 4)
  244. #define I5 PAL_LINE(GPIOI, 5)
  245. #define I6 PAL_LINE(GPIOI, 6)
  246. #define I7 PAL_LINE(GPIOI, 7)
  247. #define I8 PAL_LINE(GPIOI, 8)
  248. #define I9 PAL_LINE(GPIOI, 9)
  249. #define I10 PAL_LINE(GPIOI, 10)
  250. #define I11 PAL_LINE(GPIOI, 11)
  251. #define I12 PAL_LINE(GPIOI, 12)
  252. #define I13 PAL_LINE(GPIOI, 13)
  253. #define I14 PAL_LINE(GPIOI, 14)
  254. #define I15 PAL_LINE(GPIOI, 15)
  255. #define J0 PAL_LINE(GPIOJ, 0)
  256. #define J1 PAL_LINE(GPIOJ, 1)
  257. #define J2 PAL_LINE(GPIOJ, 2)
  258. #define J3 PAL_LINE(GPIOJ, 3)
  259. #define J4 PAL_LINE(GPIOJ, 4)
  260. #define J5 PAL_LINE(GPIOJ, 5)
  261. #define J6 PAL_LINE(GPIOJ, 6)
  262. #define J7 PAL_LINE(GPIOJ, 7)
  263. #define J8 PAL_LINE(GPIOJ, 8)
  264. #define J9 PAL_LINE(GPIOJ, 9)
  265. #define J10 PAL_LINE(GPIOJ, 10)
  266. #define J11 PAL_LINE(GPIOJ, 11)
  267. #define J12 PAL_LINE(GPIOJ, 12)
  268. #define J13 PAL_LINE(GPIOJ, 13)
  269. #define J14 PAL_LINE(GPIOJ, 14)
  270. #define J15 PAL_LINE(GPIOJ, 15)
  271. // Keyboards can `#define KEYBOARD_REQUIRES_GPIOK` if they need to access GPIO-K pins. These conflict with a whole
  272. // bunch of layout definitions, so it's intentionally left out unless absolutely required -- in that case, the
  273. // keyboard designer should use a different symbol when defining their layout macros.
  274. #ifdef KEYBOARD_REQUIRES_GPIOK
  275. # define K0 PAL_LINE(GPIOK, 0)
  276. # define K1 PAL_LINE(GPIOK, 1)
  277. # define K2 PAL_LINE(GPIOK, 2)
  278. # define K3 PAL_LINE(GPIOK, 3)
  279. # define K4 PAL_LINE(GPIOK, 4)
  280. # define K5 PAL_LINE(GPIOK, 5)
  281. # define K6 PAL_LINE(GPIOK, 6)
  282. # define K7 PAL_LINE(GPIOK, 7)
  283. # define K8 PAL_LINE(GPIOK, 8)
  284. # define K9 PAL_LINE(GPIOK, 9)
  285. # define K10 PAL_LINE(GPIOK, 10)
  286. # define K11 PAL_LINE(GPIOK, 11)
  287. # define K12 PAL_LINE(GPIOK, 12)
  288. # define K13 PAL_LINE(GPIOK, 13)
  289. # define K14 PAL_LINE(GPIOK, 14)
  290. # define K15 PAL_LINE(GPIOK, 15)
  291. #endif