F2837xD_can.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_can.h
  4. //
  5. // TITLE: CAN Register Definitions.
  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 __F2837xD_CAN_H__
  43. #define __F2837xD_CAN_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // CAN Individual Register Bit Definitions:
  49. struct CAN_CTL_BITS { // bits description
  50. bp_16 Init:1; // 0 Initialization
  51. bp_16 IE0:1; // 1 Interrupt line 0 Enable
  52. bp_16 SIE:1; // 2 Status Change Interrupt Enable
  53. bp_16 EIE:1; // 3 Error Interrupt Enable
  54. bp_16 rsvd1:1; // 4 Reserved
  55. bp_16 DAR:1; // 5 Disable Automatic Retransmission
  56. bp_16 CCE:1; // 6 Configuration Change Enable
  57. bp_16 Test:1; // 7 Test Mode Enable
  58. bp_16 IDS:1; // 8 Interruption Debug Support Enable
  59. bp_16 ABO:1; // 9 Auto-Bus-On Enable
  60. bp_16 PMD:4; // 13:10 Parity on/off
  61. bp_16 rsvd2:1; // 14 Reserved
  62. bp_16 SWR:1; // 15 SW Reset Enable
  63. bp_32 INITDBG:1; // 16 Debug Mode Status
  64. bp_32 IE1:1; // 17 Interrupt line 1 Enable Disabled
  65. bp_32 rsvd3:1; // 18 Reserved
  66. bp_32 rsvd4:1; // 19 Reserved
  67. bp_32 rsvd5:1; // 20 Reserved
  68. bp_32 rsvd6:3; // 23:21 Reserved
  69. bp_32 rsvd7:1; // 24 Reserved
  70. bp_32 rsvd8:1; // 25 Reserved
  71. bp_32 rsvd9:6; // 31:26 Reserved
  72. };
  73. union CAN_CTL_REG {
  74. bp_32 all;
  75. struct CAN_CTL_BITS bit;
  76. };
  77. struct CAN_ES_BITS { // bits description
  78. bp_16 LEC:3; // 2:0 Last Error Code
  79. bp_16 TxOk:1; // 3 Transmission status
  80. bp_16 RxOk:1; // 4 Reception status
  81. bp_16 EPass:1; // 5 Error Passive State
  82. bp_16 EWarn:1; // 6 Warning State
  83. bp_16 BOff:1; // 7 Bus-Off State
  84. bp_16 PER:1; // 8 Parity Error Detected
  85. bp_16 rsvd1:1; // 9 Reserved
  86. bp_16 rsvd2:1; // 10 Reserved
  87. bp_16 rsvd3:5; // 15:11 Reserved
  88. bp_32 rsvd4:16; // 31:16 Reserved
  89. };
  90. union CAN_ES_REG {
  91. bp_32 all;
  92. struct CAN_ES_BITS bit;
  93. };
  94. struct CAN_ERRC_BITS { // bits description
  95. bp_16 TEC:8; // 7:0 Transmit Error Counter
  96. bp_16 REC:7; // 14:8 Receive Error Counter
  97. bp_16 RP:1; // 15 Receive Error Passive
  98. bp_32 rsvd1:16; // 31:16 Reserved
  99. };
  100. union CAN_ERRC_REG {
  101. bp_32 all;
  102. struct CAN_ERRC_BITS bit;
  103. };
  104. struct CAN_BTR_BITS { // bits description
  105. bp_16 BRP:6; // 5:0 Baud Rate Prescaler
  106. bp_16 SJW:2; // 7:6 Synchronization Jump Width
  107. bp_16 TSEG1:4; // 11:8 Time segment
  108. bp_16 TSEG2:3; // 14:12 Time segment
  109. bp_16 rsvd1:1; // 15 Reserved
  110. bp_32 BRPE:4; // 19:16 Baud Rate Prescaler Extension
  111. bp_32 rsvd2:12; // 31:20 Reserved
  112. };
  113. union CAN_BTR_REG {
  114. bp_32 all;
  115. struct CAN_BTR_BITS bit;
  116. };
  117. struct CAN_INT_BITS { // bits description
  118. bp_16 INT0ID:16; // 15:0 Interrupt Identifier
  119. bp_32 INT1ID:8; // 23:16 Interrupt 1 Identifier
  120. bp_32 rsvd1:8; // 31:24 Reserved
  121. };
  122. union CAN_INT_REG {
  123. bp_32 all;
  124. struct CAN_INT_BITS bit;
  125. };
  126. struct CAN_TEST_BITS { // bits description
  127. bp_16 rsvd1:3; // 2:0 Reserved
  128. bp_16 SILENT:1; // 3 Silent Mode
  129. bp_16 LBACK:1; // 4 Loopback Mode
  130. bp_16 TX:2; // 6:5 CANTX Pin Control
  131. bp_16 RX:1; // 7 CANRX Pin Status
  132. bp_16 EXL:1; // 8 External Loopback Mode
  133. bp_16 RDA:1; // 9 RAM Direct Access Enable:
  134. bp_16 rsvd2:6; // 15:10 Reserved
  135. bp_32 rsvd3:16; // 31:16 Reserved
  136. };
  137. union CAN_TEST_REG {
  138. bp_32 all;
  139. struct CAN_TEST_BITS bit;
  140. };
  141. struct CAN_PERR_BITS { // bits description
  142. bp_16 MSG_NUM:8; // 7:0 Message Number
  143. bp_16 WORD_NUM:3; // 10:8 Word Number
  144. bp_16 rsvd1:5; // 15:11 Reserved
  145. bp_32 rsvd2:16; // 31:16 Reserved
  146. };
  147. union CAN_PERR_REG {
  148. bp_32 all;
  149. struct CAN_PERR_BITS bit;
  150. };
  151. struct CAN_RAM_INIT_BITS { // bits description
  152. bp_16 KEY0:1; // 0 KEY0
  153. bp_16 KEY1:1; // 1 KEY1
  154. bp_16 KEY2:1; // 2 KEY2
  155. bp_16 KEY3:1; // 3 KEY3
  156. bp_16 CAN_RAM_INIT:1; // 4 Initialize CAN Mailbox RAM
  157. bp_16 RAM_INIT_DONE:1; // 5 CAN RAM initialization complete
  158. bp_16 rsvd1:10; // 15:6 Reserved
  159. bp_32 rsvd2:16; // 31:16 Reserved
  160. };
  161. union CAN_RAM_INIT_REG {
  162. bp_32 all;
  163. struct CAN_RAM_INIT_BITS bit;
  164. };
  165. struct CAN_GLB_INT_EN_BITS { // bits description
  166. bp_16 GLBINT0_EN:1; // 0 Global Interrupt Enable for CAN INT0
  167. bp_16 GLBINT1_EN:1; // 1 Global Interrupt Enable for CAN INT1
  168. bp_16 rsvd1:14; // 15:2 Reserved
  169. bp_32 rsvd2:16; // 31:16 Reserved
  170. };
  171. union CAN_GLB_INT_EN_REG {
  172. bp_32 all;
  173. struct CAN_GLB_INT_EN_BITS bit;
  174. };
  175. struct CAN_GLB_INT_FLG_BITS { // bits description
  176. bp_16 INT0_FLG:1; // 0 Global Interrupt Flag for CAN INT0
  177. bp_16 INT1_FLG:1; // 1 Global Interrupt Flag for CAN INT1
  178. bp_16 rsvd1:14; // 15:2 Reserved
  179. bp_32 rsvd2:16; // 31:16 Reserved
  180. };
  181. union CAN_GLB_INT_FLG_REG {
  182. bp_32 all;
  183. struct CAN_GLB_INT_FLG_BITS bit;
  184. };
  185. struct CAN_GLB_INT_CLR_BITS { // bits description
  186. bp_16 INT0_FLG_CLR:1; // 0 Global Interrupt flag clear for CAN INT0
  187. bp_16 INT1_FLG_CLR:1; // 1 Global Interrupt flag clear for CAN INT1
  188. bp_16 rsvd1:14; // 15:2 Reserved
  189. bp_32 rsvd2:16; // 31:16 Reserved
  190. };
  191. union CAN_GLB_INT_CLR_REG {
  192. bp_32 all;
  193. struct CAN_GLB_INT_CLR_BITS bit;
  194. };
  195. struct CAN_TXRQ_X_BITS { // bits description
  196. bp_16 TxRqstReg1:2; // 1:0 Transmit Request Register 1
  197. bp_16 TxRqstReg2:2; // 3:2 Transmit Request Register 2
  198. bp_16 rsvd1:12; // 15:4 Reserved
  199. bp_32 rsvd2:16; // 31:16 Reserved
  200. };
  201. union CAN_TXRQ_X_REG {
  202. bp_32 all;
  203. struct CAN_TXRQ_X_BITS bit;
  204. };
  205. struct CAN_NDAT_X_BITS { // bits description
  206. bp_16 NewDatReg1:2; // 1:0 New Data Register 1
  207. bp_16 NewDatReg2:2; // 3:2 New Data Register 2
  208. bp_16 rsvd1:12; // 15:4 Reserved
  209. bp_32 rsvd2:16; // 31:16 Reserved
  210. };
  211. union CAN_NDAT_X_REG {
  212. bp_32 all;
  213. struct CAN_NDAT_X_BITS bit;
  214. };
  215. struct CAN_IPEN_X_BITS { // bits description
  216. bp_16 IntPndReg1:2; // 1:0 Interrupt Pending Register 1
  217. bp_16 IntPndReg2:2; // 3:2 Interrupt Pending Register 2
  218. bp_16 rsvd1:12; // 15:4 Reserved
  219. bp_32 rsvd2:16; // 31:16 Reserved
  220. };
  221. union CAN_IPEN_X_REG {
  222. bp_32 all;
  223. struct CAN_IPEN_X_BITS bit;
  224. };
  225. struct CAN_MVAL_X_BITS { // bits description
  226. bp_16 MsgValReg1:2; // 1:0 Message Valid Register 1
  227. bp_16 MsgValReg2:2; // 3:2 Message Valid Register 2
  228. bp_16 rsvd1:12; // 15:4 Reserved
  229. bp_32 rsvd2:16; // 31:16 Reserved
  230. };
  231. union CAN_MVAL_X_REG {
  232. bp_32 all;
  233. struct CAN_MVAL_X_BITS bit;
  234. };
  235. struct CAN_IF1CMD_BITS { // bits description
  236. bp_16 MSG_NUM:8; // 7:0 Message Number
  237. bp_16 rsvd1:6; // 13:8 Reserved
  238. bp_16 rsvd2:1; // 14 Reserved
  239. bp_16 Busy:1; // 15 Busy Flag
  240. bp_32 DATA_B:1; // 16 Access Data Bytes 4-7
  241. bp_32 DATA_A:1; // 17 Access Data Bytes 0-3
  242. bp_32 TXRQST:1; // 18 Access Transmission Request Bit
  243. bp_32 ClrIntPnd:1; // 19 Clear Interrupt Pending Bit
  244. bp_32 Control:1; // 20 Access Control Bits
  245. bp_32 Arb:1; // 21 Access Arbitration Bits
  246. bp_32 Mask:1; // 22 Access Mask Bits
  247. bp_32 DIR:1; // 23 Write/Read Direction
  248. bp_32 rsvd3:8; // 31:24 Reserved
  249. };
  250. union CAN_IF1CMD_REG {
  251. bp_32 all;
  252. struct CAN_IF1CMD_BITS bit;
  253. };
  254. struct CAN_IF1MSK_BITS { // bits description
  255. bp_32 Msk:29; // 28:0 Identifier Mask
  256. bp_32 rsvd1:1; // 29 Reserved
  257. bp_32 MDir:1; // 30 Mask Message Direction
  258. bp_32 MXtd:1; // 31 Mask Extended Identifier
  259. };
  260. union CAN_IF1MSK_REG {
  261. bp_32 all;
  262. struct CAN_IF1MSK_BITS bit;
  263. };
  264. struct CAN_IF1ARB_BITS { // bits description
  265. bp_32 ID:29; // 28:0 `
  266. bp_32 Dir:1; // 29 Message Direction
  267. bp_32 Xtd:1; // 30 Extended Identifier
  268. bp_32 MsgVal:1; // 31 Message Valid
  269. };
  270. union CAN_IF1ARB_REG {
  271. bp_32 all;
  272. struct CAN_IF1ARB_BITS bit;
  273. };
  274. struct CAN_IF1MCTL_BITS { // bits description
  275. bp_16 DLC:4; // 3:0 Data length code
  276. bp_16 rsvd1:3; // 6:4 Reserved
  277. bp_16 EoB:1; // 7 End of Block
  278. bp_16 TxRqst:1; // 8 Transmit Request
  279. bp_16 RmtEn:1; // 9 Remote Enable
  280. bp_16 RxIE:1; // 10 Receive Interrupt Enable
  281. bp_16 TxIE:1; // 11 Transmit Interrupt Enable
  282. bp_16 UMask:1; // 12 Use Acceptance Mask
  283. bp_16 IntPnd:1; // 13 Interrupt Pending
  284. bp_16 MsgLst:1; // 14 Message Lost
  285. bp_16 NewDat:1; // 15 New Data
  286. bp_32 rsvd2:16; // 31:16 Reserved
  287. };
  288. union CAN_IF1MCTL_REG {
  289. bp_32 all;
  290. struct CAN_IF1MCTL_BITS bit;
  291. };
  292. struct CAN_IF1DATA_BITS { // bits description
  293. bp_16 Data_0:8; // 7:0 Data Byte 0
  294. bp_16 Data_1:8; // 15:8 Data Byte 1
  295. bp_32 Data_2:8; // 23:16 Data Byte 2
  296. bp_32 Data_3:8; // 31:24 Data Byte 3
  297. };
  298. union CAN_IF1DATA_REG {
  299. bp_32 all;
  300. struct CAN_IF1DATA_BITS bit;
  301. };
  302. struct CAN_IF1DATB_BITS { // bits description
  303. bp_16 Data_4:8; // 7:0 Data Byte 4
  304. bp_16 Data_5:8; // 15:8 Data Byte 5
  305. bp_32 Data_6:8; // 23:16 Data Byte 6
  306. bp_32 Data_7:8; // 31:24 Data Byte 7
  307. };
  308. union CAN_IF1DATB_REG {
  309. bp_32 all;
  310. struct CAN_IF1DATB_BITS bit;
  311. };
  312. struct CAN_IF2CMD_BITS { // bits description
  313. bp_16 MSG_NUM:8; // 7:0 Message Number
  314. bp_16 rsvd1:6; // 13:8 Reserved
  315. bp_16 rsvd2:1; // 14 Reserved
  316. bp_16 Busy:1; // 15 Busy Flag
  317. bp_32 DATA_B:1; // 16 Access Data Bytes 4-7
  318. bp_32 DATA_A:1; // 17 Access Data Bytes 0-3
  319. bp_32 TxRqst:1; // 18 Access Transmission Request Bit
  320. bp_32 ClrIntPnd:1; // 19 Clear Interrupt Pending Bit
  321. bp_32 Control:1; // 20 Access Control Bits
  322. bp_32 Arb:1; // 21 Access Arbitration Bits
  323. bp_32 Mask:1; // 22 Access Mask Bits
  324. bp_32 DIR:1; // 23 Write/Read Direction
  325. bp_32 rsvd3:8; // 31:24 Reserved
  326. };
  327. union CAN_IF2CMD_REG {
  328. bp_32 all;
  329. struct CAN_IF2CMD_BITS bit;
  330. };
  331. struct CAN_IF2MSK_BITS { // bits description
  332. bp_32 Msk:29; // 28:0 Identifier Mask
  333. bp_32 rsvd1:1; // 29 Reserved
  334. bp_32 MDir:1; // 30 Mask Message Direction
  335. bp_32 MXtd:1; // 31 Mask Extended Identifier
  336. };
  337. union CAN_IF2MSK_REG {
  338. bp_32 all;
  339. struct CAN_IF2MSK_BITS bit;
  340. };
  341. struct CAN_IF2ARB_BITS { // bits description
  342. bp_32 ID:29; // 28:0 Message Identifier
  343. bp_32 Dir:1; // 29 Message Direction
  344. bp_32 Xtd:1; // 30 Extended Identifier
  345. bp_32 MsgVal:1; // 31 Message Valid
  346. };
  347. union CAN_IF2ARB_REG {
  348. bp_32 all;
  349. struct CAN_IF2ARB_BITS bit;
  350. };
  351. struct CAN_IF2MCTL_BITS { // bits description
  352. bp_16 DLC:4; // 3:0 Data length code
  353. bp_16 rsvd1:3; // 6:4 Reserved
  354. bp_16 EoB:1; // 7 End of Block
  355. bp_16 TxRqst:1; // 8 Transmit Request
  356. bp_16 RmtEn:1; // 9 Remote Enable
  357. bp_16 RxIE:1; // 10 Receive Interrupt Enable
  358. bp_16 TxIE:1; // 11 Transmit Interrupt Enable
  359. bp_16 UMask:1; // 12 Use Acceptance Mask
  360. bp_16 IntPnd:1; // 13 Interrupt Pending
  361. bp_16 MsgLst:1; // 14 Message Lost
  362. bp_16 NewDat:1; // 15 New Data
  363. bp_32 rsvd2:16; // 31:16 Reserved
  364. };
  365. union CAN_IF2MCTL_REG {
  366. bp_32 all;
  367. struct CAN_IF2MCTL_BITS bit;
  368. };
  369. struct CAN_IF2DATA_BITS { // bits description
  370. bp_16 Data_0:8; // 7:0 Data Byte 0
  371. bp_16 Data_1:8; // 15:8 Data Byte 1
  372. bp_32 Data_2:8; // 23:16 Data Byte 2
  373. bp_32 Data_3:8; // 31:24 Data Byte 3
  374. };
  375. union CAN_IF2DATA_REG {
  376. bp_32 all;
  377. struct CAN_IF2DATA_BITS bit;
  378. };
  379. struct CAN_IF2DATB_BITS { // bits description
  380. bp_16 Data_4:8; // 7:0 Data Byte 4
  381. bp_16 Data_5:8; // 15:8 Data Byte 5
  382. bp_32 Data_6:8; // 23:16 Data Byte 6
  383. bp_32 Data_7:8; // 31:24 Data Byte 7
  384. };
  385. union CAN_IF2DATB_REG {
  386. bp_32 all;
  387. struct CAN_IF2DATB_BITS bit;
  388. };
  389. struct CAN_IF3OBS_BITS { // bits description
  390. bp_16 Mask:1; // 0 Mask data read observation
  391. bp_16 Arb:1; // 1 Arbitration data read observation
  392. bp_16 Ctrl:1; // 2 Ctrl read observation
  393. bp_16 Data_A:1; // 3 Data A read observation
  394. bp_16 Data_B:1; // 4 Data B read observation
  395. bp_16 rsvd1:3; // 7:5 Reserved
  396. bp_16 IF3SM:1; // 8 IF3 Status of Mask data read access
  397. bp_16 IF3SA:1; // 9 IF3 Status of Arbitration data read access
  398. bp_16 IF3SC:1; // 10 IF3 Status of Control bits read access
  399. bp_16 IF3SDA:1; // 11 IF3 Status of Data A read access
  400. bp_16 IF3SDB:1; // 12 IF3 Status of Data B read access
  401. bp_16 rsvd2:2; // 14:13 Reserved
  402. bp_16 IF3Upd:1; // 15 IF3 Update Data
  403. bp_32 rsvd3:16; // 31:16 Reserved
  404. };
  405. union CAN_IF3OBS_REG {
  406. bp_32 all;
  407. struct CAN_IF3OBS_BITS bit;
  408. };
  409. struct CAN_IF3MSK_BITS { // bits description
  410. bp_32 Msk:29; // 28:0 Mask
  411. bp_32 rsvd1:1; // 29 Reserved
  412. bp_32 MDir:1; // 30 Mask Message Direction
  413. bp_32 MXtd:1; // 31 Mask Extended Identifier
  414. };
  415. union CAN_IF3MSK_REG {
  416. bp_32 all;
  417. struct CAN_IF3MSK_BITS bit;
  418. };
  419. struct CAN_IF3ARB_BITS { // bits description
  420. bp_32 ID:29; // 28:0 Message Identifier
  421. bp_32 Dir:1; // 29 Message Direction
  422. bp_32 Xtd:1; // 30 Extended Identifier
  423. bp_32 MsgVal:1; // 31 Message Valid
  424. };
  425. union CAN_IF3ARB_REG {
  426. bp_32 all;
  427. struct CAN_IF3ARB_BITS bit;
  428. };
  429. struct CAN_IF3MCTL_BITS { // bits description
  430. bp_16 DLC:4; // 3:0 Data length code
  431. bp_16 rsvd1:3; // 6:4 Reserved
  432. bp_16 EoB:1; // 7 End of Block
  433. bp_16 TxRqst:1; // 8 Transmit Request
  434. bp_16 RmtEn:1; // 9 Remote Enable
  435. bp_16 RxIE:1; // 10 Receive Interrupt Enable
  436. bp_16 TxIE:1; // 11 Transmit Interrupt Enable
  437. bp_16 UMask:1; // 12 Use Acceptance Mask
  438. bp_16 IntPnd:1; // 13 Interrupt Pending
  439. bp_16 MsgLst:1; // 14 Message Lost
  440. bp_16 NewDat:1; // 15 New Data
  441. bp_32 rsvd2:16; // 31:16 Reserved
  442. };
  443. union CAN_IF3MCTL_REG {
  444. bp_32 all;
  445. struct CAN_IF3MCTL_BITS bit;
  446. };
  447. struct CAN_IF3DATA_BITS { // bits description
  448. bp_16 Data_0:8; // 7:0 Data Byte 0
  449. bp_16 Data_1:8; // 15:8 Data Byte 1
  450. bp_32 Data_2:8; // 23:16 Data Byte 2
  451. bp_32 Data_3:8; // 31:24 Data Byte 3
  452. };
  453. union CAN_IF3DATA_REG {
  454. bp_32 all;
  455. struct CAN_IF3DATA_BITS bit;
  456. };
  457. struct CAN_IF3DATB_BITS { // bits description
  458. bp_16 Data_4:8; // 7:0 Data Byte 4
  459. bp_16 Data_5:8; // 15:8 Data Byte 5
  460. bp_32 Data_6:8; // 23:16 Data Byte 6
  461. bp_32 Data_7:8; // 31:24 Data Byte 7
  462. };
  463. union CAN_IF3DATB_REG {
  464. bp_32 all;
  465. struct CAN_IF3DATB_BITS bit;
  466. };
  467. struct CAN_REGS {
  468. union CAN_CTL_REG CAN_CTL; // CAN Control Register
  469. union CAN_ES_REG CAN_ES; // Error and Status Register
  470. union CAN_ERRC_REG CAN_ERRC; // Error Counter Register
  471. union CAN_BTR_REG CAN_BTR; // Bit Timing Register
  472. union CAN_INT_REG CAN_INT; // Interrupt Register
  473. union CAN_TEST_REG CAN_TEST; // Test Register
  474. uint32_t rsvd1[2]; // Reserved
  475. union CAN_PERR_REG CAN_PERR; // CAN Parity Error Code Register
  476. uint32_t rsvd2[16]; // Reserved
  477. union CAN_RAM_INIT_REG CAN_RAM_INIT; // CAN RAM Initialization Register
  478. uint32_t rsvd3[6]; // Reserved
  479. union CAN_GLB_INT_EN_REG CAN_GLB_INT_EN; // CAN Global Interrupt Enable Register
  480. union CAN_GLB_INT_FLG_REG CAN_GLB_INT_FLG; // CAN Global Interrupt Flag Register
  481. union CAN_GLB_INT_CLR_REG CAN_GLB_INT_CLR; // CAN Global Interrupt Clear Register
  482. uint32_t rsvd4[18]; // Reserved
  483. bp_32 CAN_ABOTR; // Auto-Bus-On Time Register
  484. union CAN_TXRQ_X_REG CAN_TXRQ_X; // CAN Transmission Request Register
  485. bp_32 CAN_TXRQ_21; // CAN Transmission Request 2_1 Register
  486. uint32_t rsvd5[6]; // Reserved
  487. union CAN_NDAT_X_REG CAN_NDAT_X; // CAN New Data Register
  488. bp_32 CAN_NDAT_21; // CAN New Data 2_1 Register
  489. uint32_t rsvd6[6]; // Reserved
  490. union CAN_IPEN_X_REG CAN_IPEN_X; // CAN Interrupt Pending Register
  491. bp_32 CAN_IPEN_21; // CAN Interrupt Pending 2_1 Register
  492. uint32_t rsvd7[6]; // Reserved
  493. union CAN_MVAL_X_REG CAN_MVAL_X; // CAN Message Valid Register
  494. bp_32 CAN_MVAL_21; // CAN Message Valid 2_1 Register
  495. uint32_t rsvd8[8]; // Reserved
  496. bp_32 CAN_IP_MUX21; // CAN Interrupt Multiplexer 2_1 Register
  497. uint32_t rsvd9[18]; // Reserved
  498. union CAN_IF1CMD_REG CAN_IF1CMD; // IF1 Command Register
  499. union CAN_IF1MSK_REG CAN_IF1MSK; // IF1 Mask Register
  500. union CAN_IF1ARB_REG CAN_IF1ARB; // IF1 Arbitration Register
  501. union CAN_IF1MCTL_REG CAN_IF1MCTL; // IF1 Message Control Register
  502. union CAN_IF1DATA_REG CAN_IF1DATA; // IF1 Data A Register
  503. union CAN_IF1DATB_REG CAN_IF1DATB; // IF1 Data B Register
  504. uint32_t rsvd10[4]; // Reserved
  505. union CAN_IF2CMD_REG CAN_IF2CMD; // IF2 Command Register
  506. union CAN_IF2MSK_REG CAN_IF2MSK; // IF2 Mask Register
  507. union CAN_IF2ARB_REG CAN_IF2ARB; // IF2 Arbitration Register
  508. union CAN_IF2MCTL_REG CAN_IF2MCTL; // IF2 Message Control Register
  509. union CAN_IF2DATA_REG CAN_IF2DATA; // IF2 Data A Register
  510. union CAN_IF2DATB_REG CAN_IF2DATB; // IF2 Data B Register
  511. uint32_t rsvd11[4]; // Reserved
  512. union CAN_IF3OBS_REG CAN_IF3OBS; // IF3 Observation Register
  513. union CAN_IF3MSK_REG CAN_IF3MSK; // IF3 Mask Register
  514. union CAN_IF3ARB_REG CAN_IF3ARB; // IF3 Arbitration Register
  515. union CAN_IF3MCTL_REG CAN_IF3MCTL; // IF3 Message Control Register
  516. union CAN_IF3DATA_REG CAN_IF3DATA; // IF3 Data A Register
  517. union CAN_IF3DATB_REG CAN_IF3DATB; // IF3 Data B Register
  518. uint32_t rsvd12[4]; // Reserved
  519. bp_32 CAN_IF3UPD; // IF3 Update Enable Register
  520. };
  521. //---------------------------------------------------------------------------
  522. // CAN External References & Function Declarations:
  523. //
  524. #ifdef CPU1
  525. extern volatile struct CAN_REGS CanaRegs;
  526. extern volatile struct CAN_REGS CanbRegs;
  527. #endif
  528. #ifdef CPU2
  529. extern volatile struct CAN_REGS CanaRegs;
  530. extern volatile struct CAN_REGS CanbRegs;
  531. #endif
  532. #ifdef __cplusplus
  533. }
  534. #endif /* extern "C" */
  535. #endif
  536. //===========================================================================
  537. // End of file.
  538. //===========================================================================