PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1224 lines
59KB

  1. /*
  2. * File: kinetis_flexcan.h
  3. * Purpose: Register and bit definitions
  4. */
  5. #ifndef __KINETIS_FLEXCAN_H
  6. #define __KINETIS_FLEXCAN_H
  7. #include <stdint.h>
  8. #define FLEXCAN1_BASE (0x401D0000)
  9. #define FLEXCAN2_BASE (0x401D4000)
  10. #define FLEXCANb_MCR(b) (*(vuint32_t*)(b))
  11. #define FLEXCANb_CTRL1(b) (*(vuint32_t*)(b+4))
  12. #define FLEXCANb_TIMER(b) (*(vuint32_t*)(b+8))
  13. #define FLEXCANb_RXMGMASK(b) (*(vuint32_t*)(b+0x10))
  14. #define FLEXCANb_RX14MASK(b) (*(vuint32_t*)(b+0x14))
  15. #define FLEXCANb_RX15MASK(b) (*(vuint32_t*)(b+0x18))
  16. #define FLEXCANb_ECR(b) (*(vuint32_t*)(b+0x1C))
  17. #define FLEXCANb_ESR1(b) (*(vuint32_t*)(b+0x20))
  18. #define FLEXCANb_IMASK2(b) (*(vuint32_t*)(b+0x24))
  19. #define FLEXCANb_IMASK1(b) (*(vuint32_t*)(b+0x28))
  20. #define FLEXCANb_IFLAG2(b) (*(vuint32_t*)(b+0x2C))
  21. #define FLEXCANb_IFLAG1(b) (*(vuint32_t*)(b+0x30))
  22. #define FLEXCANb_CTRL2(b) (*(vuint32_t*)(b+0x34))
  23. #define FLEXCANb_ESR2(b) (*(vuint32_t*)(b+0x38))
  24. #define FLEXCANb_CRCR(b) (*(vuint32_t*)(b+0x44))
  25. #define FLEXCANb_RXFGMASK(b) (*(vuint32_t*)(b+0x48))
  26. #define FLEXCANb_RXFIR(b) (*(vuint32_t*)(b+0x4C))
  27. #define FLEXCANb_RXIMR(b, n) (*(vuint32_t*)(b+0x880+(n*4)))
  28. #define FLEXCANb_GFWR(b, n) (*(vuint32_t*)(b+0x1E0))
  29. #define FLEXCANb_MBn_CS(b, n) (*(vuint32_t*)(b+0x80+n*0x10))
  30. #define FLEXCANb_MBn_ID(b, n) (*(vuint32_t*)(b+0x84+n*0x10))
  31. #define FLEXCANb_MBn_WORD0(b, n) (*(vuint32_t*)(b+0x88+n*0x10))
  32. #define FLEXCANb_MBn_WORD1(b, n) (*(vuint32_t*)(b+0x8C+n*0x10))
  33. #define FLEXCANb_IDFLT_TAB(b, n) (*(vuint32_t*)(b+0xE0+(n*4)))
  34. #define FLEXCANb_MAXMB_SIZE(b) ((FLEXCANb_MCR(b)&0x7F)+1)
  35. // CANFD (confirmed valid)
  36. #define FLEXCANb_FDCTRL(b) (*(vuint32_t*)(b+0xC00))
  37. #define FLEXCANb_FDCBT(b) (*(vuint32_t*)(b+0xC04))
  38. #define FLEXCANb_CBT(b) (*(vuint32_t*)(b+0x50))
  39. #define FLEXCANb_ERFCR(b) (*(vuint32_t*)(b+0xC0C))
  40. #define FLEXCANb_DBG1(b) (*(vuint32_t*)(b+0x58))
  41. #define FLEXCANb_DBG2(b) (*(vuint32_t*)(b+0x5C))
  42. #define FLEXCAN_MCR_IDAM(x) (((x)&0x00000003)<<8)
  43. #define FLEXCAN_MCR_IDAM_MASK (0x00000300)
  44. #define FLEXCAN_MCR_IDAM_BIT_NO (8)
  45. #define FLEXCAN_MCR_AEN (0x00001000)
  46. #define FLEXCAN_MCR_LPRIO_EN (0x00002000)
  47. #define FLEXCAN_MCR_IRMQ (0x00010000)
  48. #define FLEXCAN_MCR_SRX_DIS (0x00020000)
  49. #define FLEXCAN_MCR_DOZE (0x00040000)
  50. #define FLEXCAN_MCR_WAK_SRC (0x00080000)
  51. #define FLEXCAN_MCR_LPM_ACK (0x00100000)
  52. #define FLEXCAN_MCR_WRN_EN (0x00200000)
  53. #define FLEXCAN_MCR_SLF_WAK (0x00400000)
  54. #define FLEXCAN_MCR_SUPV (0x00800000)
  55. #define FLEXCAN_MCR_FRZ_ACK (0x01000000)
  56. #define FLEXCAN_MCR_SOFT_RST (0x02000000)
  57. #define FLEXCAN_MCR_WAK_MSK (0x04000000)
  58. #define FLEXCAN_MCR_NOT_RDY (0x08000000)
  59. #define FLEXCAN_MCR_HALT (0x10000000)
  60. #define FLEXCAN_MCR_FEN (0x20000000)
  61. #define FLEXCAN_MCR_FRZ (0x40000000)
  62. #define FLEXCAN_MCR_MDIS (0x80000000)
  63. #define FLEXCAN_MCR_DMA (0x00008000)
  64. #define FLEXCAN_CTRL_PROPSEG(x) (((x)&0x00000007L)<<0)
  65. #define FLEXCAN_CTRL_LOM (0x00000008)
  66. #define FLEXCAN_CTRL_LBUF (0x00000010)
  67. #define FLEXCAN_CTRL_TSYNC (0x00000020)
  68. #define FLEXCAN_CTRL_BOFF_REC (0x00000040)
  69. #define FLEXCAN_CTRL_SMP (0x00000080)
  70. #define FLEXCAN_CTRL_RWRN_MSK (0x00000400)
  71. #define FLEXCAN_CTRL_TWRN_MSK (0x00000800)
  72. #define FLEXCAN_CTRL_LPB (0x00001000UL)
  73. #define FLEXCAN_CTRL_CLK_SRC (0x00002000)
  74. #define FLEXCAN_CTRL_ERR_MSK (0x00004000)
  75. #define FLEXCAN_CTRL_BOFF_MSK (0x00008000)
  76. #define FLEXCAN_CTRL_PSEG2(x) (((x)&0x00000007L)<<16)
  77. #define FLEXCAN_CTRL_PSEG1(x) (((x)&0x00000007L)<<19)
  78. #define FLEXCAN_CTRL_RJW(x) (((x)&0x00000003L)<<22)
  79. #define FLEXCAN_CTRL_PRESDIV(x) (((x)&0x000000FFL)<<24)
  80. #define FLEXCAN_CTRL2_ISOCANFDEN (BIT12)
  81. #define FLEXCAN_CTRL2_IMEUEN (BIT31)
  82. #define FLEXCAN_CTRL2_RFFN (0x0F000000UL)
  83. #define FLEXCAN_CTRL2_RFFN_BIT_NO (24)
  84. #define FLEXCAN_CTRL2_TASD (0x00F80000UL)
  85. #define FLEXCAN_CTRL2_TASD_BIT_NO (19)
  86. #define FLEXCAN_CTRL2_MRP (BIT18)
  87. #define FLEXCAN_CTRL2_RRS (BIT17)
  88. #define FLEXCAN_CTRL2_EACEN (BIT16)
  89. #define FLEXCAN_CTRL2_MUMASK (BIT1)
  90. #define FLEXCAN_CTRL2_FUMASK (BIT0)
  91. #define FLEXCAN_CTRL2_LOSTRLMSK (BIT2)
  92. #define FLEXCAN_CTRL2_LOSTRMMSK (BIT1)
  93. #define FLEXCAN_CTRL2_IMEUMASK (BIT0)
  94. #define FLEXCAN_set_rffn(ctrl2,rffn) ctrl2 = ((ctrl2) & ~FLEXCAN_CTRL2_RFFN) | ((rffn & 0xF)<<FLEXCAN_CTRL2_RFFN_BIT_NO)
  95. /* Common bit definition */
  96. #define BIT0 (1UL)
  97. #define BIT1 (BIT0<<1)
  98. #define BIT2 (BIT0<<2)
  99. #define BIT3 (BIT0<<3)
  100. #define BIT4 (BIT0<<4)
  101. #define BIT5 (BIT0<<5)
  102. #define BIT6 (BIT0<<6)
  103. #define BIT7 (BIT0<<7)
  104. #define BIT8 (BIT0<<8)
  105. #define BIT9 (BIT0<<9)
  106. #define BIT10 (BIT0<<10)
  107. #define BIT11 (BIT0<<11)
  108. #define BIT12 (0x00001000UL)
  109. #define BIT13 (0x00002000UL)
  110. #define BIT14 (0x00004000UL)
  111. #define BIT15 (0x00008000UL)
  112. #define BIT16 (0x00010000UL)
  113. #define BIT17 (0x00020000UL)
  114. #define BIT18 (0x00040000UL)
  115. #define BIT19 (0x00080000UL)
  116. #define BIT20 (0x00100000UL)
  117. #define BIT21 (0x00200000UL)
  118. #define BIT22 (0x00400000UL)
  119. #define BIT23 (0x00800000UL)
  120. #define BIT24 (0x01000000UL)
  121. #define BIT25 (0x02000000UL)
  122. #define BIT26 (0x04000000UL)
  123. #define BIT27 (0x08000000UL)
  124. #define BIT28 (0x10000000UL)
  125. #define BIT29 (0x20000000UL)
  126. #define BIT30 (0x40000000UL)
  127. #define BIT31 (0x80000000UL)
  128. /* FlexCAN module I/O Base Addresss */
  129. typedef volatile uint32_t vuint32_t;
  130. /*********************************************************************
  131. *
  132. * FlexCAN0 (FLEXCAN0)
  133. *
  134. *********************************************************************/
  135. /* Register read/write macros */
  136. #define FLEXCAN0_MCR (*(vuint32_t*)(FLEXCAN0_BASE))
  137. #define FLEXCAN0_CTRL1 (*(vuint32_t*)(FLEXCAN0_BASE+4))
  138. #define FLEXCAN0_TIMER (*(vuint32_t*)(FLEXCAN0_BASE+8))
  139. #define FLEXCAN0_TCR (*(vuint32_t*)(FLEXCAN0_BASE+0x0C))
  140. #define FLEXCAN0_RXMGMASK (*(vuint32_t*)(FLEXCAN0_BASE+0x10))
  141. #define FLEXCAN0_RX14MASK (*(vuint32_t*)(FLEXCAN0_BASE+0x14))
  142. #define FLEXCAN0_RX15MASK (*(vuint32_t*)(FLEXCAN0_BASE+0x18))
  143. #define FLEXCAN0_ECR (*(vuint32_t*)(FLEXCAN0_BASE+0x1C))
  144. #define FLEXCAN0_ESR1 (*(vuint32_t*)(FLEXCAN0_BASE+0x20))
  145. #define FLEXCAN0_IMASK2 (*(vuint32_t*)(FLEXCAN0_BASE+0x24))
  146. #define FLEXCAN0_IMASK1 (*(vuint32_t*)(FLEXCAN0_BASE+0x28))
  147. #define FLEXCAN0_IFLAG2 (*(vuint32_t*)(FLEXCAN0_BASE+0x2C))
  148. #define FLEXCAN0_IFLAG1 (*(vuint32_t*)(FLEXCAN0_BASE+0x30))
  149. #define FLEXCAN0_CTRL2 (*(vuint32_t*)(FLEXCAN0_BASE+0x34))
  150. #define FLEXCAN0_ESR2 (*(vuint32_t*)(FLEXCAN0_BASE+0x38))
  151. #define FLEXCAN0_FUREQ (*(vuint32_t*)(FLEXCAN0_BASE+0x3C))
  152. #define FLEXCAN0_FUACK (*(vuint32_t*)(FLEXCAN0_BASE+0x40))
  153. #define FLEXCAN0_CRCR (*(vuint32_t*)(FLEXCAN0_BASE+0x44))
  154. #define FLEXCAN0_RXFGMASK (*(vuint32_t*)(FLEXCAN0_BASE+0x48))
  155. #define FLEXCAN0_RXFIR (*(vuint32_t*)(FLEXCAN0_BASE+0x4C))
  156. #define FLEXCAN0_DBG1 (*(vuint32_t*)(FLEXCAN0_BASE+0x58))
  157. #define FLEXCAN0_DBG2 (*(vuint32_t*)(FLEXCAN0_BASE+0x5C))
  158. #define FLEXCAN0_IMEUR FLEXCAN0_FUREQ
  159. #define FLEXCAN0_LRFR FLEXCAN0_FUACK
  160. /* Message Buffers */
  161. #define FLEXCAN0_MB0_CS (*(vuint32_t*)(FLEXCAN0_BASE+0x80))
  162. #define FLEXCAN0_MB0_ID (*(vuint32_t*)(FLEXCAN0_BASE+0x84))
  163. #define FLEXCAN0_MB0_WORD0 (*(vuint32_t*)(FLEXCAN0_BASE+0x88))
  164. #define FLEXCAN0_MB0_WORD1 (*(vuint32_t*)(FLEXCAN0_BASE+0x8C))
  165. #define FLEXCAN0_MBn_CS(n) (*(vuint32_t*)(FLEXCAN0_BASE+0x80+n*0x10))
  166. #define FLEXCAN0_MBn_ID(n) (*(vuint32_t*)(FLEXCAN0_BASE+0x84+n*0x10))
  167. #define FLEXCAN0_MBn_WORD0(n) (*(vuint32_t*)(FLEXCAN0_BASE+0x88+n*0x10))
  168. #define FLEXCAN0_MBn_WORD1(n) (*(vuint32_t*)(FLEXCAN0_BASE+0x8C+n*0x10))
  169. /* Rx Individual Mask Registers */
  170. #define FLEXCAN0_RXIMR0 (*(vuint32_t*)(FLEXCAN0_BASE+0x880))
  171. #define FLEXCAN0_RXIMRn(n) (*(vuint32_t*)(FLEXCAN0_BASE+0x880+n*4))
  172. /* Rx FIFO ID Filter Table Element 0 to 127 */
  173. #define FLEXCAN0_IDFLT_TAB0 (*(vuint32_t*)(FLEXCAN0_BASE+0xE0))
  174. #define FLEXCAN0_IDFLT_TAB(n) (*(vuint32_t*)(FLEXCAN0_BASE+0xE0+(n*4)))
  175. //#define FLEXCAN0_IDFLT_TAB(n) (*(vuint32_t*)(FLEXCAN0_BASE+0xE0+(n<<2)))
  176. /* Memory Error Control Register */
  177. #define FLEXCAN0_MECR *(vuint32_t*)(FLEXCAN0_BASE+0x3B70))
  178. /* Error Injection Address Register */
  179. #define FLEXCAN0_ERRIAR *(vuint32_t*)(FLEXCAN0_BASE+0x3B74))
  180. /* Error Injection Data Pattern Register */
  181. #define FLEXCAN0_ERRIDPR *(vuint32_t*)(FLEXCAN0_BASE+0x3B78))
  182. /* Error Injection Parity Pattern Register */
  183. #define FLEXCAN0_ERRIPPR *(vuint32_t*)(FLEXCAN0_BASE+0x3B7C))
  184. /* Error Report Address Register */
  185. #define FLEXCAN0_RERRAR *(vuint32_t*)(FLEXCAN0_BASE+0x3B80))
  186. /* Error Report Data Register */
  187. #define FLEXCAN0_RERRDR *(vuint32_t*)(FLEXCAN0_BASE+0x3B84))
  188. /* Error Report Syndrome Register */
  189. #define FLEXCAN0_RERRSYNR *(vuint32_t*)(FLEXCAN0_BASE+0x3B88))
  190. /* Error Status Register */
  191. #define FLEXCAN0_ERRSR *(vuint32_t*)(FLEXCAN0_BASE+0x3B8C))
  192. /*********************************************************************
  193. *
  194. * FlexCAN1 (FLEXCAN1)
  195. *
  196. *********************************************************************/
  197. /* Register read/write macros */
  198. /*
  199. #define FLEXCAN1_MCR (*(vuint32_t*)(FLEXCAN1_BASE))
  200. #define FLEXCAN1_CTRL1 (*(vuint32_t*)(FLEXCAN1_BASE+4))
  201. #define FLEXCAN1_TIMER (*(vuint32_t*)(FLEXCAN1_BASE+8))
  202. #define FLEXCAN1_TCR (*(vuint32_t*)(FLEXCAN1_BASE+0x0C))
  203. #define FLEXCAN1_RXMGMASK (*(vuint32_t*)(FLEXCAN1_BASE+0x10))
  204. #define FLEXCAN1_RX14MASK (*(vuint32_t*)(FLEXCAN1_BASE+0x14))
  205. #define FLEXCAN1_RX15MASK (*(vuint32_t*)(FLEXCAN1_BASE+0x18))
  206. #define FLEXCAN1_ECR (*(vuint32_t*)(FLEXCAN1_BASE+0x1C))
  207. #define FLEXCAN1_ESR1 (*(vuint32_t*)(FLEXCAN1_BASE+0x20))
  208. #define FLEXCAN1_IMASK2 (*(vuint32_t*)(FLEXCAN1_BASE+0x24))
  209. #define FLEXCAN1_IMASK1 (*(vuint32_t*)(FLEXCAN1_BASE+0x28))
  210. #define FLEXCAN1_IFLAG2 (*(vuint32_t*)(FLEXCAN1_BASE+0x2C))
  211. #define FLEXCAN1_IFLAG1 (*(vuint32_t*)(FLEXCAN1_BASE+0x30))
  212. #define FLEXCAN1_CTRL2 (*(vuint32_t*)(FLEXCAN1_BASE+0x34))
  213. #define FLEXCAN1_ESR2 (*(vuint32_t*)(FLEXCAN1_BASE+0x38))
  214. #define FLEXCAN1_FUREQ (*(vuint32_t*)(FLEXCAN1_BASE+0x3C))
  215. #define FLEXCAN1_FUACK (*(vuint32_t*)(FLEXCAN1_BASE+0x40))
  216. #define FLEXCAN1_CRCR (*(vuint32_t*)(FLEXCAN1_BASE+0x44))
  217. #define FLEXCAN1_RXFGMASK (*(vuint32_t*)(FLEXCAN1_BASE+0x48))
  218. #define FLEXCAN1_RXFIR (*(vuint32_t*)(FLEXCAN1_BASE+0x4C))
  219. #define FLEXCAN1_DBG1 (*(vuint32_t*)(FLEXCAN1_BASE+0x58))
  220. #define FLEXCAN1_DBG2 (*(vuint32_t*)(FLEXCAN1_BASE+0x5C))
  221. #define FLEXCAN1_IMEUR FLEXCAN1_FUREQ
  222. #define FLEXCAN1_LRFR FLEXCAN1_FUACK
  223. */
  224. /* Message Buffers */
  225. #define FLEXCAN1_MB0_CS (*(vuint32_t*)(FLEXCAN1_BASE+0x80))
  226. #define FLEXCAN1_MB0_ID (*(vuint32_t*)(FLEXCAN1_BASE+0x84))
  227. #define FLEXCAN1_MB0_WORD0 (*(vuint32_t*)(FLEXCAN1_BASE+0x88))
  228. #define FLEXCAN1_MB0_WORD1 (*(vuint32_t*)(FLEXCAN1_BASE+0x8C))
  229. #define FLEXCAN1_MBn_CS(n) (*(vuint32_t*)(FLEXCAN1_BASE+0x80+n*0x10))
  230. #define FLEXCAN1_MBn_ID(n) (*(vuint32_t*)(FLEXCAN1_BASE+0x84+n*0x10))
  231. #define FLEXCAN1_MBn_WORD0(n) (*(vuint32_t*)(FLEXCAN1_BASE+0x88+n*0x10))
  232. #define FLEXCAN1_MBn_WORD1(n) (*(vuint32_t*)(FLEXCAN1_BASE+0x8C+n*0x10))
  233. /* Rx Individual Mask Registers */
  234. /*
  235. #define FLEXCAN1_RXIMR0 (*(vuint32_t*)(FLEXCAN1_BASE+0x880))
  236. #define FLEXCAN1_RXIMRn(n) (*(vuint32_t*)(FLEXCAN1_BASE+0x880+n*4))
  237. */
  238. /* Rx FIFO ID Filter Table Element 0 to 127 */
  239. #define FLEXCAN1_IDFLT_TAB0 (*(vuint32_t*)(FLEXCAN1_BASE+0xE0))
  240. #define FLEXCAN1_IDFLT_TAB(n) (*(vuint32_t*)(FLEXCAN1_BASE+0xE0+(n<<2)))
  241. /* Memory Error Control Register */
  242. #define FLEXCAN1_MECR *(vuint32_t*)(FLEXCAN1_BASE+0x7B70))
  243. /* Error Injection Address Register */
  244. #define FLEXCAN1_ERRIAR *(vuint32_t*)(FLEXCAN1_BASE+0x3B74))
  245. /* Error Injection Data Pattern Register */
  246. #define FLEXCAN1_ERRIDPR *(vuint32_t*)(FLEXCAN1_BASE+0x3B78))
  247. /* Error Injection Parity Pattern Register */
  248. #define FLEXCAN1_ERRIPPR *(vuint32_t*)(FLEXCAN1_BASE+0x3B7C))
  249. /* Error Report Address Register */
  250. #define FLEXCAN1_RERRAR *(vuint32_t*)(FLEXCAN1_BASE+0x3B80))
  251. /* Error Report Data Register */
  252. #define FLEXCAN1_RERRDR *(vuint32_t*)(FLEXCAN1_BASE+0x3B84))
  253. /* Error Report Syndrome Register */
  254. #define FLEXCAN1_RERRSYNR *(vuint32_t*)(FLEXCAN1_BASE+0x3B88))
  255. /* Error Status Register */
  256. #define FLEXCAN1_ERRSR *(vuint32_t*)(FLEXCAN1_BASE+0x3B8C))
  257. /* Bit definitions and macros for FLEXCAN_MCR */
  258. /*
  259. #define FLEXCAN_MCR_MAXMB(x) (((x)&0x0000007F)<<0)
  260. #define FLEXCAN_MCR_MAXMB_MASK (0x0000007F)
  261. */
  262. /* Bit definitions and macros for FLEXCAN_CTRL */
  263. /*
  264. #define FLEXCAN_CTRL_PROPSEG(x) (((x)&0x00000007L)<<0)
  265. #define FLEXCAN_CTRL_LOM (0x00000008)
  266. #define FLEXCAN_CTRL_LBUF (0x00000010)
  267. #define FLEXCAN_CTRL_TSYNC (0x00000020)
  268. #define FLEXCAN_CTRL_BOFF_REC (0x00000040)
  269. #define FLEXCAN_CTRL_SMP (0x00000080)
  270. #define FLEXCAN_CTRL_RWRN_MSK (0x00000400)
  271. #define FLEXCAN_CTRL_TWRN_MSK (0x00000800)
  272. #define FLEXCAN_CTRL_LPB (0x00001000UL)
  273. #define FLEXCAN_CTRL_CLK_SRC (0x00002000)
  274. #define FLEXCAN_CTRL_ERR_MSK (0x00004000)
  275. #define FLEXCAN_CTRL_BOFF_MSK (0x00008000)
  276. #define FLEXCAN_CTRL_PSEG2(x) (((x)&0x00000007L)<<16)
  277. #define FLEXCAN_CTRL_PSEG1(x) (((x)&0x00000007L)<<19)
  278. #define FLEXCAN_CTRL_RJW(x) (((x)&0x00000003L)<<22)
  279. #define FLEXCAN_CTRL_PRESDIV(x) (((x)&0x000000FFL)<<24)
  280. */
  281. /* Bit definitions and macros for FLEXCAN_CTRL2 */
  282. /*
  283. */
  284. /* Bit definitions and macros for FLEXCAN_TIMER */
  285. #define FLEXCAN_TIMER_TIMER(x) (((x)&0x0000FFFF)<<0)
  286. /* Bit definitions and macros for FLEXCAN_TCR */
  287. #define FLEXCAN_TCR_DSCACK (0x00000100)
  288. #define FLEXCAN_TCR_BIT_CLS (0x00000200)
  289. #define FLEXCAN_TCR_TRD (0x00000400)
  290. /* Bit definitions and macros for FLEXCAN_RXGMASK */
  291. /*
  292. #define FLEXCAN_RXGMASK_MI0 (0x00000001)
  293. #define FLEXCAN_RXGMASK_MI1 (0x00000002)
  294. #define FLEXCAN_RXGMASK_MI2 (0x00000004)
  295. #define FLEXCAN_RXGMASK_MI3 (0x00000008)
  296. #define FLEXCAN_RXGMASK_MI4 (0x00000010)
  297. #define FLEXCAN_RXGMASK_MI5 (0x00000020)
  298. #define FLEXCAN_RXGMASK_MI6 (0x00000040)
  299. #define FLEXCAN_RXGMASK_MI7 (0x00000080)
  300. #define FLEXCAN_RXGMASK_MI8 (0x00000100)
  301. #define FLEXCAN_RXGMASK_MI9 (0x00000200)
  302. #define FLEXCAN_RXGMASK_MI10 (0x00000400)
  303. #define FLEXCAN_RXGMASK_MI11 (0x00000800)
  304. #define FLEXCAN_RXGMASK_MI12 (0x00001000)
  305. #define FLEXCAN_RXGMASK_MI13 (0x00002000)
  306. #define FLEXCAN_RXGMASK_MI14 (0x00004000)
  307. #define FLEXCAN_RXGMASK_MI15 (0x00008000)
  308. #define FLEXCAN_RXGMASK_MI16 (0x00010000)
  309. #define FLEXCAN_RXGMASK_MI17 (0x00020000)
  310. #define FLEXCAN_RXGMASK_MI18 (0x00040000)
  311. #define FLEXCAN_RXGMASK_MI19 (0x00080000)
  312. #define FLEXCAN_RXGMASK_MI20 (0x00100000)
  313. #define FLEXCAN_RXGMASK_MI21 (0x00200000)
  314. #define FLEXCAN_RXGMASK_MI22 (0x00400000)
  315. #define FLEXCAN_RXGMASK_MI23 (0x00800000)
  316. #define FLEXCAN_RXGMASK_MI24 (0x01000000)
  317. #define FLEXCAN_RXGMASK_MI25 (0x02000000)
  318. #define FLEXCAN_RXGMASK_MI26 (0x04000000)
  319. #define FLEXCAN_RXGMASK_MI27 (0x08000000)
  320. #define FLEXCAN_RXGMASK_MI28 (0x10000000)
  321. #define FLEXCAN_RXGMASK_MI29 (0x20000000)
  322. #define FLEXCAN_RXGMASK_MI30 (0x40000000)
  323. #define FLEXCAN_RXGMASK_MI31 (0x80000000)
  324. */
  325. /* Bit definitions and macros for FLEXCAN_RX14MASK */
  326. /*
  327. #define FLEXCAN_RX14MASK_MI0 (0x00000001)
  328. #define FLEXCAN_RX14MASK_MI1 (0x00000002)
  329. #define FLEXCAN_RX14MASK_MI2 (0x00000004)
  330. #define FLEXCAN_RX14MASK_MI3 (0x00000008)
  331. #define FLEXCAN_RX14MASK_MI4 (0x00000010)
  332. #define FLEXCAN_RX14MASK_MI5 (0x00000020)
  333. #define FLEXCAN_RX14MASK_MI6 (0x00000040)
  334. #define FLEXCAN_RX14MASK_MI7 (0x00000080)
  335. #define FLEXCAN_RX14MASK_MI8 (0x00000100)
  336. #define FLEXCAN_RX14MASK_MI9 (0x00000200)
  337. #define FLEXCAN_RX14MASK_MI10 (0x00000400)
  338. #define FLEXCAN_RX14MASK_MI11 (0x00000800)
  339. #define FLEXCAN_RX14MASK_MI12 (0x00001000)
  340. #define FLEXCAN_RX14MASK_MI13 (0x00002000)
  341. #define FLEXCAN_RX14MASK_MI14 (0x00004000)
  342. #define FLEXCAN_RX14MASK_MI15 (0x00008000)
  343. #define FLEXCAN_RX14MASK_MI16 (0x00010000)
  344. #define FLEXCAN_RX14MASK_MI17 (0x00020000)
  345. #define FLEXCAN_RX14MASK_MI18 (0x00040000)
  346. #define FLEXCAN_RX14MASK_MI19 (0x00080000)
  347. #define FLEXCAN_RX14MASK_MI20 (0x00100000)
  348. #define FLEXCAN_RX14MASK_MI21 (0x00200000)
  349. #define FLEXCAN_RX14MASK_MI22 (0x00400000)
  350. #define FLEXCAN_RX14MASK_MI23 (0x00800000)
  351. #define FLEXCAN_RX14MASK_MI24 (0x01000000)
  352. #define FLEXCAN_RX14MASK_MI25 (0x02000000)
  353. #define FLEXCAN_RX14MASK_MI26 (0x04000000)
  354. #define FLEXCAN_RX14MASK_MI27 (0x08000000)
  355. #define FLEXCAN_RX14MASK_MI28 (0x10000000)
  356. #define FLEXCAN_RX14MASK_MI29 (0x20000000)
  357. #define FLEXCAN_RX14MASK_MI30 (0x40000000)
  358. #define FLEXCAN_RX14MASK_MI31 (0x80000000)
  359. */
  360. /* Bit definitions and macros for FLEXCAN_RX15MASK */
  361. #define FLEXCAN_RX15MASK_MI0 (0x00000001)
  362. #define FLEXCAN_RX15MASK_MI1 (0x00000002)
  363. #define FLEXCAN_RX15MASK_MI2 (0x00000004)
  364. #define FLEXCAN_RX15MASK_MI3 (0x00000008)
  365. #define FLEXCAN_RX15MASK_MI4 (0x00000010)
  366. #define FLEXCAN_RX15MASK_MI5 (0x00000020)
  367. #define FLEXCAN_RX15MASK_MI6 (0x00000040)
  368. #define FLEXCAN_RX15MASK_MI7 (0x00000080)
  369. #define FLEXCAN_RX15MASK_MI8 (0x00000100)
  370. #define FLEXCAN_RX15MASK_MI9 (0x00000200)
  371. #define FLEXCAN_RX15MASK_MI10 (0x00000400)
  372. #define FLEXCAN_RX15MASK_MI11 (0x00000800)
  373. #define FLEXCAN_RX15MASK_MI12 (0x00001000)
  374. #define FLEXCAN_RX15MASK_MI13 (0x00002000)
  375. #define FLEXCAN_RX15MASK_MI14 (0x00004000)
  376. #define FLEXCAN_RX15MASK_MI15 (0x00008000)
  377. #define FLEXCAN_RX15MASK_MI16 (0x00010000)
  378. #define FLEXCAN_RX15MASK_MI17 (0x00020000)
  379. #define FLEXCAN_RX15MASK_MI18 (0x00040000)
  380. #define FLEXCAN_RX15MASK_MI19 (0x00080000)
  381. #define FLEXCAN_RX15MASK_MI20 (0x00100000)
  382. #define FLEXCAN_RX15MASK_MI21 (0x00200000)
  383. #define FLEXCAN_RX15MASK_MI22 (0x00400000)
  384. #define FLEXCAN_RX15MASK_MI23 (0x00800000)
  385. #define FLEXCAN_RX15MASK_MI24 (0x01000000)
  386. #define FLEXCAN_RX15MASK_MI25 (0x02000000)
  387. #define FLEXCAN_RX15MASK_MI26 (0x04000000)
  388. #define FLEXCAN_RX15MASK_MI27 (0x08000000)
  389. #define FLEXCAN_RX15MASK_MI28 (0x10000000)
  390. #define FLEXCAN_RX15MASK_MI29 (0x20000000)
  391. #define FLEXCAN_RX15MASK_MI30 (0x40000000)
  392. #define FLEXCAN_RX15MASK_MI31 (0x80000000)
  393. /* Bit definitions and macros for FLEXCAN_ECR */
  394. #define FLEXCAN_ECR_TX_ERR_COUNTER(x) (((x)&0x000000FF)<<0)
  395. #define FLEXCAN_ECR_RX_ERR_COUNTER(x) (((x)&0x000000FF)<<8)
  396. /* Bit definitions and macros for FLEXCAN_ESR1 */
  397. #define FLEXCAN_ESR_WAK_INT (0x00000001)
  398. #define FLEXCAN_ESR_ERR_INT (0x00000002)
  399. #define FLEXCAN_ESR_BOFF_INT (0x00000004)
  400. #define FLEXCAN_ESR_RX (0x00000008)
  401. #define FLEXCAN_ESR_FLT_CONF(x) (((x)&0x00000003)<<4)
  402. #define FLEXCAN_ESR_FLT_CONF_MASK (0x00000030)
  403. #define FLEXCAN_ESR_TX (0x00000040)
  404. #define FLEXCAN_ESR_IDLE (0x00000080)
  405. #define FLEXCAN_ESR_RX_WRN (0x00000100)
  406. #define FLEXCAN_ESR_TX_WRN (0x00000200)
  407. #define FLEXCAN_ESR_STF_ERR (0x00000400)
  408. #define FLEXCAN_ESR_FRM_ERR (0x00000800)
  409. #define FLEXCAN_ESR_CRC_ERR (0x00001000)
  410. #define FLEXCAN_ESR_ACK_ERR (0x00002000)
  411. #define FLEXCAN_ESR_BIT0_ERR (0x00004000)
  412. #define FLEXCAN_ESR_BIT1_ERR (0x00008000)
  413. #define FLEXCAN_ESR_RWRN_INT (0x00010000)
  414. #define FLEXCAN_ESR_TWRN_INT (0x00020000)
  415. #define FLEXCAN_ESR_get_fault_code(esr) (((esr) & FLEXCAN_ESR_FLT_CONF_MASK)>>4)
  416. #define CAN_ERROR_ACTIVE 0
  417. #define CAN_ERROR_PASSIVE 1
  418. #define CAN_ERROR_BUS_OFF 2
  419. /* Bit definition for FLEXCAN_ESR2 */
  420. #define FLEXCAN_ESR2_IMB (0x00002000)
  421. #define FLEXCAN_ESR2_VPS (0x00004000)
  422. #define FLEXCAN_ESR2_LTM (0x007F0000UL)
  423. #define FLEXCAN_ESR2_LTM_BIT_NO (16)
  424. #define FLEXCAN_ESR2_LOSTRLF (0x00000004)
  425. #define FLEXCAN_ESR2_LOSTRMF (0x00000002)
  426. #define FLEXCAN_ESR2_IMEUF (0x00000001)
  427. #define FLEXCAN_get_LTM(esr2_value) (((esr2_value) & (FLEXCAN_ESR2_LTM))>>(FLEXCAN_ESR2_LTM_BIT_NO))
  428. /* Bit definitions and macros for FLEXCAN_IMASK1 */
  429. #define FLEXCAN_IMASK1_BUF0M (0x00000001)
  430. #define FLEXCAN_IMASK1_BUF1M (0x00000002)
  431. #define FLEXCAN_IMASK1_BUF2M (0x00000004)
  432. #define FLEXCAN_IMASK1_BUF3M (0x00000008)
  433. #define FLEXCAN_IMASK1_BUF4M (0x00000010)
  434. #define FLEXCAN_IMASK1_BUF5M (0x00000020)
  435. #define FLEXCAN_IMASK1_BUF6M (0x00000040)
  436. #define FLEXCAN_IMASK1_BUF7M (0x00000080)
  437. #define FLEXCAN_IMASK1_BUF8M (0x00000100)
  438. #define FLEXCAN_IMASK1_BUF9M (0x00000200)
  439. #define FLEXCAN_IMASK1_BUF10M (0x00000400)
  440. #define FLEXCAN_IMASK1_BUF11M (0x00000800)
  441. #define FLEXCAN_IMASK1_BUF12M (0x00001000)
  442. #define FLEXCAN_IMASK1_BUF13M (0x00002000)
  443. #define FLEXCAN_IMASK1_BUF14M (0x00004000)
  444. #define FLEXCAN_IMASK1_BUF15M (0x00008000)
  445. #define FLEXCAN_IMASK1_BUF16M (0x00010000)
  446. #define FLEXCAN_IMASK1_BUF17M (0x00020000)
  447. #define FLEXCAN_IMASK1_BUF18M (0x00040000)
  448. #define FLEXCAN_IMASK1_BUF19M (0x00080000)
  449. #define FLEXCAN_IMASK1_BUF20M (0x00100000)
  450. #define FLEXCAN_IMASK1_BUF21M (0x00200000)
  451. #define FLEXCAN_IMASK1_BUF22M (0x00400000)
  452. #define FLEXCAN_IMASK1_BUF23M (0x00800000)
  453. #define FLEXCAN_IMASK1_BUF24M (0x01000000)
  454. #define FLEXCAN_IMASK1_BUF25M (0x02000000)
  455. #define FLEXCAN_IMASK1_BUF26M (0x04000000)
  456. #define FLEXCAN_IMASK1_BUF27M (0x08000000)
  457. #define FLEXCAN_IMASK1_BUF28M (0x10000000)
  458. #define FLEXCAN_IMASK1_BUF29M (0x20000000)
  459. #define FLEXCAN_IMASK1_BUF30M (0x40000000)
  460. #define FLEXCAN_IMASK1_BUF31M (0x80000000)
  461. /* Bit definitions and macros for FLEXCAN_IFLAG1 */
  462. #define FLEXCAN_IFLAG1_BUF0I (0x00000001)
  463. #define FLEXCAN_IFLAG1_BUF1I (0x00000002)
  464. #define FLEXCAN_IFLAG1_BUF2I (0x00000004)
  465. #define FLEXCAN_IFLAG1_BUF3I (0x00000008)
  466. #define FLEXCAN_IFLAG1_BUF4I (0x00000010)
  467. #define FLEXCAN_IFLAG1_BUF5I (0x00000020)
  468. #define FLEXCAN_IFLAG1_BUF6I (0x00000040)
  469. #define FLEXCAN_IFLAG1_BUF7I (0x00000080)
  470. #define FLEXCAN_IFLAG1_BUF8I (0x00000100)
  471. #define FLEXCAN_IFLAG1_BUF9I (0x00000200)
  472. #define FLEXCAN_IFLAG1_BUF10I (0x00000400)
  473. #define FLEXCAN_IFLAG1_BUF11I (0x00000800)
  474. #define FLEXCAN_IFLAG1_BUF12I (0x00001000)
  475. #define FLEXCAN_IFLAG1_BUF13I (0x00002000)
  476. #define FLEXCAN_IFLAG1_BUF14I (0x00004000)
  477. #define FLEXCAN_IFLAG1_BUF15I (0x00008000)
  478. #define FLEXCAN_IFLAG1_BUF16I (0x00010000)
  479. #define FLEXCAN_IFLAG1_BUF17I (0x00020000)
  480. #define FLEXCAN_IFLAG1_BUF18I (0x00040000)
  481. #define FLEXCAN_IFLAG1_BUF19I (0x00080000)
  482. #define FLEXCAN_IFLAG1_BUF20I (0x00100000)
  483. #define FLEXCAN_IFLAG1_BUF21I (0x00200000)
  484. #define FLEXCAN_IFLAG1_BUF22I (0x00400000)
  485. #define FLEXCAN_IFLAG1_BUF23I (0x00800000)
  486. #define FLEXCAN_IFLAG1_BUF24I (0x01000000)
  487. #define FLEXCAN_IFLAG1_BUF25I (0x02000000)
  488. #define FLEXCAN_IFLAG1_BUF26I (0x04000000)
  489. #define FLEXCAN_IFLAG1_BUF27I (0x08000000)
  490. #define FLEXCAN_IFLAG1_BUF28I (0x10000000)
  491. #define FLEXCAN_IFLAG1_BUF29I (0x20000000)
  492. #define FLEXCAN_IFLAG1_BUF30I (0x40000000)
  493. #define FLEXCAN_IFLAG1_BUF31I (0x80000000)
  494. /* Bit definitions and macros for FLEXCAN_MB_CS */
  495. #define FLEXCAN_MB_CS_TIMESTAMP(x) (((x)&0x0000FFFF)<<0)
  496. #define FLEXCAN_MB_CS_TIMESTAMP_MASK (0x0000FFFFUL)
  497. #define FLEXCAN_MB_CS_LENGTH(x) (((x)&0x0000000F)<<16)
  498. #define FLEXCAN_MB_CS_RTR (0x00100000)
  499. #define FLEXCAN_MB_CS_IDE (0x00200000)
  500. #define FLEXCAN_MB_CS_SRR (0x00400000)
  501. #define FLEXCAN_MB_CS_CODE(x) (((x)&0x0000000F)<<24)
  502. #define FLEXCAN_MB_CS_CODE_MASK (0x0F000000UL)
  503. #define FLEXCAN_MB_CS_DLC_MASK (0x000F0000UL)
  504. #define FLEXCAN_MB_CODE_RX_INACTIVE (0)
  505. #define FLEXCAN_MB_CODE_RX_EMPTY (4)
  506. #define FLEXCAN_MB_CODE_RX_FULL (2)
  507. #define FLEXCAN_MB_CODE_RX_OVERRUN (6)
  508. #define FLEXCAN_MB_CODE_RX_BUSY (1)
  509. #define FLEXCAN_MB_CS_IDE_BIT_NO (21)
  510. #define FLEXCAN_MB_CS_RTR_BIT_NO (20)
  511. #define FLEXCAN_MB_CS_DLC_BIT_NO (16)
  512. #define FLEXCAN_MB_CODE_TX_INACTIVE (8)
  513. #define FLEXCAN_MB_CODE_TX_ABORT (9)
  514. #define FLEXCAN_MB_CODE_TX_ONCE (0x0C)
  515. #define FLEXCAN_MB_CODE_TX_RESPONSE (0x0A)
  516. #define FLEXCAN_MB_CODE_TX_RESPONSE_TEMPO (0x0E)
  517. #define FLEXCAN_get_code(cs) (((cs) & FLEXCAN_MB_CS_CODE_MASK)>>24)
  518. #define FLEXCAN_get_length(cs) (((cs) & FLEXCAN_MB_CS_DLC_MASK)>>16)
  519. #define FLEXCAN_get_timestamp(cs) (((cs) & FLEXCAN_MB_CS_TIMESTAMP_MASK)>>0)
  520. /* Bit definitions and macros for FLEXCAN_MB_ID */
  521. #define FLEXCAN_MB_ID_STD_MASK (0x1FFC0000UL)
  522. #define FLEXCAN_MB_ID_EXT_MASK (0x1FFFFFFFUL)
  523. #define FLEXCAN_MB_ID_IDEXT(x) (((x)&0x0003FFFF)<<0)
  524. #define FLEXCAN_MB_ID_IDSTD(x) (((x)&0x000007FF)<<18)
  525. #define FLEXCAN_MB_ID_PRIO(x) (((x)&0x00000007)<<29)
  526. #define FLEXCAN_MB_ID_PRIO_BIT_NO (29)
  527. #define FLEXCAN_MB_ID_STD_BIT_NO (18)
  528. #define FLEXCAN_MB_ID_EXT_BIT_NO (0)
  529. /* Bit definitions and macros for FLEXCAN_MB_WORD0 */
  530. #define FLEXCAN_MB_WORD0_DATA3(x) (((x)&0x000000FF)<<0)
  531. #define FLEXCAN_MB_WORD0_DATA2(x) (((x)&0x000000FF)<<8)
  532. #define FLEXCAN_MB_WORD0_DATA1(x) (((x)&0x000000FF)<<16)
  533. #define FLEXCAN_MB_WORD0_DATA0(x) (((x)&0x000000FF)<<24)
  534. /* Bit definitions and macros for FLEXCAN_MB_WORD1 */
  535. #define FLEXCAN_MB_WORD1_DATA7(x) (((x)&0x000000FF)<<0)
  536. #define FLEXCAN_MB_WORD1_DATA6(x) (((x)&0x000000FF)<<8)
  537. #define FLEXCAN_MB_WORD1_DATA5(x) (((x)&0x000000FF)<<16)
  538. #define FLEXCAN_MB_WORD1_DATA4(x) (((x)&0x000000FF)<<24)
  539. /* Bit definitions and macros for FLEXCAN_RXIMR0 */
  540. #define FLEXCAN_RXIMR0_MI0 (0x00000001)
  541. #define FLEXCAN_RXIMR0_MI1 (0x00000002)
  542. #define FLEXCAN_RXIMR0_MI2 (0x00000004)
  543. #define FLEXCAN_RXIMR0_MI3 (0x00000008)
  544. #define FLEXCAN_RXIMR0_MI4 (0x00000010)
  545. #define FLEXCAN_RXIMR0_MI5 (0x00000020)
  546. #define FLEXCAN_RXIMR0_MI6 (0x00000040)
  547. #define FLEXCAN_RXIMR0_MI7 (0x00000080)
  548. #define FLEXCAN_RXIMR0_MI8 (0x00000100)
  549. #define FLEXCAN_RXIMR0_MI9 (0x00000200)
  550. #define FLEXCAN_RXIMR0_MI10 (0x00000400)
  551. #define FLEXCAN_RXIMR0_MI11 (0x00000800)
  552. #define FLEXCAN_RXIMR0_MI12 (0x00001000)
  553. #define FLEXCAN_RXIMR0_MI13 (0x00002000)
  554. #define FLEXCAN_RXIMR0_MI14 (0x00004000)
  555. #define FLEXCAN_RXIMR0_MI15 (0x00008000)
  556. #define FLEXCAN_RXIMR0_MI16 (0x00010000)
  557. #define FLEXCAN_RXIMR0_MI17 (0x00020000)
  558. #define FLEXCAN_RXIMR0_MI18 (0x00040000)
  559. #define FLEXCAN_RXIMR0_MI19 (0x00080000)
  560. #define FLEXCAN_RXIMR0_MI20 (0x00100000)
  561. #define FLEXCAN_RXIMR0_MI21 (0x00200000)
  562. #define FLEXCAN_RXIMR0_MI22 (0x00400000)
  563. #define FLEXCAN_RXIMR0_MI23 (0x00800000)
  564. #define FLEXCAN_RXIMR0_MI24 (0x01000000)
  565. #define FLEXCAN_RXIMR0_MI25 (0x02000000)
  566. #define FLEXCAN_RXIMR0_MI26 (0x04000000)
  567. #define FLEXCAN_RXIMR0_MI27 (0x08000000)
  568. #define FLEXCAN_RXIMR0_MI28 (0x10000000)
  569. #define FLEXCAN_RXIMR0_MI29 (0x20000000)
  570. #define FLEXCAN_RXIMR0_MI30 (0x40000000)
  571. #define FLEXCAN_RXIMR0_MI31 (0x80000000)
  572. /* Bit definitions and macros for FLEXCAN_RXIMR1 */
  573. #define FLEXCAN_RXIMR1_MI0 (0x00000001)
  574. #define FLEXCAN_RXIMR1_MI1 (0x00000002)
  575. #define FLEXCAN_RXIMR1_MI2 (0x00000004)
  576. #define FLEXCAN_RXIMR1_MI3 (0x00000008)
  577. #define FLEXCAN_RXIMR1_MI4 (0x00000010)
  578. #define FLEXCAN_RXIMR1_MI5 (0x00000020)
  579. #define FLEXCAN_RXIMR1_MI6 (0x00000040)
  580. #define FLEXCAN_RXIMR1_MI7 (0x00000080)
  581. #define FLEXCAN_RXIMR1_MI8 (0x00000100)
  582. #define FLEXCAN_RXIMR1_MI9 (0x00000200)
  583. #define FLEXCAN_RXIMR1_MI10 (0x00000400)
  584. #define FLEXCAN_RXIMR1_MI11 (0x00000800)
  585. #define FLEXCAN_RXIMR1_MI12 (0x00001000)
  586. #define FLEXCAN_RXIMR1_MI13 (0x00002000)
  587. #define FLEXCAN_RXIMR1_MI14 (0x00004000)
  588. #define FLEXCAN_RXIMR1_MI15 (0x00008000)
  589. #define FLEXCAN_RXIMR1_MI16 (0x00010000)
  590. #define FLEXCAN_RXIMR1_MI17 (0x00020000)
  591. #define FLEXCAN_RXIMR1_MI18 (0x00040000)
  592. #define FLEXCAN_RXIMR1_MI19 (0x00080000)
  593. #define FLEXCAN_RXIMR1_MI20 (0x00100000)
  594. #define FLEXCAN_RXIMR1_MI21 (0x00200000)
  595. #define FLEXCAN_RXIMR1_MI22 (0x00400000)
  596. #define FLEXCAN_RXIMR1_MI23 (0x00800000)
  597. #define FLEXCAN_RXIMR1_MI24 (0x01000000)
  598. #define FLEXCAN_RXIMR1_MI25 (0x02000000)
  599. #define FLEXCAN_RXIMR1_MI26 (0x04000000)
  600. #define FLEXCAN_RXIMR1_MI27 (0x08000000)
  601. #define FLEXCAN_RXIMR1_MI28 (0x10000000)
  602. #define FLEXCAN_RXIMR1_MI29 (0x20000000)
  603. #define FLEXCAN_RXIMR1_MI30 (0x40000000)
  604. #define FLEXCAN_RXIMR1_MI31 (0x80000000)
  605. /* Bit definitions and macros for FLEXCAN_RXIMR2 */
  606. #define FLEXCAN_RXIMR2_MI0 (0x00000001)
  607. #define FLEXCAN_RXIMR2_MI1 (0x00000002)
  608. #define FLEXCAN_RXIMR2_MI2 (0x00000004)
  609. #define FLEXCAN_RXIMR2_MI3 (0x00000008)
  610. #define FLEXCAN_RXIMR2_MI4 (0x00000010)
  611. #define FLEXCAN_RXIMR2_MI5 (0x00000020)
  612. #define FLEXCAN_RXIMR2_MI6 (0x00000040)
  613. #define FLEXCAN_RXIMR2_MI7 (0x00000080)
  614. #define FLEXCAN_RXIMR2_MI8 (0x00000100)
  615. #define FLEXCAN_RXIMR2_MI9 (0x00000200)
  616. #define FLEXCAN_RXIMR2_MI10 (0x00000400)
  617. #define FLEXCAN_RXIMR2_MI11 (0x00000800)
  618. #define FLEXCAN_RXIMR2_MI12 (0x00001000)
  619. #define FLEXCAN_RXIMR2_MI13 (0x00002000)
  620. #define FLEXCAN_RXIMR2_MI14 (0x00004000)
  621. #define FLEXCAN_RXIMR2_MI15 (0x00008000)
  622. #define FLEXCAN_RXIMR2_MI16 (0x00010000)
  623. #define FLEXCAN_RXIMR2_MI17 (0x00020000)
  624. #define FLEXCAN_RXIMR2_MI18 (0x00040000)
  625. #define FLEXCAN_RXIMR2_MI19 (0x00080000)
  626. #define FLEXCAN_RXIMR2_MI20 (0x00100000)
  627. #define FLEXCAN_RXIMR2_MI21 (0x00200000)
  628. #define FLEXCAN_RXIMR2_MI22 (0x00400000)
  629. #define FLEXCAN_RXIMR2_MI23 (0x00800000)
  630. #define FLEXCAN_RXIMR2_MI24 (0x01000000)
  631. #define FLEXCAN_RXIMR2_MI25 (0x02000000)
  632. #define FLEXCAN_RXIMR2_MI26 (0x04000000)
  633. #define FLEXCAN_RXIMR2_MI27 (0x08000000)
  634. #define FLEXCAN_RXIMR2_MI28 (0x10000000)
  635. #define FLEXCAN_RXIMR2_MI29 (0x20000000)
  636. #define FLEXCAN_RXIMR2_MI30 (0x40000000)
  637. #define FLEXCAN_RXIMR2_MI31 (0x80000000)
  638. /* Bit definitions and macros for FLEXCAN_RXIMR3 */
  639. #define FLEXCAN_RXIMR3_MI0 (0x00000001)
  640. #define FLEXCAN_RXIMR3_MI1 (0x00000002)
  641. #define FLEXCAN_RXIMR3_MI2 (0x00000004)
  642. #define FLEXCAN_RXIMR3_MI3 (0x00000008)
  643. #define FLEXCAN_RXIMR3_MI4 (0x00000010)
  644. #define FLEXCAN_RXIMR3_MI5 (0x00000020)
  645. #define FLEXCAN_RXIMR3_MI6 (0x00000040)
  646. #define FLEXCAN_RXIMR3_MI7 (0x00000080)
  647. #define FLEXCAN_RXIMR3_MI8 (0x00000100)
  648. #define FLEXCAN_RXIMR3_MI9 (0x00000200)
  649. #define FLEXCAN_RXIMR3_MI10 (0x00000400)
  650. #define FLEXCAN_RXIMR3_MI11 (0x00000800)
  651. #define FLEXCAN_RXIMR3_MI12 (0x00001000)
  652. #define FLEXCAN_RXIMR3_MI13 (0x00002000)
  653. #define FLEXCAN_RXIMR3_MI14 (0x00004000)
  654. #define FLEXCAN_RXIMR3_MI15 (0x00008000)
  655. #define FLEXCAN_RXIMR3_MI16 (0x00010000)
  656. #define FLEXCAN_RXIMR3_MI17 (0x00020000)
  657. #define FLEXCAN_RXIMR3_MI18 (0x00040000)
  658. #define FLEXCAN_RXIMR3_MI19 (0x00080000)
  659. #define FLEXCAN_RXIMR3_MI20 (0x00100000)
  660. #define FLEXCAN_RXIMR3_MI21 (0x00200000)
  661. #define FLEXCAN_RXIMR3_MI22 (0x00400000)
  662. #define FLEXCAN_RXIMR3_MI23 (0x00800000)
  663. #define FLEXCAN_RXIMR3_MI24 (0x01000000)
  664. #define FLEXCAN_RXIMR3_MI25 (0x02000000)
  665. #define FLEXCAN_RXIMR3_MI26 (0x04000000)
  666. #define FLEXCAN_RXIMR3_MI27 (0x08000000)
  667. #define FLEXCAN_RXIMR3_MI28 (0x10000000)
  668. #define FLEXCAN_RXIMR3_MI29 (0x20000000)
  669. #define FLEXCAN_RXIMR3_MI30 (0x40000000)
  670. #define FLEXCAN_RXIMR3_MI31 (0x80000000)
  671. /* Bit definitions and macros for FLEXCAN_RXIMR4 */
  672. #define FLEXCAN_RXIMR4_MI0 (0x00000001)
  673. #define FLEXCAN_RXIMR4_MI1 (0x00000002)
  674. #define FLEXCAN_RXIMR4_MI2 (0x00000004)
  675. #define FLEXCAN_RXIMR4_MI3 (0x00000008)
  676. #define FLEXCAN_RXIMR4_MI4 (0x00000010)
  677. #define FLEXCAN_RXIMR4_MI5 (0x00000020)
  678. #define FLEXCAN_RXIMR4_MI6 (0x00000040)
  679. #define FLEXCAN_RXIMR4_MI7 (0x00000080)
  680. #define FLEXCAN_RXIMR4_MI8 (0x00000100)
  681. #define FLEXCAN_RXIMR4_MI9 (0x00000200)
  682. #define FLEXCAN_RXIMR4_MI10 (0x00000400)
  683. #define FLEXCAN_RXIMR4_MI11 (0x00000800)
  684. #define FLEXCAN_RXIMR4_MI12 (0x00001000)
  685. #define FLEXCAN_RXIMR4_MI13 (0x00002000)
  686. #define FLEXCAN_RXIMR4_MI14 (0x00004000)
  687. #define FLEXCAN_RXIMR4_MI15 (0x00008000)
  688. #define FLEXCAN_RXIMR4_MI16 (0x00010000)
  689. #define FLEXCAN_RXIMR4_MI17 (0x00020000)
  690. #define FLEXCAN_RXIMR4_MI18 (0x00040000)
  691. #define FLEXCAN_RXIMR4_MI19 (0x00080000)
  692. #define FLEXCAN_RXIMR4_MI20 (0x00100000)
  693. #define FLEXCAN_RXIMR4_MI21 (0x00200000)
  694. #define FLEXCAN_RXIMR4_MI22 (0x00400000)
  695. #define FLEXCAN_RXIMR4_MI23 (0x00800000)
  696. #define FLEXCAN_RXIMR4_MI24 (0x01000000)
  697. #define FLEXCAN_RXIMR4_MI25 (0x02000000)
  698. #define FLEXCAN_RXIMR4_MI26 (0x04000000)
  699. #define FLEXCAN_RXIMR4_MI27 (0x08000000)
  700. #define FLEXCAN_RXIMR4_MI28 (0x10000000)
  701. #define FLEXCAN_RXIMR4_MI29 (0x20000000)
  702. #define FLEXCAN_RXIMR4_MI30 (0x40000000)
  703. #define FLEXCAN_RXIMR4_MI31 (0x80000000)
  704. /* Bit definitions and macros for FLEXCAN_RXIMR5 */
  705. #define FLEXCAN_RXIMR5_MI0 (0x00000001)
  706. #define FLEXCAN_RXIMR5_MI1 (0x00000002)
  707. #define FLEXCAN_RXIMR5_MI2 (0x00000004)
  708. #define FLEXCAN_RXIMR5_MI3 (0x00000008)
  709. #define FLEXCAN_RXIMR5_MI4 (0x00000010)
  710. #define FLEXCAN_RXIMR5_MI5 (0x00000020)
  711. #define FLEXCAN_RXIMR5_MI6 (0x00000040)
  712. #define FLEXCAN_RXIMR5_MI7 (0x00000080)
  713. #define FLEXCAN_RXIMR5_MI8 (0x00000100)
  714. #define FLEXCAN_RXIMR5_MI9 (0x00000200)
  715. #define FLEXCAN_RXIMR5_MI10 (0x00000400)
  716. #define FLEXCAN_RXIMR5_MI11 (0x00000800)
  717. #define FLEXCAN_RXIMR5_MI12 (0x00001000)
  718. #define FLEXCAN_RXIMR5_MI13 (0x00002000)
  719. #define FLEXCAN_RXIMR5_MI14 (0x00004000)
  720. #define FLEXCAN_RXIMR5_MI15 (0x00008000)
  721. #define FLEXCAN_RXIMR5_MI16 (0x00010000)
  722. #define FLEXCAN_RXIMR5_MI17 (0x00020000)
  723. #define FLEXCAN_RXIMR5_MI18 (0x00040000)
  724. #define FLEXCAN_RXIMR5_MI19 (0x00080000)
  725. #define FLEXCAN_RXIMR5_MI20 (0x00100000)
  726. #define FLEXCAN_RXIMR5_MI21 (0x00200000)
  727. #define FLEXCAN_RXIMR5_MI22 (0x00400000)
  728. #define FLEXCAN_RXIMR5_MI23 (0x00800000)
  729. #define FLEXCAN_RXIMR5_MI24 (0x01000000)
  730. #define FLEXCAN_RXIMR5_MI25 (0x02000000)
  731. #define FLEXCAN_RXIMR5_MI26 (0x04000000)
  732. #define FLEXCAN_RXIMR5_MI27 (0x08000000)
  733. #define FLEXCAN_RXIMR5_MI28 (0x10000000)
  734. #define FLEXCAN_RXIMR5_MI29 (0x20000000)
  735. #define FLEXCAN_RXIMR5_MI30 (0x40000000)
  736. #define FLEXCAN_RXIMR5_MI31 (0x80000000)
  737. /* Bit definitions and macros for FLEXCAN_RXIMR6 */
  738. #define FLEXCAN_RXIMR6_MI0 (0x00000001)
  739. #define FLEXCAN_RXIMR6_MI1 (0x00000002)
  740. #define FLEXCAN_RXIMR6_MI2 (0x00000004)
  741. #define FLEXCAN_RXIMR6_MI3 (0x00000008)
  742. #define FLEXCAN_RXIMR6_MI4 (0x00000010)
  743. #define FLEXCAN_RXIMR6_MI5 (0x00000020)
  744. #define FLEXCAN_RXIMR6_MI6 (0x00000040)
  745. #define FLEXCAN_RXIMR6_MI7 (0x00000080)
  746. #define FLEXCAN_RXIMR6_MI8 (0x00000100)
  747. #define FLEXCAN_RXIMR6_MI9 (0x00000200)
  748. #define FLEXCAN_RXIMR6_MI10 (0x00000400)
  749. #define FLEXCAN_RXIMR6_MI11 (0x00000800)
  750. #define FLEXCAN_RXIMR6_MI12 (0x00001000)
  751. #define FLEXCAN_RXIMR6_MI13 (0x00002000)
  752. #define FLEXCAN_RXIMR6_MI14 (0x00004000)
  753. #define FLEXCAN_RXIMR6_MI15 (0x00008000)
  754. #define FLEXCAN_RXIMR6_MI16 (0x00010000)
  755. #define FLEXCAN_RXIMR6_MI17 (0x00020000)
  756. #define FLEXCAN_RXIMR6_MI18 (0x00040000)
  757. #define FLEXCAN_RXIMR6_MI19 (0x00080000)
  758. #define FLEXCAN_RXIMR6_MI20 (0x00100000)
  759. #define FLEXCAN_RXIMR6_MI21 (0x00200000)
  760. #define FLEXCAN_RXIMR6_MI22 (0x00400000)
  761. #define FLEXCAN_RXIMR6_MI23 (0x00800000)
  762. #define FLEXCAN_RXIMR6_MI24 (0x01000000)
  763. #define FLEXCAN_RXIMR6_MI25 (0x02000000)
  764. #define FLEXCAN_RXIMR6_MI26 (0x04000000)
  765. #define FLEXCAN_RXIMR6_MI27 (0x08000000)
  766. #define FLEXCAN_RXIMR6_MI28 (0x10000000)
  767. #define FLEXCAN_RXIMR6_MI29 (0x20000000)
  768. #define FLEXCAN_RXIMR6_MI30 (0x40000000)
  769. #define FLEXCAN_RXIMR6_MI31 (0x80000000)
  770. /* Bit definitions and macros for FLEXCAN_RXIMR7 */
  771. #define FLEXCAN_RXIMR7_MI0 (0x00000001)
  772. #define FLEXCAN_RXIMR7_MI1 (0x00000002)
  773. #define FLEXCAN_RXIMR7_MI2 (0x00000004)
  774. #define FLEXCAN_RXIMR7_MI3 (0x00000008)
  775. #define FLEXCAN_RXIMR7_MI4 (0x00000010)
  776. #define FLEXCAN_RXIMR7_MI5 (0x00000020)
  777. #define FLEXCAN_RXIMR7_MI6 (0x00000040)
  778. #define FLEXCAN_RXIMR7_MI7 (0x00000080)
  779. #define FLEXCAN_RXIMR7_MI8 (0x00000100)
  780. #define FLEXCAN_RXIMR7_MI9 (0x00000200)
  781. #define FLEXCAN_RXIMR7_MI10 (0x00000400)
  782. #define FLEXCAN_RXIMR7_MI11 (0x00000800)
  783. #define FLEXCAN_RXIMR7_MI12 (0x00001000)
  784. #define FLEXCAN_RXIMR7_MI13 (0x00002000)
  785. #define FLEXCAN_RXIMR7_MI14 (0x00004000)
  786. #define FLEXCAN_RXIMR7_MI15 (0x00008000)
  787. #define FLEXCAN_RXIMR7_MI16 (0x00010000)
  788. #define FLEXCAN_RXIMR7_MI17 (0x00020000)
  789. #define FLEXCAN_RXIMR7_MI18 (0x00040000)
  790. #define FLEXCAN_RXIMR7_MI19 (0x00080000)
  791. #define FLEXCAN_RXIMR7_MI20 (0x00100000)
  792. #define FLEXCAN_RXIMR7_MI21 (0x00200000)
  793. #define FLEXCAN_RXIMR7_MI22 (0x00400000)
  794. #define FLEXCAN_RXIMR7_MI23 (0x00800000)
  795. #define FLEXCAN_RXIMR7_MI24 (0x01000000)
  796. #define FLEXCAN_RXIMR7_MI25 (0x02000000)
  797. #define FLEXCAN_RXIMR7_MI26 (0x04000000)
  798. #define FLEXCAN_RXIMR7_MI27 (0x08000000)
  799. #define FLEXCAN_RXIMR7_MI28 (0x10000000)
  800. #define FLEXCAN_RXIMR7_MI29 (0x20000000)
  801. #define FLEXCAN_RXIMR7_MI30 (0x40000000)
  802. #define FLEXCAN_RXIMR7_MI31 (0x80000000)
  803. /* Bit definitions and macros for FLEXCAN_RXIMR8 */
  804. #define FLEXCAN_RXIMR8_MI0 (0x00000001)
  805. #define FLEXCAN_RXIMR8_MI1 (0x00000002)
  806. #define FLEXCAN_RXIMR8_MI2 (0x00000004)
  807. #define FLEXCAN_RXIMR8_MI3 (0x00000008)
  808. #define FLEXCAN_RXIMR8_MI4 (0x00000010)
  809. #define FLEXCAN_RXIMR8_MI5 (0x00000020)
  810. #define FLEXCAN_RXIMR8_MI6 (0x00000040)
  811. #define FLEXCAN_RXIMR8_MI7 (0x00000080)
  812. #define FLEXCAN_RXIMR8_MI8 (0x00000100)
  813. #define FLEXCAN_RXIMR8_MI9 (0x00000200)
  814. #define FLEXCAN_RXIMR8_MI10 (0x00000400)
  815. #define FLEXCAN_RXIMR8_MI11 (0x00000800)
  816. #define FLEXCAN_RXIMR8_MI12 (0x00001000)
  817. #define FLEXCAN_RXIMR8_MI13 (0x00002000)
  818. #define FLEXCAN_RXIMR8_MI14 (0x00004000)
  819. #define FLEXCAN_RXIMR8_MI15 (0x00008000)
  820. #define FLEXCAN_RXIMR8_MI16 (0x00010000)
  821. #define FLEXCAN_RXIMR8_MI17 (0x00020000)
  822. #define FLEXCAN_RXIMR8_MI18 (0x00040000)
  823. #define FLEXCAN_RXIMR8_MI19 (0x00080000)
  824. #define FLEXCAN_RXIMR8_MI20 (0x00100000)
  825. #define FLEXCAN_RXIMR8_MI21 (0x00200000)
  826. #define FLEXCAN_RXIMR8_MI22 (0x00400000)
  827. #define FLEXCAN_RXIMR8_MI23 (0x00800000)
  828. #define FLEXCAN_RXIMR8_MI24 (0x01000000)
  829. #define FLEXCAN_RXIMR8_MI25 (0x02000000)
  830. #define FLEXCAN_RXIMR8_MI26 (0x04000000)
  831. #define FLEXCAN_RXIMR8_MI27 (0x08000000)
  832. #define FLEXCAN_RXIMR8_MI28 (0x10000000)
  833. #define FLEXCAN_RXIMR8_MI29 (0x20000000)
  834. #define FLEXCAN_RXIMR8_MI30 (0x40000000)
  835. #define FLEXCAN_RXIMR8_MI31 (0x80000000)
  836. /* Bit definitions and macros for FLEXCAN_RXIMR9 */
  837. #define FLEXCAN_RXIMR9_MI0 (0x00000001)
  838. #define FLEXCAN_RXIMR9_MI1 (0x00000002)
  839. #define FLEXCAN_RXIMR9_MI2 (0x00000004)
  840. #define FLEXCAN_RXIMR9_MI3 (0x00000008)
  841. #define FLEXCAN_RXIMR9_MI4 (0x00000010)
  842. #define FLEXCAN_RXIMR9_MI5 (0x00000020)
  843. #define FLEXCAN_RXIMR9_MI6 (0x00000040)
  844. #define FLEXCAN_RXIMR9_MI7 (0x00000080)
  845. #define FLEXCAN_RXIMR9_MI8 (0x00000100)
  846. #define FLEXCAN_RXIMR9_MI9 (0x00000200)
  847. #define FLEXCAN_RXIMR9_MI10 (0x00000400)
  848. #define FLEXCAN_RXIMR9_MI11 (0x00000800)
  849. #define FLEXCAN_RXIMR9_MI12 (0x00001000)
  850. #define FLEXCAN_RXIMR9_MI13 (0x00002000)
  851. #define FLEXCAN_RXIMR9_MI14 (0x00004000)
  852. #define FLEXCAN_RXIMR9_MI15 (0x00008000)
  853. #define FLEXCAN_RXIMR9_MI16 (0x00010000)
  854. #define FLEXCAN_RXIMR9_MI17 (0x00020000)
  855. #define FLEXCAN_RXIMR9_MI18 (0x00040000)
  856. #define FLEXCAN_RXIMR9_MI19 (0x00080000)
  857. #define FLEXCAN_RXIMR9_MI20 (0x00100000)
  858. #define FLEXCAN_RXIMR9_MI21 (0x00200000)
  859. #define FLEXCAN_RXIMR9_MI22 (0x00400000)
  860. #define FLEXCAN_RXIMR9_MI23 (0x00800000)
  861. #define FLEXCAN_RXIMR9_MI24 (0x01000000)
  862. #define FLEXCAN_RXIMR9_MI25 (0x02000000)
  863. #define FLEXCAN_RXIMR9_MI26 (0x04000000)
  864. #define FLEXCAN_RXIMR9_MI27 (0x08000000)
  865. #define FLEXCAN_RXIMR9_MI28 (0x10000000)
  866. #define FLEXCAN_RXIMR9_MI29 (0x20000000)
  867. #define FLEXCAN_RXIMR9_MI30 (0x40000000)
  868. #define FLEXCAN_RXIMR9_MI31 (0x80000000)
  869. /* Bit definitions and macros for FLEXCAN_RXIMR10 */
  870. #define FLEXCAN_RXIMR10_MI0 (0x00000001)
  871. #define FLEXCAN_RXIMR10_MI1 (0x00000002)
  872. #define FLEXCAN_RXIMR10_MI2 (0x00000004)
  873. #define FLEXCAN_RXIMR10_MI3 (0x00000008)
  874. #define FLEXCAN_RXIMR10_MI4 (0x00000010)
  875. #define FLEXCAN_RXIMR10_MI5 (0x00000020)
  876. #define FLEXCAN_RXIMR10_MI6 (0x00000040)
  877. #define FLEXCAN_RXIMR10_MI7 (0x00000080)
  878. #define FLEXCAN_RXIMR10_MI8 (0x00000100)
  879. #define FLEXCAN_RXIMR10_MI9 (0x00000200)
  880. #define FLEXCAN_RXIMR10_MI10 (0x00000400)
  881. #define FLEXCAN_RXIMR10_MI11 (0x00000800)
  882. #define FLEXCAN_RXIMR10_MI12 (0x00001000)
  883. #define FLEXCAN_RXIMR10_MI13 (0x00002000)
  884. #define FLEXCAN_RXIMR10_MI14 (0x00004000)
  885. #define FLEXCAN_RXIMR10_MI15 (0x00008000)
  886. #define FLEXCAN_RXIMR10_MI16 (0x00010000)
  887. #define FLEXCAN_RXIMR10_MI17 (0x00020000)
  888. #define FLEXCAN_RXIMR10_MI18 (0x00040000)
  889. #define FLEXCAN_RXIMR10_MI19 (0x00080000)
  890. #define FLEXCAN_RXIMR10_MI20 (0x00100000)
  891. #define FLEXCAN_RXIMR10_MI21 (0x00200000)
  892. #define FLEXCAN_RXIMR10_MI22 (0x00400000)
  893. #define FLEXCAN_RXIMR10_MI23 (0x00800000)
  894. #define FLEXCAN_RXIMR10_MI24 (0x01000000)
  895. #define FLEXCAN_RXIMR10_MI25 (0x02000000)
  896. #define FLEXCAN_RXIMR10_MI26 (0x04000000)
  897. #define FLEXCAN_RXIMR10_MI27 (0x08000000)
  898. #define FLEXCAN_RXIMR10_MI28 (0x10000000)
  899. #define FLEXCAN_RXIMR10_MI29 (0x20000000)
  900. #define FLEXCAN_RXIMR10_MI30 (0x40000000)
  901. #define FLEXCAN_RXIMR10_MI31 (0x80000000)
  902. /* Bit definitions and macros for FLEXCAN_RXIMR11 */
  903. #define FLEXCAN_RXIMR11_MI0 (0x00000001)
  904. #define FLEXCAN_RXIMR11_MI1 (0x00000002)
  905. #define FLEXCAN_RXIMR11_MI2 (0x00000004)
  906. #define FLEXCAN_RXIMR11_MI3 (0x00000008)
  907. #define FLEXCAN_RXIMR11_MI4 (0x00000010)
  908. #define FLEXCAN_RXIMR11_MI5 (0x00000020)
  909. #define FLEXCAN_RXIMR11_MI6 (0x00000040)
  910. #define FLEXCAN_RXIMR11_MI7 (0x00000080)
  911. #define FLEXCAN_RXIMR11_MI8 (0x00000100)
  912. #define FLEXCAN_RXIMR11_MI9 (0x00000200)
  913. #define FLEXCAN_RXIMR11_MI10 (0x00000400)
  914. #define FLEXCAN_RXIMR11_MI11 (0x00000800)
  915. #define FLEXCAN_RXIMR11_MI12 (0x00001000)
  916. #define FLEXCAN_RXIMR11_MI13 (0x00002000)
  917. #define FLEXCAN_RXIMR11_MI14 (0x00004000)
  918. #define FLEXCAN_RXIMR11_MI15 (0x00008000)
  919. #define FLEXCAN_RXIMR11_MI16 (0x00010000)
  920. #define FLEXCAN_RXIMR11_MI17 (0x00020000)
  921. #define FLEXCAN_RXIMR11_MI18 (0x00040000)
  922. #define FLEXCAN_RXIMR11_MI19 (0x00080000)
  923. #define FLEXCAN_RXIMR11_MI20 (0x00100000)
  924. #define FLEXCAN_RXIMR11_MI21 (0x00200000)
  925. #define FLEXCAN_RXIMR11_MI22 (0x00400000)
  926. #define FLEXCAN_RXIMR11_MI23 (0x00800000)
  927. #define FLEXCAN_RXIMR11_MI24 (0x01000000)
  928. #define FLEXCAN_RXIMR11_MI25 (0x02000000)
  929. #define FLEXCAN_RXIMR11_MI26 (0x04000000)
  930. #define FLEXCAN_RXIMR11_MI27 (0x08000000)
  931. #define FLEXCAN_RXIMR11_MI28 (0x10000000)
  932. #define FLEXCAN_RXIMR11_MI29 (0x20000000)
  933. #define FLEXCAN_RXIMR11_MI30 (0x40000000)
  934. #define FLEXCAN_RXIMR11_MI31 (0x80000000)
  935. /* Bit definitions and macros for FLEXCAN_RXIMR12 */
  936. #define FLEXCAN_RXIMR12_MI0 (0x00000001)
  937. #define FLEXCAN_RXIMR12_MI1 (0x00000002)
  938. #define FLEXCAN_RXIMR12_MI2 (0x00000004)
  939. #define FLEXCAN_RXIMR12_MI3 (0x00000008)
  940. #define FLEXCAN_RXIMR12_MI4 (0x00000010)
  941. #define FLEXCAN_RXIMR12_MI5 (0x00000020)
  942. #define FLEXCAN_RXIMR12_MI6 (0x00000040)
  943. #define FLEXCAN_RXIMR12_MI7 (0x00000080)
  944. #define FLEXCAN_RXIMR12_MI8 (0x00000100)
  945. #define FLEXCAN_RXIMR12_MI9 (0x00000200)
  946. #define FLEXCAN_RXIMR12_MI10 (0x00000400)
  947. #define FLEXCAN_RXIMR12_MI11 (0x00000800)
  948. #define FLEXCAN_RXIMR12_MI12 (0x00001000)
  949. #define FLEXCAN_RXIMR12_MI13 (0x00002000)
  950. #define FLEXCAN_RXIMR12_MI14 (0x00004000)
  951. #define FLEXCAN_RXIMR12_MI15 (0x00008000)
  952. #define FLEXCAN_RXIMR12_MI16 (0x00010000)
  953. #define FLEXCAN_RXIMR12_MI17 (0x00020000)
  954. #define FLEXCAN_RXIMR12_MI18 (0x00040000)
  955. #define FLEXCAN_RXIMR12_MI19 (0x00080000)
  956. #define FLEXCAN_RXIMR12_MI20 (0x00100000)
  957. #define FLEXCAN_RXIMR12_MI21 (0x00200000)
  958. #define FLEXCAN_RXIMR12_MI22 (0x00400000)
  959. #define FLEXCAN_RXIMR12_MI23 (0x00800000)
  960. #define FLEXCAN_RXIMR12_MI24 (0x01000000)
  961. #define FLEXCAN_RXIMR12_MI25 (0x02000000)
  962. #define FLEXCAN_RXIMR12_MI26 (0x04000000)
  963. #define FLEXCAN_RXIMR12_MI27 (0x08000000)
  964. #define FLEXCAN_RXIMR12_MI28 (0x10000000)
  965. #define FLEXCAN_RXIMR12_MI29 (0x20000000)
  966. #define FLEXCAN_RXIMR12_MI30 (0x40000000)
  967. #define FLEXCAN_RXIMR12_MI31 (0x80000000)
  968. /* Bit definitions and macros for FLEXCAN_RXIMR13 */
  969. #define FLEXCAN_RXIMR13_MI0 (0x00000001)
  970. #define FLEXCAN_RXIMR13_MI1 (0x00000002)
  971. #define FLEXCAN_RXIMR13_MI2 (0x00000004)
  972. #define FLEXCAN_RXIMR13_MI3 (0x00000008)
  973. #define FLEXCAN_RXIMR13_MI4 (0x00000010)
  974. #define FLEXCAN_RXIMR13_MI5 (0x00000020)
  975. #define FLEXCAN_RXIMR13_MI6 (0x00000040)
  976. #define FLEXCAN_RXIMR13_MI7 (0x00000080)
  977. #define FLEXCAN_RXIMR13_MI8 (0x00000100)
  978. #define FLEXCAN_RXIMR13_MI9 (0x00000200)
  979. #define FLEXCAN_RXIMR13_MI10 (0x00000400)
  980. #define FLEXCAN_RXIMR13_MI11 (0x00000800)
  981. #define FLEXCAN_RXIMR13_MI12 (0x00001000)
  982. #define FLEXCAN_RXIMR13_MI13 (0x00002000)
  983. #define FLEXCAN_RXIMR13_MI14 (0x00004000)
  984. #define FLEXCAN_RXIMR13_MI15 (0x00008000)
  985. #define FLEXCAN_RXIMR13_MI16 (0x00010000)
  986. #define FLEXCAN_RXIMR13_MI17 (0x00020000)
  987. #define FLEXCAN_RXIMR13_MI18 (0x00040000)
  988. #define FLEXCAN_RXIMR13_MI19 (0x00080000)
  989. #define FLEXCAN_RXIMR13_MI20 (0x00100000)
  990. #define FLEXCAN_RXIMR13_MI21 (0x00200000)
  991. #define FLEXCAN_RXIMR13_MI22 (0x00400000)
  992. #define FLEXCAN_RXIMR13_MI23 (0x00800000)
  993. #define FLEXCAN_RXIMR13_MI24 (0x01000000)
  994. #define FLEXCAN_RXIMR13_MI25 (0x02000000)
  995. #define FLEXCAN_RXIMR13_MI26 (0x04000000)
  996. #define FLEXCAN_RXIMR13_MI27 (0x08000000)
  997. #define FLEXCAN_RXIMR13_MI28 (0x10000000)
  998. #define FLEXCAN_RXIMR13_MI29 (0x20000000)
  999. #define FLEXCAN_RXIMR13_MI30 (0x40000000)
  1000. #define FLEXCAN_RXIMR13_MI31 (0x80000000)
  1001. /* Bit definitions and macros for FLEXCAN_RXIMR14 */
  1002. #define FLEXCAN_RXIMR14_MI0 (0x00000001)
  1003. #define FLEXCAN_RXIMR14_MI1 (0x00000002)
  1004. #define FLEXCAN_RXIMR14_MI2 (0x00000004)
  1005. #define FLEXCAN_RXIMR14_MI3 (0x00000008)
  1006. #define FLEXCAN_RXIMR14_MI4 (0x00000010)
  1007. #define FLEXCAN_RXIMR14_MI5 (0x00000020)
  1008. #define FLEXCAN_RXIMR14_MI6 (0x00000040)
  1009. #define FLEXCAN_RXIMR14_MI7 (0x00000080)
  1010. #define FLEXCAN_RXIMR14_MI8 (0x00000100)
  1011. #define FLEXCAN_RXIMR14_MI9 (0x00000200)
  1012. #define FLEXCAN_RXIMR14_MI10 (0x00000400)
  1013. #define FLEXCAN_RXIMR14_MI11 (0x00000800)
  1014. #define FLEXCAN_RXIMR14_MI12 (0x00001000)
  1015. #define FLEXCAN_RXIMR14_MI13 (0x00002000)
  1016. #define FLEXCAN_RXIMR14_MI14 (0x00004000)
  1017. #define FLEXCAN_RXIMR14_MI15 (0x00008000)
  1018. #define FLEXCAN_RXIMR14_MI16 (0x00010000)
  1019. #define FLEXCAN_RXIMR14_MI17 (0x00020000)
  1020. #define FLEXCAN_RXIMR14_MI18 (0x00040000)
  1021. #define FLEXCAN_RXIMR14_MI19 (0x00080000)
  1022. #define FLEXCAN_RXIMR14_MI20 (0x00100000)
  1023. #define FLEXCAN_RXIMR14_MI21 (0x00200000)
  1024. #define FLEXCAN_RXIMR14_MI22 (0x00400000)
  1025. #define FLEXCAN_RXIMR14_MI23 (0x00800000)
  1026. #define FLEXCAN_RXIMR14_MI24 (0x01000000)
  1027. #define FLEXCAN_RXIMR14_MI25 (0x02000000)
  1028. #define FLEXCAN_RXIMR14_MI26 (0x04000000)
  1029. #define FLEXCAN_RXIMR14_MI27 (0x08000000)
  1030. #define FLEXCAN_RXIMR14_MI28 (0x10000000)
  1031. #define FLEXCAN_RXIMR14_MI29 (0x20000000)
  1032. #define FLEXCAN_RXIMR14_MI30 (0x40000000)
  1033. #define FLEXCAN_RXIMR14_MI31 (0x80000000)
  1034. /* Bit definitions and macros for FLEXCAN_RXIMR15 */
  1035. #define FLEXCAN_RXIMR15_MI0 (0x00000001)
  1036. #define FLEXCAN_RXIMR15_MI1 (0x00000002)
  1037. #define FLEXCAN_RXIMR15_MI2 (0x00000004)
  1038. #define FLEXCAN_RXIMR15_MI3 (0x00000008)
  1039. #define FLEXCAN_RXIMR15_MI4 (0x00000010)
  1040. #define FLEXCAN_RXIMR15_MI5 (0x00000020)
  1041. #define FLEXCAN_RXIMR15_MI6 (0x00000040)
  1042. #define FLEXCAN_RXIMR15_MI7 (0x00000080)
  1043. #define FLEXCAN_RXIMR15_MI8 (0x00000100)
  1044. #define FLEXCAN_RXIMR15_MI9 (0x00000200)
  1045. #define FLEXCAN_RXIMR15_MI10 (0x00000400)
  1046. #define FLEXCAN_RXIMR15_MI11 (0x00000800)
  1047. #define FLEXCAN_RXIMR15_MI12 (0x00001000)
  1048. #define FLEXCAN_RXIMR15_MI13 (0x00002000)
  1049. #define FLEXCAN_RXIMR15_MI14 (0x00004000)
  1050. #define FLEXCAN_RXIMR15_MI15 (0x00008000)
  1051. #define FLEXCAN_RXIMR15_MI16 (0x00010000)
  1052. #define FLEXCAN_RXIMR15_MI17 (0x00020000)
  1053. #define FLEXCAN_RXIMR15_MI18 (0x00040000)
  1054. #define FLEXCAN_RXIMR15_MI19 (0x00080000)
  1055. #define FLEXCAN_RXIMR15_MI20 (0x00100000)
  1056. #define FLEXCAN_RXIMR15_MI21 (0x00200000)
  1057. #define FLEXCAN_RXIMR15_MI22 (0x00400000)
  1058. #define FLEXCAN_RXIMR15_MI23 (0x00800000)
  1059. #define FLEXCAN_RXIMR15_MI24 (0x01000000)
  1060. #define FLEXCAN_RXIMR15_MI25 (0x02000000)
  1061. #define FLEXCAN_RXIMR15_MI26 (0x04000000)
  1062. #define FLEXCAN_RXIMR15_MI27 (0x08000000)
  1063. #define FLEXCAN_RXIMR15_MI28 (0x10000000)
  1064. #define FLEXCAN_RXIMR15_MI29 (0x20000000)
  1065. #define FLEXCAN_RXIMR15_MI30 (0x40000000)
  1066. #define FLEXCAN_RXIMR15_MI31 (0x80000000)
  1067. /* Bit definitions for CRC register */
  1068. #define FLEXCAN_CRCR_MBCRC_BIT_NO (16)
  1069. #define FLEXCAN_CRCR_MBCRC_MASK (0x007F0000)
  1070. #define FLEXCAN_CRCR_CRC_BIT_NO (0)
  1071. #define FLEXCAN_CRCR_CRC_MASK (0x00007FFF)
  1072. /* Bit definition for Individual Matching Elements Update Register (IMEUR) */
  1073. #define FLEXCAN_IMEUR_IMEUP_MASK (0x0000007F)
  1074. #define FLEXCAN_IMEUR_IMEUP_BIT_NO (0)
  1075. #define FLEXCAN_IMEUR_IMEUREQ_MASK (0x00000100)
  1076. #define FLEXCAN_IMEUR_IMEUACK_MASK (0x00000200)
  1077. #define FLEXCAN_Set_IMEUP(imeur,imeup) imeur = (imeur & ~(FLEXCAN_IMEUR_IMEUP_MASK)) | (imeup & FLEXCAN_IMEUR_IMEUP_MASK)
  1078. #define FLEXCAN_Get_IMEUP(imeur) (imeur & FLEXCAN_IMEUR_IMEUP_MASK)
  1079. /* Bit definition for Lost Rx Frames Register (LRFR)
  1080. */
  1081. #define FLEXCAN_LRFR_LOSTRLP_MASK (0x007F0000)
  1082. #define FLEXCAN_LRFR_LFIFOMTC_MASK (0x00008000)
  1083. #define FLEXCAN_LRFR_LOSTRMP_MASK (0x000001FF)
  1084. #define FLEXCAN_LRFR_LOSTRLP_BIT_NO (16)
  1085. #define FLEXCAN_LRFR_LFIFOMTC_BIT_NO (15)
  1086. #define FLEXCAN_LRFR_LOSTRMP_BIT_NO (0)
  1087. #define FLEXCAN_Get_LostMBLocked(lrfr) ((lrfr & FLEXCAN_LRFR_LOSTRLP_MASK)>>(FLEXCAN_LRFR_LOSTRLP_BIT_NO))
  1088. #define FLEXCAN_Get_LostMBUpdated(lrfr) ((lrfr & FLEXCAN_LRFR_LOSTRMP_MASK))
  1089. /* Bit definition for Memory Error Control Register */
  1090. #define FLEXCAN_MECR_NCEFAFRZ_MASK (0x00000080)
  1091. #define FLEXCAN_MECR_RERRDIS_MASK (0x00000100)
  1092. #define FLEXCAN_MECR_EXTERRIE_MAKS (0x00002000)
  1093. #define FLEXCAN_MECR_FAERRIE_MAKS (0x00004000)
  1094. #define FLEXCAN_MECR_HAERRIE_MAKS (0x00008000)
  1095. #define FLEXCAN_MECR_CEI_MSK_MAKS (0x00010000)
  1096. #define FLEXCAN_MECR_FANCEI_MSK_MAKS (0x00040000)
  1097. #define FLEXCAN_MECR_HANCEI_MSK_MAKS (0x00080000)
  1098. #define FLEXCAN_MECR_ECRWRDIS_MSK_MAKS (0x80000000)
  1099. /* Bit definition for Error Report Address Register (RERRAR) */
  1100. #define FLEXCAN_RERRAR_NCE_MASK (0x01000000)
  1101. #define FLEXCAN_RERRAR_SAID_MASK (0x00070000)
  1102. #define FLEXCAN_ERRADDR_MASK (0x00003FFF)
  1103. /* Bit definition for Error Report Syndrome Register (RERRSYNR) */
  1104. #define FLEXCAN_RERRSYNR_BE3_MASK (0x80000000)
  1105. #define FLEXCAN_RERRSYNR_SYND3_MASK (0x1F000000)
  1106. #define FLEXCAN_RERRSYNR_SYND3_BIT_NO (24)
  1107. #define FLEXCAN_RERRSYNR_BE2_MASK (0x00800000)
  1108. #define FLEXCAN_RERRSYNR_SYND2_MASK (0x001F0000)
  1109. #define FLEXCAN_RERRSYNR_SYND2_BIT_NO (16)
  1110. #define FLEXCAN_RERRSYNR_BE1_MASK (0x00008000)
  1111. #define FLEXCAN_RERRSYNR_SYND1_MASK (0x00001F00)
  1112. #define FLEXCAN_RERRSYNR_SYND1_BIT_NO (8)
  1113. #define FLEXCAN_RERRSYNR_BE0_MASK (0x00000080)
  1114. #define FLEXCAN_RERRSYNR_SYND0_MASK (0x0000001F)
  1115. #define FLEXCAN_RERRSYNR_SYND0_BIT_NO (0)
  1116. #define FLEXCAN_RERRSYNR_check_BEn_Bit(errsynr,n) (errsynr & FLEXCAN_RERRSYNR_BE##n##_MASK)
  1117. #define FLEXCAN_RERRSYNR_get_SYNDn(errsynr,n) (errsynr & FLEXCAN_RERRSYNR_SYND##n##_MASK)
  1118. #define FLEXCAN_RERRSYNR_check_SYNDn_Bit(errsynr,n) ((errsynr & FLEXCAN_RERRSYNR_SYND##n##_MASK)>>FLEXCAN_RERRSYNR_SYND##n##_BIT_NO)
  1119. /* Bit definition for Error Status Register (ERRSR) */
  1120. #define FLEXCAN_ERRSR_CEIOF_MASK (0x00000001)
  1121. #define FLEXCAN_ERRSR_FANCEIOF_MASK (0x00000004)
  1122. #define FLEXCAN_ERRSR_HANCEIOF_MASK (0x00000008)
  1123. #define FLEXCAN_ERRSR_CEIF_MASK (0x00010000)
  1124. #define FLEXCAN_ERRSR_FANCEIF_MASK (0x00040000)
  1125. #define FLEXCAN_ERRSR_HANCEIF_MASK (0x00080000)
  1126. /********************************************************************/
  1127. #endif // __KINETIS_FLEXCAN_H