hw_can.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. //###########################################################################
  2. //
  3. // FILE: hw_can.h
  4. //
  5. // TITLE: Definitions for the C28x CAN registers.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef __HW_CAN_H__
  43. #define __HW_CAN_H__
  44. //*****************************************************************************
  45. //
  46. // The following are defines for the CAN register offsets
  47. //
  48. //*****************************************************************************
  49. #define CAN_O_CTL 0x0 // CAN Control Register
  50. #define CAN_O_ES 0x4 // Error and Status Register
  51. #define CAN_O_ERRC 0x8 // Error Counter Register
  52. #define CAN_O_BTR 0xC // Bit Timing Register
  53. #define CAN_O_INT 0x10 // Interrupt Register
  54. #define CAN_O_TEST 0x14 // Test Register
  55. #define CAN_O_PERR 0x1C // CAN Parity Error Code Register
  56. #define CAN_O_REL 0x20 // CAN Core Release Register
  57. #define CAN_O_RAM_INIT 0x40 // CAN RAM Initialization Register
  58. #define CAN_O_GLB_INT_EN 0x50 // CAN Global Interrupt Enable
  59. // Register
  60. #define CAN_O_GLB_INT_FLG 0x54 // CAN Global Interrupt Flag
  61. // Register
  62. #define CAN_O_GLB_INT_CLR 0x58 // CAN Global Interrupt Clear
  63. // Register
  64. #define CAN_O_ABOTR 0x80 // Auto-Bus-On Time Register
  65. #define CAN_O_TXRQ_X 0x84 // CAN Transmission Request X
  66. // Register
  67. #define CAN_O_TXRQ_21 0x88 // CAN Transmission Request 2_1
  68. // Register
  69. #define CAN_O_NDAT_X 0x98 // CAN New Data X Register
  70. #define CAN_O_NDAT_21 0x9C // CAN New Data 2_1 Register
  71. #define CAN_O_IPEN_X 0xAC // CAN Interrupt Pending X
  72. // Register
  73. #define CAN_O_IPEN_21 0xB0 // CAN Interrupt Pending 2_1
  74. // Register
  75. #define CAN_O_MVAL_X 0xC0 // CAN Message Valid X Register
  76. #define CAN_O_MVAL_21 0xC4 // CAN Message Valid 2_1 Register
  77. #define CAN_O_IP_MUX21 0xD8 // CAN Interrupt Multiplexer 2_1
  78. // Register
  79. #define CAN_O_IF1CMD 0x100 // IF1 Command Register
  80. #define CAN_O_IF1MSK 0x104 // IF1 Mask Register
  81. #define CAN_O_IF1ARB 0x108 // IF1 Arbitration Register
  82. #define CAN_O_IF1MCTL 0x10C // IF1 Message Control Register
  83. #define CAN_O_IF1DATA 0x110 // IF1 Data A Register
  84. #define CAN_O_IF1DATB 0x114 // IF1 Data B Register
  85. #define CAN_O_IF2CMD 0x120 // IF2 Command Register
  86. #define CAN_O_IF2MSK 0x124 // IF2 Mask Register
  87. #define CAN_O_IF2ARB 0x128 // IF2 Arbitration Register
  88. #define CAN_O_IF2MCTL 0x12C // IF2 Message Control Register
  89. #define CAN_O_IF2DATA 0x130 // IF2 Data A Register
  90. #define CAN_O_IF2DATB 0x134 // IF2 Data B Register
  91. #define CAN_O_IF3OBS 0x140 // IF3 Observation Register
  92. #define CAN_O_IF3MSK 0x144 // IF3 Mask Register
  93. #define CAN_O_IF3ARB 0x148 // IF3 Arbitration Register
  94. #define CAN_O_IF3MCTL 0x14C // IF3 Message Control Register
  95. #define CAN_O_IF3DATA 0x150 // IF3 Data A Register
  96. #define CAN_O_IF3DATB 0x154 // IF3 Data B Register
  97. #define CAN_O_IF3UPD 0x160 // IF3 Update Enable Register
  98. //*****************************************************************************
  99. //
  100. // The following are defines for the bit fields in the CAN_CTL register
  101. //
  102. //*****************************************************************************
  103. #define CAN_CTL_INIT 0x1 // Initialization
  104. #define CAN_CTL_IE0 0x2 // Interrupt line 0 Enable
  105. // Disabled
  106. #define CAN_CTL_SIE 0x4 // Status Change Interrupt Enable
  107. // Disabled
  108. #define CAN_CTL_EIE 0x8 // Error Interrupt Enable Disabled
  109. #define CAN_CTL_DAR 0x20 // Disable Automatic
  110. // Retransmission
  111. #define CAN_CTL_CCE 0x40 // Configuration Change Enable
  112. #define CAN_CTL_TEST 0x80 // Test Mode Enable
  113. #define CAN_CTL_IDS 0x100 // Interruption Debug Support
  114. // Enable
  115. #define CAN_CTL_ABO 0x200 // Auto-Bus-On Enable
  116. #define CAN_CTL_PMD_S 10
  117. #define CAN_CTL_PMD_M 0x3C00 // Parity on/off
  118. #define CAN_CTL_SWR 0x8000 // SW Reset Enable
  119. #define CAN_CTL_INITDBG 0x10000 // Debug Mode Status
  120. #define CAN_CTL_IE1 0x20000 // Interrupt line 1 Enable
  121. // Disabled
  122. #define CAN_CTL_PDR 0x1000000 // Power Down Request Mode
  123. #define CAN_CTL_WUBA 0x2000000 // Wake Up on Bus Activity
  124. //*****************************************************************************
  125. //
  126. // The following are defines for the bit fields in the CAN_ES register
  127. //
  128. //*****************************************************************************
  129. #define CAN_ES_LEC_S 0
  130. #define CAN_ES_LEC_M 0x7 // Last Error Code
  131. #define CAN_ES_TXOK 0x8 // Transmission status
  132. #define CAN_ES_RXOK 0x10 // Reception status
  133. #define CAN_ES_EPASS 0x20 // Error Passive State
  134. #define CAN_ES_EWARN 0x40 // Warning State
  135. #define CAN_ES_BOFF 0x80 // Bus-Off State
  136. #define CAN_ES_PER 0x100 // Parity Error Detected
  137. #define CAN_ES_WAKEUPPND 0x200 // Wake Up Pending
  138. #define CAN_ES_PDA 0x400 // Power down mode acknowledge
  139. //*****************************************************************************
  140. //
  141. // The following are defines for the bit fields in the CAN_ERRC register
  142. //
  143. //*****************************************************************************
  144. #define CAN_ERRC_TEC_S 0
  145. #define CAN_ERRC_TEC_M 0xFF // Transmit Error Counter
  146. #define CAN_ERRC_REC_S 8
  147. #define CAN_ERRC_REC_M 0x7F00 // Receive Error Counter
  148. #define CAN_ERRC_RP 0x8000 // Receive Error Passive
  149. //*****************************************************************************
  150. //
  151. // The following are defines for the bit fields in the CAN_BTR register
  152. //
  153. //*****************************************************************************
  154. #define CAN_BTR_BRP_S 0
  155. #define CAN_BTR_BRP_M 0x3F // Baud Rate Prescaler
  156. #define CAN_BTR_SJW_S 6
  157. #define CAN_BTR_SJW_M 0xC0 // Synchronization Jump Width
  158. #define CAN_BTR_TSEG1_S 8
  159. #define CAN_BTR_TSEG1_M 0xF00 // Time segment
  160. #define CAN_BTR_TSEG2_S 12
  161. #define CAN_BTR_TSEG2_M 0x7000 // Time segment
  162. #define CAN_BTR_BRPE_S 16
  163. #define CAN_BTR_BRPE_M 0xF0000 // Baud Rate Prescaler Extension
  164. //*****************************************************************************
  165. //
  166. // The following are defines for the bit fields in the CAN_INT register
  167. //
  168. //*****************************************************************************
  169. #define CAN_INT_INT0ID_S 0
  170. #define CAN_INT_INT0ID_M 0xFFFF // Interrupt Identifier
  171. #define CAN_INT_INT1ID_S 16
  172. #define CAN_INT_INT1ID_M 0xFF0000 // Interrupt 1 Identifier
  173. //*****************************************************************************
  174. //
  175. // The following are defines for the bit fields in the CAN_TEST register
  176. //
  177. //*****************************************************************************
  178. #define CAN_TEST_SILENT 0x8 // Silent Mode
  179. #define CAN_TEST_LBACK 0x10 // Loopback Mode
  180. #define CAN_TEST_TX_S 5
  181. #define CAN_TEST_TX_M 0x60 // CANTX Pin Control
  182. #define CAN_TEST_RX 0x80 // CANRX Pin Status
  183. #define CAN_TEST_EXL 0x100 // External Loopback Mode
  184. #define CAN_TEST_RDA 0x200 // RAM Direct Access Enable:
  185. //*****************************************************************************
  186. //
  187. // The following are defines for the bit fields in the CAN_PERR register
  188. //
  189. //*****************************************************************************
  190. #define CAN_PERR_MSG_NUM_S 0
  191. #define CAN_PERR_MSG_NUM_M 0xFF // Message Number
  192. #define CAN_PERR_WORD_NUM_S 8
  193. #define CAN_PERR_WORD_NUM_M 0x700 // Word Number
  194. //*****************************************************************************
  195. //
  196. // The following are defines for the bit fields in the CAN_REL register
  197. //
  198. //*****************************************************************************
  199. #define CAN_REL_DAY_S 0
  200. #define CAN_REL_DAY_M 0xFF // Day
  201. #define CAN_REL_MON_S 8
  202. #define CAN_REL_MON_M 0xFF00 // Month
  203. #define CAN_REL_YEAR_S 16
  204. #define CAN_REL_YEAR_M 0xF0000 // Year
  205. #define CAN_REL_SUBSTEP_S 20
  206. #define CAN_REL_SUBSTEP_M 0xF00000 // Substep
  207. #define CAN_REL_STEP_S 24
  208. #define CAN_REL_STEP_M 0xF000000 // Step
  209. #define CAN_REL_REL_S 28
  210. #define CAN_REL_REL_M 0xF0000000 // Release
  211. //*****************************************************************************
  212. //
  213. // The following are defines for the bit fields in the CAN_RAM_INIT register
  214. //
  215. //*****************************************************************************
  216. #define CAN_RAM_INIT_KEY0 0x1 // KEY0
  217. #define CAN_RAM_INIT_KEY1 0x2 // KEY1
  218. #define CAN_RAM_INIT_KEY2 0x4 // KEY2
  219. #define CAN_RAM_INIT_KEY3 0x8 // KEY3
  220. #define CAN_RAM_INIT_CAN_RAM_INIT 0x10 // Initialize CAN Mailbox RAM
  221. #define CAN_RAM_INIT_RAM_INIT_DONE 0x20 // CAN RAM initialization complete
  222. //*****************************************************************************
  223. //
  224. // The following are defines for the bit fields in the CAN_GLB_INT_EN register
  225. //
  226. //*****************************************************************************
  227. #define CAN_GLB_INT_CANINT0 0x1 // Global Interrupt Enable for CAN INT0
  228. #define CAN_GLB_INT_CANINT1 0x2 // Global Interrupt Enable for CAN INT1
  229. //*****************************************************************************
  230. //
  231. // The following are defines for the bit fields in the CAN_GLB_INT_FLG register
  232. //
  233. //*****************************************************************************
  234. #define CAN_GLB_INT_FLG_NAME 0x1 // Global Interrupt Flag for CAN
  235. // INT0
  236. #define CAN_GLB_INT_FLG_INT1_FLG 0x2 // Global Interrupt Flag for CAN
  237. // INT1
  238. //*****************************************************************************
  239. //
  240. // The following are defines for the bit fields in the CAN_GLB_INT_CLR register
  241. //
  242. //*****************************************************************************
  243. #define CAN_GLB_INT_CLR_INT0_FLG_CLR 0x1 // Global Interrupt flag clear for
  244. // CAN INT0
  245. #define CAN_GLB_INT_CLR_INT1_FLG_CLR 0x2 // Global Interrupt flag clear
  246. // for CAN INT1
  247. //*****************************************************************************
  248. //
  249. // The following are defines for the bit fields in the CAN_ABOTR register
  250. //
  251. //*****************************************************************************
  252. #define CAN_ABOTR_ABO_TIME_S 0
  253. #define CAN_ABOTR_ABO_TIME_M 0xFFFFFFFF // Auto-Bus-On Timer
  254. //*****************************************************************************
  255. //
  256. // The following are defines for the bit fields in the CAN_TXRQ_X register
  257. //
  258. //*****************************************************************************
  259. #define CAN_TXRQ_X_TXRQSTREG1_S 0
  260. #define CAN_TXRQ_X_TXRQSTREG1_M 0x3 // Transmit Request Register 1
  261. #define CAN_TXRQ_X_TXRQSTREG2_S 2
  262. #define CAN_TXRQ_X_TXRQSTREG2_M 0xC // Transmit Request Register 2
  263. //*****************************************************************************
  264. //
  265. // The following are defines for the bit fields in the CAN_TXRQ_21 register
  266. //
  267. //*****************************************************************************
  268. #define CAN_TXRQ_21_TXRQST_S 0
  269. #define CAN_TXRQ_21_TXRQST_M 0xFFFFFFFF // Transmission Request Bits
  270. //*****************************************************************************
  271. //
  272. // The following are defines for the bit fields in the CAN_NDAT_X register
  273. //
  274. //*****************************************************************************
  275. #define CAN_NDAT_X_NEWDATREG1_S 0
  276. #define CAN_NDAT_X_NEWDATREG1_M 0x3 // New Data Register 1
  277. #define CAN_NDAT_X_NEWDATREG2_S 2
  278. #define CAN_NDAT_X_NEWDATREG2_M 0xC // New Data Register 2
  279. //*****************************************************************************
  280. //
  281. // The following are defines for the bit fields in the CAN_NDAT_21 register
  282. //
  283. //*****************************************************************************
  284. #define CAN_NDAT_21_NEWDAT_S 0
  285. #define CAN_NDAT_21_NEWDAT_M 0xFFFFFFFF // New Data Bits
  286. //*****************************************************************************
  287. //
  288. // The following are defines for the bit fields in the CAN_IPEN_X register
  289. //
  290. //*****************************************************************************
  291. #define CAN_IPEN_X_INTPNDREG1_S 0
  292. #define CAN_IPEN_X_INTPNDREG1_M 0x3 // Interrupt Pending Register 1
  293. #define CAN_IPEN_X_INTPNDREG2_S 2
  294. #define CAN_IPEN_X_INTPNDREG2_M 0xC // Interrupt Pending Register 2
  295. //*****************************************************************************
  296. //
  297. // The following are defines for the bit fields in the CAN_IPEN_21 register
  298. //
  299. //*****************************************************************************
  300. #define CAN_IPEN_21_INTPND_S 0
  301. #define CAN_IPEN_21_INTPND_M 0xFFFFFFFF // Interrupt Pending
  302. //*****************************************************************************
  303. //
  304. // The following are defines for the bit fields in the CAN_MVAL_X register
  305. //
  306. //*****************************************************************************
  307. #define CAN_MVAL_X_MSGVALREG1_S 0
  308. #define CAN_MVAL_X_MSGVALREG1_M 0x3 // Message Valid Register 1
  309. #define CAN_MVAL_X_MSGVALREG2_S 2
  310. #define CAN_MVAL_X_MSGVALREG2_M 0xC // Message Valid Register 2
  311. //*****************************************************************************
  312. //
  313. // The following are defines for the bit fields in the CAN_MVAL_21 register
  314. //
  315. //*****************************************************************************
  316. #define CAN_MVAL_21_MSGVALREG_S 0
  317. #define CAN_MVAL_21_MSGVALREG_M 0xFFFFFFFF // Message Valid Bits
  318. //*****************************************************************************
  319. //
  320. // The following are defines for the bit fields in the CAN_IP_MUX21 register
  321. //
  322. //*****************************************************************************
  323. #define CAN_IP_MUX21_INTMUX_S 0
  324. #define CAN_IP_MUX21_INTMUX_M 0xFFFFFFFF // Interrupt Mux
  325. //*****************************************************************************
  326. //
  327. // The following are defines for the bit fields in the CAN_IF1CMD register
  328. //
  329. //*****************************************************************************
  330. #define CAN_IF1CMD_MSG_NUM_S 0
  331. #define CAN_IF1CMD_MSG_NUM_M 0xFF // Message Number
  332. #define CAN_IF1CMD_BUSY 0x8000 // Busy Flag
  333. #define CAN_IF1CMD_DATA_B 0x10000 // Access Data Bytes 4-7
  334. #define CAN_IF1CMD_DATA_A 0x20000 // Access Data Bytes 0-3
  335. #define CAN_IF1CMD_TXRQST 0x40000 // Access Transmission Request Bit
  336. #define CAN_IF1CMD_CLRINTPND 0x80000 // Clear Interrupt Pending Bit
  337. #define CAN_IF1CMD_CONTROL 0x100000 // Access Control Bits
  338. #define CAN_IF1CMD_ARB 0x200000 // Access Arbitration Bits
  339. #define CAN_IF1CMD_MASK 0x400000 // Access Mask Bits
  340. #define CAN_IF1CMD_DIR 0x800000 // Write/Read Direction
  341. //*****************************************************************************
  342. //
  343. // The following are defines for the bit fields in the CAN_IF1MSK register
  344. //
  345. //*****************************************************************************
  346. #define CAN_IF1MSK_MSK_S 0
  347. #define CAN_IF1MSK_MSK_M 0x1FFFFFFF // Identifier Mask
  348. #define CAN_IF1MSK_MDIR 0x40000000 // Mask Message Direction
  349. #define CAN_IF1MSK_MXTD 0x80000000 // Mask Extended Identifier
  350. //*****************************************************************************
  351. //
  352. // The following are defines for the bit fields in the CAN_IF1ARB register
  353. //
  354. //*****************************************************************************
  355. #define CAN_IF1ARB_ID_S 0
  356. #define CAN_IF1ARB_ID_M 0x1FFFFFFF // `
  357. #define CAN_IF1ARB_DIR 0x20000000 // Message Direction
  358. #define CAN_IF1ARB_XTD 0x40000000 // Extended Identifier
  359. #define CAN_IF1ARB_MSGVAL 0x80000000 // Message Valid
  360. //*****************************************************************************
  361. //
  362. // The following are defines for the bit fields in the CAN_IF1MCTL register
  363. //
  364. //*****************************************************************************
  365. #define CAN_IF1MCTL_DLC_S 0
  366. #define CAN_IF1MCTL_DLC_M 0xF // Data length code
  367. #define CAN_IF1MCTL_EOB 0x80 // End of Block
  368. #define CAN_IF1MCTL_TXRQST 0x100 // Transmit Request
  369. #define CAN_IF1MCTL_RMTEN 0x200 // Remote Enable
  370. #define CAN_IF1MCTL_RXIE 0x400 // Receive Interrupt Enable
  371. #define CAN_IF1MCTL_TXIE 0x800 // Transmit Interrupt Enable
  372. #define CAN_IF1MCTL_UMASK 0x1000 // Use Acceptance Mask
  373. #define CAN_IF1MCTL_INTPND 0x2000 // Interrupt Pending
  374. #define CAN_IF1MCTL_MSGLST 0x4000 // Message Lost
  375. #define CAN_IF1MCTL_NEWDAT 0x8000 // New Data
  376. //*****************************************************************************
  377. //
  378. // The following are defines for the bit fields in the CAN_IF1DATA register
  379. //
  380. //*****************************************************************************
  381. #define CAN_IF1DATA_DATA_0_S 0
  382. #define CAN_IF1DATA_DATA_0_M 0xFF // Data Byte 0
  383. #define CAN_IF1DATA_DATA_1_S 8
  384. #define CAN_IF1DATA_DATA_1_M 0xFF00 // Data Byte 1
  385. #define CAN_IF1DATA_DATA_2_S 16
  386. #define CAN_IF1DATA_DATA_2_M 0xFF0000 // Data Byte 2
  387. #define CAN_IF1DATA_DATA_3_S 24
  388. #define CAN_IF1DATA_DATA_3_M 0xFF000000 // Data Byte 3
  389. //*****************************************************************************
  390. //
  391. // The following are defines for the bit fields in the CAN_IF1DATB register
  392. //
  393. //*****************************************************************************
  394. #define CAN_IF1DATB_DATA_4_S 0
  395. #define CAN_IF1DATB_DATA_4_M 0xFF // Data Byte 4
  396. #define CAN_IF1DATB_DATA_5_S 8
  397. #define CAN_IF1DATB_DATA_5_M 0xFF00 // Data Byte 5
  398. #define CAN_IF1DATB_DATA_6_S 16
  399. #define CAN_IF1DATB_DATA_6_M 0xFF0000 // Data Byte 6
  400. #define CAN_IF1DATB_DATA_7_S 24
  401. #define CAN_IF1DATB_DATA_7_M 0xFF000000 // Data Byte 7
  402. //*****************************************************************************
  403. //
  404. // The following are defines for the bit fields in the CAN_IF2CMD register
  405. //
  406. //*****************************************************************************
  407. #define CAN_IF2CMD_MSG_NUM_S 0
  408. #define CAN_IF2CMD_MSG_NUM_M 0xFF // Message Number
  409. #define CAN_IF2CMD_BUSY 0x8000 // Busy Flag
  410. #define CAN_IF2CMD_DATA_B 0x10000 // Access Data Bytes 4-7
  411. #define CAN_IF2CMD_DATA_A 0x20000 // Access Data Bytes 0-3
  412. #define CAN_IF2CMD_TXRQST 0x40000 // Access Transmission Request Bit
  413. #define CAN_IF2CMD_CLRINTPND 0x80000 // Clear Interrupt Pending Bit
  414. #define CAN_IF2CMD_CONTROL 0x100000 // Access Control Bits
  415. #define CAN_IF2CMD_ARB 0x200000 // Access Arbitration Bits
  416. #define CAN_IF2CMD_MASK 0x400000 // Access Mask Bits
  417. #define CAN_IF2CMD_DIR 0x800000 // Write/Read Direction
  418. //*****************************************************************************
  419. //
  420. // The following are defines for the bit fields in the CAN_IF2MSK register
  421. //
  422. //*****************************************************************************
  423. #define CAN_IF2MSK_MSK_S 0
  424. #define CAN_IF2MSK_MSK_M 0x1FFFFFFF // Identifier Mask
  425. #define CAN_IF2MSK_MDIR 0x40000000 // Mask Message Direction
  426. #define CAN_IF2MSK_MXTD 0x80000000 // Mask Extended Identifier
  427. //*****************************************************************************
  428. //
  429. // The following are defines for the bit fields in the CAN_IF2ARB register
  430. //
  431. //*****************************************************************************
  432. #define CAN_IF2ARB_ID_S 0
  433. #define CAN_IF2ARB_ID_M 0x1FFFFFFF // Message Identifier
  434. #define CAN_IF2ARB_DIR 0x20000000 // Message Direction
  435. #define CAN_IF2ARB_XTD 0x40000000 // Extended Identifier
  436. #define CAN_IF2ARB_MSGVAL 0x80000000 // Message Valid
  437. //*****************************************************************************
  438. //
  439. // The following are defines for the bit fields in the CAN_IF2MCTL register
  440. //
  441. //*****************************************************************************
  442. #define CAN_IF2MCTL_DLC_S 0
  443. #define CAN_IF2MCTL_DLC_M 0xF // Data length code
  444. #define CAN_IF2MCTL_EOB 0x80 // End of Block
  445. #define CAN_IF2MCTL_TXRQST 0x100 // Transmit Request
  446. #define CAN_IF2MCTL_RMTEN 0x200 // Remote Enable
  447. #define CAN_IF2MCTL_RXIE 0x400 // Receive Interrupt Enable
  448. #define CAN_IF2MCTL_TXIE 0x800 // Transmit Interrupt Enable
  449. #define CAN_IF2MCTL_UMASK 0x1000 // Use Acceptance Mask
  450. #define CAN_IF2MCTL_INTPND 0x2000 // Interrupt Pending
  451. #define CAN_IF2MCTL_MSGLST 0x4000 // Message Lost
  452. #define CAN_IF2MCTL_NEWDAT 0x8000 // New Data
  453. //*****************************************************************************
  454. //
  455. // The following are defines for the bit fields in the CAN_IF2DATA register
  456. //
  457. //*****************************************************************************
  458. #define CAN_IF2DATA_DATA_0_S 0
  459. #define CAN_IF2DATA_DATA_0_M 0xFF // Data Byte 0
  460. #define CAN_IF2DATA_DATA_1_S 8
  461. #define CAN_IF2DATA_DATA_1_M 0xFF00 // Data Byte 1
  462. #define CAN_IF2DATA_DATA_2_S 16
  463. #define CAN_IF2DATA_DATA_2_M 0xFF0000 // Data Byte 2
  464. #define CAN_IF2DATA_DATA_3_S 24
  465. #define CAN_IF2DATA_DATA_3_M 0xFF000000 // Data Byte 3
  466. //*****************************************************************************
  467. //
  468. // The following are defines for the bit fields in the CAN_IF2DATB register
  469. //
  470. //*****************************************************************************
  471. #define CAN_IF2DATB_DATA_4_S 0
  472. #define CAN_IF2DATB_DATA_4_M 0xFF // Data Byte 4
  473. #define CAN_IF2DATB_DATA_5_S 8
  474. #define CAN_IF2DATB_DATA_5_M 0xFF00 // Data Byte 5
  475. #define CAN_IF2DATB_DATA_6_S 16
  476. #define CAN_IF2DATB_DATA_6_M 0xFF0000 // Data Byte 6
  477. #define CAN_IF2DATB_DATA_7_S 24
  478. #define CAN_IF2DATB_DATA_7_M 0xFF000000 // Data Byte 7
  479. //*****************************************************************************
  480. //
  481. // The following are defines for the bit fields in the CAN_IF3OBS register
  482. //
  483. //*****************************************************************************
  484. #define CAN_IF3OBS_MASK 0x1 // Mask data read observation
  485. #define CAN_IF3OBS_ARB 0x2 // Arbitration data read
  486. // observation
  487. #define CAN_IF3OBS_CTRL 0x4 // Ctrl read observation
  488. #define CAN_IF3OBS_DATA_A 0x8 // Data A read observation
  489. #define CAN_IF3OBS_DATA_B 0x10 // Data B read observation
  490. #define CAN_IF3OBS_IF3SM 0x100 // IF3 Status of Mask data read
  491. // access
  492. #define CAN_IF3OBS_IF3SA 0x200 // IF3 Status of Arbitration data
  493. // read access
  494. #define CAN_IF3OBS_IF3SC 0x400 // IF3 Status of Control bits read
  495. // access
  496. #define CAN_IF3OBS_IF3SDA 0x800 // IF3 Status of Data A read
  497. // access
  498. #define CAN_IF3OBS_IF3SDB 0x1000 // IF3 Status of Data B read
  499. // access
  500. #define CAN_IF3OBS_IF3UPD 0x8000 // IF3 Update Data
  501. //*****************************************************************************
  502. //
  503. // The following are defines for the bit fields in the CAN_IF3MSK register
  504. //
  505. //*****************************************************************************
  506. #define CAN_IF3MSK_MSK_S 0
  507. #define CAN_IF3MSK_MSK_M 0x1FFFFFFF // Mask
  508. #define CAN_IF3MSK_MDIR 0x40000000 // Mask Message Direction
  509. #define CAN_IF3MSK_MXTD 0x80000000 // Mask Extended Identifier
  510. //*****************************************************************************
  511. //
  512. // The following are defines for the bit fields in the CAN_IF3ARB register
  513. //
  514. //*****************************************************************************
  515. #define CAN_IF3ARB_ID_S 0
  516. #define CAN_IF3ARB_ID_M 0x1FFFFFFF // Message Identifier
  517. #define CAN_IF3ARB_DIR 0x20000000 // Message Direction
  518. #define CAN_IF3ARB_XTD 0x40000000 // Extended Identifier
  519. #define CAN_IF3ARB_MSGVAL 0x80000000 // Message Valid
  520. //*****************************************************************************
  521. //
  522. // The following are defines for the bit fields in the CAN_IF3MCTL register
  523. //
  524. //*****************************************************************************
  525. #define CAN_IF3MCTL_DLC_S 0
  526. #define CAN_IF3MCTL_DLC_M 0xF // Data length code
  527. #define CAN_IF3MCTL_EOB 0x80 // End of Block
  528. #define CAN_IF3MCTL_TXRQST 0x100 // Transmit Request
  529. #define CAN_IF3MCTL_RMTEN 0x200 // Remote Enable
  530. #define CAN_IF3MCTL_RXIE 0x400 // Receive Interrupt Enable
  531. #define CAN_IF3MCTL_TXIE 0x800 // Transmit Interrupt Enable
  532. #define CAN_IF3MCTL_UMASK 0x1000 // Use Acceptance Mask
  533. #define CAN_IF3MCTL_INTPND 0x2000 // Interrupt Pending
  534. #define CAN_IF3MCTL_MSGLST 0x4000 // Message Lost
  535. #define CAN_IF3MCTL_NEWDAT 0x8000 // New Data
  536. //*****************************************************************************
  537. //
  538. // The following are defines for the bit fields in the CAN_IF3DATA register
  539. //
  540. //*****************************************************************************
  541. #define CAN_IF3DATA_DATA_0_S 0
  542. #define CAN_IF3DATA_DATA_0_M 0xFF // Data Byte 0
  543. #define CAN_IF3DATA_DATA_1_S 8
  544. #define CAN_IF3DATA_DATA_1_M 0xFF00 // Data Byte 1
  545. #define CAN_IF3DATA_DATA_2_S 16
  546. #define CAN_IF3DATA_DATA_2_M 0xFF0000 // Data Byte 2
  547. #define CAN_IF3DATA_DATA_3_S 24
  548. #define CAN_IF3DATA_DATA_3_M 0xFF000000 // Data Byte 3
  549. //*****************************************************************************
  550. //
  551. // The following are defines for the bit fields in the CAN_IF3DATB register
  552. //
  553. //*****************************************************************************
  554. #define CAN_IF3DATB_DATA_4_S 0
  555. #define CAN_IF3DATB_DATA_4_M 0xFF // Data Byte 4
  556. #define CAN_IF3DATB_DATA_5_S 8
  557. #define CAN_IF3DATB_DATA_5_M 0xFF00 // Data Byte 5
  558. #define CAN_IF3DATB_DATA_6_S 16
  559. #define CAN_IF3DATB_DATA_6_M 0xFF0000 // Data Byte 6
  560. #define CAN_IF3DATB_DATA_7_S 24
  561. #define CAN_IF3DATB_DATA_7_M 0xFF000000 // Data Byte 7
  562. //*****************************************************************************
  563. //
  564. // The following are defines for the bit fields in the CAN_IF3UPD register
  565. //
  566. //*****************************************************************************
  567. #define CAN_IF3UPD_IF3UPDEN_S 0
  568. #define CAN_IF3UPD_IF3UPDEN_M 0xFFFFFFFF // IF3 Update Enabled
  569. #endif