hw_can.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. //*****************************************************************************
  2. //
  3. // hw_can.h - Defines and macros used when accessing the can.
  4. //
  5. // Copyright (c) 2006-2009 Luminary Micro, Inc. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
  9. // exclusively on LMI's microcontroller products.
  10. //
  11. // The software is owned by LMI and/or its suppliers, and is protected under
  12. // applicable copyright laws. All rights are reserved. You may not combine
  13. // this software with "viral" open-source software in order to form a larger
  14. // program. Any use in violation of the foregoing restrictions may subject
  15. // the user to criminal sanctions under applicable laws, as well as to civil
  16. // liability for the breach of the terms and conditions of this license.
  17. //
  18. // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  19. // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  20. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  21. // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  22. // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  23. //
  24. // This is part of revision 4694 of the Stellaris Firmware Development Package.
  25. //
  26. //*****************************************************************************
  27. #ifndef __HW_CAN_H__
  28. #define __HW_CAN_H__
  29. //*****************************************************************************
  30. //
  31. // The following are defines for the CAN register offsets.
  32. //
  33. //*****************************************************************************
  34. #define CAN_O_CTL 0x00000000 // Control register
  35. #define CAN_O_STS 0x00000004 // Status register
  36. #define CAN_O_ERR 0x00000008 // Error register
  37. #define CAN_O_BIT 0x0000000C // Bit Timing register
  38. #define CAN_O_INT 0x00000010 // Interrupt register
  39. #define CAN_O_TST 0x00000014 // Test register
  40. #define CAN_O_BRPE 0x00000018 // Baud Rate Prescaler register
  41. #define CAN_O_IF1CRQ 0x00000020 // Interface 1 Command Request reg.
  42. #define CAN_O_IF1CMSK 0x00000024 // Interface 1 Command Mask reg.
  43. #define CAN_O_IF1MSK1 0x00000028 // Interface 1 Mask 1 register
  44. #define CAN_O_IF1MSK2 0x0000002C // Interface 1 Mask 2 register
  45. #define CAN_O_IF1ARB1 0x00000030 // Interface 1 Arbitration 1 reg.
  46. #define CAN_O_IF1ARB2 0x00000034 // Interface 1 Arbitration 2 reg.
  47. #define CAN_O_IF1MCTL 0x00000038 // Interface 1 Message Control reg.
  48. #define CAN_O_IF1DA1 0x0000003C // Interface 1 DataA 1 register
  49. #define CAN_O_IF1DA2 0x00000040 // Interface 1 DataA 2 register
  50. #define CAN_O_IF1DB1 0x00000044 // Interface 1 DataB 1 register
  51. #define CAN_O_IF1DB2 0x00000048 // Interface 1 DataB 2 register
  52. #define CAN_O_IF2CRQ 0x00000080 // Interface 2 Command Request reg.
  53. #define CAN_O_IF2CMSK 0x00000084 // Interface 2 Command Mask reg.
  54. #define CAN_O_IF2MSK1 0x00000088 // Interface 2 Mask 1 register
  55. #define CAN_O_IF2MSK2 0x0000008C // Interface 2 Mask 2 register
  56. #define CAN_O_IF2ARB1 0x00000090 // Interface 2 Arbitration 1 reg.
  57. #define CAN_O_IF2ARB2 0x00000094 // Interface 2 Arbitration 2 reg.
  58. #define CAN_O_IF2MCTL 0x00000098 // Interface 2 Message Control reg.
  59. #define CAN_O_IF2DA1 0x0000009C // Interface 2 DataA 1 register
  60. #define CAN_O_IF2DA2 0x000000A0 // Interface 2 DataA 2 register
  61. #define CAN_O_IF2DB1 0x000000A4 // Interface 2 DataB 1 register
  62. #define CAN_O_IF2DB2 0x000000A8 // Interface 2 DataB 2 register
  63. #define CAN_O_TXRQ1 0x00000100 // Transmission Request 1 register
  64. #define CAN_O_TXRQ2 0x00000104 // Transmission Request 2 register
  65. #define CAN_O_NWDA1 0x00000120 // New Data 1 register
  66. #define CAN_O_NWDA2 0x00000124 // New Data 2 register
  67. #define CAN_O_MSG1INT 0x00000140 // CAN Message 1 Interrupt Pending
  68. #define CAN_O_MSG2INT 0x00000144 // CAN Message 2 Interrupt Pending
  69. #define CAN_O_MSG1VAL 0x00000160 // CAN Message 1 Valid
  70. #define CAN_O_MSG2VAL 0x00000164 // CAN Message 2 Valid
  71. //*****************************************************************************
  72. //
  73. // The following are defines for the bit fields in the CAN_CTL register.
  74. //
  75. //*****************************************************************************
  76. #define CAN_CTL_TEST 0x00000080 // Test mode enable
  77. #define CAN_CTL_CCE 0x00000040 // Configuration change enable
  78. #define CAN_CTL_DAR 0x00000020 // Disable automatic retransmission
  79. #define CAN_CTL_EIE 0x00000008 // Error interrupt enable
  80. #define CAN_CTL_SIE 0x00000004 // Status change interrupt enable
  81. #define CAN_CTL_IE 0x00000002 // Module interrupt enable
  82. #define CAN_CTL_INIT 0x00000001 // Initialization
  83. //*****************************************************************************
  84. //
  85. // The following are defines for the bit fields in the CAN_STS register.
  86. //
  87. //*****************************************************************************
  88. #define CAN_STS_BOFF 0x00000080 // Bus Off status
  89. #define CAN_STS_EWARN 0x00000040 // Error Warning status
  90. #define CAN_STS_EPASS 0x00000020 // Error Passive status
  91. #define CAN_STS_RXOK 0x00000010 // Received Message Successful
  92. #define CAN_STS_TXOK 0x00000008 // Transmitted Message Successful
  93. #define CAN_STS_LEC_M 0x00000007 // Last Error Code
  94. #define CAN_STS_LEC_NONE 0x00000000 // No error
  95. #define CAN_STS_LEC_STUFF 0x00000001 // Stuff error
  96. #define CAN_STS_LEC_FORM 0x00000002 // Form(at) error
  97. #define CAN_STS_LEC_ACK 0x00000003 // Ack error
  98. #define CAN_STS_LEC_BIT1 0x00000004 // Bit 1 error
  99. #define CAN_STS_LEC_BIT0 0x00000005 // Bit 0 error
  100. #define CAN_STS_LEC_CRC 0x00000006 // CRC error
  101. #define CAN_STS_LEC_NOEVENT 0x00000007 // Unused
  102. //*****************************************************************************
  103. //
  104. // The following are defines for the bit fields in the CAN_ERR register.
  105. //
  106. //*****************************************************************************
  107. #define CAN_ERR_RP 0x00008000 // Receive error passive status
  108. #define CAN_ERR_REC_M 0x00007F00 // Receive Error Counter.
  109. #define CAN_ERR_TEC_M 0x000000FF // Transmit Error Counter.
  110. #define CAN_ERR_REC_S 8 // Receive error counter bit pos
  111. #define CAN_ERR_TEC_S 0 // Transmit error counter bit pos
  112. //*****************************************************************************
  113. //
  114. // The following are defines for the bit fields in the CAN_BIT register.
  115. //
  116. //*****************************************************************************
  117. #define CAN_BIT_TSEG2_M 0x00007000 // Time Segment after Sample Point.
  118. #define CAN_BIT_TSEG1_M 0x00000F00 // Time Segment Before Sample
  119. // Point.
  120. #define CAN_BIT_SJW_M 0x000000C0 // (Re)Synchronization Jump Width.
  121. #define CAN_BIT_BRP_M 0x0000003F // Baud Rate Prescalar.
  122. #define CAN_BIT_TSEG2_S 12
  123. #define CAN_BIT_TSEG1_S 8
  124. #define CAN_BIT_SJW_S 6
  125. #define CAN_BIT_BRP_S 0
  126. //*****************************************************************************
  127. //
  128. // The following are defines for the bit fields in the CAN_INT register.
  129. //
  130. //*****************************************************************************
  131. #define CAN_INT_INTID_M 0x0000FFFF // Interrupt Identifier.
  132. #define CAN_INT_INTID_NONE 0x00000000 // No Interrupt Pending
  133. #define CAN_INT_INTID_STATUS 0x00008000 // Status Interrupt
  134. //*****************************************************************************
  135. //
  136. // The following are defines for the bit fields in the CAN_TST register.
  137. //
  138. //*****************************************************************************
  139. #define CAN_TST_RX 0x00000080 // CAN_RX pin status
  140. #define CAN_TST_TX_M 0x00000060 // Overide control of CAN_TX pin
  141. #define CAN_TST_TX_CANCTL 0x00000000 // CAN core controls CAN_TX
  142. #define CAN_TST_TX_SAMPLE 0x00000020 // Sample Point on CAN_TX
  143. #define CAN_TST_TX_DOMINANT 0x00000040 // Dominant value on CAN_TX
  144. #define CAN_TST_TX_RECESSIVE 0x00000060 // Recessive value on CAN_TX
  145. #define CAN_TST_LBACK 0x00000010 // Loop back mode
  146. #define CAN_TST_SILENT 0x00000008 // Silent mode
  147. #define CAN_TST_BASIC 0x00000004 // Basic mode
  148. //*****************************************************************************
  149. //
  150. // The following are defines for the bit fields in the CAN_BRPE register.
  151. //
  152. //*****************************************************************************
  153. #define CAN_BRPE_BRPE_M 0x0000000F // Baud Rate Prescalar Extension.
  154. #define CAN_BRPE_BRPE_S 0
  155. //*****************************************************************************
  156. //
  157. // The following are defines for the bit fields in the CAN_TXRQ1 register.
  158. //
  159. //*****************************************************************************
  160. #define CAN_TXRQ1_TXRQST_M 0x0000FFFF // Transmission Request Bits.
  161. #define CAN_TXRQ1_TXRQST_S 0
  162. //*****************************************************************************
  163. //
  164. // The following are defines for the bit fields in the CAN_TXRQ2 register.
  165. //
  166. //*****************************************************************************
  167. #define CAN_TXRQ2_TXRQST_M 0x0000FFFF // Transmission Request Bits.
  168. #define CAN_TXRQ2_TXRQST_S 0
  169. //*****************************************************************************
  170. //
  171. // The following are defines for the bit fields in the CAN_NWDA1 register.
  172. //
  173. //*****************************************************************************
  174. #define CAN_NWDA1_NEWDAT_M 0x0000FFFF // New Data Bits.
  175. #define CAN_NWDA1_NEWDAT_S 0
  176. //*****************************************************************************
  177. //
  178. // The following are defines for the bit fields in the CAN_NWDA2 register.
  179. //
  180. //*****************************************************************************
  181. #define CAN_NWDA2_NEWDAT_M 0x0000FFFF // New Data Bits.
  182. #define CAN_NWDA2_NEWDAT_S 0
  183. //*****************************************************************************
  184. //
  185. // The following are defines for the bit fields in the CAN_O_IF1CRQ register.
  186. //
  187. //*****************************************************************************
  188. #define CAN_IF1CRQ_BUSY 0x00008000 // Busy Flag.
  189. #define CAN_IF1CRQ_MNUM_M 0x0000003F // Message Number.
  190. #define CAN_IF1CRQ_MNUM_RSVD 0x00000000 // 0 is not a valid message number;
  191. // it is interpreted as 0x20, or
  192. // object 32.
  193. //*****************************************************************************
  194. //
  195. // The following are defines for the bit fields in the CAN_O_IF1CMSK register.
  196. //
  197. //*****************************************************************************
  198. #define CAN_IF1CMSK_WRNRD 0x00000080 // Write, Not Read.
  199. #define CAN_IF1CMSK_MASK 0x00000040 // Access Mask Bits.
  200. #define CAN_IF1CMSK_ARB 0x00000020 // Access Arbitration Bits.
  201. #define CAN_IF1CMSK_CONTROL 0x00000010 // Access Control Bits.
  202. #define CAN_IF1CMSK_CLRINTPND 0x00000008 // Clear Interrupt Pending Bit.
  203. #define CAN_IF1CMSK_NEWDAT 0x00000004 // Access New Data.
  204. #define CAN_IF1CMSK_TXRQST 0x00000004 // Access Transmission Request.
  205. #define CAN_IF1CMSK_DATAA 0x00000002 // Access Data Byte 0 to 3.
  206. #define CAN_IF1CMSK_DATAB 0x00000001 // Access Data Byte 4 to 7.
  207. //*****************************************************************************
  208. //
  209. // The following are defines for the bit fields in the CAN_O_IF1MSK1 register.
  210. //
  211. //*****************************************************************************
  212. #define CAN_IF1MSK1_IDMSK_M 0x0000FFFF // Identifier Mask.
  213. #define CAN_IF1MSK1_IDMSK_S 0
  214. //*****************************************************************************
  215. //
  216. // The following are defines for the bit fields in the CAN_O_IF1MSK2 register.
  217. //
  218. //*****************************************************************************
  219. #define CAN_IF1MSK2_MXTD 0x00008000 // Mask Extended Identifier.
  220. #define CAN_IF1MSK2_MDIR 0x00004000 // Mask Message Direction.
  221. #define CAN_IF1MSK2_IDMSK_M 0x00001FFF // Identifier Mask.
  222. #define CAN_IF1MSK2_IDMSK_S 0
  223. //*****************************************************************************
  224. //
  225. // The following are defines for the bit fields in the CAN_O_IF1ARB1 register.
  226. //
  227. //*****************************************************************************
  228. #define CAN_IF1ARB1_ID_M 0x0000FFFF // Message Identifier.
  229. #define CAN_IF1ARB1_ID_S 0
  230. //*****************************************************************************
  231. //
  232. // The following are defines for the bit fields in the CAN_O_IF1ARB2 register.
  233. //
  234. //*****************************************************************************
  235. #define CAN_IF1ARB2_MSGVAL 0x00008000 // Message Valid.
  236. #define CAN_IF1ARB2_XTD 0x00004000 // Extended Identifier.
  237. #define CAN_IF1ARB2_DIR 0x00002000 // Message Direction.
  238. #define CAN_IF1ARB2_ID_M 0x00001FFF // Message Identifier.
  239. #define CAN_IF1ARB2_ID_S 0
  240. //*****************************************************************************
  241. //
  242. // The following are defines for the bit fields in the CAN_O_IF1MCTL register.
  243. //
  244. //*****************************************************************************
  245. #define CAN_IF1MCTL_NEWDAT 0x00008000 // New Data.
  246. #define CAN_IF1MCTL_MSGLST 0x00004000 // Message Lost.
  247. #define CAN_IF1MCTL_INTPND 0x00002000 // Interrupt Pending.
  248. #define CAN_IF1MCTL_UMASK 0x00001000 // Use Acceptance Mask.
  249. #define CAN_IF1MCTL_TXIE 0x00000800 // Transmit Interrupt Enable.
  250. #define CAN_IF1MCTL_RXIE 0x00000400 // Receive Interrupt Enable.
  251. #define CAN_IF1MCTL_RMTEN 0x00000200 // Remote Enable.
  252. #define CAN_IF1MCTL_TXRQST 0x00000100 // Transmit Request.
  253. #define CAN_IF1MCTL_EOB 0x00000080 // End of Buffer.
  254. #define CAN_IF1MCTL_DLC_M 0x0000000F // Data Length Code.
  255. #define CAN_IF1MCTL_DLC_S 0
  256. //*****************************************************************************
  257. //
  258. // The following are defines for the bit fields in the CAN_O_IF1DA1 register.
  259. //
  260. //*****************************************************************************
  261. #define CAN_IF1DA1_DATA_M 0x0000FFFF // Data.
  262. #define CAN_IF1DA1_DATA_S 0
  263. //*****************************************************************************
  264. //
  265. // The following are defines for the bit fields in the CAN_O_IF1DA2 register.
  266. //
  267. //*****************************************************************************
  268. #define CAN_IF1DA2_DATA_M 0x0000FFFF // Data.
  269. #define CAN_IF1DA2_DATA_S 0
  270. //*****************************************************************************
  271. //
  272. // The following are defines for the bit fields in the CAN_O_IF1DB1 register.
  273. //
  274. //*****************************************************************************
  275. #define CAN_IF1DB1_DATA_M 0x0000FFFF // Data.
  276. #define CAN_IF1DB1_DATA_S 0
  277. //*****************************************************************************
  278. //
  279. // The following are defines for the bit fields in the CAN_O_IF1DB2 register.
  280. //
  281. //*****************************************************************************
  282. #define CAN_IF1DB2_DATA_M 0x0000FFFF // Data.
  283. #define CAN_IF1DB2_DATA_S 0
  284. //*****************************************************************************
  285. //
  286. // The following are defines for the bit fields in the CAN_O_IF2CRQ register.
  287. //
  288. //*****************************************************************************
  289. #define CAN_IF2CRQ_BUSY 0x00008000 // Busy Flag.
  290. #define CAN_IF2CRQ_MNUM_M 0x0000003F // Message Number.
  291. #define CAN_IF2CRQ_MNUM_RSVD 0x00000000 // 0 is not a valid message number;
  292. // it is interpreted as 0x20, or
  293. // object 32.
  294. //*****************************************************************************
  295. //
  296. // The following are defines for the bit fields in the CAN_O_IF2CMSK register.
  297. //
  298. //*****************************************************************************
  299. #define CAN_IF2CMSK_WRNRD 0x00000080 // Write, Not Read.
  300. #define CAN_IF2CMSK_MASK 0x00000040 // Access Mask Bits.
  301. #define CAN_IF2CMSK_ARB 0x00000020 // Access Arbitration Bits.
  302. #define CAN_IF2CMSK_CONTROL 0x00000010 // Access Control Bits.
  303. #define CAN_IF2CMSK_CLRINTPND 0x00000008 // Clear Interrupt Pending Bit.
  304. #define CAN_IF2CMSK_NEWDAT 0x00000004 // Access New Data.
  305. #define CAN_IF2CMSK_TXRQST 0x00000004 // Access Transmission Request.
  306. #define CAN_IF2CMSK_DATAA 0x00000002 // Access Data Byte 0 to 3.
  307. #define CAN_IF2CMSK_DATAB 0x00000001 // Access Data Byte 4 to 7.
  308. //*****************************************************************************
  309. //
  310. // The following are defines for the bit fields in the CAN_O_IF2MSK1 register.
  311. //
  312. //*****************************************************************************
  313. #define CAN_IF2MSK1_IDMSK_M 0x0000FFFF // Identifier Mask.
  314. #define CAN_IF2MSK1_IDMSK_S 0
  315. //*****************************************************************************
  316. //
  317. // The following are defines for the bit fields in the CAN_O_IF2MSK2 register.
  318. //
  319. //*****************************************************************************
  320. #define CAN_IF2MSK2_MXTD 0x00008000 // Mask Extended Identifier.
  321. #define CAN_IF2MSK2_MDIR 0x00004000 // Mask Message Direction.
  322. #define CAN_IF2MSK2_IDMSK_M 0x00001FFF // Identifier Mask.
  323. #define CAN_IF2MSK2_IDMSK_S 0
  324. //*****************************************************************************
  325. //
  326. // The following are defines for the bit fields in the CAN_O_IF2ARB1 register.
  327. //
  328. //*****************************************************************************
  329. #define CAN_IF2ARB1_ID_M 0x0000FFFF // Message Identifier.
  330. #define CAN_IF2ARB1_ID_S 0
  331. //*****************************************************************************
  332. //
  333. // The following are defines for the bit fields in the CAN_O_IF2ARB2 register.
  334. //
  335. //*****************************************************************************
  336. #define CAN_IF2ARB2_MSGVAL 0x00008000 // Message Valid.
  337. #define CAN_IF2ARB2_XTD 0x00004000 // Extended Identifier.
  338. #define CAN_IF2ARB2_DIR 0x00002000 // Message Direction.
  339. #define CAN_IF2ARB2_ID_M 0x00001FFF // Message Identifier.
  340. #define CAN_IF2ARB2_ID_S 0
  341. //*****************************************************************************
  342. //
  343. // The following are defines for the bit fields in the CAN_O_IF2MCTL register.
  344. //
  345. //*****************************************************************************
  346. #define CAN_IF2MCTL_NEWDAT 0x00008000 // New Data.
  347. #define CAN_IF2MCTL_MSGLST 0x00004000 // Message Lost.
  348. #define CAN_IF2MCTL_INTPND 0x00002000 // Interrupt Pending.
  349. #define CAN_IF2MCTL_UMASK 0x00001000 // Use Acceptance Mask.
  350. #define CAN_IF2MCTL_TXIE 0x00000800 // Transmit Interrupt Enable.
  351. #define CAN_IF2MCTL_RXIE 0x00000400 // Receive Interrupt Enable.
  352. #define CAN_IF2MCTL_RMTEN 0x00000200 // Remote Enable.
  353. #define CAN_IF2MCTL_TXRQST 0x00000100 // Transmit Request.
  354. #define CAN_IF2MCTL_EOB 0x00000080 // End of Buffer.
  355. #define CAN_IF2MCTL_DLC_M 0x0000000F // Data Length Code.
  356. #define CAN_IF2MCTL_DLC_S 0
  357. //*****************************************************************************
  358. //
  359. // The following are defines for the bit fields in the CAN_O_IF2DA1 register.
  360. //
  361. //*****************************************************************************
  362. #define CAN_IF2DA1_DATA_M 0x0000FFFF // Data.
  363. #define CAN_IF2DA1_DATA_S 0
  364. //*****************************************************************************
  365. //
  366. // The following are defines for the bit fields in the CAN_O_IF2DA2 register.
  367. //
  368. //*****************************************************************************
  369. #define CAN_IF2DA2_DATA_M 0x0000FFFF // Data.
  370. #define CAN_IF2DA2_DATA_S 0
  371. //*****************************************************************************
  372. //
  373. // The following are defines for the bit fields in the CAN_O_IF2DB1 register.
  374. //
  375. //*****************************************************************************
  376. #define CAN_IF2DB1_DATA_M 0x0000FFFF // Data.
  377. #define CAN_IF2DB1_DATA_S 0
  378. //*****************************************************************************
  379. //
  380. // The following are defines for the bit fields in the CAN_O_IF2DB2 register.
  381. //
  382. //*****************************************************************************
  383. #define CAN_IF2DB2_DATA_M 0x0000FFFF // Data.
  384. #define CAN_IF2DB2_DATA_S 0
  385. //*****************************************************************************
  386. //
  387. // The following are defines for the bit fields in the CAN_O_MSG1INT register.
  388. //
  389. //*****************************************************************************
  390. #define CAN_MSG1INT_INTPND_M 0x0000FFFF // Interrupt Pending Bits.
  391. #define CAN_MSG1INT_INTPND_S 0
  392. //*****************************************************************************
  393. //
  394. // The following are defines for the bit fields in the CAN_O_MSG2INT register.
  395. //
  396. //*****************************************************************************
  397. #define CAN_MSG2INT_INTPND_M 0x0000FFFF // Interrupt Pending Bits.
  398. #define CAN_MSG2INT_INTPND_S 0
  399. //*****************************************************************************
  400. //
  401. // The following are defines for the bit fields in the CAN_O_MSG1VAL register.
  402. //
  403. //*****************************************************************************
  404. #define CAN_MSG1VAL_MSGVAL_M 0x0000FFFF // Message Valid Bits.
  405. #define CAN_MSG1VAL_MSGVAL_S 0
  406. //*****************************************************************************
  407. //
  408. // The following are defines for the bit fields in the CAN_O_MSG2VAL register.
  409. //
  410. //*****************************************************************************
  411. #define CAN_MSG2VAL_MSGVAL_M 0x0000FFFF // Message Valid Bits.
  412. #define CAN_MSG2VAL_MSGVAL_S 0
  413. //*****************************************************************************
  414. //
  415. // The following definitions are deprecated.
  416. //
  417. //*****************************************************************************
  418. #ifndef DEPRECATED
  419. //*****************************************************************************
  420. //
  421. // The following are deprecated defines for the CAN register offsets.
  422. //
  423. //*****************************************************************************
  424. #define CAN_O_MSGINT1 0x00000140 // Intr. Pending in Msg Obj 1 reg.
  425. #define CAN_O_MSGINT2 0x00000144 // Intr. Pending in Msg Obj 2 reg.
  426. #define CAN_O_MSGVAL1 0x00000160 // Message Valid in Msg Obj 1 reg.
  427. #define CAN_O_MSGVAL2 0x00000164 // Message Valid in Msg Obj 2 reg.
  428. //*****************************************************************************
  429. //
  430. // The following are deprecated defines for the reset values of the can
  431. // registers.
  432. //
  433. //*****************************************************************************
  434. #define CAN_RV_IF1MSK2 0x0000FFFF
  435. #define CAN_RV_IF1MSK1 0x0000FFFF
  436. #define CAN_RV_IF2MSK1 0x0000FFFF
  437. #define CAN_RV_IF2MSK2 0x0000FFFF
  438. #define CAN_RV_BIT 0x00002301
  439. #define CAN_RV_CTL 0x00000001
  440. #define CAN_RV_IF1CRQ 0x00000001
  441. #define CAN_RV_IF2CRQ 0x00000001
  442. #define CAN_RV_TXRQ2 0x00000000
  443. #define CAN_RV_IF2DB1 0x00000000
  444. #define CAN_RV_INT 0x00000000
  445. #define CAN_RV_IF1DB2 0x00000000
  446. #define CAN_RV_BRPE 0x00000000
  447. #define CAN_RV_IF2DA2 0x00000000
  448. #define CAN_RV_MSGVAL2 0x00000000
  449. #define CAN_RV_TXRQ1 0x00000000
  450. #define CAN_RV_IF1MCTL 0x00000000
  451. #define CAN_RV_IF1DB1 0x00000000
  452. #define CAN_RV_STS 0x00000000
  453. #define CAN_RV_MSGINT1 0x00000000
  454. #define CAN_RV_IF1DA2 0x00000000
  455. #define CAN_RV_TST 0x00000000
  456. #define CAN_RV_IF1ARB1 0x00000000
  457. #define CAN_RV_IF1ARB2 0x00000000
  458. #define CAN_RV_NWDA2 0x00000000
  459. #define CAN_RV_IF2CMSK 0x00000000
  460. #define CAN_RV_NWDA1 0x00000000
  461. #define CAN_RV_IF1DA1 0x00000000
  462. #define CAN_RV_IF2DA1 0x00000000
  463. #define CAN_RV_IF2MCTL 0x00000000
  464. #define CAN_RV_MSGVAL1 0x00000000
  465. #define CAN_RV_IF1CMSK 0x00000000
  466. #define CAN_RV_ERR 0x00000000
  467. #define CAN_RV_IF2ARB2 0x00000000
  468. #define CAN_RV_MSGINT2 0x00000000
  469. #define CAN_RV_IF2ARB1 0x00000000
  470. #define CAN_RV_IF2DB2 0x00000000
  471. //*****************************************************************************
  472. //
  473. // The following are deprecated defines for the bit fields in the CAN_STS
  474. // register.
  475. //
  476. //*****************************************************************************
  477. #define CAN_STS_LEC_MSK 0x00000007 // Last Error Code
  478. //*****************************************************************************
  479. //
  480. // The following are deprecated defines for the bit fields in the CAN_ERR
  481. // register.
  482. //
  483. //*****************************************************************************
  484. #define CAN_ERR_REC_MASK 0x00007F00 // Receive error counter status
  485. #define CAN_ERR_TEC_MASK 0x000000FF // Transmit error counter status
  486. #define CAN_ERR_REC_SHIFT 8 // Receive error counter bit pos
  487. #define CAN_ERR_TEC_SHIFT 0 // Transmit error counter bit pos
  488. //*****************************************************************************
  489. //
  490. // The following are deprecated defines for the bit fields in the CAN_BIT
  491. // register.
  492. //
  493. //*****************************************************************************
  494. #define CAN_BIT_TSEG2 0x00007000 // Time segment after sample point
  495. #define CAN_BIT_TSEG1 0x00000F00 // Time segment before sample point
  496. #define CAN_BIT_SJW 0x000000C0 // (Re)Synchronization jump width
  497. #define CAN_BIT_BRP 0x0000003F // Baud rate prescaler
  498. //*****************************************************************************
  499. //
  500. // The following are deprecated defines for the bit fields in the CAN_INT
  501. // register.
  502. //
  503. //*****************************************************************************
  504. #define CAN_INT_INTID_MSK 0x0000FFFF // Interrupt Identifier
  505. //*****************************************************************************
  506. //
  507. // The following are deprecated defines for the bit fields in the CAN_TST
  508. // register.
  509. //
  510. //*****************************************************************************
  511. #define CAN_TST_TX_MSK 0x00000060 // Overide control of CAN_TX pin
  512. //*****************************************************************************
  513. //
  514. // The following are deprecated defines for the bit fields in the CAN_BRPE
  515. // register.
  516. //
  517. //*****************************************************************************
  518. #define CAN_BRPE_BRPE 0x0000000F // Baud rate prescaler extension
  519. //*****************************************************************************
  520. //
  521. // The following are deprecated defines for the bit fields in the CAN_IF1CRQ
  522. // and CAN_IF1CRQ registers.
  523. // Note: All bits may not be available in all registers
  524. //
  525. //*****************************************************************************
  526. #define CAN_IFCRQ_BUSY 0x00008000 // Busy flag status
  527. #define CAN_IFCRQ_MNUM_MSK 0x0000003F // Message Number
  528. //*****************************************************************************
  529. //
  530. // The following are deprecated defines for the bit fields in the CAN_IF1CMSK
  531. // and CAN_IF2CMSK registers.
  532. // Note: All bits may not be available in all registers
  533. //
  534. //*****************************************************************************
  535. #define CAN_IFCMSK_WRNRD 0x00000080 // Write, not Read
  536. #define CAN_IFCMSK_MASK 0x00000040 // Access Mask Bits
  537. #define CAN_IFCMSK_ARB 0x00000020 // Access Arbitration Bits
  538. #define CAN_IFCMSK_CONTROL 0x00000010 // Access Control Bits
  539. #define CAN_IFCMSK_CLRINTPND 0x00000008 // Clear interrupt pending Bit
  540. #define CAN_IFCMSK_TXRQST 0x00000004 // Access Tx request bit (WRNRD=1)
  541. #define CAN_IFCMSK_NEWDAT 0x00000004 // Access New Data bit (WRNRD=0)
  542. #define CAN_IFCMSK_DATAA 0x00000002 // DataA access - bytes 0 to 3
  543. #define CAN_IFCMSK_DATAB 0x00000001 // DataB access - bytes 4 to 7
  544. //*****************************************************************************
  545. //
  546. // The following are deprecated defines for the bit fields in the CAN_IF1MSK1
  547. // and CAN_IF2MSK1 registers.
  548. // Note: All bits may not be available in all registers
  549. //
  550. //*****************************************************************************
  551. #define CAN_IFMSK1_MSK 0x0000FFFF // Identifier Mask
  552. //*****************************************************************************
  553. //
  554. // The following are deprecated defines for the bit fields in the CAN_IF1MSK2
  555. // and CAN_IF2MSK2 registers.
  556. // Note: All bits may not be available in all registers
  557. //
  558. //*****************************************************************************
  559. #define CAN_IFMSK2_MXTD 0x00008000 // Mask extended identifier
  560. #define CAN_IFMSK2_MDIR 0x00004000 // Mask message direction
  561. #define CAN_IFMSK2_MSK 0x00001FFF // Mask identifier
  562. //*****************************************************************************
  563. //
  564. // The following are deprecated defines for the bit fields in the CAN_IF1ARB1
  565. // and CAN_IF2ARB1 registers.
  566. // Note: All bits may not be available in all registers
  567. //
  568. //*****************************************************************************
  569. #define CAN_IFARB1_ID 0x0000FFFF // Identifier
  570. //*****************************************************************************
  571. //
  572. // The following are deprecated defines for the bit fields in the CAN_IF1ARB2
  573. // and CAN_IF2ARB2 registers.
  574. // Note: All bits may not be available in all registers
  575. //
  576. //*****************************************************************************
  577. #define CAN_IFARB2_MSGVAL 0x00008000 // Message valid
  578. #define CAN_IFARB2_XTD 0x00004000 // Extended identifier
  579. #define CAN_IFARB2_DIR 0x00002000 // Message direction
  580. #define CAN_IFARB2_ID 0x00001FFF // Message identifier
  581. //*****************************************************************************
  582. //
  583. // The following are deprecated defines for the bit fields in the CAN_IF1MCTL
  584. // and CAN_IF2MCTL registers.
  585. // Note: All bits may not be available in all registers
  586. //
  587. //*****************************************************************************
  588. #define CAN_IFMCTL_NEWDAT 0x00008000 // New Data
  589. #define CAN_IFMCTL_MSGLST 0x00004000 // Message lost
  590. #define CAN_IFMCTL_INTPND 0x00002000 // Interrupt pending
  591. #define CAN_IFMCTL_UMASK 0x00001000 // Use acceptance mask
  592. #define CAN_IFMCTL_TXIE 0x00000800 // Transmit interrupt enable
  593. #define CAN_IFMCTL_RXIE 0x00000400 // Receive interrupt enable
  594. #define CAN_IFMCTL_RMTEN 0x00000200 // Remote enable
  595. #define CAN_IFMCTL_TXRQST 0x00000100 // Transmit request
  596. #define CAN_IFMCTL_EOB 0x00000080 // End of buffer
  597. #define CAN_IFMCTL_DLC 0x0000000F // Data length code
  598. //*****************************************************************************
  599. //
  600. // The following are deprecated defines for the bit fields in the CAN_IF1DA1
  601. // and CAN_IF2DA1 registers.
  602. // Note: All bits may not be available in all registers
  603. //
  604. //*****************************************************************************
  605. #define CAN_IFDA1_DATA 0x0000FFFF // Data - bytes 1 and 0
  606. //*****************************************************************************
  607. //
  608. // The following are deprecated defines for the bit fields in the CAN_IF1DA2
  609. // and CAN_IF2DA2 registers.
  610. // Note: All bits may not be available in all registers
  611. //
  612. //*****************************************************************************
  613. #define CAN_IFDA2_DATA 0x0000FFFF // Data - bytes 3 and 2
  614. //*****************************************************************************
  615. //
  616. // The following are deprecated defines for the bit fields in the CAN_IF1DB1
  617. // and CAN_IF2DB1 registers.
  618. // Note: All bits may not be available in all registers
  619. //
  620. //*****************************************************************************
  621. #define CAN_IFDB1_DATA 0x0000FFFF // Data - bytes 5 and 4
  622. //*****************************************************************************
  623. //
  624. // The following are deprecated defines for the bit fields in the CAN_IF1DB2
  625. // and CAN_IF2DB2 registers.
  626. // Note: All bits may not be available in all registers
  627. //
  628. //*****************************************************************************
  629. #define CAN_IFDB2_DATA 0x0000FFFF // Data - bytes 7 and 6
  630. //*****************************************************************************
  631. //
  632. // The following are deprecated defines for the bit fields in the CAN_TXRQ1
  633. // register.
  634. //
  635. //*****************************************************************************
  636. #define CAN_TXRQ1_TXRQST 0x0000FFFF // Transmission Request Bits
  637. //*****************************************************************************
  638. //
  639. // The following are deprecated defines for the bit fields in the CAN_TXRQ2
  640. // register.
  641. //
  642. //*****************************************************************************
  643. #define CAN_TXRQ2_TXRQST 0x0000FFFF // Transmission Request Bits
  644. //*****************************************************************************
  645. //
  646. // The following are deprecated defines for the bit fields in the CAN_NWDA1
  647. // register.
  648. //
  649. //*****************************************************************************
  650. #define CAN_NWDA1_NEWDATA 0x0000FFFF // New Data Bits
  651. //*****************************************************************************
  652. //
  653. // The following are deprecated defines for the bit fields in the CAN_NWDA2
  654. // register.
  655. //
  656. //*****************************************************************************
  657. #define CAN_NWDA2_NEWDATA 0x0000FFFF // New Data Bits
  658. //*****************************************************************************
  659. //
  660. // The following are deprecated defines for the bit fields in the CAN_MSGINT1
  661. // register.
  662. //
  663. //*****************************************************************************
  664. #define CAN_MSGINT1_INTPND 0x0000FFFF // Interrupt Pending Bits
  665. //*****************************************************************************
  666. //
  667. // The following are deprecated defines for the bit fields in the CAN_MSGINT2
  668. // register.
  669. //
  670. //*****************************************************************************
  671. #define CAN_MSGINT2_INTPND 0x0000FFFF // Interrupt Pending Bits
  672. //*****************************************************************************
  673. //
  674. // The following are deprecated defines for the bit fields in the CAN_MSGVAL1
  675. // register.
  676. //
  677. //*****************************************************************************
  678. #define CAN_MSGVAL1_MSGVAL 0x0000FFFF // Message Valid Bits
  679. //*****************************************************************************
  680. //
  681. // The following are deprecated defines for the bit fields in the CAN_MSGVAL2
  682. // register.
  683. //
  684. //*****************************************************************************
  685. #define CAN_MSGVAL2_MSGVAL 0x0000FFFF // Message Valid Bits
  686. #endif
  687. #endif // __HW_CAN_H__