hpm_can_regs.h 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402
  1. /*
  2. * Copyright (c) 2021-2023 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef HPM_CAN_H
  8. #define HPM_CAN_H
  9. typedef struct {
  10. __RW uint32_t RBUF[20]; /* 0x0 - 0x4C: receive buffer registers and reception time stamp */
  11. __RW uint32_t TBUF[18]; /* 0x50 - 0x94: transmit buffer register */
  12. __R uint32_t TTS[2]; /* 0x98 - 0x9C: transmission time stamp, LSB 32bit */
  13. __RW uint32_t CMD_STA_CMD_CTRL; /* 0xA0: config, status, command and control bits */
  14. __RW uint8_t RTIE; /* 0xA4: Receive and Transmit Interrupt Enable Register RTIE */
  15. __W uint8_t RTIF; /* 0xA5: Receive and Transmit Interrupt Flag Register RTIF (0xa5) */
  16. __RW uint8_t ERRINT; /* 0xA6: ERRor INTerrupt Enable and Flag Register ERRINT */
  17. __RW uint8_t LIMIT; /* 0xA7: Warning Limits Register LIMIT */
  18. __RW uint32_t S_PRESC; /* 0xA8: Bit Timing Register(Slow Speed) */
  19. __RW uint32_t F_PRESC; /* 0xAC: Bit Timing Register(Fast Speed) */
  20. __R uint8_t EALCAP; /* 0xB0: Error and Arbitration Lost Capture Register EALCAP */
  21. __RW uint8_t TDC; /* 0xB1: Transmitter Delay Compensation Register TDC */
  22. __R uint8_t RECNT; /* 0xB2: Error Counter Registers RECNT */
  23. __R uint8_t TECNT; /* 0xB3: Error Counter Registers TECNT */
  24. __RW uint8_t ACFCTRL; /* 0xB4: Acceptance Filter Control Register ACFCTRL */
  25. __RW uint8_t TIMECFG; /* 0xB5: CiA 603 Time-Stamping TIMECFG */
  26. __RW uint16_t ACF_EN; /* 0xB6: Acceptance Filter Enable ACF_EN */
  27. __RW uint32_t ACF; /* 0xB8: Acceptance CODE ACODE or ACMASK */
  28. __RW uint16_t VER; /* 0xBC: Version Information VER */
  29. __RW uint8_t TBSLOT; /* 0xBE: TTCAN: TB Slot Pointer TBSLOT */
  30. __RW uint8_t TTCFG; /* 0xBF: TTCAN: Time Trigger Configuration TTCFG */
  31. __RW uint32_t REF_MSG; /* 0xC0: TTCAN: Reference Message REF_MSG */
  32. __RW uint16_t TRIG_CFG; /* 0xC4: TTCAN: Trigger Configuration TRIG_CFG */
  33. __RW uint16_t TT_TRIG; /* 0xC6: TTCAN: Trigger Time TT_TRIG */
  34. __RW uint16_t TT_WTRIG; /* 0xC8: TTCAN: Watch Trigger Time TT_WTRIG */
  35. } CAN_Type;
  36. /* Bitfield definition for register array: RBUF */
  37. /*
  38. * RBUF (RW)
  39. *
  40. * receive buffer
  41. */
  42. #define CAN_RBUF_RBUF_MASK (0xFFFFFFFFUL)
  43. #define CAN_RBUF_RBUF_SHIFT (0U)
  44. #define CAN_RBUF_RBUF_SET(x) (((uint32_t)(x) << CAN_RBUF_RBUF_SHIFT) & CAN_RBUF_RBUF_MASK)
  45. #define CAN_RBUF_RBUF_GET(x) (((uint32_t)(x) & CAN_RBUF_RBUF_MASK) >> CAN_RBUF_RBUF_SHIFT)
  46. /* Bitfield definition for register array: TBUF */
  47. /*
  48. * TBUF (RW)
  49. *
  50. * transmit buffer
  51. */
  52. #define CAN_TBUF_TBUF_MASK (0xFFFFFFFFUL)
  53. #define CAN_TBUF_TBUF_SHIFT (0U)
  54. #define CAN_TBUF_TBUF_SET(x) (((uint32_t)(x) << CAN_TBUF_TBUF_SHIFT) & CAN_TBUF_TBUF_MASK)
  55. #define CAN_TBUF_TBUF_GET(x) (((uint32_t)(x) & CAN_TBUF_TBUF_MASK) >> CAN_TBUF_TBUF_SHIFT)
  56. /* Bitfield definition for register array: TTS */
  57. /*
  58. * TTS_WRD0 (RO)
  59. *
  60. * transmission time stamp, word 0, LSB 32bit
  61. */
  62. #define CAN_TTS_TTS_WRD0_MASK (0xFFFFFFFFUL)
  63. #define CAN_TTS_TTS_WRD0_SHIFT (0U)
  64. #define CAN_TTS_TTS_WRD0_GET(x) (((uint32_t)(x) & CAN_TTS_TTS_WRD0_MASK) >> CAN_TTS_TTS_WRD0_SHIFT)
  65. /* Bitfield definition for register: CMD_STA_CMD_CTRL */
  66. /*
  67. * SACK (RW)
  68. *
  69. * Self-ACKnowledge
  70. * 0 – no self-ACK
  71. * 1 – self-ACK when LBME=1
  72. */
  73. #define CAN_CMD_STA_CMD_CTRL_SACK_MASK (0x80000000UL)
  74. #define CAN_CMD_STA_CMD_CTRL_SACK_SHIFT (31U)
  75. #define CAN_CMD_STA_CMD_CTRL_SACK_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_SACK_SHIFT) & CAN_CMD_STA_CMD_CTRL_SACK_MASK)
  76. #define CAN_CMD_STA_CMD_CTRL_SACK_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_SACK_MASK) >> CAN_CMD_STA_CMD_CTRL_SACK_SHIFT)
  77. /*
  78. * ROM (RW)
  79. *
  80. * Receive buffer Overflow Mode
  81. * In case of a full RBUF when a new message is received, then ROM selects the following:
  82. * 1 – The new message will not be stored.
  83. * 0 – The oldest message will be overwritten.
  84. */
  85. #define CAN_CMD_STA_CMD_CTRL_ROM_MASK (0x40000000UL)
  86. #define CAN_CMD_STA_CMD_CTRL_ROM_SHIFT (30U)
  87. #define CAN_CMD_STA_CMD_CTRL_ROM_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_ROM_SHIFT) & CAN_CMD_STA_CMD_CTRL_ROM_MASK)
  88. #define CAN_CMD_STA_CMD_CTRL_ROM_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_ROM_MASK) >> CAN_CMD_STA_CMD_CTRL_ROM_SHIFT)
  89. /*
  90. * ROV (RO)
  91. *
  92. * Receive buffer OVerflow
  93. * 1 – Overflow. At least one message is lost.
  94. * 0 – No Overflow.
  95. * ROV is cleared by setting RREL=1.
  96. */
  97. #define CAN_CMD_STA_CMD_CTRL_ROV_MASK (0x20000000UL)
  98. #define CAN_CMD_STA_CMD_CTRL_ROV_SHIFT (29U)
  99. #define CAN_CMD_STA_CMD_CTRL_ROV_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_ROV_MASK) >> CAN_CMD_STA_CMD_CTRL_ROV_SHIFT)
  100. /*
  101. * RREL (RW)
  102. *
  103. * Receive buffer RELease
  104. * The host controller has read the actual RB slot and releases it. Afterwards the CAN-CTRL
  105. * core points to the next RB slot. RSTAT gets updated.
  106. * 1 – Release: The host has read the RB.
  107. * 0 – No release
  108. */
  109. #define CAN_CMD_STA_CMD_CTRL_RREL_MASK (0x10000000UL)
  110. #define CAN_CMD_STA_CMD_CTRL_RREL_SHIFT (28U)
  111. #define CAN_CMD_STA_CMD_CTRL_RREL_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_RREL_SHIFT) & CAN_CMD_STA_CMD_CTRL_RREL_MASK)
  112. #define CAN_CMD_STA_CMD_CTRL_RREL_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_RREL_MASK) >> CAN_CMD_STA_CMD_CTRL_RREL_SHIFT)
  113. /*
  114. * RBALL (RW)
  115. *
  116. * Receive Buffer stores ALL data frames
  117. * 0 – normal operation
  118. * 1 – RB stores correct data frames as well as data frames with error
  119. */
  120. #define CAN_CMD_STA_CMD_CTRL_RBALL_MASK (0x8000000UL)
  121. #define CAN_CMD_STA_CMD_CTRL_RBALL_SHIFT (27U)
  122. #define CAN_CMD_STA_CMD_CTRL_RBALL_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_RBALL_SHIFT) & CAN_CMD_STA_CMD_CTRL_RBALL_MASK)
  123. #define CAN_CMD_STA_CMD_CTRL_RBALL_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_RBALL_MASK) >> CAN_CMD_STA_CMD_CTRL_RBALL_SHIFT)
  124. /*
  125. * RSTAT (RO)
  126. *
  127. * Receive buffer STATus
  128. * 00 - empty
  129. * 01 - > empty and < almost full (AFWL)
  130. * 10 -  almost full (programmable threshold by AFWL) but not full and no overflow
  131. * 11 - full (stays set in case of overflow – for overflow signaling see ROV)
  132. */
  133. #define CAN_CMD_STA_CMD_CTRL_RSTAT_MASK (0x3000000UL)
  134. #define CAN_CMD_STA_CMD_CTRL_RSTAT_SHIFT (24U)
  135. #define CAN_CMD_STA_CMD_CTRL_RSTAT_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_RSTAT_MASK) >> CAN_CMD_STA_CMD_CTRL_RSTAT_SHIFT)
  136. /*
  137. * FD_ISO (RW)
  138. *
  139. * CAN FD ISO mode
  140. * 0 - Bosch CAN FD (non-ISO) mode
  141. * 1 - ISO CAN FD mode (ISO 11898-1:2015)
  142. * ISO CAN FD mode has a different CRC initialization value and an additional stuff bit count.
  143. * Both modes are incompatible and must not be mixed in one CAN network.
  144. * This bit has no impact to CAN 2.0B.
  145. * This bit is only writeable if RESET=1.
  146. */
  147. #define CAN_CMD_STA_CMD_CTRL_FD_ISO_MASK (0x800000UL)
  148. #define CAN_CMD_STA_CMD_CTRL_FD_ISO_SHIFT (23U)
  149. #define CAN_CMD_STA_CMD_CTRL_FD_ISO_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_FD_ISO_SHIFT) & CAN_CMD_STA_CMD_CTRL_FD_ISO_MASK)
  150. #define CAN_CMD_STA_CMD_CTRL_FD_ISO_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_FD_ISO_MASK) >> CAN_CMD_STA_CMD_CTRL_FD_ISO_SHIFT)
  151. /*
  152. * TSNEXT (RW)
  153. *
  154. * Transmit buffer Secondary NEXT
  155. * 0 - no action
  156. * 1 - STB slot filled, select next slot.
  157. * After all frame bytes are written to the TBUF registers, the host controller has to set
  158. * TSNEXT to signal that this slot has been filled. Then the CAN-CTRL core connects the TBUF
  159. * registers to the next slot. Once a slot is marked as filled a transmission can be started
  160. * using TSONE or TSALL.
  161. * It is possible to set TSNEXT and TSONE or TSALL together in one write access.
  162. * TSNEXT has to be set by the host controller and is automatically reset by the CAN-CTRL
  163. * core immediately after it was set.
  164. * Setting TSNEXT is meaningless if TBSEL=0. In this case TSNEXT is ignored and
  165. * automatically cleared. It does not do any harm.
  166. * If all slots of the STB are filled, TSNEXT stays set until a slot becomes free.
  167. * TSNEXT has no meaning in TTCAN mode and is fixed to 0.
  168. */
  169. #define CAN_CMD_STA_CMD_CTRL_TSNEXT_MASK (0x400000UL)
  170. #define CAN_CMD_STA_CMD_CTRL_TSNEXT_SHIFT (22U)
  171. #define CAN_CMD_STA_CMD_CTRL_TSNEXT_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSNEXT_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSNEXT_MASK)
  172. #define CAN_CMD_STA_CMD_CTRL_TSNEXT_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSNEXT_MASK) >> CAN_CMD_STA_CMD_CTRL_TSNEXT_SHIFT)
  173. /*
  174. * TSMODE (RW)
  175. *
  176. * Transmit buffer Secondary operation MODE
  177. * 0 - FIFO mode
  178. * 1 - priority decision mode
  179. * In FIFO mode frames are transmitted in the order in that they are written into the STB.
  180. * In priority decision mode the frame with the highest priority in the STB is automatically
  181. * transmitted first. The ID of a frame is used for the priority decision. A lower ID means a
  182. * higher priority of a frame. A frame in the PTB has always the highest priority regardless of
  183. * the ID.
  184. * TSMODE shall be switched only if the STB if empty
  185. */
  186. #define CAN_CMD_STA_CMD_CTRL_TSMODE_MASK (0x200000UL)
  187. #define CAN_CMD_STA_CMD_CTRL_TSMODE_SHIFT (21U)
  188. #define CAN_CMD_STA_CMD_CTRL_TSMODE_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSMODE_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSMODE_MASK)
  189. #define CAN_CMD_STA_CMD_CTRL_TSMODE_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSMODE_MASK) >> CAN_CMD_STA_CMD_CTRL_TSMODE_SHIFT)
  190. /*
  191. * TTTBM (RW)
  192. *
  193. * TTCAN Transmit Buffer Mode
  194. * If TTEN=0 then TTTBM is ignored, otherwise the following is valid:
  195. * 0 - separate PTB and STB, behavior defined by TSMODE
  196. * 1 - full TTCAN support: buffer slots selectable by TBPTR and TTPTR
  197. * For event-driven CAN communication (TTEN=0), the system provides PTB and STB and
  198. * the behavior of the STB is defined by TSMODE. Then TTTBM is ignored.
  199. * For time-triggered CAN communication (TTEN=1) with full support of all features including
  200. * time-triggered transmissions, TTTBM=1 needs to be chosen. Then the all TB slots are
  201. * addressable using TTPTR and TBPTR.
  202. * For time-triggered CAN communication (TTEN=1) with only support of reception timestamps, TTTBM=0 can be chosen. Then the transmit buffer acts as in event-driven mode
  203. * and the behavior can be selected by TSMODE.
  204. * TTTBM shall be switched only if the TBUF is empty.
  205. */
  206. #define CAN_CMD_STA_CMD_CTRL_TTTBM_MASK (0x100000UL)
  207. #define CAN_CMD_STA_CMD_CTRL_TTTBM_SHIFT (20U)
  208. #define CAN_CMD_STA_CMD_CTRL_TTTBM_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TTTBM_SHIFT) & CAN_CMD_STA_CMD_CTRL_TTTBM_MASK)
  209. #define CAN_CMD_STA_CMD_CTRL_TTTBM_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TTTBM_MASK) >> CAN_CMD_STA_CMD_CTRL_TTTBM_SHIFT)
  210. /*
  211. * TSSTAT (RO)
  212. *
  213. * Transmission Secondary STATus bits
  214. * If TTEN=0 or TTTBM=0:
  215. * 00 – STB is empty
  216. * 01 – STB is less than or equal to half full
  217. * 10 – STB is more than half full
  218. * 11 – STB is full
  219. * If the STB is disabled using STB_DISABLE, then TSSTAT=00.
  220. * If TTEN=1 and TTTBM=1:
  221. * 00 – PTB and STB are empty
  222. * 01 – PTB and STB are not empty and not full
  223. * 11 – PTB and STB are full
  224. */
  225. #define CAN_CMD_STA_CMD_CTRL_TSSTAT_MASK (0x30000UL)
  226. #define CAN_CMD_STA_CMD_CTRL_TSSTAT_SHIFT (16U)
  227. #define CAN_CMD_STA_CMD_CTRL_TSSTAT_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSSTAT_MASK) >> CAN_CMD_STA_CMD_CTRL_TSSTAT_SHIFT)
  228. /*
  229. * TBSEL (RW)
  230. *
  231. * Transmit Buffer Select
  232. * Selects the transmit buffer to be loaded with a message. Use the TBUF registers for
  233. * access. TBSEL needs to be stable all the time the TBUF registers are written and when
  234. * TSNEXT is set.
  235. * 0 - PTB (high-priority buffer)
  236. * 1 - STB
  237. * The bit will be reset to the hardware reset value if (TTEN=1 and TTTBM=1)
  238. */
  239. #define CAN_CMD_STA_CMD_CTRL_TBSEL_MASK (0x8000U)
  240. #define CAN_CMD_STA_CMD_CTRL_TBSEL_SHIFT (15U)
  241. #define CAN_CMD_STA_CMD_CTRL_TBSEL_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TBSEL_SHIFT) & CAN_CMD_STA_CMD_CTRL_TBSEL_MASK)
  242. #define CAN_CMD_STA_CMD_CTRL_TBSEL_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TBSEL_MASK) >> CAN_CMD_STA_CMD_CTRL_TBSEL_SHIFT)
  243. /*
  244. * LOM (RW)
  245. *
  246. * Listen Only Mode
  247. * 0 - Disabled
  248. * 1 - Enabled
  249. * LOM cannot be set if TPE, TSONE or TSALL is set. No transmission can be started if LOM
  250. * is enabled and LBME is disabled.
  251. * LOM=1 and LBME=0 disables all transmissions.
  252. * LOM=1 and LBME=1 disables the ACK for received frames and error frames, but enables
  253. * the transmission of own frames.
  254. */
  255. #define CAN_CMD_STA_CMD_CTRL_LOM_MASK (0x4000U)
  256. #define CAN_CMD_STA_CMD_CTRL_LOM_SHIFT (14U)
  257. #define CAN_CMD_STA_CMD_CTRL_LOM_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_LOM_SHIFT) & CAN_CMD_STA_CMD_CTRL_LOM_MASK)
  258. #define CAN_CMD_STA_CMD_CTRL_LOM_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_LOM_MASK) >> CAN_CMD_STA_CMD_CTRL_LOM_SHIFT)
  259. /*
  260. * STBY (RW)
  261. *
  262. * Transceiver Standby Mode
  263. * 0 - Disabled
  264. * 1 - Enabled
  265. * This register bit is connected to the output signal stby which can be used to control a
  266. * standby mode of a transceiver.
  267. * STBY cannot be set to 1 if TPE=1, TSONE=1 or TSALL=1.
  268. * If the host sets STBY to 0 then the host needs to wait for the time required by the
  269. * transceiver to start up before the host requests a new transmission.
  270. */
  271. #define CAN_CMD_STA_CMD_CTRL_STBY_MASK (0x2000U)
  272. #define CAN_CMD_STA_CMD_CTRL_STBY_SHIFT (13U)
  273. #define CAN_CMD_STA_CMD_CTRL_STBY_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_STBY_SHIFT) & CAN_CMD_STA_CMD_CTRL_STBY_MASK)
  274. #define CAN_CMD_STA_CMD_CTRL_STBY_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_STBY_MASK) >> CAN_CMD_STA_CMD_CTRL_STBY_SHIFT)
  275. /*
  276. * TPE (RW)
  277. *
  278. * Transmit Primary Enable
  279. * 1 - Transmission enable for the message in the high-priority PTB
  280. * 0 - No transmission for the PTB
  281. * If TPE is set, the message from the PTB will be transmitted at the next possible transmit
  282. * position. A started transmission from the STB will be completed before, but pending new
  283. * messages are delayed until the PTB message has been transmitted.
  284. * TPE stays set until the message has been transmitted successfully or it is aborted using
  285. * TPA.
  286. * The host controller can set TPE to 1 but can not reset it to 0. This would only be possible
  287. * using TPA and aborting the message.
  288. * The bit will be reset to the hardware reset value if RESET=1, STBY=1, (LOM=1 and
  289. * LBME=0) or (TTEN=1 and TTTBM=1).
  290. */
  291. #define CAN_CMD_STA_CMD_CTRL_TPE_MASK (0x1000U)
  292. #define CAN_CMD_STA_CMD_CTRL_TPE_SHIFT (12U)
  293. #define CAN_CMD_STA_CMD_CTRL_TPE_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TPE_SHIFT) & CAN_CMD_STA_CMD_CTRL_TPE_MASK)
  294. #define CAN_CMD_STA_CMD_CTRL_TPE_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TPE_MASK) >> CAN_CMD_STA_CMD_CTRL_TPE_SHIFT)
  295. /*
  296. * TPA (RW)
  297. *
  298. * Transmit Primary Abort
  299. * 1 – Aborts a transmission from PTB which has been requested by TPE=1 but not
  300. * started yet. (The data bytes of the message remains in the PTB.)
  301. * 0 – no abort
  302. * The bit has to be set by the host controller and will be reset by CAN-CTRL. Setting TPA
  303. * automatically de-asserts TPE.
  304. * The host controller can set TPA to 1 but can not reset it to 0.
  305. * During the short time while the CAN-CTRL core resets the bit, it cannot be set by the
  306. * host.
  307. * The bit will be reset to the hardware reset value if RESET=1 or (TTEN=1 and TTTBM=1).
  308. * TPA should not be set simultaneously with TPE.
  309. */
  310. #define CAN_CMD_STA_CMD_CTRL_TPA_MASK (0x800U)
  311. #define CAN_CMD_STA_CMD_CTRL_TPA_SHIFT (11U)
  312. #define CAN_CMD_STA_CMD_CTRL_TPA_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TPA_SHIFT) & CAN_CMD_STA_CMD_CTRL_TPA_MASK)
  313. #define CAN_CMD_STA_CMD_CTRL_TPA_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TPA_MASK) >> CAN_CMD_STA_CMD_CTRL_TPA_SHIFT)
  314. /*
  315. * TSONE (RW)
  316. *
  317. * Transmit Secondary ONE frame
  318. * 1 – Transmission enable of one in the STB. In FIFO mode this is the oldest message
  319. * and in priority mode this is the one with the highest priority.
  320. * TSONE in priority mode is difficult to handle, because it is not always clear which
  321. * message will be transmitted if new messages are written to the STB meanwhile.
  322. * The controller starts the transmission as soon as the bus becomes vacant and
  323. * no request of the PTB (bit TPE) is pending.
  324. * 0 – No transmission for the STB.
  325. * TSONE stays set until the message has been transmitted successfully or it is aborted
  326. * using TSA.
  327. * The host controller can set TSONE to 1 but can not reset it to 0. This would only be
  328. * possible using TSA and aborting the message.
  329. * The bit will be reset to the hardware reset value if RESET=1, STBY=1, (LOM=1 and
  330. * LBME=0) or (TTEN=1 and TTTBM=1).
  331. */
  332. #define CAN_CMD_STA_CMD_CTRL_TSONE_MASK (0x400U)
  333. #define CAN_CMD_STA_CMD_CTRL_TSONE_SHIFT (10U)
  334. #define CAN_CMD_STA_CMD_CTRL_TSONE_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSONE_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSONE_MASK)
  335. #define CAN_CMD_STA_CMD_CTRL_TSONE_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSONE_MASK) >> CAN_CMD_STA_CMD_CTRL_TSONE_SHIFT)
  336. /*
  337. * TSALL (RW)
  338. *
  339. * Transmit Secondary ALL frames
  340. * 1 – Transmission enable of all messages in the STB.
  341. * The controller starts the transmission as soon as the bus becomes vacant and
  342. * no request of the PTB (bit TPE) is pending.
  343. * 0 – No transmission for the STB.
  344. * TSALL stays set until all messages have been transmitted successfully or they are aborted
  345. * using TSA.
  346. * The host controller can set TSALL to 1 but can not reset it to 0. This would only be
  347. * possible using TSA and aborting the messages.
  348. * The bit will be reset to the hardware reset value if RESET=1, STBY=1, (LOM=1 and
  349. * LBME=0) or (TTEN=1 and TTTBM=1).
  350. * If during a transmission the STB is loaded with a new frame then the new frame will be
  351. * transmitted too. In other words: a transmission initiated by TSALL is finished when the
  352. * STB becomes empty.
  353. */
  354. #define CAN_CMD_STA_CMD_CTRL_TSALL_MASK (0x200U)
  355. #define CAN_CMD_STA_CMD_CTRL_TSALL_SHIFT (9U)
  356. #define CAN_CMD_STA_CMD_CTRL_TSALL_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSALL_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSALL_MASK)
  357. #define CAN_CMD_STA_CMD_CTRL_TSALL_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSALL_MASK) >> CAN_CMD_STA_CMD_CTRL_TSALL_SHIFT)
  358. /*
  359. * TSA (RW)
  360. *
  361. * Transmit Secondary Abort
  362. * 1 – Aborts a transmission from STB which has been requested but not started yet.
  363. * For a TSONE transmission, only one frame is aborted while for a TSALL
  364. * Transmission, all frames are aborted.
  365. * One or all message slots will be released which updates TSSTAT.
  366. * All aborted messages are lost because they are not accessible any more.
  367. * If in priority mode a TSONE transmission is aborted, then it is not clear which
  368. * frame will be aborted if new frames are written to the STB meanwhile.
  369. * 0 – no abort
  370. * The bit has to be set by the host controller and will be reset by CAN-CTRL. Setting TSA,automatically de-asserts TSONE or TSALL respectively.
  371. * The host controller can set TSA to 1 but can not reset it to 0.
  372. * The bit will be reset to the hardware reset value if RESET=1.
  373. * TSA should not be set simultaneously with TSONE or TSALL.
  374. */
  375. #define CAN_CMD_STA_CMD_CTRL_TSA_MASK (0x100U)
  376. #define CAN_CMD_STA_CMD_CTRL_TSA_SHIFT (8U)
  377. #define CAN_CMD_STA_CMD_CTRL_TSA_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSA_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSA_MASK)
  378. #define CAN_CMD_STA_CMD_CTRL_TSA_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSA_MASK) >> CAN_CMD_STA_CMD_CTRL_TSA_SHIFT)
  379. /*
  380. * RESET (RW)
  381. *
  382. * RESET request bit
  383. * 1 - The host controller performs a local reset of CAN-CTRL.
  384. * 0 - no local reset of CAN-CTRLThe some register (e.g for node configuration) can only be modified if RESET=1.
  385. * Bit RESET forces several components to a reset state.
  386. * RESET is automatically set if the node enters “bus off” state.
  387. * Note that a CAN node will participate in CAN communication after RESET is switched to 0after 11 CAN bit times.
  388. * This delay is required by the CAN standard (bus idle time).If RESET is set to 1 and immediately set to 0, then it takes some time until RESET can beread as 0 and becomes inactive.
  389. * The reason is clock domain crossing from host to CAN clockdomain. RESET is held active as long as needed depending on the relation between host andCAN clock.
  390. */
  391. #define CAN_CMD_STA_CMD_CTRL_RESET_MASK (0x80U)
  392. #define CAN_CMD_STA_CMD_CTRL_RESET_SHIFT (7U)
  393. #define CAN_CMD_STA_CMD_CTRL_RESET_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_RESET_SHIFT) & CAN_CMD_STA_CMD_CTRL_RESET_MASK)
  394. #define CAN_CMD_STA_CMD_CTRL_RESET_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_RESET_MASK) >> CAN_CMD_STA_CMD_CTRL_RESET_SHIFT)
  395. /*
  396. * LBME (RW)
  397. *
  398. * Loop Back Mode, External
  399. * 0 - Disabled
  400. * 1 - EnabledLBME should not be enabled while a transmission is active
  401. */
  402. #define CAN_CMD_STA_CMD_CTRL_LBME_MASK (0x40U)
  403. #define CAN_CMD_STA_CMD_CTRL_LBME_SHIFT (6U)
  404. #define CAN_CMD_STA_CMD_CTRL_LBME_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_LBME_SHIFT) & CAN_CMD_STA_CMD_CTRL_LBME_MASK)
  405. #define CAN_CMD_STA_CMD_CTRL_LBME_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_LBME_MASK) >> CAN_CMD_STA_CMD_CTRL_LBME_SHIFT)
  406. /*
  407. * LBMI (RW)
  408. *
  409. * Loop Back Mode, Internal
  410. * 0 - Disabled1 - EnabledLBMI should not be enabled while a transmission is active.
  411. */
  412. #define CAN_CMD_STA_CMD_CTRL_LBMI_MASK (0x20U)
  413. #define CAN_CMD_STA_CMD_CTRL_LBMI_SHIFT (5U)
  414. #define CAN_CMD_STA_CMD_CTRL_LBMI_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_LBMI_SHIFT) & CAN_CMD_STA_CMD_CTRL_LBMI_MASK)
  415. #define CAN_CMD_STA_CMD_CTRL_LBMI_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_LBMI_MASK) >> CAN_CMD_STA_CMD_CTRL_LBMI_SHIFT)
  416. /*
  417. * TPSS (RW)
  418. *
  419. * Transmission Primary Single Shot mode for PTB
  420. * 0 - Disabled
  421. * 1 - Enabled
  422. */
  423. #define CAN_CMD_STA_CMD_CTRL_TPSS_MASK (0x10U)
  424. #define CAN_CMD_STA_CMD_CTRL_TPSS_SHIFT (4U)
  425. #define CAN_CMD_STA_CMD_CTRL_TPSS_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TPSS_SHIFT) & CAN_CMD_STA_CMD_CTRL_TPSS_MASK)
  426. #define CAN_CMD_STA_CMD_CTRL_TPSS_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TPSS_MASK) >> CAN_CMD_STA_CMD_CTRL_TPSS_SHIFT)
  427. /*
  428. * TSSS (RW)
  429. *
  430. * Transmission Secondary Single Shot mode for STB
  431. * 0 - Disabled
  432. * 1 - Enabled
  433. */
  434. #define CAN_CMD_STA_CMD_CTRL_TSSS_MASK (0x8U)
  435. #define CAN_CMD_STA_CMD_CTRL_TSSS_SHIFT (3U)
  436. #define CAN_CMD_STA_CMD_CTRL_TSSS_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_TSSS_SHIFT) & CAN_CMD_STA_CMD_CTRL_TSSS_MASK)
  437. #define CAN_CMD_STA_CMD_CTRL_TSSS_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TSSS_MASK) >> CAN_CMD_STA_CMD_CTRL_TSSS_SHIFT)
  438. /*
  439. * RACTIVE (RO)
  440. *
  441. * Reception ACTIVE (Receive Status bit)
  442. * 1 - The controller is currently receiving a frame.
  443. * 0 - No receive activity.
  444. */
  445. #define CAN_CMD_STA_CMD_CTRL_RACTIVE_MASK (0x4U)
  446. #define CAN_CMD_STA_CMD_CTRL_RACTIVE_SHIFT (2U)
  447. #define CAN_CMD_STA_CMD_CTRL_RACTIVE_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_RACTIVE_MASK) >> CAN_CMD_STA_CMD_CTRL_RACTIVE_SHIFT)
  448. /*
  449. * TACTIVE (RO)
  450. *
  451. * Transmission ACTIVE (Transmit Status bit)
  452. * 1 - The controller is currently transmitting a frame.
  453. * 0 - No transmit activity.
  454. */
  455. #define CAN_CMD_STA_CMD_CTRL_TACTIVE_MASK (0x2U)
  456. #define CAN_CMD_STA_CMD_CTRL_TACTIVE_SHIFT (1U)
  457. #define CAN_CMD_STA_CMD_CTRL_TACTIVE_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_TACTIVE_MASK) >> CAN_CMD_STA_CMD_CTRL_TACTIVE_SHIFT)
  458. /*
  459. * BUSOFF (RW)
  460. *
  461. * Bus Off (Bus Status bit)
  462. * 1 - The controller status is “bus off”.
  463. * 0 - The controller status is “bus on”.
  464. * Writing a 1 to BUSOFF will reset TECNT and RECNT. This should be done only for debugging.
  465. * See Chapter 3.9.10.6 for details.
  466. */
  467. #define CAN_CMD_STA_CMD_CTRL_BUSOFF_MASK (0x1U)
  468. #define CAN_CMD_STA_CMD_CTRL_BUSOFF_SHIFT (0U)
  469. #define CAN_CMD_STA_CMD_CTRL_BUSOFF_SET(x) (((uint32_t)(x) << CAN_CMD_STA_CMD_CTRL_BUSOFF_SHIFT) & CAN_CMD_STA_CMD_CTRL_BUSOFF_MASK)
  470. #define CAN_CMD_STA_CMD_CTRL_BUSOFF_GET(x) (((uint32_t)(x) & CAN_CMD_STA_CMD_CTRL_BUSOFF_MASK) >> CAN_CMD_STA_CMD_CTRL_BUSOFF_SHIFT)
  471. /* Bitfield definition for register: RTIE */
  472. /*
  473. * RIE (RW)
  474. *
  475. * Receive Interrupt Enable
  476. * 0 – Disabled, 1 – Enabled
  477. */
  478. #define CAN_RTIE_RIE_MASK (0x80U)
  479. #define CAN_RTIE_RIE_SHIFT (7U)
  480. #define CAN_RTIE_RIE_SET(x) (((uint8_t)(x) << CAN_RTIE_RIE_SHIFT) & CAN_RTIE_RIE_MASK)
  481. #define CAN_RTIE_RIE_GET(x) (((uint8_t)(x) & CAN_RTIE_RIE_MASK) >> CAN_RTIE_RIE_SHIFT)
  482. /*
  483. * ROIE (RW)
  484. *
  485. * RB Overrun Interrupt Enable
  486. * 0 – Disabled, 1 – Enabled
  487. */
  488. #define CAN_RTIE_ROIE_MASK (0x40U)
  489. #define CAN_RTIE_ROIE_SHIFT (6U)
  490. #define CAN_RTIE_ROIE_SET(x) (((uint8_t)(x) << CAN_RTIE_ROIE_SHIFT) & CAN_RTIE_ROIE_MASK)
  491. #define CAN_RTIE_ROIE_GET(x) (((uint8_t)(x) & CAN_RTIE_ROIE_MASK) >> CAN_RTIE_ROIE_SHIFT)
  492. /*
  493. * RFIE (RW)
  494. *
  495. * RB Full Interrupt Enable
  496. * 0 – Disabled, 1 – Enabled
  497. */
  498. #define CAN_RTIE_RFIE_MASK (0x20U)
  499. #define CAN_RTIE_RFIE_SHIFT (5U)
  500. #define CAN_RTIE_RFIE_SET(x) (((uint8_t)(x) << CAN_RTIE_RFIE_SHIFT) & CAN_RTIE_RFIE_MASK)
  501. #define CAN_RTIE_RFIE_GET(x) (((uint8_t)(x) & CAN_RTIE_RFIE_MASK) >> CAN_RTIE_RFIE_SHIFT)
  502. /*
  503. * RAFIE (RW)
  504. *
  505. * RB Almost Full Interrupt Enable
  506. * 0 – Disabled, 1 – Enabled
  507. */
  508. #define CAN_RTIE_RAFIE_MASK (0x10U)
  509. #define CAN_RTIE_RAFIE_SHIFT (4U)
  510. #define CAN_RTIE_RAFIE_SET(x) (((uint8_t)(x) << CAN_RTIE_RAFIE_SHIFT) & CAN_RTIE_RAFIE_MASK)
  511. #define CAN_RTIE_RAFIE_GET(x) (((uint8_t)(x) & CAN_RTIE_RAFIE_MASK) >> CAN_RTIE_RAFIE_SHIFT)
  512. /*
  513. * TPIE (RW)
  514. *
  515. * Transmission Primary Interrupt Enable
  516. * 0 – Disabled, 1 – Enabled
  517. */
  518. #define CAN_RTIE_TPIE_MASK (0x8U)
  519. #define CAN_RTIE_TPIE_SHIFT (3U)
  520. #define CAN_RTIE_TPIE_SET(x) (((uint8_t)(x) << CAN_RTIE_TPIE_SHIFT) & CAN_RTIE_TPIE_MASK)
  521. #define CAN_RTIE_TPIE_GET(x) (((uint8_t)(x) & CAN_RTIE_TPIE_MASK) >> CAN_RTIE_TPIE_SHIFT)
  522. /*
  523. * TSIE (RW)
  524. *
  525. * Transmission Secondary Interrupt Enable
  526. * 0 – Disabled, 1 – Enabled
  527. */
  528. #define CAN_RTIE_TSIE_MASK (0x4U)
  529. #define CAN_RTIE_TSIE_SHIFT (2U)
  530. #define CAN_RTIE_TSIE_SET(x) (((uint8_t)(x) << CAN_RTIE_TSIE_SHIFT) & CAN_RTIE_TSIE_MASK)
  531. #define CAN_RTIE_TSIE_GET(x) (((uint8_t)(x) & CAN_RTIE_TSIE_MASK) >> CAN_RTIE_TSIE_SHIFT)
  532. /*
  533. * EIE (RW)
  534. *
  535. * Error Interrupt Enable
  536. * 0 – Disabled, 1 – Enabled
  537. */
  538. #define CAN_RTIE_EIE_MASK (0x2U)
  539. #define CAN_RTIE_EIE_SHIFT (1U)
  540. #define CAN_RTIE_EIE_SET(x) (((uint8_t)(x) << CAN_RTIE_EIE_SHIFT) & CAN_RTIE_EIE_MASK)
  541. #define CAN_RTIE_EIE_GET(x) (((uint8_t)(x) & CAN_RTIE_EIE_MASK) >> CAN_RTIE_EIE_SHIFT)
  542. /*
  543. * TSFF (RO)
  544. *
  545. * If TTEN=0 or TTTBM=0: Transmit Secondary buffer Full Flag
  546. * 1 - The STB is filled with the maximal number of messages.
  547. * 0 - The STB is not filled with the maximal number of messages.
  548. * If the STB is disabled using STB_DISABLE, then TSFF=0.
  549. * If TTEN=1 and TTTBM=1: Transmit buffer Slot Full Flag
  550. * 1 - The buffer slot selected by TBPTR is filled.
  551. * 0 - The buffer slot selected by TBPTR is empty.
  552. */
  553. #define CAN_RTIE_TSFF_MASK (0x1U)
  554. #define CAN_RTIE_TSFF_SHIFT (0U)
  555. #define CAN_RTIE_TSFF_GET(x) (((uint8_t)(x) & CAN_RTIE_TSFF_MASK) >> CAN_RTIE_TSFF_SHIFT)
  556. /* Bitfield definition for register: RTIF */
  557. /*
  558. * RIF (W1C)
  559. *
  560. * Receive Interrupt Flag
  561. * 1 - Data or a remote frame has been received and is available in the receive buffer.
  562. * 0 - No frame has been received.
  563. */
  564. #define CAN_RTIF_RIF_MASK (0x80U)
  565. #define CAN_RTIF_RIF_SHIFT (7U)
  566. #define CAN_RTIF_RIF_SET(x) (((uint8_t)(x) << CAN_RTIF_RIF_SHIFT) & CAN_RTIF_RIF_MASK)
  567. #define CAN_RTIF_RIF_GET(x) (((uint8_t)(x) & CAN_RTIF_RIF_MASK) >> CAN_RTIF_RIF_SHIFT)
  568. /*
  569. * ROIF (W1C)
  570. *
  571. * RB Overrun Interrupt Flag
  572. * 1 - At least one received message has been overwritten in the RB.
  573. * 0 - No RB overwritten.
  574. * In case of an overrun both ROIF and RFIF will be set.
  575. */
  576. #define CAN_RTIF_ROIF_MASK (0x40U)
  577. #define CAN_RTIF_ROIF_SHIFT (6U)
  578. #define CAN_RTIF_ROIF_SET(x) (((uint8_t)(x) << CAN_RTIF_ROIF_SHIFT) & CAN_RTIF_ROIF_MASK)
  579. #define CAN_RTIF_ROIF_GET(x) (((uint8_t)(x) & CAN_RTIF_ROIF_MASK) >> CAN_RTIF_ROIF_SHIFT)
  580. /*
  581. * RFIF (W1C)
  582. *
  583. * RB Full Interrupt Flag
  584. * 1 - All RBs are full. If no RB will be released until the next valid message is received,
  585. * the oldest message will be lost.
  586. * 0 - The RB FIFO is not full.
  587. */
  588. #define CAN_RTIF_RFIF_MASK (0x20U)
  589. #define CAN_RTIF_RFIF_SHIFT (5U)
  590. #define CAN_RTIF_RFIF_SET(x) (((uint8_t)(x) << CAN_RTIF_RFIF_SHIFT) & CAN_RTIF_RFIF_MASK)
  591. #define CAN_RTIF_RFIF_GET(x) (((uint8_t)(x) & CAN_RTIF_RFIF_MASK) >> CAN_RTIF_RFIF_SHIFT)
  592. /*
  593. * RAFIF (W1C)
  594. *
  595. * RB Almost Full Interrupt Flag
  596. * 1 - number of filled RB slots >= AFWL_i
  597. * 0 - number of filled RB slots < AFWL_i
  598. */
  599. #define CAN_RTIF_RAFIF_MASK (0x10U)
  600. #define CAN_RTIF_RAFIF_SHIFT (4U)
  601. #define CAN_RTIF_RAFIF_SET(x) (((uint8_t)(x) << CAN_RTIF_RAFIF_SHIFT) & CAN_RTIF_RAFIF_MASK)
  602. #define CAN_RTIF_RAFIF_GET(x) (((uint8_t)(x) & CAN_RTIF_RAFIF_MASK) >> CAN_RTIF_RAFIF_SHIFT)
  603. /*
  604. * TPIF (W1C)
  605. *
  606. * Transmission Primary Interrupt Flag
  607. * 1 - The requested transmission of the PTB has been successfully completed.
  608. * 0 - No transmission of the PTB has been completed.
  609. * In TTCAN mode, TPIF will never be set. Then only TSIF is valid.
  610. */
  611. #define CAN_RTIF_TPIF_MASK (0x8U)
  612. #define CAN_RTIF_TPIF_SHIFT (3U)
  613. #define CAN_RTIF_TPIF_SET(x) (((uint8_t)(x) << CAN_RTIF_TPIF_SHIFT) & CAN_RTIF_TPIF_MASK)
  614. #define CAN_RTIF_TPIF_GET(x) (((uint8_t)(x) & CAN_RTIF_TPIF_MASK) >> CAN_RTIF_TPIF_SHIFT)
  615. /*
  616. * TSIF (W1C)
  617. *
  618. * Transmission Secondary Interrupt Flag
  619. * 1 - The requested transmission of the STB has been successfully completed.
  620. * 0 - No transmission of the STB has been completed successfully.
  621. * In TTCAN mode TSIF will signal all successful transmissions, regardless of storage location of
  622. * the message.
  623. */
  624. #define CAN_RTIF_TSIF_MASK (0x4U)
  625. #define CAN_RTIF_TSIF_SHIFT (2U)
  626. #define CAN_RTIF_TSIF_SET(x) (((uint8_t)(x) << CAN_RTIF_TSIF_SHIFT) & CAN_RTIF_TSIF_MASK)
  627. #define CAN_RTIF_TSIF_GET(x) (((uint8_t)(x) & CAN_RTIF_TSIF_MASK) >> CAN_RTIF_TSIF_SHIFT)
  628. /*
  629. * EIF (W1C)
  630. *
  631. * Error Interrupt Flag
  632. * 1 - The border of the error warning limit has been crossed in either direction,
  633. * or the BUSOFF bit has been changed in either direction.
  634. * 0 - There has been no change.
  635. */
  636. #define CAN_RTIF_EIF_MASK (0x2U)
  637. #define CAN_RTIF_EIF_SHIFT (1U)
  638. #define CAN_RTIF_EIF_SET(x) (((uint8_t)(x) << CAN_RTIF_EIF_SHIFT) & CAN_RTIF_EIF_MASK)
  639. #define CAN_RTIF_EIF_GET(x) (((uint8_t)(x) & CAN_RTIF_EIF_MASK) >> CAN_RTIF_EIF_SHIFT)
  640. /*
  641. * AIF (W1C)
  642. *
  643. * Abort Interrupt Flag
  644. * 1 - After setting TPA or TSA the appropriated message(s) have been aborted.
  645. * It is recommended to not set both TPA and TSA simultaneously because both
  646. * source AIF.
  647. * 0 - No abort has been executed.
  648. * The AIF does not have an associated enable register.
  649. */
  650. #define CAN_RTIF_AIF_MASK (0x1U)
  651. #define CAN_RTIF_AIF_SHIFT (0U)
  652. #define CAN_RTIF_AIF_SET(x) (((uint8_t)(x) << CAN_RTIF_AIF_SHIFT) & CAN_RTIF_AIF_MASK)
  653. #define CAN_RTIF_AIF_GET(x) (((uint8_t)(x) & CAN_RTIF_AIF_MASK) >> CAN_RTIF_AIF_SHIFT)
  654. /* Bitfield definition for register: ERRINT */
  655. /*
  656. * EWARN (RO)
  657. *
  658. * Error WARNing limit reached
  659. * 1 - One of the error counters RECNT or TECNT is equal or bigger than EWL0 - The values in both counters are less than EWL.
  660. */
  661. #define CAN_ERRINT_EWARN_MASK (0x80U)
  662. #define CAN_ERRINT_EWARN_SHIFT (7U)
  663. #define CAN_ERRINT_EWARN_GET(x) (((uint8_t)(x) & CAN_ERRINT_EWARN_MASK) >> CAN_ERRINT_EWARN_SHIFT)
  664. /*
  665. * EPASS (RO)
  666. *
  667. * Error Passive mode active
  668. * 0 - not active (node is error active)
  669. * 1 - active (node is error passive)
  670. */
  671. #define CAN_ERRINT_EPASS_MASK (0x40U)
  672. #define CAN_ERRINT_EPASS_SHIFT (6U)
  673. #define CAN_ERRINT_EPASS_GET(x) (((uint8_t)(x) & CAN_ERRINT_EPASS_MASK) >> CAN_ERRINT_EPASS_SHIFT)
  674. /*
  675. * EPIE (RW)
  676. *
  677. * Error Passive Interrupt Enable
  678. */
  679. #define CAN_ERRINT_EPIE_MASK (0x20U)
  680. #define CAN_ERRINT_EPIE_SHIFT (5U)
  681. #define CAN_ERRINT_EPIE_SET(x) (((uint8_t)(x) << CAN_ERRINT_EPIE_SHIFT) & CAN_ERRINT_EPIE_MASK)
  682. #define CAN_ERRINT_EPIE_GET(x) (((uint8_t)(x) & CAN_ERRINT_EPIE_MASK) >> CAN_ERRINT_EPIE_SHIFT)
  683. /*
  684. * EPIF (W1C)
  685. *
  686. * Error Passive Interrupt Flag. EPIF will be activated if the error status changes from error
  687. * active to error passive or vice versa and if this interrupt is enabled.
  688. */
  689. #define CAN_ERRINT_EPIF_MASK (0x10U)
  690. #define CAN_ERRINT_EPIF_SHIFT (4U)
  691. #define CAN_ERRINT_EPIF_SET(x) (((uint8_t)(x) << CAN_ERRINT_EPIF_SHIFT) & CAN_ERRINT_EPIF_MASK)
  692. #define CAN_ERRINT_EPIF_GET(x) (((uint8_t)(x) & CAN_ERRINT_EPIF_MASK) >> CAN_ERRINT_EPIF_SHIFT)
  693. /*
  694. * ALIE (RW)
  695. *
  696. * Arbitration Lost Interrupt Enable
  697. */
  698. #define CAN_ERRINT_ALIE_MASK (0x8U)
  699. #define CAN_ERRINT_ALIE_SHIFT (3U)
  700. #define CAN_ERRINT_ALIE_SET(x) (((uint8_t)(x) << CAN_ERRINT_ALIE_SHIFT) & CAN_ERRINT_ALIE_MASK)
  701. #define CAN_ERRINT_ALIE_GET(x) (((uint8_t)(x) & CAN_ERRINT_ALIE_MASK) >> CAN_ERRINT_ALIE_SHIFT)
  702. /*
  703. * ALIF (W1C)
  704. *
  705. * Arbitration Lost Interrupt Flag
  706. */
  707. #define CAN_ERRINT_ALIF_MASK (0x4U)
  708. #define CAN_ERRINT_ALIF_SHIFT (2U)
  709. #define CAN_ERRINT_ALIF_SET(x) (((uint8_t)(x) << CAN_ERRINT_ALIF_SHIFT) & CAN_ERRINT_ALIF_MASK)
  710. #define CAN_ERRINT_ALIF_GET(x) (((uint8_t)(x) & CAN_ERRINT_ALIF_MASK) >> CAN_ERRINT_ALIF_SHIFT)
  711. /*
  712. * BEIE (RW)
  713. *
  714. * Bus Error Interrupt Enable
  715. */
  716. #define CAN_ERRINT_BEIE_MASK (0x2U)
  717. #define CAN_ERRINT_BEIE_SHIFT (1U)
  718. #define CAN_ERRINT_BEIE_SET(x) (((uint8_t)(x) << CAN_ERRINT_BEIE_SHIFT) & CAN_ERRINT_BEIE_MASK)
  719. #define CAN_ERRINT_BEIE_GET(x) (((uint8_t)(x) & CAN_ERRINT_BEIE_MASK) >> CAN_ERRINT_BEIE_SHIFT)
  720. /*
  721. * BEIF (W1C)
  722. *
  723. * Bus Error Interrupt Flag
  724. */
  725. #define CAN_ERRINT_BEIF_MASK (0x1U)
  726. #define CAN_ERRINT_BEIF_SHIFT (0U)
  727. #define CAN_ERRINT_BEIF_SET(x) (((uint8_t)(x) << CAN_ERRINT_BEIF_SHIFT) & CAN_ERRINT_BEIF_MASK)
  728. #define CAN_ERRINT_BEIF_GET(x) (((uint8_t)(x) & CAN_ERRINT_BEIF_MASK) >> CAN_ERRINT_BEIF_SHIFT)
  729. /* Bitfield definition for register: LIMIT */
  730. /*
  731. * AFWL (RW)
  732. *
  733. * receive buffer Almost Full Warning Limit
  734. * AFWL defines the internal warning limit AFWL_i with being the number of availableRB slots.
  735. * AFWL_i is compared to the number of filled RB slots and triggers RAFIF if equal. Thevalid range of .
  736. * AFWL = 0 is meaningless and automatically treated as 0x1. (Note that AFWL is meant in this rule and not AFWL_i.)
  737. * AFWL_i > nRB is meaningless and automatically treated as nRB.
  738. * AFWL_i = nRB is a valid value, but note that RFIF also exists.
  739. */
  740. #define CAN_LIMIT_AFWL_MASK (0xF0U)
  741. #define CAN_LIMIT_AFWL_SHIFT (4U)
  742. #define CAN_LIMIT_AFWL_SET(x) (((uint8_t)(x) << CAN_LIMIT_AFWL_SHIFT) & CAN_LIMIT_AFWL_MASK)
  743. #define CAN_LIMIT_AFWL_GET(x) (((uint8_t)(x) & CAN_LIMIT_AFWL_MASK) >> CAN_LIMIT_AFWL_SHIFT)
  744. /*
  745. * EWL (RW)
  746. *
  747. * Programmable Error Warning Limit = (EWL+1)*8. Possible Limit values: 8, 16, … 128.
  748. * The value of EWL controls EIF.
  749. */
  750. #define CAN_LIMIT_EWL_MASK (0xFU)
  751. #define CAN_LIMIT_EWL_SHIFT (0U)
  752. #define CAN_LIMIT_EWL_SET(x) (((uint8_t)(x) << CAN_LIMIT_EWL_SHIFT) & CAN_LIMIT_EWL_MASK)
  753. #define CAN_LIMIT_EWL_GET(x) (((uint8_t)(x) & CAN_LIMIT_EWL_MASK) >> CAN_LIMIT_EWL_SHIFT)
  754. /* Bitfield definition for register: S_PRESC */
  755. /*
  756. * S_PRESC (RW)
  757. *
  758. * Prescaler (slow speed)
  759. * The prescaler divides the system clock to get the time quanta clock tq_clk.Valid range PRESC=[0x00, 0xff] results in divider values 1 to 256.
  760. */
  761. #define CAN_S_PRESC_S_PRESC_MASK (0xFF000000UL)
  762. #define CAN_S_PRESC_S_PRESC_SHIFT (24U)
  763. #define CAN_S_PRESC_S_PRESC_SET(x) (((uint32_t)(x) << CAN_S_PRESC_S_PRESC_SHIFT) & CAN_S_PRESC_S_PRESC_MASK)
  764. #define CAN_S_PRESC_S_PRESC_GET(x) (((uint32_t)(x) & CAN_S_PRESC_S_PRESC_MASK) >> CAN_S_PRESC_S_PRESC_SHIFT)
  765. /*
  766. * S_SJW (RW)
  767. *
  768. * Synchronization Jump Width (slow speed)
  769. * The Synchronization Jump Width is the maximum time forshortening or lengthening the Bit Time for resynchronization, where TQ is a timequanta.
  770. */
  771. #define CAN_S_PRESC_S_SJW_MASK (0x7F0000UL)
  772. #define CAN_S_PRESC_S_SJW_SHIFT (16U)
  773. #define CAN_S_PRESC_S_SJW_SET(x) (((uint32_t)(x) << CAN_S_PRESC_S_SJW_SHIFT) & CAN_S_PRESC_S_SJW_MASK)
  774. #define CAN_S_PRESC_S_SJW_GET(x) (((uint32_t)(x) & CAN_S_PRESC_S_SJW_MASK) >> CAN_S_PRESC_S_SJW_SHIFT)
  775. /*
  776. * S_SEG_2 (RW)
  777. *
  778. * Bit Timing Segment 2 (slow speed)
  779. * Time after the sample point.
  780. */
  781. #define CAN_S_PRESC_S_SEG_2_MASK (0x7F00U)
  782. #define CAN_S_PRESC_S_SEG_2_SHIFT (8U)
  783. #define CAN_S_PRESC_S_SEG_2_SET(x) (((uint32_t)(x) << CAN_S_PRESC_S_SEG_2_SHIFT) & CAN_S_PRESC_S_SEG_2_MASK)
  784. #define CAN_S_PRESC_S_SEG_2_GET(x) (((uint32_t)(x) & CAN_S_PRESC_S_SEG_2_MASK) >> CAN_S_PRESC_S_SEG_2_SHIFT)
  785. /*
  786. * S_SEG_1 (RW)
  787. *
  788. * Bit Timing Segment 1 (slow speed)
  789. * The sample point will be set to after start of bit time.
  790. */
  791. #define CAN_S_PRESC_S_SEG_1_MASK (0xFFU)
  792. #define CAN_S_PRESC_S_SEG_1_SHIFT (0U)
  793. #define CAN_S_PRESC_S_SEG_1_SET(x) (((uint32_t)(x) << CAN_S_PRESC_S_SEG_1_SHIFT) & CAN_S_PRESC_S_SEG_1_MASK)
  794. #define CAN_S_PRESC_S_SEG_1_GET(x) (((uint32_t)(x) & CAN_S_PRESC_S_SEG_1_MASK) >> CAN_S_PRESC_S_SEG_1_SHIFT)
  795. /* Bitfield definition for register: F_PRESC */
  796. /*
  797. * F_PRESC (RW)
  798. *
  799. * Prescaler (fast speed)
  800. * The prescaler divides the system clock to get the time quanta clock tq_clk.Valid range PRESC=[0x00, 0xff] results in divider values 1 to 256.
  801. */
  802. #define CAN_F_PRESC_F_PRESC_MASK (0xFF000000UL)
  803. #define CAN_F_PRESC_F_PRESC_SHIFT (24U)
  804. #define CAN_F_PRESC_F_PRESC_SET(x) (((uint32_t)(x) << CAN_F_PRESC_F_PRESC_SHIFT) & CAN_F_PRESC_F_PRESC_MASK)
  805. #define CAN_F_PRESC_F_PRESC_GET(x) (((uint32_t)(x) & CAN_F_PRESC_F_PRESC_MASK) >> CAN_F_PRESC_F_PRESC_SHIFT)
  806. /*
  807. * F_SJW (RW)
  808. *
  809. * Synchronization Jump Width (fast speed)
  810. * The Synchronization Jump Width is the maximum time forshortening or lengthening the Bit Time for resynchronization, where TQ is a timequanta.
  811. */
  812. #define CAN_F_PRESC_F_SJW_MASK (0xF0000UL)
  813. #define CAN_F_PRESC_F_SJW_SHIFT (16U)
  814. #define CAN_F_PRESC_F_SJW_SET(x) (((uint32_t)(x) << CAN_F_PRESC_F_SJW_SHIFT) & CAN_F_PRESC_F_SJW_MASK)
  815. #define CAN_F_PRESC_F_SJW_GET(x) (((uint32_t)(x) & CAN_F_PRESC_F_SJW_MASK) >> CAN_F_PRESC_F_SJW_SHIFT)
  816. /*
  817. * F_SEG_2 (RW)
  818. *
  819. * Bit Timing Segment 2 (fast speed)
  820. * Time after the sample point
  821. */
  822. #define CAN_F_PRESC_F_SEG_2_MASK (0xF00U)
  823. #define CAN_F_PRESC_F_SEG_2_SHIFT (8U)
  824. #define CAN_F_PRESC_F_SEG_2_SET(x) (((uint32_t)(x) << CAN_F_PRESC_F_SEG_2_SHIFT) & CAN_F_PRESC_F_SEG_2_MASK)
  825. #define CAN_F_PRESC_F_SEG_2_GET(x) (((uint32_t)(x) & CAN_F_PRESC_F_SEG_2_MASK) >> CAN_F_PRESC_F_SEG_2_SHIFT)
  826. /*
  827. * F_SEG_1 (RW)
  828. *
  829. * Bit Timing Segment 1 (fast speed)
  830. * The sample point will be set to after start of bit time.
  831. */
  832. #define CAN_F_PRESC_F_SEG_1_MASK (0xFU)
  833. #define CAN_F_PRESC_F_SEG_1_SHIFT (0U)
  834. #define CAN_F_PRESC_F_SEG_1_SET(x) (((uint32_t)(x) << CAN_F_PRESC_F_SEG_1_SHIFT) & CAN_F_PRESC_F_SEG_1_MASK)
  835. #define CAN_F_PRESC_F_SEG_1_GET(x) (((uint32_t)(x) & CAN_F_PRESC_F_SEG_1_MASK) >> CAN_F_PRESC_F_SEG_1_SHIFT)
  836. /* Bitfield definition for register: EALCAP */
  837. /*
  838. * KOER (RO)
  839. *
  840. * Kind Of ERror (Error code)
  841. * 000 - no error
  842. * 001 - BIT ERROR
  843. * 010 - FORM ERROR
  844. * 011 - STUFF ERROR
  845. * 100 - ACKNOWLEDGEMENT ERROR
  846. * 101 - CRC ERROR
  847. * 110 - OTHER ERROR(dominant bits after own error flag, received active Error Flag too long,dominant bit during Passive-Error-Flag after ACK error)
  848. * 111 - not used
  849. * KOER is updated with each new error. Therefore it stays untouched when frames aresuccessfully transmitted or received.
  850. */
  851. #define CAN_EALCAP_KOER_MASK (0xE0U)
  852. #define CAN_EALCAP_KOER_SHIFT (5U)
  853. #define CAN_EALCAP_KOER_GET(x) (((uint8_t)(x) & CAN_EALCAP_KOER_MASK) >> CAN_EALCAP_KOER_SHIFT)
  854. /*
  855. * ALC (RO)
  856. *
  857. * Arbitration Lost Capture (bit position in the frame where the arbitration has been lost)
  858. */
  859. #define CAN_EALCAP_ALC_MASK (0x1FU)
  860. #define CAN_EALCAP_ALC_SHIFT (0U)
  861. #define CAN_EALCAP_ALC_GET(x) (((uint8_t)(x) & CAN_EALCAP_ALC_MASK) >> CAN_EALCAP_ALC_SHIFT)
  862. /* Bitfield definition for register: TDC */
  863. /*
  864. * TDCEN (RW)
  865. *
  866. * Transmitter Delay Compensation ENable
  867. * TDC will be activated during the data phase of a CAN FD frame if BRS is active if TDCEN=1.
  868. */
  869. #define CAN_TDC_TDCEN_MASK (0x80U)
  870. #define CAN_TDC_TDCEN_SHIFT (7U)
  871. #define CAN_TDC_TDCEN_SET(x) (((uint8_t)(x) << CAN_TDC_TDCEN_SHIFT) & CAN_TDC_TDCEN_MASK)
  872. #define CAN_TDC_TDCEN_GET(x) (((uint8_t)(x) & CAN_TDC_TDCEN_MASK) >> CAN_TDC_TDCEN_SHIFT)
  873. /*
  874. * SSPOFF (RW)
  875. *
  876. * Secondary Sample Point OFFset
  877. * The transmitter delay plus SSPOFF defines the time of the secondary sample point for TDC.
  878. * SSPOFF is given as a number of TQ.
  879. */
  880. #define CAN_TDC_SSPOFF_MASK (0x7FU)
  881. #define CAN_TDC_SSPOFF_SHIFT (0U)
  882. #define CAN_TDC_SSPOFF_SET(x) (((uint8_t)(x) << CAN_TDC_SSPOFF_SHIFT) & CAN_TDC_SSPOFF_MASK)
  883. #define CAN_TDC_SSPOFF_GET(x) (((uint8_t)(x) & CAN_TDC_SSPOFF_MASK) >> CAN_TDC_SSPOFF_SHIFT)
  884. /* Bitfield definition for register: RECNT */
  885. /*
  886. * RECNT (RO)
  887. *
  888. * Receive Error CouNT (number of errors during reception)
  889. * RECNT is incremented and decremented as defined in the CAN specification.
  890. * RECNT does not overflow.
  891. * If TXB=1, then the error counters are frozen.
  892. */
  893. #define CAN_RECNT_RECNT_MASK (0xFFU)
  894. #define CAN_RECNT_RECNT_SHIFT (0U)
  895. #define CAN_RECNT_RECNT_GET(x) (((uint8_t)(x) & CAN_RECNT_RECNT_MASK) >> CAN_RECNT_RECNT_SHIFT)
  896. /* Bitfield definition for register: TECNT */
  897. /*
  898. * TECNT (RO)
  899. *
  900. * Transmit Error CouNT (number of errors during transmission)
  901. * TECNT is incremented and decremented as defined in the CAN specification.
  902. * In case of the “bus off state” TECNT may overflow.
  903. * If TXB=1, then the error counters are frozen.
  904. */
  905. #define CAN_TECNT_TECNT_MASK (0xFFU)
  906. #define CAN_TECNT_TECNT_SHIFT (0U)
  907. #define CAN_TECNT_TECNT_GET(x) (((uint8_t)(x) & CAN_TECNT_TECNT_MASK) >> CAN_TECNT_TECNT_SHIFT)
  908. /* Bitfield definition for register: ACFCTRL */
  909. /*
  910. * SELMASK (RW)
  911. *
  912. * SELect acceptance MASK
  913. * 0 - Registers ACF_x point to acceptance code
  914. * 1 - Registers ACF_x point to acceptance mask.
  915. * ACFADR selects one specific acceptance filter.
  916. */
  917. #define CAN_ACFCTRL_SELMASK_MASK (0x20U)
  918. #define CAN_ACFCTRL_SELMASK_SHIFT (5U)
  919. #define CAN_ACFCTRL_SELMASK_SET(x) (((uint8_t)(x) << CAN_ACFCTRL_SELMASK_SHIFT) & CAN_ACFCTRL_SELMASK_MASK)
  920. #define CAN_ACFCTRL_SELMASK_GET(x) (((uint8_t)(x) & CAN_ACFCTRL_SELMASK_MASK) >> CAN_ACFCTRL_SELMASK_SHIFT)
  921. /*
  922. * ACFADR (RW)
  923. *
  924. * acceptance filter address
  925. * ACFADR points to a specific acceptance filter.
  926. * The selected filter is accessible using theregisters ACF_x.
  927. * Bit SELMASK selects between acceptance code and mask for theselected acceptance filter.
  928. * A value of ACFADR>ACF_NUMBER-1 is meaningless and automatically treated as value ACF_NUMBER-1.
  929. * ACF_NUMBER = 16.
  930. */
  931. #define CAN_ACFCTRL_ACFADR_MASK (0xFU)
  932. #define CAN_ACFCTRL_ACFADR_SHIFT (0U)
  933. #define CAN_ACFCTRL_ACFADR_SET(x) (((uint8_t)(x) << CAN_ACFCTRL_ACFADR_SHIFT) & CAN_ACFCTRL_ACFADR_MASK)
  934. #define CAN_ACFCTRL_ACFADR_GET(x) (((uint8_t)(x) & CAN_ACFCTRL_ACFADR_MASK) >> CAN_ACFCTRL_ACFADR_SHIFT)
  935. /* Bitfield definition for register: TIMECFG */
  936. /*
  937. * TIMEPOS (RW)
  938. *
  939. * TIME-stamping POSition
  940. * 0 – SOF1 – EOF (see Chapter 7)TIMEPOS can only be changed if TIMEEN=0, but it is possible to modify TIMPOS withthe same write access that sets TIMEEN=1.
  941. */
  942. #define CAN_TIMECFG_TIMEPOS_MASK (0x2U)
  943. #define CAN_TIMECFG_TIMEPOS_SHIFT (1U)
  944. #define CAN_TIMECFG_TIMEPOS_SET(x) (((uint8_t)(x) << CAN_TIMECFG_TIMEPOS_SHIFT) & CAN_TIMECFG_TIMEPOS_MASK)
  945. #define CAN_TIMECFG_TIMEPOS_GET(x) (((uint8_t)(x) & CAN_TIMECFG_TIMEPOS_MASK) >> CAN_TIMECFG_TIMEPOS_SHIFT)
  946. /*
  947. * TIMEEN (RW)
  948. *
  949. * TIME-stamping ENable
  950. * 0 – disabled
  951. * 1 – enabled
  952. */
  953. #define CAN_TIMECFG_TIMEEN_MASK (0x1U)
  954. #define CAN_TIMECFG_TIMEEN_SHIFT (0U)
  955. #define CAN_TIMECFG_TIMEEN_SET(x) (((uint8_t)(x) << CAN_TIMECFG_TIMEEN_SHIFT) & CAN_TIMECFG_TIMEEN_MASK)
  956. #define CAN_TIMECFG_TIMEEN_GET(x) (((uint8_t)(x) & CAN_TIMECFG_TIMEEN_MASK) >> CAN_TIMECFG_TIMEEN_SHIFT)
  957. /* Bitfield definition for register: ACF_EN */
  958. /*
  959. * ACF_EN (RW)
  960. *
  961. * Acceptance filter Enable
  962. * 1 - acceptance filter enabled
  963. * 0 - acceptance filter disable
  964. * Each acceptance filter (AMASK / ACODE) can be individually enabled or disabled.
  965. * Disabled filters reject a message. Only enabled filters can accept a message if the
  966. * appropriate AMASK / ACODE configuration matches.
  967. */
  968. #define CAN_ACF_EN_ACF_EN_MASK (0xFFFFU)
  969. #define CAN_ACF_EN_ACF_EN_SHIFT (0U)
  970. #define CAN_ACF_EN_ACF_EN_SET(x) (((uint16_t)(x) << CAN_ACF_EN_ACF_EN_SHIFT) & CAN_ACF_EN_ACF_EN_MASK)
  971. #define CAN_ACF_EN_ACF_EN_GET(x) (((uint16_t)(x) & CAN_ACF_EN_ACF_EN_MASK) >> CAN_ACF_EN_ACF_EN_SHIFT)
  972. /* Bitfield definition for register: ACF */
  973. /*
  974. * AIDEE (RW)
  975. *
  976. * Acceptance mask IDE bit check enable
  977. * 1 - acceptance filter accepts either standard or extended as defined by AIDE
  978. * 0 - acceptance filter accepts both standard or extended frames
  979. * Only filter 0 is affected by the power-on reset. All other filters stay uninitialized.
  980. */
  981. #define CAN_ACF_AIDEE_MASK (0x40000000UL)
  982. #define CAN_ACF_AIDEE_SHIFT (30U)
  983. #define CAN_ACF_AIDEE_SET(x) (((uint32_t)(x) << CAN_ACF_AIDEE_SHIFT) & CAN_ACF_AIDEE_MASK)
  984. #define CAN_ACF_AIDEE_GET(x) (((uint32_t)(x) & CAN_ACF_AIDEE_MASK) >> CAN_ACF_AIDEE_SHIFT)
  985. /*
  986. * AIDE (RW)
  987. *
  988. * Acceptance mask IDE bit value
  989. * If AIDEE=1 then:
  990. * 1 - acceptance filter accepts only extended frames
  991. * 0 - acceptance filter accepts only standard frames
  992. * Only filter 0 is affected by the power-on reset. All other filters stay uninitialized.
  993. */
  994. #define CAN_ACF_AIDE_MASK (0x20000000UL)
  995. #define CAN_ACF_AIDE_SHIFT (29U)
  996. #define CAN_ACF_AIDE_SET(x) (((uint32_t)(x) << CAN_ACF_AIDE_SHIFT) & CAN_ACF_AIDE_MASK)
  997. #define CAN_ACF_AIDE_GET(x) (((uint32_t)(x) & CAN_ACF_AIDE_MASK) >> CAN_ACF_AIDE_SHIFT)
  998. /*
  999. * CODE_MASK (RW)
  1000. *
  1001. * Acceptance CODE
  1002. * 1 - ACC bit value to compare with ID bit of the received message
  1003. * 0 - ACC bit value to compare with ID bit of the received message
  1004. * ACODE_x(10:0) will be used for extended frames.
  1005. * ACODE_x(28:0) will be used for extended frames.
  1006. * Only filter 0 is affected by the power-on reset.
  1007. * Acceptance MASK(if SELMASK ==1 )
  1008. * 1 - acceptance check for these bits of receive identifier disabled
  1009. * 0 - acceptance check for these bits of receive identifier enable
  1010. * AMASK_x(10:0) will be used for extended frames.
  1011. * AMASK_x(28:0) will be used for extended frames.
  1012. * Disabled bits result in accepting the message. Therefore the default configuration after
  1013. * reset for filter 0 accepts all messages.
  1014. * Only filter 0 is affected by the power-on reset.
  1015. */
  1016. #define CAN_ACF_CODE_MASK_MASK (0x1FFFFFFFUL)
  1017. #define CAN_ACF_CODE_MASK_SHIFT (0U)
  1018. #define CAN_ACF_CODE_MASK_SET(x) (((uint32_t)(x) << CAN_ACF_CODE_MASK_SHIFT) & CAN_ACF_CODE_MASK_MASK)
  1019. #define CAN_ACF_CODE_MASK_GET(x) (((uint32_t)(x) & CAN_ACF_CODE_MASK_MASK) >> CAN_ACF_CODE_MASK_SHIFT)
  1020. /* Bitfield definition for register: VER */
  1021. /*
  1022. * VERSION (RW)
  1023. *
  1024. * Version of CAN-CTRL, given as decimal value. VER_1 holds the major version and
  1025. * VER_0 the minor version.Example: version 5x16N00S00 is represented by VER_1=5 and VER_0=16
  1026. */
  1027. #define CAN_VER_VERSION_MASK (0xFFFFU)
  1028. #define CAN_VER_VERSION_SHIFT (0U)
  1029. #define CAN_VER_VERSION_SET(x) (((uint16_t)(x) << CAN_VER_VERSION_SHIFT) & CAN_VER_VERSION_MASK)
  1030. #define CAN_VER_VERSION_GET(x) (((uint16_t)(x) & CAN_VER_VERSION_MASK) >> CAN_VER_VERSION_SHIFT)
  1031. /* Bitfield definition for register: TBSLOT */
  1032. /*
  1033. * TBE (RW)
  1034. *
  1035. * set TB slot to “Empty”
  1036. * 1 - slot selected by TBPTR shall be marked as “empty”
  1037. * 0 - no actionTBE is automatically reset to 0 as soon as the slot is marked as empty and TSFF=0.
  1038. * If atransmission from this slot is active, then TBE stays set as long as either the transmission completes or after a transmission error or arbitration loss the
  1039. * transmissionis not active any more.
  1040. * If both TBF and TBE are set, then TBE wins
  1041. */
  1042. #define CAN_TBSLOT_TBE_MASK (0x80U)
  1043. #define CAN_TBSLOT_TBE_SHIFT (7U)
  1044. #define CAN_TBSLOT_TBE_SET(x) (((uint8_t)(x) << CAN_TBSLOT_TBE_SHIFT) & CAN_TBSLOT_TBE_MASK)
  1045. #define CAN_TBSLOT_TBE_GET(x) (((uint8_t)(x) & CAN_TBSLOT_TBE_MASK) >> CAN_TBSLOT_TBE_SHIFT)
  1046. /*
  1047. * TBF (RW)
  1048. *
  1049. * set TB slot to “Filled”
  1050. * 1 - slot selected by TBPTR shall be marked as “filled”
  1051. * 0 - no actionTBF is automatically reset to 0 as soon as the slot is marked as filled and TSFF=1.
  1052. * If both TBF and TBE are set, then TBE wins.
  1053. */
  1054. #define CAN_TBSLOT_TBF_MASK (0x40U)
  1055. #define CAN_TBSLOT_TBF_SHIFT (6U)
  1056. #define CAN_TBSLOT_TBF_SET(x) (((uint8_t)(x) << CAN_TBSLOT_TBF_SHIFT) & CAN_TBSLOT_TBF_MASK)
  1057. #define CAN_TBSLOT_TBF_GET(x) (((uint8_t)(x) & CAN_TBSLOT_TBF_MASK) >> CAN_TBSLOT_TBF_SHIFT)
  1058. /*
  1059. * TBPTR (RW)
  1060. *
  1061. * Pointer to a TB message slot.
  1062. * 0x00 - Pointer to the PTB
  1063. * others - Pointer to a slot in the STB
  1064. * The message slot pointed to by TBPTR is readable / writable using the TBUF registers.
  1065. * Write access is only possible if TSFF=0.
  1066. * Setting TBF to 1 marks the selected slot asfilled and setting TBE to 1 marks the selected slot as empty.
  1067. * TBSEL and TSNEXT are unused in TTCAN mode and have no meaning.
  1068. * TBPTR can only point to buffer slots, that exist in the hardware.
  1069. * Unusable bits ofTBPTR are fixed to 0.
  1070. * TBPTR is limited to the PTB and 63 STB slots.
  1071. * More slots cannot be used in TTCANmode.If TBPTR is too big and points to a slot that is not available, then TBF and TBE arereset automatically and no action takes place.
  1072. */
  1073. #define CAN_TBSLOT_TBPTR_MASK (0x3FU)
  1074. #define CAN_TBSLOT_TBPTR_SHIFT (0U)
  1075. #define CAN_TBSLOT_TBPTR_SET(x) (((uint8_t)(x) << CAN_TBSLOT_TBPTR_SHIFT) & CAN_TBSLOT_TBPTR_MASK)
  1076. #define CAN_TBSLOT_TBPTR_GET(x) (((uint8_t)(x) & CAN_TBSLOT_TBPTR_MASK) >> CAN_TBSLOT_TBPTR_SHIFT)
  1077. /* Bitfield definition for register: TTCFG */
  1078. /*
  1079. * WTIE (RW)
  1080. *
  1081. * Watch Trigger Interrupt Enable
  1082. */
  1083. #define CAN_TTCFG_WTIE_MASK (0x80U)
  1084. #define CAN_TTCFG_WTIE_SHIFT (7U)
  1085. #define CAN_TTCFG_WTIE_SET(x) (((uint8_t)(x) << CAN_TTCFG_WTIE_SHIFT) & CAN_TTCFG_WTIE_MASK)
  1086. #define CAN_TTCFG_WTIE_GET(x) (((uint8_t)(x) & CAN_TTCFG_WTIE_MASK) >> CAN_TTCFG_WTIE_SHIFT)
  1087. /*
  1088. * WTIF (RW)
  1089. *
  1090. * Watch Trigger Interrupt Flag
  1091. * WTIF will be set if the cycle count reaches the limited defined by TT_WTRIG and WTIE is set.
  1092. */
  1093. #define CAN_TTCFG_WTIF_MASK (0x40U)
  1094. #define CAN_TTCFG_WTIF_SHIFT (6U)
  1095. #define CAN_TTCFG_WTIF_SET(x) (((uint8_t)(x) << CAN_TTCFG_WTIF_SHIFT) & CAN_TTCFG_WTIF_MASK)
  1096. #define CAN_TTCFG_WTIF_GET(x) (((uint8_t)(x) & CAN_TTCFG_WTIF_MASK) >> CAN_TTCFG_WTIF_SHIFT)
  1097. /*
  1098. * TEIF (RW)
  1099. *
  1100. * Trigger Error Interrupt Flag
  1101. * The conditions when TEIF will be set, are defined in Chapter 6.4. There is no bit toenable or disable the handling of TEIF
  1102. */
  1103. #define CAN_TTCFG_TEIF_MASK (0x20U)
  1104. #define CAN_TTCFG_TEIF_SHIFT (5U)
  1105. #define CAN_TTCFG_TEIF_SET(x) (((uint8_t)(x) << CAN_TTCFG_TEIF_SHIFT) & CAN_TTCFG_TEIF_MASK)
  1106. #define CAN_TTCFG_TEIF_GET(x) (((uint8_t)(x) & CAN_TTCFG_TEIF_MASK) >> CAN_TTCFG_TEIF_SHIFT)
  1107. /*
  1108. * TTIE (RW)
  1109. *
  1110. * Time Trigger Interrupt Enable
  1111. * If TTIE is set, then TTIF will be set if the cycle time is equal to the trigger timeTT_TRIG.
  1112. */
  1113. #define CAN_TTCFG_TTIE_MASK (0x10U)
  1114. #define CAN_TTCFG_TTIE_SHIFT (4U)
  1115. #define CAN_TTCFG_TTIE_SET(x) (((uint8_t)(x) << CAN_TTCFG_TTIE_SHIFT) & CAN_TTCFG_TTIE_MASK)
  1116. #define CAN_TTCFG_TTIE_GET(x) (((uint8_t)(x) & CAN_TTCFG_TTIE_MASK) >> CAN_TTCFG_TTIE_SHIFT)
  1117. /*
  1118. * TTIF (RW)
  1119. *
  1120. * Time Trigger Interrupt Flag
  1121. * TTIF will be set if TTIE is set and the cycle time is equal to the trigger time TT_TRIG.
  1122. * Writing an one to TTIF resets it. Writing a zero has no impact.TTIF will be set only once.
  1123. * If TT_TRIG gets not updated, then TTIF will be not setagain in the next basic cycle.
  1124. */
  1125. #define CAN_TTCFG_TTIF_MASK (0x8U)
  1126. #define CAN_TTCFG_TTIF_SHIFT (3U)
  1127. #define CAN_TTCFG_TTIF_SET(x) (((uint8_t)(x) << CAN_TTCFG_TTIF_SHIFT) & CAN_TTCFG_TTIF_MASK)
  1128. #define CAN_TTCFG_TTIF_GET(x) (((uint8_t)(x) & CAN_TTCFG_TTIF_MASK) >> CAN_TTCFG_TTIF_SHIFT)
  1129. /*
  1130. * T_PRESC (RW)
  1131. *
  1132. * TTCAN Timer PRESCaler
  1133. * 00b - 1
  1134. * 01b - 2
  1135. * 10b - 4
  1136. * 11b - 8
  1137. * The TTCAN time base is a CAN bittime defined by S_PRES, S_SEG_1 and S_SEG_2.With T_PRESC an additional prescaling factor of 1, 2, 4 or 8 is defined.
  1138. * T_PRESC can only be modified if TTEN=0, but it is possible to modify T_PRESC and setTTEN simultaneously with one write access.
  1139. */
  1140. #define CAN_TTCFG_T_PRESC_MASK (0x6U)
  1141. #define CAN_TTCFG_T_PRESC_SHIFT (1U)
  1142. #define CAN_TTCFG_T_PRESC_SET(x) (((uint8_t)(x) << CAN_TTCFG_T_PRESC_SHIFT) & CAN_TTCFG_T_PRESC_MASK)
  1143. #define CAN_TTCFG_T_PRESC_GET(x) (((uint8_t)(x) & CAN_TTCFG_T_PRESC_MASK) >> CAN_TTCFG_T_PRESC_SHIFT)
  1144. /*
  1145. * TTEN (RW)
  1146. *
  1147. * Time Trigger Enable
  1148. * 1 - TTCAN enabled, timer is running0 - disabled
  1149. */
  1150. #define CAN_TTCFG_TTEN_MASK (0x1U)
  1151. #define CAN_TTCFG_TTEN_SHIFT (0U)
  1152. #define CAN_TTCFG_TTEN_SET(x) (((uint8_t)(x) << CAN_TTCFG_TTEN_SHIFT) & CAN_TTCFG_TTEN_MASK)
  1153. #define CAN_TTCFG_TTEN_GET(x) (((uint8_t)(x) & CAN_TTCFG_TTEN_MASK) >> CAN_TTCFG_TTEN_SHIFT)
  1154. /* Bitfield definition for register: REF_MSG */
  1155. /*
  1156. * REF_IDE (RW)
  1157. *
  1158. * REFerence message IDE bit.
  1159. */
  1160. #define CAN_REF_MSG_REF_IDE_MASK (0x80000000UL)
  1161. #define CAN_REF_MSG_REF_IDE_SHIFT (31U)
  1162. #define CAN_REF_MSG_REF_IDE_SET(x) (((uint32_t)(x) << CAN_REF_MSG_REF_IDE_SHIFT) & CAN_REF_MSG_REF_IDE_MASK)
  1163. #define CAN_REF_MSG_REF_IDE_GET(x) (((uint32_t)(x) & CAN_REF_MSG_REF_IDE_MASK) >> CAN_REF_MSG_REF_IDE_SHIFT)
  1164. /*
  1165. * REF_MSG (RW)
  1166. *
  1167. * REFerence message IDentifier.
  1168. * If REF_IDE is
  1169. * 1 - REF_ID(28:0) is valid (extended ID)
  1170. * 0 - REF_ID(10:0) is valid (standard ID)
  1171. * REF_ID is used in TTCAN mode to detect a reference message. This holds for time
  1172. * slaves (reception) as well as for the time master (transmission). If the reference
  1173. * message is detected and there are no errors, then the Sync_Mark of this frame will
  1174. * become the Ref_Mark.
  1175. * REF_ID(2:0) is not tested and therefore the appropriate register bits are forced to 0.
  1176. * These bits are used for up to 8 potential time masters.
  1177. * CAN-CTRL recognizes the reference message only by ID. The payload is not tested.
  1178. * Additional note: A time master will transmit a reference message in the same way as a
  1179. * normal frame. REF_ID is intended for detection of a successful transmission of a
  1180. * reference message.
  1181. */
  1182. #define CAN_REF_MSG_REF_MSG_MASK (0x1FFFFFFFUL)
  1183. #define CAN_REF_MSG_REF_MSG_SHIFT (0U)
  1184. #define CAN_REF_MSG_REF_MSG_SET(x) (((uint32_t)(x) << CAN_REF_MSG_REF_MSG_SHIFT) & CAN_REF_MSG_REF_MSG_MASK)
  1185. #define CAN_REF_MSG_REF_MSG_GET(x) (((uint32_t)(x) & CAN_REF_MSG_REF_MSG_MASK) >> CAN_REF_MSG_REF_MSG_SHIFT)
  1186. /* Bitfield definition for register: TRIG_CFG */
  1187. /*
  1188. * TEW (RW)
  1189. *
  1190. * Transmit Enable Window
  1191. * For a single shot transmit trigger there is a time of up to 16 ticks of the cycle time
  1192. * where the frame is allowed to start. TWE+1 defines the number of ticks.
  1193. * TEW=0 is a valid setting and shortens the transmit enable window to 1 tick
  1194. */
  1195. #define CAN_TRIG_CFG_TEW_MASK (0xF000U)
  1196. #define CAN_TRIG_CFG_TEW_SHIFT (12U)
  1197. #define CAN_TRIG_CFG_TEW_SET(x) (((uint16_t)(x) << CAN_TRIG_CFG_TEW_SHIFT) & CAN_TRIG_CFG_TEW_MASK)
  1198. #define CAN_TRIG_CFG_TEW_GET(x) (((uint16_t)(x) & CAN_TRIG_CFG_TEW_MASK) >> CAN_TRIG_CFG_TEW_SHIFT)
  1199. /*
  1200. * TTYPE (RW)
  1201. *
  1202. * Trigger Type
  1203. * 000b - Immediate Trigger for immediate transmission
  1204. * 001b - Time Trigger for receive triggers
  1205. * 010b - Single Shot Transmit Trigger for exclusive time windows
  1206. * 011b - Transmit Start Trigger for merged arbitrating time windows
  1207. * 100b - Transmit Stop Trigger for merged arbitrating time windows
  1208. * others - no action
  1209. * The time of the trigger is defined by TT_TRIG. TTPTR selects the TB slot for the
  1210. * transmit triggers. See Chapter 6.4 for more details.
  1211. */
  1212. #define CAN_TRIG_CFG_TTYPE_MASK (0x700U)
  1213. #define CAN_TRIG_CFG_TTYPE_SHIFT (8U)
  1214. #define CAN_TRIG_CFG_TTYPE_SET(x) (((uint16_t)(x) << CAN_TRIG_CFG_TTYPE_SHIFT) & CAN_TRIG_CFG_TTYPE_MASK)
  1215. #define CAN_TRIG_CFG_TTYPE_GET(x) (((uint16_t)(x) & CAN_TRIG_CFG_TTYPE_MASK) >> CAN_TRIG_CFG_TTYPE_SHIFT)
  1216. /*
  1217. * TTPTR (RW)
  1218. *
  1219. * Transmit Trigger TB slot Pointer
  1220. * If TTPTR is too big and points to a slot that is not available, then TEIF is set and no
  1221. * new trigger can be activated after a write access to TT_TRIG_1.
  1222. * If TTPTR points to an empty slot, then TEIF will be set at the moment, when the
  1223. * trigger time is reached.
  1224. */
  1225. #define CAN_TRIG_CFG_TTPTR_MASK (0x3FU)
  1226. #define CAN_TRIG_CFG_TTPTR_SHIFT (0U)
  1227. #define CAN_TRIG_CFG_TTPTR_SET(x) (((uint16_t)(x) << CAN_TRIG_CFG_TTPTR_SHIFT) & CAN_TRIG_CFG_TTPTR_MASK)
  1228. #define CAN_TRIG_CFG_TTPTR_GET(x) (((uint16_t)(x) & CAN_TRIG_CFG_TTPTR_MASK) >> CAN_TRIG_CFG_TTPTR_SHIFT)
  1229. /* Bitfield definition for register: TT_TRIG */
  1230. /*
  1231. * TT_TRIG (RW)
  1232. *
  1233. * Trigger Time
  1234. * TT_TRIG(15:0) defines the cycle time for a trigger.
  1235. * For a transmission trigger theearliest point of transmission of the SOF of the appropriate frame will be TT_TRIG+1.
  1236. */
  1237. #define CAN_TT_TRIG_TT_TRIG_MASK (0xFFFFU)
  1238. #define CAN_TT_TRIG_TT_TRIG_SHIFT (0U)
  1239. #define CAN_TT_TRIG_TT_TRIG_SET(x) (((uint16_t)(x) << CAN_TT_TRIG_TT_TRIG_SHIFT) & CAN_TT_TRIG_TT_TRIG_MASK)
  1240. #define CAN_TT_TRIG_TT_TRIG_GET(x) (((uint16_t)(x) & CAN_TT_TRIG_TT_TRIG_MASK) >> CAN_TT_TRIG_TT_TRIG_SHIFT)
  1241. /* Bitfield definition for register: TT_WTRIG */
  1242. /*
  1243. * TT_WTRIG (RW)
  1244. *
  1245. * Watch Trigger Time
  1246. * TT_WTRIG(15:0) defines the cycle time for a watch trigger. The initial watch trigger isthe maximum cycle time 0xffff.
  1247. */
  1248. #define CAN_TT_WTRIG_TT_WTRIG_MASK (0xFFFFU)
  1249. #define CAN_TT_WTRIG_TT_WTRIG_SHIFT (0U)
  1250. #define CAN_TT_WTRIG_TT_WTRIG_SET(x) (((uint16_t)(x) << CAN_TT_WTRIG_TT_WTRIG_SHIFT) & CAN_TT_WTRIG_TT_WTRIG_MASK)
  1251. #define CAN_TT_WTRIG_TT_WTRIG_GET(x) (((uint16_t)(x) & CAN_TT_WTRIG_TT_WTRIG_MASK) >> CAN_TT_WTRIG_TT_WTRIG_SHIFT)
  1252. /* RBUF register group index macro definition */
  1253. #define CAN_RBUF_BUF0 (0UL)
  1254. #define CAN_RBUF_BUF1 (1UL)
  1255. #define CAN_RBUF_BUF2 (2UL)
  1256. #define CAN_RBUF_BUF3 (3UL)
  1257. #define CAN_RBUF_BUF4 (4UL)
  1258. #define CAN_RBUF_BUF5 (5UL)
  1259. #define CAN_RBUF_BUF6 (6UL)
  1260. #define CAN_RBUF_BUF7 (7UL)
  1261. #define CAN_RBUF_BUF8 (8UL)
  1262. #define CAN_RBUF_BUF9 (9UL)
  1263. #define CAN_RBUF_BUF10 (10UL)
  1264. #define CAN_RBUF_BUF11 (11UL)
  1265. #define CAN_RBUF_BUF12 (12UL)
  1266. #define CAN_RBUF_BUF13 (13UL)
  1267. #define CAN_RBUF_BUF14 (14UL)
  1268. #define CAN_RBUF_BUF15 (15UL)
  1269. #define CAN_RBUF_BUF16 (16UL)
  1270. #define CAN_RBUF_BUF17 (17UL)
  1271. #define CAN_RBUF_BUF18 (18UL)
  1272. #define CAN_RBUF_BUF19 (19UL)
  1273. /* TBUF register group index macro definition */
  1274. #define CAN_TBUF_BUF0 (0UL)
  1275. #define CAN_TBUF_BUF1 (1UL)
  1276. #define CAN_TBUF_BUF2 (2UL)
  1277. #define CAN_TBUF_BUF3 (3UL)
  1278. #define CAN_TBUF_BUF4 (4UL)
  1279. #define CAN_TBUF_BUF5 (5UL)
  1280. #define CAN_TBUF_BUF6 (6UL)
  1281. #define CAN_TBUF_BUF7 (7UL)
  1282. #define CAN_TBUF_BUF8 (8UL)
  1283. #define CAN_TBUF_BUF9 (9UL)
  1284. #define CAN_TBUF_BUF10 (10UL)
  1285. #define CAN_TBUF_BUF11 (11UL)
  1286. #define CAN_TBUF_BUF12 (12UL)
  1287. #define CAN_TBUF_BUF13 (13UL)
  1288. #define CAN_TBUF_BUF14 (14UL)
  1289. #define CAN_TBUF_BUF15 (15UL)
  1290. #define CAN_TBUF_BUF16 (16UL)
  1291. #define CAN_TBUF_BUF17 (17UL)
  1292. /* TTS register group index macro definition */
  1293. #define CAN_TTS_WRD0 (0UL)
  1294. #define CAN_TTS_WRD1 (1UL)
  1295. #endif /* HPM_CAN_H */