![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
#include <can_reg.h>
Data Fields | |
__IO uint32_t | CREQ |
__IO uint32_t | CMASK |
__IO uint32_t | MASK1 |
__IO uint32_t | MASK2 |
__IO uint32_t | ARB1 |
__IO uint32_t | ARB2 |
__IO uint32_t | MCON |
__IO uint32_t | DAT_A1 |
__IO uint32_t | DAT_A2 |
__IO uint32_t | DAT_B1 |
__IO uint32_t | DAT_B2 |
@addtogroup CAN Controller Area Network Controller(CAN) Memory Mapped Structure for CAN Controller
CAN_IF_T::ARB1 |
CAN_IF_T::ARB2 |
[0x0034] IFn Arbitration 2 Register
Bits | Field | Descriptions |
[12:0] | ID | Message Identifier 28-16
ID28 - ID0, 29-bit Identifier (Extended Frame) ID28 - ID18, 11-bit Identifier (Standard Frame) |
[13] | Dir | Message Direction
0 = Direction is receive. On TxRqst, a Remote Frame with the identifier of this Message Object is transmitted On reception of a Data Frame with matching identifier, that message is stored in this Message Object. 1 = Direction is transmit. On TxRqst, the respective Message Object is transmitted as a Data Frame 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). |
[14] | Xtd | Extended Identifier
0 = The 11-bit (standard) Identifier will be used for this Message Object. 1 = The 29-bit (extended) Identifier will be used for this Message Object. |
[15] | MsgVal | Message Valid
0 = The Message Object is ignored by the Message Handler. 1 = The Message Object is configured and should be considered by the Message Handler. 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]) 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. |
CAN_IF_T::CMASK |
[0x0024] IFn Command Mask Register
Bits | Field | Descriptions |
[0] | DAT_B | Access Data Bytes [7:4]
Write Operation: 0 = Data Bytes [7:4] unchanged. 1 = Transfer Data Bytes [7:4] to Message Object. Read Operation: 0 = Data Bytes [7:4] unchanged. 1 = Transfer Data Bytes [7:4] to IFn Message Buffer Register. |
[1] | DAT_A | Access Data Bytes [3:0]
Write Operation: 0 = Data Bytes [3:0] unchanged. 1 = Transfer Data Bytes [3:0] to Message Object. Read Operation: 0 = Data Bytes [3:0] unchanged. 1 = Transfer Data Bytes [3:0] to IFn Message Buffer Register. |
[2] | TxRqst_NewDat | Access Transmission Request Bit When Write Operation
0 = TxRqst bit unchanged. 1 = Set TxRqst bit. 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. Access New Data Bit when Read Operation. 0 = NewDat bit remains unchanged. 1 = Clear NewDat bit in the Message Object. Note: A read access to a Message Object can be combined with the reset of the control bits IntPnd and NewDat The values of these bits transferred to the IFn Message Control Register always reflect the status before resetting these bits. |
[3] | ClrIntPnd | Clear Interrupt Pending Bit
Write Operation: When writing to a Message Object, this bit is ignored. Read Operation: 0 = IntPnd bit (CAN_IFn_MCON[13]) remains unchanged. 1 = Clear IntPnd bit in the Message Object. |
[4] | Control | Control Access Control Bits
Write Operation: 0 = Control Bits unchanged. 1 = Transfer Control Bits to Message Object. Read Operation: 0 = Control Bits unchanged. 1 = Transfer Control Bits to IFn Message Buffer Register. |
[5] | Arb | Access Arbitration Bits
Write Operation: 0 = Arbitration bits unchanged. 1 = Transfer Identifier + Dir (CAN_IFn_ARB2[13]) + Xtd (CAN_IFn_ARB2[14]) + MsgVal (CAN_IFn_ARB2[15]) to Message Object. Read Operation: 0 = Arbitration bits unchanged. 1 = Transfer Identifier + Dir + Xtd + MsgVal to IFn Message Buffer Register. |
[6] | Mask | Access Mask Bits
Write Operation: 0 = Mask bits unchanged. 1 = Transfer Identifier Mask + MDir + MXtd to Message Object. Read Operation: 0 = Mask bits unchanged. 1 = Transfer Identifier Mask + MDir + MXtd to IFn Message Buffer Register. |
[7] | WR_RD | Write / Read Mode
0 = Read: Transfer data from the Message Object addressed by the Command Request Register into the selected Message Buffer Registers. 1 = Write: Transfer data from the selected Message Buffer Registers to the Message Object addressed by the Command Request Register. |
CAN_IF_T::CREQ |
[0x0020] IFn Command Request Register
Bits | Field | Descriptions |
[5:0] | MessageNumber | Message Number
0x01-0x20: Valid Message Number, the Message Object in the Message RAM is selected for data transfer. 0x00: Not a valid Message Number, interpreted as 0x20. 0x21-0x3F: Not a valid Message Number, interpreted as 0x01-0x1F. |
[15] | Busy | Busy Flag
0 = Read/write action has finished. 1 = Writing to the IFn Command Request Register is in progress This bit can only be read by the software. |
CAN_IF_T::DAT_A1 |
CAN_IF_T::DAT_A2 |
CAN_IF_T::DAT_B1 |
CAN_IF_T::DAT_B2 |
CAN_IF_T::MASK1 |
[0x0028] IFn Mask 1 Register
Bits | Field | Descriptions |
[15:0] | Msk | Identifier Mask 15-0
0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. 1 = The corresponding identifier bit is used for acceptance filtering. |
CAN_IF_T::MASK2 |
[0x002c] IFn Mask 2 Register
Bits | Field | Descriptions |
[12:0] | Msk | Identifier Mask 28-16
0 = The corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. 1 = The corresponding identifier bit is used for acceptance filtering. |
[14] | MDir | Mask Message Direction
0 = The message direction bit (Dir (CAN_IFn_ARB2[13])) has no effect on the acceptance filtering. 1 = The message direction bit (Dir) is used for acceptance filtering. |
[15] | MXtd | Mask Extended Identifier
0 = The extended identifier bit (IDE) has no effect on the acceptance filtering. 1 = The extended identifier bit (IDE) is used for acceptance filtering. 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]) For acceptance filtering, only these bits together with mask bits Msk28 to Msk18 (CAN_IFn_MASK2[12:2]) are considered. |
CAN_IF_T::MCON |
[0x0038] IFn Message Control Register
Bits | Field | Descriptions |
[3:0] | DLC | Data Length Code
0-8: Data Frame has 0-8 data bytes. 9-15: Data Frame has 8 data bytes 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 When the Message Handler stores a data frame, it will write the DLC to the value given by the received message. Data(0): 1st data byte of a CAN Data Frame Data(1): 2nd data byte of a CAN Data Frame Data(2): 3rd data byte of a CAN Data Frame Data(3): 4th data byte of a CAN Data Frame Data(4): 5th data byte of a CAN Data Frame Data(5): 6th data byte of a CAN Data Frame Data(6): 7th data byte of a CAN Data Frame Data(7): 8th data byte of a CAN Data Frame 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 When the Message Handler stores a Data Frame, it will write all the eight data bytes into a Message Object If the Data Length Code is less than 8, the remaining bytes of the Message Object will be overwritten by unspecified values. |
[7] | EoB | End of Buffer
0 = Message Object belongs to a FIFO Buffer and is not the last Message Object of that FIFO Buffer. 1 = Single Message Object or last Message Object of a FIFO Buffer. Note: This bit is used to concatenate two or more Message Objects (up to 32) to build a FIFO Buffer For single Message Objects (not belonging to a FIFO Buffer), this bit must always be set to one |
[8] | TxRqst | Transmit Request
0 = This Message Object is not waiting for transmission. 1 = The transmission of this Message Object is requested and is not yet done. |
[9] | RmtEn | Remote Enable Bit
0 = At the reception of a Remote Frame, TxRqst (CAN_IFn_MCON[8]) is left unchanged. 1 = At the reception of a Remote Frame, TxRqst is set. |
[10] | RxIE | Receive Interrupt Enable Bit
0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after a successful reception of a frame. 1 = IntPnd will be set after a successful reception of a frame. |
[11] | TxIE | Transmit Interrupt Enable Bit
0 = IntPnd (CAN_IFn_MCON[13]) will be left unchanged after the successful transmission of a frame. 1 = IntPnd will be set after a successful transmission of a frame. |
[12] | UMask | Use Acceptance Mask
0 = Mask ignored. 1 = Use Mask (Msk28-0, MXtd, and MDir) for acceptance filtering. 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. |
[13] | IntPnd | Interrupt Pending
0 = This message object is not the source of an interrupt. 1 = This message object is the source of an interrupt The Interrupt Identifier in the Interrupt Register will point to this message object if there is no other interrupt source with higher priority. |
[14] | MsgLst | Message Lost (only valid for Message Objects with direction = receive).
0 = No message lost since last time this bit was reset by the CPU. 1 = The Message Handler stored a new message into this object when NewDat was still set, the CPU has lost a message. |
[15] | NewDat | New Data
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. 1 = The Message Handler or the application software has written new data into the data portion of this Message Object. |