can_reg.h 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. /**************************************************************************//**
  2. * @file can_reg.h
  3. * @version V1.00
  4. * @brief CAN register definition header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __CAN_REG_H__
  10. #define __CAN_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup CAN Controller Area Network Controller(CAN)
  20. Memory Mapped Structure for CAN Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var CAN_IF_T::CREQ
  26. * Offset: 0x20, 0x80 IFn Command Request Register
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[5:0] |MessageNumber|Message Number
  31. * | | |0x01-0x20: Valid Message Number, the Message Object in the Message
  32. * | | |RAM is selected for data transfer.
  33. * | | |0x00: Not a valid Message Number, interpreted as 0x20.
  34. * | | |0x21-0x3F: Not a valid Message Number, interpreted as 0x01-0x1F.
  35. * |[15] |Busy |Busy Flag
  36. * | | |0 = Read/write action has finished.
  37. * | | |1 = Writing to the IFn Command Request Register is in progress
  38. * | | |This bit can only be read by the software.
  39. * @var CAN_IF_T::CMASK
  40. * Offset: 0x24, 0x84 IFn Command Mask Register
  41. * ---------------------------------------------------------------------------------------------------
  42. * |Bits |Field |Descriptions
  43. * | :----: | :----: | :---- |
  44. * |[0] |DAT_B |Access Data Bytes [7:4]
  45. * | | |Write Operation:
  46. * | | |0 = Data Bytes [7:4] unchanged.
  47. * | | |1 = Transfer Data Bytes [7:4] to Message Object.
  48. * | | |Read Operation:
  49. * | | |0 = Data Bytes [7:4] unchanged.
  50. * | | |1 = Transfer Data Bytes [7:4] to IFn Message Buffer Register.
  51. * |[1] |DAT_A |Access Data Bytes [3:0]
  52. * | | |Write Operation:
  53. * | | |0 = Data Bytes [3:0] unchanged.
  54. * | | |1 = Transfer Data Bytes [3:0] to Message Object.
  55. * | | |Read Operation:
  56. * | | |0 = Data Bytes [3:0] unchanged.
  57. * | | |1 = Transfer Data Bytes [3:0] to IFn Message Buffer Register.
  58. * |[2] |TxRqst_NewDat|Access Transmission Request Bit When Write Operation
  59. * | | |0 = TxRqst bit unchanged.
  60. * | | |1 = Set TxRqst bit.
  61. * | | |Note: If a transmission is requested by programming bit TxRqst/NewDat in the IFn Command Mask Register, bit TxRqst in the IFn Message Control Register will be ignored.
  62. * | | |Access New Data Bit when Read Operation.
  63. * | | |0 = NewDat bit remains unchanged.
  64. * | | |1 = Clear NewDat bit in the Message Object.
  65. * | | |Note: A read access to a Message Object can be combined with the reset of the control bits IntPnd and NewDat
  66. * | | |The values of these bits transferred to the IFn Message Control Register always reflect the status before resetting these bits.
  67. * |[3] |ClrIntPnd |Clear Interrupt Pending Bit
  68. * | | |Write Operation:
  69. * | | |When writing to a Message Object, this bit is ignored.
  70. * | | |Read Operation:
  71. * | | |0 = IntPnd bit (CAN_IFn_MCON[13]) remains unchanged.
  72. * | | |1 = Clear IntPnd bit in the Message Object.
  73. * |[4] |Control |Control Access Control Bits
  74. * | | |Write Operation:
  75. * | | |0 = Control Bits unchanged.
  76. * | | |1 = Transfer Control Bits to Message Object.
  77. * | | |Read Operation:
  78. * | | |0 = Control Bits unchanged.
  79. * | | |1 = Transfer Control Bits to IFn Message Buffer Register.
  80. * |[5] |Arb |Access Arbitration Bits
  81. * | | |Write Operation:
  82. * | | |0 = Arbitration bits unchanged.
  83. * | | |1 = Transfer Identifier + Dir (CAN_IFn_ARB2[13]) + Xtd (CAN_IFn_ARB2[14]) + MsgVal (CAN_IFn_ARB2[15]) to Message Object.
  84. * | | |Read Operation:
  85. * | | |0 = Arbitration bits unchanged.
  86. * | | |1 = Transfer Identifier + Dir + Xtd + MsgVal to IFn Message Buffer Register.
  87. * |[6] |Mask |Access Mask Bits
  88. * | | |Write Operation:
  89. * | | |0 = Mask bits unchanged.
  90. * | | |1 = Transfer Identifier Mask + MDir + MXtd to Message Object.
  91. * | | |Read Operation:
  92. * | | |0 = Mask bits unchanged.
  93. * | | |1 = Transfer Identifier Mask + MDir + MXtd to IFn Message Buffer Register.
  94. * |[7] |WR_RD |Write / Read Mode
  95. * | | |0 = Read: Transfer data from the Message Object addressed by the Command Request Register into the selected Message Buffer Registers.
  96. * | | |1 = Write: Transfer data from the selected Message Buffer Registers to the Message Object addressed by the Command Request Register.
  97. * @var CAN_IF_T::MASK1
  98. * Offset: 0x28, 0x88 IFn Mask 1 Register
  99. * ---------------------------------------------------------------------------------------------------
  100. * |Bits |Field |Descriptions
  101. * | :----: | :----: | :---- |
  102. * |[15:0] |Msk |Identifier Mask 15-0
  103. * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering.
  104. * | | |1 = The corresponding identifier bit is used for acceptance filtering.
  105. * @var CAN_IF_T::MASK2
  106. * Offset: 0x2C, 0x8C IFn Mask 2 Register
  107. * ---------------------------------------------------------------------------------------------------
  108. * |Bits |Field |Descriptions
  109. * | :----: | :----: | :---- |
  110. * |[12:0] |Msk |Identifier Mask 28-16
  111. * | | |0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering.
  112. * | | |1 = The corresponding identifier bit is used for acceptance filtering.
  113. * |[14] |MDir |Mask Message Direction
  114. * | | |0 = The message direction bit (Dir (CAN_IFn_ARB2[13])) has no effect on the acceptance filtering.
  115. * | | |1 = The message direction bit (Dir) is used for acceptance filtering.
  116. * |[15] |MXtd |Mask Extended Identifier
  117. * | | |0 = The extended identifier bit (IDE) has no effect on the acceptance filtering.
  118. * | | |1 = The extended identifier bit (IDE) is used for acceptance filtering.
  119. * | | |Note: When 11-bit (standard) Identifiers are used for a Message Object, the identifiers of received Data Frames are written into bits ID28 to ID18 (CAN_IFn_ARB2[12:2])
  120. * | | |For acceptance filtering, only these bits together with mask bits Msk28 to Msk18 (CAN_IFn_MASK2[12:2]) are considered.
  121. * @var CAN_IF_T::ARB1
  122. * Offset: 0x30, 0x90 IFn Arbitration 1 Register
  123. * ---------------------------------------------------------------------------------------------------
  124. * |Bits |Field |Descriptions
  125. * | :----: | :----: | :---- |
  126. * |[15:0] |ID |Message Identifier 15-0
  127. * | | |ID28 - ID0, 29-bit Identifier (Extended Frame)
  128. * | | |ID28 - ID18, 11-bit Identifier (Standard Frame)
  129. * @var CAN_IF_T::ARB2
  130. * Offset: 0x34, 0x94 IFn Arbitration 2 Register
  131. * ---------------------------------------------------------------------------------------------------
  132. * |Bits |Field |Descriptions
  133. * | :----: | :----: | :---- |
  134. * |[12:0] |ID |Message Identifier 28-16
  135. * | | |ID28 - ID0, 29-bit Identifier (Extended Frame)
  136. * | | |ID28 - ID18, 11-bit Identifier (Standard Frame)
  137. * |[13] |Dir |Message Direction
  138. * | | |0 = Direction is receive.
  139. * | | |On TxRqst, a Remote Frame with the identifier of this Message Object is transmitted
  140. * | | |On reception of a Data Frame with matching identifier, that message is stored in this Message Object.
  141. * | | |1 = Direction is transmit.
  142. * | | |On TxRqst, the respective Message Object is transmitted as a Data Frame
  143. * | | |On reception of a Remote Frame with matching identifier, the TxRqst bit (CAN_IFn_CMASK[2]) of this Message Object is set (if RmtEn (CAN_IFn_MCON[9]) = one).
  144. * |[14] |Xtd |Extended Identifier
  145. * | | |0 = The 11-bit (standard) Identifier will be used for this Message Object.
  146. * | | |1 = The 29-bit (extended) Identifier will be used for this Message Object.
  147. * |[15] |MsgVal |Message Valid
  148. * | | |0 = The Message Object is ignored by the Message Handler.
  149. * | | |1 = The Message Object is configured and should be considered by the Message Handler.
  150. * | | |Note: The application software must reset the MsgVal bit of all unused Messages Objects during the initialization before it resets bit Init (CAN_CON[0])
  151. * | | |This bit must also be reset before the identifier Id28-0 (CAN_IFn_ARB1/2), the control bits Xtd (CAN_IFn_ARB2[14]), Dir (CAN_IFn_ARB2[13]), or the Data Length Code DLC3-0 (CAN_IFn_MCON[3:0]) are modified, or if the Messages Object is no longer required.
  152. * @var CAN_IF_T::MCON
  153. * Offset: 0x38, 0x98 IFn Message Control Register
  154. * ---------------------------------------------------------------------------------------------------
  155. * |Bits |Field |Descriptions
  156. * | :----: | :----: | :---- |
  157. * |[3:0] |DLC |Data Length Code
  158. * | | |0-8: Data Frame has 0-8 data bytes.
  159. * | | |9-15: Data Frame has 8 data bytes
  160. * | | |Note: The Data Length Code of a Message Object must be defined the same as in all the corresponding objects with the same identifier at other nodes
  161. * | | |When the Message Handler stores a data frame, it will write the DLC to the value given by the received message.
  162. * | | |Data(0): 1st data byte of a CAN Data Frame
  163. * | | |Data(1): 2nd data byte of a CAN Data Frame
  164. * | | |Data(2): 3rd data byte of a CAN Data Frame
  165. * | | |Data(3): 4th data byte of a CAN Data Frame
  166. * | | |Data(4): 5th data byte of a CAN Data Frame
  167. * | | |Data(5): 6th data byte of a CAN Data Frame
  168. * | | |Data(6): 7th data byte of a CAN Data Frame
  169. * | | |Data(7): 8th data byte of a CAN Data Frame
  170. * | | |Note: The Data(0) byte is the first data byte shifted into the shift register of the CAN Core during a reception while the Data(7) byte is the last
  171. * | | |When the Message Handler stores a Data Frame, it will write all the eight data bytes into a Message Object
  172. * | | |If the Data Length Code is less than 8, the remaining bytes of the Message Object will be overwritten by unspecified values.
  173. * |[7] |EoB |End of Buffer
  174. * | | |0 = Message Object belongs to a FIFO Buffer and is not the last Message Object of that FIFO Buffer.
  175. * | | |1 = Single Message Object or last Message Object of a FIFO Buffer.
  176. * | | |Note: This bit is used to concatenate two or more Message Objects (up to 32) to build a FIFO Buffer
  177. * | | |For single Message Objects (not belonging to a FIFO Buffer), this bit must always be set to one
  178. * |[8] |TxRqst |Transmit Request
  179. * | | |0 = This Message Object is not waiting for transmission.
  180. * | | |1 = The transmission of this Message Object is requested and is not yet done.
  181. * |[9] |RmtEn |Remote Enable Bit
  182. * | | |0 = At the reception of a Remote Frame, TxRqst (CAN_IFn_MCON[8]) is left unchanged.
  183. * | | |1 = At the reception of a Remote Frame, TxRqst is set.
  184. * |[10] |RxIE |Receive Interrupt Enable Bit
  185. * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after a successful reception of a frame.
  186. * | | |1 = IntPnd will be set after a successful reception of a frame.
  187. * |[11] |TxIE |Transmit Interrupt Enable Bit
  188. * | | |0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after the successful transmission of a frame.
  189. * | | |1 = IntPnd will be set after a successful transmission of a frame.
  190. * |[12] |UMask |Use Acceptance Mask
  191. * | | |0 = Mask ignored.
  192. * | | |1 = Use Mask (Msk28-0, MXtd, and MDir) for acceptance filtering.
  193. * | | |Note: If the UMask bit is set to one, the Message Object's mask bits have to be programmed during initialization of the Message Object before MsgVal bit (CAN_IFn_ARB2[15]) is set to one.
  194. * |[13] |IntPnd |Interrupt Pending
  195. * | | |0 = This message object is not the source of an interrupt.
  196. * | | |1 = This message object is the source of an interrupt
  197. * | | |The Interrupt Identifier in the Interrupt Register will point to this message object if there is no other interrupt source with higher priority.
  198. * |[14] |MsgLst |Message Lost (only valid for Message Objects with direction = receive).
  199. * | | |0 = No message lost since last time this bit was reset by the CPU.
  200. * | | |1 = The Message Handler stored a new message into this object when NewDat was still set, the CPU has lost a message.
  201. * |[15] |NewDat |New Data
  202. * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since last time this flag was cleared by the application software.
  203. * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object.
  204. * @var CAN_IF_T::DAT_A1
  205. * Offset: 0x3C, 0x9C IFn Data A1 Register
  206. * ---------------------------------------------------------------------------------------------------
  207. * |Bits |Field |Descriptions
  208. * | :----: | :----: | :---- |
  209. * |[7:0] |Data_0_ |Data Byte 0
  210. * | | |1st data byte of a CAN Data Frame
  211. * |[15:8] |Data_1_ |Data Byte 1
  212. * | | |2nd data byte of a CAN Data Frame
  213. * @var CAN_IF_T::DAT_A2
  214. * Offset: 0x40, 0xA0 IFn Data A2 Register
  215. * ---------------------------------------------------------------------------------------------------
  216. * |Bits |Field |Descriptions
  217. * | :----: | :----: | :---- |
  218. * |[7:0] |Data_2_ |Data Byte 2
  219. * | | |3rd data byte of CAN Data Frame
  220. * |[15:8] |Data_3_ |Data Byte 3
  221. * | | |4th data byte of CAN Data Frame
  222. * @var CAN_IF_T::DAT_B1
  223. * Offset: 0x44, 0xA4 IFn Data B1 Register
  224. * ---------------------------------------------------------------------------------------------------
  225. * |Bits |Field |Descriptions
  226. * | :----: | :----: | :---- |
  227. * |[7:0] |Data_4_ |Data Byte 4
  228. * | | |5th data byte of CAN Data Frame
  229. * |[15:8] |Data_5_ |Data Byte 5
  230. * | | |6th data byte of CAN Data Frame
  231. * @var CAN_IF_T::DAT_B2
  232. * Offset: 0x48, 0xA8 IFn Data B2 Register
  233. * ---------------------------------------------------------------------------------------------------
  234. * |Bits |Field |Descriptions
  235. * | :----: | :----: | :---- |
  236. * |[7:0] |Data_6_ |Data Byte 6
  237. * | | |7th data byte of CAN Data Frame.
  238. * |[15:8] |Data_7_ |Data Byte 7
  239. * | | |8th data byte of CAN Data Frame.
  240. */
  241. __IO uint32_t CREQ; /*!< [0x0020] IFn Command Request Register */
  242. __IO uint32_t CMASK; /*!< [0x0024] IFn Command Mask Register */
  243. __IO uint32_t MASK1; /*!< [0x0028] IFn Mask 1 Register */
  244. __IO uint32_t MASK2; /*!< [0x002c] IFn Mask 2 Register */
  245. __IO uint32_t ARB1; /*!< [0x0030] IFn Arbitration 1 Register */
  246. __IO uint32_t ARB2; /*!< [0x0034] IFn Arbitration 2 Register */
  247. __IO uint32_t MCON; /*!< [0x0038] IFn Message Control Register */
  248. __IO uint32_t DAT_A1; /*!< [0x003c] IFn Data A1 Register */
  249. __IO uint32_t DAT_A2; /*!< [0x0040] IFn Data A2 Register */
  250. __IO uint32_t DAT_B1; /*!< [0x0044] IFn Data B1 Register */
  251. __IO uint32_t DAT_B2; /*!< [0x0048] IFn Data B2 Register */
  252. /// @cond HIDDEN_SYMBOLS
  253. __I uint32_t RESERVE0[13];
  254. /// @endcond //HIDDEN_SYMBOLS
  255. } CAN_IF_T;
  256. typedef struct
  257. {
  258. /**
  259. * @var CAN_T::CON
  260. * Offset: 0x00 Control Register
  261. * ---------------------------------------------------------------------------------------------------
  262. * |Bits |Field |Descriptions
  263. * | :----: | :----: | :---- |
  264. * |[0] |Init |Init Initialization
  265. * | | |0 = Normal Operation.
  266. * | | |1 = Initialization is started.
  267. * |[1] |IE |Module Interrupt Enable Bit
  268. * | | |0 = Function interrupt is Disabled.
  269. * | | |1 = Function interrupt is Enabled.
  270. * |[2] |SIE |Status Change Interrupt Enable Bit
  271. * | | |0 = Disabled - No Status Change Interrupt will be generated.
  272. * | | |1 = Enabled - An interrupt will be generated when a message transfer is successfully completed or a CAN bus error is detected.
  273. * |[3] |EIE |Error Interrupt Enable Bit
  274. * | | |0 = Disabled - No Error Status Interrupt will be generated.
  275. * | | |1 = Enabled - A change in the bits BOff (CAN_STATUS[7]) or EWarn (CAN_STATUS[6]) in the Status Register will generate an interrupt.
  276. * |[5] |DAR |Automatic Re-transmission Disable Bit
  277. * | | |0 = Automatic Retransmission of disturbed messages Enabled.
  278. * | | |1 = Automatic Retransmission Disabled.
  279. * |[6] |CCE |Configuration Change Enable Bit
  280. * | | |0 = No write access to the Bit Timing Register.
  281. * | | |1 = Write access to the Bit Timing Register (CAN_BTIME) allowed. (while Init bit (CAN_CON[0]) = 1).
  282. * |[7] |Test |Test Mode Enable Bit
  283. * | | |0 = Normal Operation.
  284. * | | |1 = Test Mode.
  285. * @var CAN_T::STATUS
  286. * Offset: 0x04 Status Register
  287. * ---------------------------------------------------------------------------------------------------
  288. * |Bits |Field |Descriptions
  289. * | :----: | :----: | :---- |
  290. * |[2:0] |LEC |Last Error Code (Type of the Last Error to Occur on the CAN Bus)
  291. * | | |The LEC field holds a code, which indicates the type of the last error to occur on the CAN bus
  292. * | | |This field will be cleared to '0' when a message has been transferred (reception or transmission) without error
  293. * | | |The unused code '7' may be written by the CPU to check for updates
  294. * | | |The Error! Reference source not found
  295. * | | |describes the error code.
  296. * |[3] |TxOK |Transmitted a Message Successfully
  297. * | | |0 = Since this bit was reset by the CPU, no message has been successfully transmitted
  298. * | | |This bit is never reset by the CAN Core.
  299. * | | |1 = Since this bit was last reset by the CPU, a message has been successfully (error free and acknowledged by at least one other node) transmitted.
  300. * |[4] |RxOK |Received a Message Successfully
  301. * | | |0 = No message has been successfully received since this bit was last reset by the CPU
  302. * | | |This bit is never reset by the CAN Core.
  303. * | | |1 = A message has been successfully received since this bit was last reset by the CPU (independent of the result of acceptance filtering).
  304. * |[5] |EPass |Error Passive (Read Only)
  305. * | | |0 = The CAN Core is error active.
  306. * | | |1 = The CAN Core is in the error passive state as defined in the CAN Specification.
  307. * |[6] |EWarn |Error Warning Status (Read Only)
  308. * | | |0 = Both error counters are below the error warning limit of 96.
  309. * | | |1 = At least one of the error counters in the EML has reached the error warning limit of 96.
  310. * |[7] |BOff |Bus-off Status (Read Only)
  311. * | | |0 = The CAN module is not in bus-off state.
  312. * | | |1 = The CAN module is in bus-off state.
  313. * @var CAN_T::ERR
  314. * Offset: 0x08 Error Counter Register
  315. * ---------------------------------------------------------------------------------------------------
  316. * |Bits |Field |Descriptions
  317. * | :----: | :----: | :---- |
  318. * |[7:0] |TEC |Transmit Error Counter
  319. * | | |Actual state of the Transmit Error Counter. Values between 0 and 255.
  320. * |[14:8] |REC |Receive Error Counter
  321. * | | |Actual state of the Receive Error Counter. Values between 0 and 127.
  322. * |[15] |RP |Receive Error Passive
  323. * | | |0 = The Receive Error Counter is below the error passive level.
  324. * | | |1 = The Receive Error Counter has reached the error passive level as defined in the CAN Specification.
  325. * @var CAN_T::BTIME
  326. * Offset: 0x0C Bit Timing Register
  327. * ---------------------------------------------------------------------------------------------------
  328. * |Bits |Field |Descriptions
  329. * | :----: | :----: | :---- |
  330. * |[5:0] |BRP |Baud Rate Prescaler
  331. * | | |0x01-0x3F: The value by which the oscillator frequency is divided for generating the bit time quanta
  332. * | | |The bit time is built up from a multiple of this quanta
  333. * | | |Valid values for the Baud Rate Prescaler are [0...63]
  334. * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used.
  335. * |[7:6] |SJW |(Re)Synchronization Jump Width
  336. * | | |0x0-0x3: Valid programmed values are [0...3]
  337. * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used.
  338. * |[11:8] |TSeg1 |Time Segment Before the Sample Point Minus Sync_Seg
  339. * | | |0x01-0x0F: valid values for TSeg1 are [1...15]
  340. * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed is used.
  341. * |[14:12] |TSeg2 |Time Segment After Sample Point
  342. * | | |0x0-0x7: Valid values for TSeg2 are [0...7]
  343. * | | |The actual interpretation by the hardware of this value is such that one more than the value programmed here is used.
  344. * @var CAN_T::IIDR
  345. * Offset: 0x10 Interrupt Identifier Register
  346. * ---------------------------------------------------------------------------------------------------
  347. * |Bits |Field |Descriptions
  348. * | :----: | :----: | :---- |
  349. * |[15:0] |IntId |Interrupt Identifier (Indicates the Source of the Interrupt)
  350. * | | |If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt with the highest priority, disregarding their chronological order
  351. * | | |An interrupt remains pending until the application software has cleared it
  352. * | | |If IntId is different from 0x0000 and IE (CAN_CON[1]) is set, the IRQ interrupt signal to the EIC is active
  353. * | | |The interrupt remains active until IntId is back to value 0x0000 (the cause of the interrupt is reset) or until IE is reset.
  354. * | | |The Status Interrupt has the highest priority
  355. * | | |Among the message interrupts, the Message Object' s interrupt priority decreases with increasing message number.
  356. * | | |A message interrupt is cleared by clearing the Message Object's IntPnd bit (CAN_IFn_MCON[13])
  357. * | | |The Status Interrupt is cleared by reading the Status Register.
  358. * @var CAN_T::TEST
  359. * Offset: 0x14 Test Register
  360. * ---------------------------------------------------------------------------------------------------
  361. * |Bits |Field |Descriptions
  362. * | :----: | :----: | :---- |
  363. * |[2] |Basic |Basic Mode
  364. * | | |0 = Basic Mode Disabled.
  365. * | | |1= IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer.
  366. * |[3] |Silent |Silent Mode
  367. * | | |0 = Normal operation.
  368. * | | |1 = The module is in Silent Mode.
  369. * |[4] |LBack |Loop Back Mode Enable Bit
  370. * | | |0 = Loop Back Mode is Disabled.
  371. * | | |1 = Loop Back Mode is Enabled.
  372. * |[6:5] |Tx |Tx[1:0]: Control of CAN_TX Pin
  373. * | | |00 = Reset value, CAN_TX pin is controlled by the CAN Core.
  374. * | | |01 = Sample Point can be monitored at CAN_TX pin.
  375. * | | |10 = CAN_TX pin drives a dominant ('0') value.
  376. * | | |11 = CAN_TX pin drives a recessive ('1') value.
  377. * |[7] |Rx |Monitors the Actual Value of CAN_RX Pin (Read Only) *(1)
  378. * | | |0 = The CAN bus is dominant (CAN_RX = '0').
  379. * | | |1 = The CAN bus is recessive (CAN_RX = '1').
  380. * @var CAN_T::BRPE
  381. * Offset: 0x18 Baud Rate Prescaler Extension Register
  382. * ---------------------------------------------------------------------------------------------------
  383. * |Bits |Field |Descriptions
  384. * | :----: | :----: | :---- |
  385. * |[3:0] |BRPE |BRPE: Baud Rate Prescaler Extension
  386. * | | |0x00-0x0F: By programming BRPE, the Baud Rate Prescaler can be extended to values up to 1023
  387. * | | |The actual interpretation by the hardware is that one more than the value programmed by BRPE (MSBs) and BTIME (LSBs) is used.
  388. * @var CAN_T::TXREQ1
  389. * Offset: 0x100 Transmission Request Register 1
  390. * ---------------------------------------------------------------------------------------------------
  391. * |Bits |Field |Descriptions
  392. * | :----: | :----: | :---- |
  393. * |[15:0] |TxRqst16_1|Transmission Request Bits 16-1 (of All Message Objects)
  394. * | | |0 = This Message Object is not waiting for transmission.
  395. * | | |1 = The transmission of this Message Object is requested and is not yet done.
  396. * | | |These bits are read only.
  397. * @var CAN_T::TXREQ2
  398. * Offset: 0x104 Transmission Request Register 2
  399. * ---------------------------------------------------------------------------------------------------
  400. * |Bits |Field |Descriptions
  401. * | :----: | :----: | :---- |
  402. * |[15:0] |TxRqst32_17|Transmission Request Bits 32-17 (of All Message Objects)
  403. * | | |0 = This Message Object is not waiting for transmission.
  404. * | | |1 = The transmission of this Message Object is requested and is not yet done.
  405. * | | |These bits are read only.
  406. * @var CAN_T::NDAT1
  407. * Offset: 0x120 New Data Register 1
  408. * ---------------------------------------------------------------------------------------------------
  409. * |Bits |Field |Descriptions
  410. * | :----: | :----: | :---- |
  411. * |[15:0] |NewData16_1|New Data Bits 16-1 (of All Message Objects)
  412. * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software.
  413. * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object.
  414. * @var CAN_T::NDAT2
  415. * Offset: 0x124 New Data Register 2
  416. * ---------------------------------------------------------------------------------------------------
  417. * |Bits |Field |Descriptions
  418. * | :----: | :----: | :---- |
  419. * |[15:0] |NewData32_17|New Data Bits 32-17 (of All Message Objects)
  420. * | | |0 = No new data has been written into the data portion of this Message Object by the Message Handler since the last time this flag was cleared by the application software.
  421. * | | |1 = The Message Handler or the application software has written new data into the data portion of this Message Object.
  422. * @var CAN_T::IPND1
  423. * Offset: 0x140 Interrupt Pending Register 1
  424. * ---------------------------------------------------------------------------------------------------
  425. * |Bits |Field |Descriptions
  426. * | :----: | :----: | :---- |
  427. * |[15:0] |IntPnd16_1|Interrupt Pending Bits 16-1 (of All Message Objects)
  428. * | | |0 = This message object is not the source of an interrupt.
  429. * | | |1 = This message object is the source of an interrupt.
  430. * @var CAN_T::IPND2
  431. * Offset: 0x144 Interrupt Pending Register 2
  432. * ---------------------------------------------------------------------------------------------------
  433. * |Bits |Field |Descriptions
  434. * | :----: | :----: | :---- |
  435. * |[15:0] |IntPnd32_17|Interrupt Pending Bits 32-17 (of All Message Objects)
  436. * | | |0 = This message object is not the source of an interrupt.
  437. * | | |1 = This message object is the source of an interrupt.
  438. * @var CAN_T::MVLD1
  439. * Offset: 0x160 Message Valid Register 1
  440. * ---------------------------------------------------------------------------------------------------
  441. * |Bits |Field |Descriptions
  442. * | :----: | :----: | :---- |
  443. * |[15:0] |MsgVal16_1|Message Valid Bits 16-1 (of All Message Objects) (Read Only)
  444. * | | |0 = This Message Object is ignored by the Message Handler.
  445. * | | |1 = This Message Object is configured and should be considered by the Message Handler.
  446. * | | |Ex
  447. * | | |CAN_MVLD1[0] means Message object No.1 is valid or not
  448. * | | |If CAN_MVLD1[0] is set, message object No.1 is configured.
  449. * @var CAN_T::MVLD2
  450. * Offset: 0x164 Message Valid Register 2
  451. * ---------------------------------------------------------------------------------------------------
  452. * |Bits |Field |Descriptions
  453. * | :----: | :----: | :---- |
  454. * |[15:0] |MsgVal32_17|Message Valid Bits 32-17 (of All Message Objects) (Read Only)
  455. * | | |0 = This Message Object is ignored by the Message Handler.
  456. * | | |1 = This Message Object is configured and should be considered by the Message Handler.
  457. * | | |Ex.CAN_MVLD2[15] means Message object No.32 is valid or not
  458. * | | |If CAN_MVLD2[15] is set, message object No.32 is configured.
  459. * @var CAN_T::WU_EN
  460. * Offset: 0x168 Wake-up Enable Control Register
  461. * ---------------------------------------------------------------------------------------------------
  462. * |Bits |Field |Descriptions
  463. * | :----: | :----: | :---- |
  464. * |[0] |WAKUP_EN |Wake-up Enable Bit
  465. * | | |0 = The wake-up function Disabled.
  466. * | | |1 = The wake-up function Enabled.
  467. * | | |Note: User can wake-up system when there is a falling edge in the CAN_Rx pin.
  468. * @var CAN_T::WU_STATUS
  469. * Offset: 0x16C Wake-up Status Register
  470. * ---------------------------------------------------------------------------------------------------
  471. * |Bits |Field |Descriptions
  472. * | :----: | :----: | :---- |
  473. * |[0] |WAKUP_STS |Wake-up Status
  474. * | | |0 = No wake-up event occurred.
  475. * | | |1 = Wake-up event occurred.
  476. * | | |Note: This bit can be cleared by writing '0'.
  477. */
  478. __IO uint32_t CON; /*!< [0x0000] Control Register */
  479. __IO uint32_t STATUS; /*!< [0x0004] Status Register */
  480. __I uint32_t ERR; /*!< [0x0008] Error Counter Register */
  481. __IO uint32_t BTIME; /*!< [0x000c] Bit Timing Register */
  482. __I uint32_t IIDR; /*!< [0x0010] Interrupt Identifier Register */
  483. __IO uint32_t TEST; /*!< [0x0014] Test Register */
  484. __IO uint32_t BRPE; /*!< [0x0018] Baud Rate Prescaler Extension Register */
  485. /// @cond HIDDEN_SYMBOLS
  486. __I uint32_t RESERVE0[1];
  487. /// @endcond //HIDDEN_SYMBOLS
  488. __IO CAN_IF_T IF[2];
  489. /// @cond HIDDEN_SYMBOLS
  490. __I uint32_t RESERVE2[8];
  491. /// @endcond //HIDDEN_SYMBOLS
  492. __I uint32_t TXREQ1; /*!< [0x0100] Transmission Request Register 1 */
  493. __I uint32_t TXREQ2; /*!< [0x0104] Transmission Request Register 2 */
  494. /// @cond HIDDEN_SYMBOLS
  495. __I uint32_t RESERVE3[6];
  496. /// @endcond //HIDDEN_SYMBOLS
  497. __I uint32_t NDAT1; /*!< [0x0120] New Data Register 1 */
  498. __I uint32_t NDAT2; /*!< [0x0124] New Data Register 2 */
  499. /// @cond HIDDEN_SYMBOLS
  500. __I uint32_t RESERVE4[6];
  501. /// @endcond //HIDDEN_SYMBOLS
  502. __I uint32_t IPND1; /*!< [0x0140] Interrupt Pending Register 1 */
  503. __I uint32_t IPND2; /*!< [0x0144] Interrupt Pending Register 2 */
  504. /// @cond HIDDEN_SYMBOLS
  505. __I uint32_t RESERVE5[6];
  506. /// @endcond //HIDDEN_SYMBOLS
  507. __I uint32_t MVLD1; /*!< [0x0160] Message Valid Register 1 */
  508. __I uint32_t MVLD2; /*!< [0x0164] Message Valid Register 2 */
  509. __IO uint32_t WU_EN; /*!< [0x0168] Wake-up Enable Control Register */
  510. __IO uint32_t WU_STATUS; /*!< [0x016c] Wake-up Status Register */
  511. } CAN_T;
  512. /**
  513. @addtogroup CAN_CONST CAN Bit Field Definition
  514. Constant Definitions for CAN Controller
  515. @{ */
  516. #define CAN_CON_INIT_Pos (0) /*!< CAN_T::CON: Init Position */
  517. #define CAN_CON_INIT_Msk (0x1ul << CAN_CON_INIT_Pos) /*!< CAN_T::CON: Init Mask */
  518. #define CAN_CON_IE_Pos (1) /*!< CAN_T::CON: IE Position */
  519. #define CAN_CON_IE_Msk (0x1ul << CAN_CON_IE_Pos) /*!< CAN_T::CON: IE Mask */
  520. #define CAN_CON_SIE_Pos (2) /*!< CAN_T::CON: SIE Position */
  521. #define CAN_CON_SIE_Msk (0x1ul << CAN_CON_SIE_Pos) /*!< CAN_T::CON: SIE Mask */
  522. #define CAN_CON_EIE_Pos (3) /*!< CAN_T::CON: EIE Position */
  523. #define CAN_CON_EIE_Msk (0x1ul << CAN_CON_EIE_Pos) /*!< CAN_T::CON: EIE Mask */
  524. #define CAN_CON_DAR_Pos (5) /*!< CAN_T::CON: DAR Position */
  525. #define CAN_CON_DAR_Msk (0x1ul << CAN_CON_DAR_Pos) /*!< CAN_T::CON: DAR Mask */
  526. #define CAN_CON_CCE_Pos (6) /*!< CAN_T::CON: CCE Position */
  527. #define CAN_CON_CCE_Msk (0x1ul << CAN_CON_CCE_Pos) /*!< CAN_T::CON: CCE Mask */
  528. #define CAN_CON_TEST_Pos (7) /*!< CAN_T::CON: Test Position */
  529. #define CAN_CON_TEST_Msk (0x1ul << CAN_CON_TEST_Pos) /*!< CAN_T::CON: Test Mask */
  530. #define CAN_STATUS_LEC_Pos (0) /*!< CAN_T::STATUS: LEC Position */
  531. #define CAN_STATUS_LEC_Msk (0x7ul << CAN_STATUS_LEC_Pos) /*!< CAN_T::STATUS: LEC Mask */
  532. #define CAN_STATUS_TXOK_Pos (3) /*!< CAN_T::STATUS: TxOK Position */
  533. #define CAN_STATUS_TXOK_Msk (0x1ul << CAN_STATUS_TXOK_Pos) /*!< CAN_T::STATUS: TxOK Mask */
  534. #define CAN_STATUS_RXOK_Pos (4) /*!< CAN_T::STATUS: RxOK Position */
  535. #define CAN_STATUS_RXOK_Msk (0x1ul << CAN_STATUS_RXOK_Pos) /*!< CAN_T::STATUS: RxOK Mask */
  536. #define CAN_STATUS_EPASS_Pos (5) /*!< CAN_T::STATUS: EPass Position */
  537. #define CAN_STATUS_EPASS_Msk (0x1ul << CAN_STATUS_EPASS_Pos) /*!< CAN_T::STATUS: EPass Mask */
  538. #define CAN_STATUS_EWARN_Pos (6) /*!< CAN_T::STATUS: EWarn Position */
  539. #define CAN_STATUS_EWARN_Msk (0x1ul << CAN_STATUS_EWARN_Pos) /*!< CAN_T::STATUS: EWarn Mask */
  540. #define CAN_STATUS_BOFF_Pos (7) /*!< CAN_T::STATUS: BOff Position */
  541. #define CAN_STATUS_BOFF_Msk (0x1ul << CAN_STATUS_BOFF_Pos) /*!< CAN_T::STATUS: BOff Mask */
  542. #define CAN_ERR_TEC_Pos (0) /*!< CAN_T::ERR: TEC Position */
  543. #define CAN_ERR_TEC_Msk (0xfful << CAN_ERR_TEC_Pos) /*!< CAN_T::ERR: TEC Mask */
  544. #define CAN_ERR_REC_Pos (8) /*!< CAN_T::ERR: REC Position */
  545. #define CAN_ERR_REC_Msk (0x7ful << CAN_ERR_REC_Pos) /*!< CAN_T::ERR: REC Mask */
  546. #define CAN_ERR_RP_Pos (15) /*!< CAN_T::ERR: RP Position */
  547. #define CAN_ERR_RP_Msk (0x1ul << CAN_ERR_RP_Pos) /*!< CAN_T::ERR: RP Mask */
  548. #define CAN_BTIME_BRP_Pos (0) /*!< CAN_T::BTIME: BRP Position */
  549. #define CAN_BTIME_BRP_Msk (0x3ful << CAN_BTIME_BRP_Pos) /*!< CAN_T::BTIME: BRP Mask */
  550. #define CAN_BTIME_SJW_Pos (6) /*!< CAN_T::BTIME: SJW Position */
  551. #define CAN_BTIME_SJW_Msk (0x3ul << CAN_BTIME_SJW_Pos) /*!< CAN_T::BTIME: SJW Mask */
  552. #define CAN_BTIME_TSEG1_Pos (8) /*!< CAN_T::BTIME: TSeg1 Position */
  553. #define CAN_BTIME_TSEG1_Msk (0xful << CAN_BTIME_TSEG1_Pos) /*!< CAN_T::BTIME: TSeg1 Mask */
  554. #define CAN_BTIME_TSEG2_Pos (12) /*!< CAN_T::BTIME: TSeg2 Position */
  555. #define CAN_BTIME_TSEG2_Msk (0x7ul << CAN_BTIME_TSEG2_Pos) /*!< CAN_T::BTIME: TSeg2 Mask */
  556. #define CAN_IIDR_INTID_Pos (0) /*!< CAN_T::IIDR: IntId Position */
  557. #define CAN_IIDR_INTID_Msk (0xfffful << CAN_IIDR_INTID_Pos) /*!< CAN_T::IIDR: IntId Mask */
  558. #define CAN_TEST_BASIC_Pos (2) /*!< CAN_T::TEST: Basic Position */
  559. #define CAN_TEST_BASIC_Msk (0x1ul << CAN_TEST_BASIC_Pos) /*!< CAN_T::TEST: Basic Mask */
  560. #define CAN_TEST_SILENT_Pos (3) /*!< CAN_T::TEST: Silent Position */
  561. #define CAN_TEST_SILENT_Msk (0x1ul << CAN_TEST_SILENT_Pos) /*!< CAN_T::TEST: Silent Mask */
  562. #define CAN_TEST_LBACK_Pos (4) /*!< CAN_T::TEST: LBack Position */
  563. #define CAN_TEST_LBACK_Msk (0x1ul << CAN_TEST_LBACK_Pos) /*!< CAN_T::TEST: LBack Mask */
  564. #define CAN_TEST_Tx_Pos (5) /*!< CAN_T::TEST: Tx Position */
  565. #define CAN_TEST_Tx_Msk (0x3ul << CAN_TEST_Tx_Pos) /*!< CAN_T::TEST: Tx Mask */
  566. #define CAN_TEST_Rx_Pos (7) /*!< CAN_T::TEST: Rx Position */
  567. #define CAN_TEST_Rx_Msk (0x1ul << CAN_TEST_Rx_Pos) /*!< CAN_T::TEST: Rx Mask */
  568. #define CAN_BRPE_BRPE_Pos (0) /*!< CAN_T::BRPE: BRPE Position */
  569. #define CAN_BRPE_BRPE_Msk (0xful << CAN_BRPE_BRPE_Pos) /*!< CAN_T::BRPE: BRPE Mask */
  570. #define CAN_IF_CREQ_MSGNUM_Pos (0) /*!< CAN_IF_T::CREQ: MessageNumber Position*/
  571. #define CAN_IF_CREQ_MSGNUM_Msk (0x3ful << CAN_IF_CREQ_MSGNUM_Pos) /*!< CAN_IF_T::CREQ: MessageNumber Mask */
  572. #define CAN_IF_CREQ_BUSY_Pos (15) /*!< CAN_IF_T::CREQ: Busy Position */
  573. #define CAN_IF_CREQ_BUSY_Msk (0x1ul << CAN_IF_CREQ_BUSY_Pos) /*!< CAN_IF_T::CREQ: Busy Mask */
  574. #define CAN_IF_CMASK_DATAB_Pos (0) /*!< CAN_IF_T::CMASK: DAT_B Position */
  575. #define CAN_IF_CMASK_DATAB_Msk (0x1ul << CAN_IF_CMASK_DATAB_Pos) /*!< CAN_IF_T::CMASK: DAT_B Mask */
  576. #define CAN_IF_CMASK_DATAA_Pos (1) /*!< CAN_IF_T::CMASK: DAT_A Position */
  577. #define CAN_IF_CMASK_DATAA_Msk (0x1ul << CAN_IF_CMASK_DATAA_Pos) /*!< CAN_IF_T::CMASK: DAT_A Mask */
  578. #define CAN_IF_CMASK_TXRQSTNEWDAT_Pos (2) /*!< CAN_IF_T::CMASK: TxRqst_NewDat Position*/
  579. #define CAN_IF_CMASK_TXRQSTNEWDAT_Msk (0x1ul << CAN_IF_CMASK_TXRQSTNEWDAT_Pos) /*!< CAN_IF_T::CMASK: TxRqst_NewDat Mask */
  580. #define CAN_IF_CMASK_CLRINTPND_Pos (3) /*!< CAN_IF_T::CMASK: ClrIntPnd Position */
  581. #define CAN_IF_CMASK_CLRINTPND_Msk (0x1ul << CAN_IF_CMASK_CLRINTPND_Pos) /*!< CAN_IF_T::CMASK: ClrIntPnd Mask */
  582. #define CAN_IF_CMASK_CONTROL_Pos (4) /*!< CAN_IF_T::CMASK: Control Position */
  583. #define CAN_IF_CMASK_CONTROL_Msk (0x1ul << CAN_IF_CMASK_CONTROL_Pos) /*!< CAN_IF_T::CMASK: Control Mask */
  584. #define CAN_IF_CMASK_ARB_Pos (5) /*!< CAN_IF_T::CMASK: Arb Position */
  585. #define CAN_IF_CMASK_ARB_Msk (0x1ul << CAN_IF_CMASK_ARB_Pos) /*!< CAN_IF_T::CMASK: Arb Mask */
  586. #define CAN_IF_CMASK_MASK_Pos (6) /*!< CAN_IF_T::CMASK: Mask Position */
  587. #define CAN_IF_CMASK_MASK_Msk (0x1ul << CAN_IF_CMASK_MASK_Pos) /*!< CAN_IF_T::CMASK: Mask Mask */
  588. #define CAN_IF_CMASK_WRRD_Pos (7) /*!< CAN_IF_T::CMASK: WR_RD Position */
  589. #define CAN_IF_CMASK_WRRD_Msk (0x1ul << CAN_IF_CMASK_WRRD_Pos) /*!< CAN_IF_T::CMASK: WR_RD Mask */
  590. #define CAN_IF_MASK1_Msk_Pos (0) /*!< CAN_IF_T::MASK1: Msk Position */
  591. #define CAN_IF_MASK1_Msk_Msk (0xfffful << CAN_IF_MASK1_Msk_Pos) /*!< CAN_IF_T::MASK1: Msk Mask */
  592. #define CAN_IF_MASK2_Msk_Pos (0) /*!< CAN_IF_T::MASK2: Msk Position */
  593. #define CAN_IF_MASK2_Msk_Msk (0x1ffful << CAN_IF_MASK2_Msk_Pos) /*!< CAN_IF_T::MASK2: Msk Mask */
  594. #define CAN_IF_MASK2_MDIR_Pos (14) /*!< CAN_IF_T::MASK2: MDir Position */
  595. #define CAN_IF_MASK2_MDIR_Msk (0x1ul << CAN_IF_MASK2_MDIR_Pos) /*!< CAN_IF_T::MASK2: MDir Mask */
  596. #define CAN_IF_MASK2_MXTD_Pos (15) /*!< CAN_IF_T::MASK2: MXtd Position */
  597. #define CAN_IF_MASK2_MXTD_Msk (0x1ul << CAN_IF_MASK2_MXTD_Pos) /*!< CAN_IF_T::MASK2: MXtd Mask */
  598. #define CAN_IF_ARB1_ID_Pos (0) /*!< CAN_IF_T::ARB1: ID Position */
  599. #define CAN_IF_ARB1_ID_Msk (0xfffful << CAN_IF_ARB1_ID_Pos) /*!< CAN_IF_T::ARB1: ID Mask */
  600. #define CAN_IF_ARB2_ID_Pos (0) /*!< CAN_IF_T::ARB2: ID Position */
  601. #define CAN_IF_ARB2_ID_Msk (0x1ffful << CAN_IF_ARB2_ID_Pos) /*!< CAN_IF_T::ARB2: ID Mask */
  602. #define CAN_IF_ARB2_DIR_Pos (13) /*!< CAN_IF_T::ARB2: Dir Position */
  603. #define CAN_IF_ARB2_DIR_Msk (0x1ul << CAN_IF_ARB2_DIR_Pos) /*!< CAN_IF_T::ARB2: Dir Mask */
  604. #define CAN_IF_ARB2_XTD_Pos (14) /*!< CAN_IF_T::ARB2: Xtd Position */
  605. #define CAN_IF_ARB2_XTD_Msk (0x1ul << CAN_IF_ARB2_XTD_Pos) /*!< CAN_IF_T::ARB2: Xtd Mask */
  606. #define CAN_IF_ARB2_MSGVAL_Pos (15) /*!< CAN_IF_T::ARB2: MsgVal Position */
  607. #define CAN_IF_ARB2_MSGVAL_Msk (0x1ul << CAN_IF_ARB2_MSGVAL_Pos) /*!< CAN_IF_T::ARB2: MsgVal Mask */
  608. #define CAN_IF_MCON_DLC_Pos (0) /*!< CAN_IF_T::MCON: DLC Position */
  609. #define CAN_IF_MCON_DLC_Msk (0xful << CAN_IF_MCON_DLC_Pos) /*!< CAN_IF_T::MCON: DLC Mask */
  610. #define CAN_IF_MCON_EOB_Pos (7) /*!< CAN_IF_T::MCON: EoB Position */
  611. #define CAN_IF_MCON_EOB_Msk (0x1ul << CAN_IF_MCON_EOB_Pos) /*!< CAN_IF_T::MCON: EoB Mask */
  612. #define CAN_IF_MCON_TxRqst_Pos (8) /*!< CAN_IF_T::MCON: TxRqst Position */
  613. #define CAN_IF_MCON_TxRqst_Msk (0x1ul << CAN_IF_MCON_TxRqst_Pos) /*!< CAN_IF_T::MCON: TxRqst Mask */
  614. #define CAN_IF_MCON_RmtEn_Pos (9) /*!< CAN_IF_T::MCON: RmtEn Position */
  615. #define CAN_IF_MCON_RmtEn_Msk (0x1ul << CAN_IF_MCON_RmtEn_Pos) /*!< CAN_IF_T::MCON: RmtEn Mask */
  616. #define CAN_IF_MCON_RXIE_Pos (10) /*!< CAN_IF_T::MCON: RxIE Position */
  617. #define CAN_IF_MCON_RXIE_Msk (0x1ul << CAN_IF_MCON_RXIE_Pos) /*!< CAN_IF_T::MCON: RxIE Mask */
  618. #define CAN_IF_MCON_TXIE_Pos (11) /*!< CAN_IF_T::MCON: TxIE Position */
  619. #define CAN_IF_MCON_TXIE_Msk (0x1ul << CAN_IF_MCON_TXIE_Pos) /*!< CAN_IF_T::MCON: TxIE Mask */
  620. #define CAN_IF_MCON_UMASK_Pos (12) /*!< CAN_IF_T::MCON: UMask Position */
  621. #define CAN_IF_MCON_UMASK_Msk (0x1ul << CAN_IF_MCON_UMASK_Pos) /*!< CAN_IF_T::MCON: UMask Mask */
  622. #define CAN_IF_MCON_IntPnd_Pos (13) /*!< CAN_IF_T::MCON: IntPnd Position */
  623. #define CAN_IF_MCON_IntPnd_Msk (0x1ul << CAN_IF_MCON_IntPnd_Pos) /*!< CAN_IF_T::MCON: IntPnd Mask */
  624. #define CAN_IF_MCON_MsgLst_Pos (14) /*!< CAN_IF_T::MCON: MsgLst Position */
  625. #define CAN_IF_MCON_MsgLst_Msk (0x1ul << CAN_IF_MCON_MsgLst_Pos) /*!< CAN_IF_T::MCON: MsgLst Mask */
  626. #define CAN_IF_MCON_NEWDAT_Pos (15) /*!< CAN_IF_T::MCON: NewDat Position */
  627. #define CAN_IF_MCON_NEWDAT_Msk (0x1ul << CAN_IF_MCON_NEWDAT_Pos) /*!< CAN_IF_T::MCON: NewDat Mask */
  628. #define CAN_IF_DAT_A1_DATA0_Pos (0) /*!< CAN_IF_T::DAT_A1: Data_0_ Position */
  629. #define CAN_IF_DAT_A1_DATA0_Msk (0xfful << CAN_IF_DAT_A1_DATA0_Pos) /*!< CAN_IF_T::DAT_A1: Data_0_ Mask */
  630. #define CAN_IF_DAT_A1_DATA1_Pos (8) /*!< CAN_IF_T::DAT_A1: Data_1_ Position */
  631. #define CAN_IF_DAT_A1_DATA1_Msk (0xfful << CAN_IF_DAT_A1_DATA1_Pos) /*!< CAN_IF_T::DAT_A1: Data_1_ Mask */
  632. #define CAN_IF_DAT_A2_DATA2_Pos (0) /*!< CAN_IF_T::DAT_A2: Data_2_ Position */
  633. #define CAN_IF_DAT_A2_DATA2_Msk (0xfful << CAN_IF_DAT_A2_DATA2_Pos) /*!< CAN_IF_T::DAT_A2: Data_2_ Mask */
  634. #define CAN_IF_DAT_A2_DATA3_Pos (8) /*!< CAN_IF_T::DAT_A2: Data_3_ Position */
  635. #define CAN_IF_DAT_A2_DATA3_Msk (0xfful << CAN_IF_DAT_A2_DATA3_Pos) /*!< CAN_IF_T::DAT_A2: Data_3_ Mask */
  636. #define CAN_IF_DAT_B1_DATA4_Pos (0) /*!< CAN_IF_T::DAT_B1: Data_4_ Position */
  637. #define CAN_IF_DAT_B1_DATA4_Msk (0xfful << CAN_IF_DAT_B1_DATA4_Pos) /*!< CAN_IF_T::DAT_B1: Data_4_ Mask */
  638. #define CAN_IF_DAT_B1_DATA5_Pos (8) /*!< CAN_IF_T::DAT_B1: Data_5_ Position */
  639. #define CAN_IF_DAT_B1_DATA5_Msk (0xfful << CAN_IF_DAT_B1_DATA5_Pos) /*!< CAN_IF_T::DAT_B1: Data_5_ Mask */
  640. #define CAN_IF_DAT_B2_DATA6_Pos (0) /*!< CAN_IF_T::DAT_B2: Data_6_ Position */
  641. #define CAN_IF_DAT_B2_DATA6_Msk (0xfful << CAN_IF_DAT_B2_DATA6_Pos) /*!< CAN_IF_T::DAT_B2: Data_6_ Mask */
  642. #define CAN_IF_DAT_B2_DATA7_Pos (8) /*!< CAN_IF_T::DAT_B2: Data_7_ Position */
  643. #define CAN_IF_DAT_B2_DATA7_Msk (0xfful << CAN_IF_DAT_B2_DATA7_Pos) /*!< CAN_IF_T::DAT_B2: Data_7_ Mask */
  644. #define CAN_TXREQ1_TXRQST16_1_Pos (0) /*!< CAN_T::TXREQ1: TxRqst16_1 Position */
  645. #define CAN_TXREQ1_TXRQST16_1_Msk (0xfffful << CAN_TXREQ1_TXRQST16_1_Pos) /*!< CAN_T::TXREQ1: TxRqst16_1 Mask */
  646. #define CAN_TXREQ2_TXRQST32_17_Pos (0) /*!< CAN_T::TXREQ2: TxRqst32_17 Position */
  647. #define CAN_TXREQ2_TXRQST32_17_Msk (0xfffful << CAN_TXREQ2_TXRQST32_17_Pos) /*!< CAN_T::TXREQ2: TxRqst32_17 Mask */
  648. #define CAN_NDAT1_NewData16_1_Pos (0) /*!< CAN_T::NDAT1: NewData16_1 Position */
  649. #define CAN_NDAT1_NewData16_1_Msk (0xfffful << CAN_NDAT1_NewData16_1_Pos) /*!< CAN_T::NDAT1: NewData16_1 Mask */
  650. #define CAN_NDAT2_NewData32_17_Pos (0) /*!< CAN_T::NDAT2: NewData32_17 Position */
  651. #define CAN_NDAT2_NewData32_17_Msk (0xfffful << CAN_NDAT2_NewData32_17_Pos) /*!< CAN_T::NDAT2: NewData32_17 Mask */
  652. #define CAN_IPND1_IntPnd16_1_Pos (0) /*!< CAN_T::IPND1: IntPnd16_1 Position */
  653. #define CAN_IPND1_IntPnd16_1_Msk (0xfffful << CAN_IPND1_IntPnd16_1_Pos) /*!< CAN_T::IPND1: IntPnd16_1 Mask */
  654. #define CAN_IPND2_IntPnd32_17_Pos (0) /*!< CAN_T::IPND2: IntPnd32_17 Position */
  655. #define CAN_IPND2_IntPnd32_17_Msk (0xfffful << CAN_IPND2_IntPnd32_17_Pos) /*!< CAN_T::IPND2: IntPnd32_17 Mask */
  656. #define CAN_MVLD1_MsgVal16_1_Pos (0) /*!< CAN_T::MVLD1: MsgVal16_1 Position */
  657. #define CAN_MVLD1_MsgVal16_1_Msk (0xfffful << CAN_MVLD1_MsgVal16_1_Pos) /*!< CAN_T::MVLD1: MsgVal16_1 Mask */
  658. #define CAN_MVLD2_MsgVal32_17_Pos (0) /*!< CAN_T::MVLD2: MsgVal32_17 Position */
  659. #define CAN_MVLD2_MsgVal32_17_Msk (0xfffful << CAN_MVLD2_MsgVal32_17_Pos) /*!< CAN_T::MVLD2: MsgVal32_17 Mask */
  660. #define CAN_WU_EN_WAKUP_EN_Pos (0) /*!< CAN_T::WU_EN: WAKUP_EN Position */
  661. #define CAN_WU_EN_WAKUP_EN_Msk (0x1ul << CAN_WU_EN_WAKUP_EN_Pos) /*!< CAN_T::WU_EN: WAKUP_EN Mask */
  662. #define CAN_WU_STATUS_WAKUP_STS_Pos (0) /*!< CAN_T::WU_STATUS: WAKUP_STS Position */
  663. #define CAN_WU_STATUS_WAKUP_STS_Msk (0x1ul << CAN_WU_STATUS_WAKUP_STS_Pos) /*!< CAN_T::WU_STATUS: WAKUP_STS Mask */
  664. /**@}*/ /* CAN_CONST */
  665. /**@}*/ /* end of CAN register group */
  666. /**@}*/ /* end of REGISTER group */
  667. #if defined ( __CC_ARM )
  668. #pragma no_anon_unions
  669. #endif
  670. #endif /* __CAN_REG_H__ */