ports.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /*
  2. * Port Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_PORT__
  5. #define __BFIN_PERIPHERAL_PORT__
  6. /* PORTx_MUX Masks */
  7. #define PORT_x_MUX_0_MASK 0x00000003
  8. #define PORT_x_MUX_1_MASK 0x0000000C
  9. #define PORT_x_MUX_2_MASK 0x00000030
  10. #define PORT_x_MUX_3_MASK 0x000000C0
  11. #define PORT_x_MUX_4_MASK 0x00000300
  12. #define PORT_x_MUX_5_MASK 0x00000C00
  13. #define PORT_x_MUX_6_MASK 0x00003000
  14. #define PORT_x_MUX_7_MASK 0x0000C000
  15. #define PORT_x_MUX_8_MASK 0x00030000
  16. #define PORT_x_MUX_9_MASK 0x000C0000
  17. #define PORT_x_MUX_10_MASK 0x00300000
  18. #define PORT_x_MUX_11_MASK 0x00C00000
  19. #define PORT_x_MUX_12_MASK 0x03000000
  20. #define PORT_x_MUX_13_MASK 0x0C000000
  21. #define PORT_x_MUX_14_MASK 0x30000000
  22. #define PORT_x_MUX_15_MASK 0xC0000000
  23. #define PORT_x_MUX_FUNC_1 (0x0)
  24. #define PORT_x_MUX_FUNC_2 (0x1)
  25. #define PORT_x_MUX_FUNC_3 (0x2)
  26. #define PORT_x_MUX_FUNC_4 (0x3)
  27. #define PORT_x_MUX_0_FUNC_1 (PORT_x_MUX_FUNC_1 << 0)
  28. #define PORT_x_MUX_0_FUNC_2 (PORT_x_MUX_FUNC_2 << 0)
  29. #define PORT_x_MUX_0_FUNC_3 (PORT_x_MUX_FUNC_3 << 0)
  30. #define PORT_x_MUX_0_FUNC_4 (PORT_x_MUX_FUNC_4 << 0)
  31. #define PORT_x_MUX_1_FUNC_1 (PORT_x_MUX_FUNC_1 << 2)
  32. #define PORT_x_MUX_1_FUNC_2 (PORT_x_MUX_FUNC_2 << 2)
  33. #define PORT_x_MUX_1_FUNC_3 (PORT_x_MUX_FUNC_3 << 2)
  34. #define PORT_x_MUX_1_FUNC_4 (PORT_x_MUX_FUNC_4 << 2)
  35. #define PORT_x_MUX_2_FUNC_1 (PORT_x_MUX_FUNC_1 << 4)
  36. #define PORT_x_MUX_2_FUNC_2 (PORT_x_MUX_FUNC_2 << 4)
  37. #define PORT_x_MUX_2_FUNC_3 (PORT_x_MUX_FUNC_3 << 4)
  38. #define PORT_x_MUX_2_FUNC_4 (PORT_x_MUX_FUNC_4 << 4)
  39. #define PORT_x_MUX_3_FUNC_1 (PORT_x_MUX_FUNC_1 << 6)
  40. #define PORT_x_MUX_3_FUNC_2 (PORT_x_MUX_FUNC_2 << 6)
  41. #define PORT_x_MUX_3_FUNC_3 (PORT_x_MUX_FUNC_3 << 6)
  42. #define PORT_x_MUX_3_FUNC_4 (PORT_x_MUX_FUNC_4 << 6)
  43. #define PORT_x_MUX_4_FUNC_1 (PORT_x_MUX_FUNC_1 << 8)
  44. #define PORT_x_MUX_4_FUNC_2 (PORT_x_MUX_FUNC_2 << 8)
  45. #define PORT_x_MUX_4_FUNC_3 (PORT_x_MUX_FUNC_3 << 8)
  46. #define PORT_x_MUX_4_FUNC_4 (PORT_x_MUX_FUNC_4 << 8)
  47. #define PORT_x_MUX_5_FUNC_1 (PORT_x_MUX_FUNC_1 << 10)
  48. #define PORT_x_MUX_5_FUNC_2 (PORT_x_MUX_FUNC_2 << 10)
  49. #define PORT_x_MUX_5_FUNC_3 (PORT_x_MUX_FUNC_3 << 10)
  50. #define PORT_x_MUX_5_FUNC_4 (PORT_x_MUX_FUNC_4 << 10)
  51. #define PORT_x_MUX_6_FUNC_1 (PORT_x_MUX_FUNC_1 << 12)
  52. #define PORT_x_MUX_6_FUNC_2 (PORT_x_MUX_FUNC_2 << 12)
  53. #define PORT_x_MUX_6_FUNC_3 (PORT_x_MUX_FUNC_3 << 12)
  54. #define PORT_x_MUX_6_FUNC_4 (PORT_x_MUX_FUNC_4 << 12)
  55. #define PORT_x_MUX_7_FUNC_1 (PORT_x_MUX_FUNC_1 << 14)
  56. #define PORT_x_MUX_7_FUNC_2 (PORT_x_MUX_FUNC_2 << 14)
  57. #define PORT_x_MUX_7_FUNC_3 (PORT_x_MUX_FUNC_3 << 14)
  58. #define PORT_x_MUX_7_FUNC_4 (PORT_x_MUX_FUNC_4 << 14)
  59. #define PORT_x_MUX_8_FUNC_1 (PORT_x_MUX_FUNC_1 << 16)
  60. #define PORT_x_MUX_8_FUNC_2 (PORT_x_MUX_FUNC_2 << 16)
  61. #define PORT_x_MUX_8_FUNC_3 (PORT_x_MUX_FUNC_3 << 16)
  62. #define PORT_x_MUX_8_FUNC_4 (PORT_x_MUX_FUNC_4 << 16)
  63. #define PORT_x_MUX_9_FUNC_1 (PORT_x_MUX_FUNC_1 << 18)
  64. #define PORT_x_MUX_9_FUNC_2 (PORT_x_MUX_FUNC_2 << 18)
  65. #define PORT_x_MUX_9_FUNC_3 (PORT_x_MUX_FUNC_3 << 18)
  66. #define PORT_x_MUX_9_FUNC_4 (PORT_x_MUX_FUNC_4 << 18)
  67. #define PORT_x_MUX_10_FUNC_1 (PORT_x_MUX_FUNC_1 << 20)
  68. #define PORT_x_MUX_10_FUNC_2 (PORT_x_MUX_FUNC_2 << 20)
  69. #define PORT_x_MUX_10_FUNC_3 (PORT_x_MUX_FUNC_3 << 20)
  70. #define PORT_x_MUX_10_FUNC_4 (PORT_x_MUX_FUNC_4 << 20)
  71. #define PORT_x_MUX_11_FUNC_1 (PORT_x_MUX_FUNC_1 << 22)
  72. #define PORT_x_MUX_11_FUNC_2 (PORT_x_MUX_FUNC_2 << 22)
  73. #define PORT_x_MUX_11_FUNC_3 (PORT_x_MUX_FUNC_3 << 22)
  74. #define PORT_x_MUX_11_FUNC_4 (PORT_x_MUX_FUNC_4 << 22)
  75. #define PORT_x_MUX_12_FUNC_1 (PORT_x_MUX_FUNC_1 << 24)
  76. #define PORT_x_MUX_12_FUNC_2 (PORT_x_MUX_FUNC_2 << 24)
  77. #define PORT_x_MUX_12_FUNC_3 (PORT_x_MUX_FUNC_3 << 24)
  78. #define PORT_x_MUX_12_FUNC_4 (PORT_x_MUX_FUNC_4 << 24)
  79. #define PORT_x_MUX_13_FUNC_1 (PORT_x_MUX_FUNC_1 << 26)
  80. #define PORT_x_MUX_13_FUNC_2 (PORT_x_MUX_FUNC_2 << 26)
  81. #define PORT_x_MUX_13_FUNC_3 (PORT_x_MUX_FUNC_3 << 26)
  82. #define PORT_x_MUX_13_FUNC_4 (PORT_x_MUX_FUNC_4 << 26)
  83. #define PORT_x_MUX_14_FUNC_1 (PORT_x_MUX_FUNC_1 << 28)
  84. #define PORT_x_MUX_14_FUNC_2 (PORT_x_MUX_FUNC_2 << 28)
  85. #define PORT_x_MUX_14_FUNC_3 (PORT_x_MUX_FUNC_3 << 28)
  86. #define PORT_x_MUX_14_FUNC_4 (PORT_x_MUX_FUNC_4 << 28)
  87. #define PORT_x_MUX_15_FUNC_1 (PORT_x_MUX_FUNC_1 << 30)
  88. #define PORT_x_MUX_15_FUNC_2 (PORT_x_MUX_FUNC_2 << 30)
  89. #define PORT_x_MUX_15_FUNC_3 (PORT_x_MUX_FUNC_3 << 30)
  90. #define PORT_x_MUX_15_FUNC_4 (PORT_x_MUX_FUNC_4 << 30)
  91. /* Port A Masks */
  92. #define PA0 0x0001
  93. #define PA1 0x0002
  94. #define PA2 0x0004
  95. #define PA3 0x0008
  96. #define PA4 0x0010
  97. #define PA5 0x0020
  98. #define PA6 0x0040
  99. #define PA7 0x0080
  100. #define PA8 0x0100
  101. #define PA9 0x0200
  102. #define PA10 0x0400
  103. #define PA11 0x0800
  104. #define PA12 0x1000
  105. #define PA13 0x2000
  106. #define PA14 0x4000
  107. #define PA15 0x8000
  108. /* Port B Masks */
  109. #define PB0 0x0001
  110. #define PB1 0x0002
  111. #define PB2 0x0004
  112. #define PB3 0x0008
  113. #define PB4 0x0010
  114. #define PB5 0x0020
  115. #define PB6 0x0040
  116. #define PB7 0x0080
  117. #define PB8 0x0100
  118. #define PB9 0x0200
  119. #define PB10 0x0400
  120. #define PB11 0x0800
  121. #define PB12 0x1000
  122. #define PB13 0x2000
  123. #define PB14 0x4000
  124. #define PB15 0x8000
  125. /* Port C Masks */
  126. #define PC0 0x0001
  127. #define PC1 0x0002
  128. #define PC2 0x0004
  129. #define PC3 0x0008
  130. #define PC4 0x0010
  131. #define PC5 0x0020
  132. #define PC6 0x0040
  133. #define PC7 0x0080
  134. #define PC8 0x0100
  135. #define PC9 0x0200
  136. #define PC10 0x0400
  137. #define PC11 0x0800
  138. #define PC12 0x1000
  139. #define PC13 0x2000
  140. #define PC14 0x4000
  141. #define PC15 0x8000
  142. /* Port F Masks */
  143. #define PD0 0x0001
  144. #define PD1 0x0002
  145. #define PD2 0x0004
  146. #define PD3 0x0008
  147. #define PD4 0x0010
  148. #define PD5 0x0020
  149. #define PD6 0x0040
  150. #define PD7 0x0080
  151. #define PD8 0x0100
  152. #define PD9 0x0200
  153. #define PD10 0x0400
  154. #define PD11 0x0800
  155. #define PD12 0x1000
  156. #define PD13 0x2000
  157. #define PD14 0x4000
  158. #define PD15 0x8000
  159. /* Port F Masks */
  160. #define PE0 0x0001
  161. #define PE1 0x0002
  162. #define PE2 0x0004
  163. #define PE3 0x0008
  164. #define PE4 0x0010
  165. #define PE5 0x0020
  166. #define PE6 0x0040
  167. #define PE7 0x0080
  168. #define PE8 0x0100
  169. #define PE9 0x0200
  170. #define PE10 0x0400
  171. #define PE11 0x0800
  172. #define PE12 0x1000
  173. #define PE13 0x2000
  174. #define PE14 0x4000
  175. #define PE15 0x8000
  176. /* Port F Masks */
  177. #define PF0 0x0001
  178. #define PF1 0x0002
  179. #define PF2 0x0004
  180. #define PF3 0x0008
  181. #define PF4 0x0010
  182. #define PF5 0x0020
  183. #define PF6 0x0040
  184. #define PF7 0x0080
  185. #define PF8 0x0100
  186. #define PF9 0x0200
  187. #define PF10 0x0400
  188. #define PF11 0x0800
  189. #define PF12 0x1000
  190. #define PF13 0x2000
  191. #define PF14 0x4000
  192. #define PF15 0x8000
  193. /* Port G Masks */
  194. #define PG0 0x0001
  195. #define PG1 0x0002
  196. #define PG2 0x0004
  197. #define PG3 0x0008
  198. #define PG4 0x0010
  199. #define PG5 0x0020
  200. #define PG6 0x0040
  201. #define PG7 0x0080
  202. #define PG8 0x0100
  203. #define PG9 0x0200
  204. #define PG10 0x0400
  205. #define PG11 0x0800
  206. #define PG12 0x1000
  207. #define PG13 0x2000
  208. #define PG14 0x4000
  209. #define PG15 0x8000
  210. /* Port H Masks */
  211. #define PH0 0x0001
  212. #define PH1 0x0002
  213. #define PH2 0x0004
  214. #define PH3 0x0008
  215. #define PH4 0x0010
  216. #define PH5 0x0020
  217. #define PH6 0x0040
  218. #define PH7 0x0080
  219. #define PH8 0x0100
  220. #define PH9 0x0200
  221. #define PH10 0x0400
  222. #define PH11 0x0800
  223. #define PH12 0x1000
  224. #define PH13 0x2000
  225. #define PH14 0x4000
  226. #define PH15 0x8000
  227. /* Port J Masks */
  228. #define PJ0 0x0001
  229. #define PJ1 0x0002
  230. #define PJ2 0x0004
  231. #define PJ3 0x0008
  232. #define PJ4 0x0010
  233. #define PJ5 0x0020
  234. #define PJ6 0x0040
  235. #define PJ7 0x0080
  236. #define PJ8 0x0100
  237. #define PJ9 0x0200
  238. #define PJ10 0x0400
  239. #define PJ11 0x0800
  240. #define PJ12 0x1000
  241. #define PJ13 0x2000
  242. #define PJ14 0x4000
  243. #define PJ15 0x8000
  244. #endif