Structure Definitions (CAN)
This section describes CAN-related structure definitions for this product.
Main APIs
- StMPXCANParam: MPXCANSetParam
- StMPXCANLog: MPXCANGetLogEx
- StMPXCANSlot: MPXCANSetSlot
- StMPXCANFrame: MPXCANChangeSlot
- StMPXCANDirect: MPXCANDirectSend
Definition List
| Type Name | Description |
|---|---|
| StMPXCANParam | CAN parameter setting information |
| StMPXCANLog | Log information for CAN log acquisition API |
| StMPXCANFrameOption | CAN frame option information |
| StMPXCANFrameType | CAN frame attribute information |
| StMPXCANID | CAN ID information |
| StMPXCANFrame | CAN frame information |
| StMPXCANSlot | CAN slot information |
| StMPXCANDirect | CAN direct transmission information |
Definition Details
StMPXCANParam
Members of StMPXCANParam (CAN parameter setting information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| EnableTerminate | uint8_t | Termination resistor enable/disable | See CAN Termination Resistor. |
| Mode | uint8_t | Operation mode | See CAN Operation Mode. |
| ArbitrationBaudrate | uint8_t | Arbitration baudrate | See CAN Arbitration Baudrate. |
| ArbitrationSamplepoint | uint8_t | Arbitration sample point | See CAN Sample Point. |
| DataBaudrate | uint8_t | Data baudrate | See CAN Data Baudrate. |
| DataSamplepoint | uint8_t | Data sample point | See CAN Sample Point. |
| Reserved | uint8_t [2] | Reserved |
Available sample points depend on the combination of arbitration baudrate and data baudrate.
For details, see Baudrate and Sample Point Settings.
StMPXCANLog
Members of StMPXCANLog (log information for CAN log acquisition API) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| mSec | uint32_t | Timestamp (milliseconds) | Timestamp is represented by combining mSec and uSec.For example, for 12.345 ms (12 ms + 345 us), mSec is 12 and uSec is 345. |
| uSec | uint16_t | Timestamp (microseconds) | |
| Protocol | uint8_t | Protocol | See Log Type. |
| Dir | uint8_t | Direction | See Log Direction. |
| ID | uint32_t | CAN ID (standard or extended) | For standard ID, set in lower 11 bits (bit10 to bit0). |
| RTR | uint8_t | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | uint8_t | ID format (IDE) | See CAN ID Format. |
| DL | uint8_t | Data length (DL) | |
| Error | uint8_t | Error flag | See CAN Error Flag. |
| ErrorInfo | uint32_t | Error information | See CAN Error Information. |
| Data | uint8_t [64] | Data | Element indices 0 to 63 correspond to D1 to D64. |
StMPXCANFrameOption
Members of StMPXCANFrameOption (CAN frame option information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| Protocol | uint8_t | Protocol | See CAN Protocol. |
| BRS | uint8_t | Bit Rate Switch (BRS) | See CAN Bit Rate Switch. |
| ErrorAction | uint8_t | Error behavior | See CAN Error Behavior. |
| Reserved | uint8_t | Reserved |
StMPXCANFrameType
Members of StMPXCANFrameType (CAN frame attribute information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| isOneShot | uint8_t | One-shot transmission enable/disable | See CAN One-shot Transmission. |
| FrameType | uint8_t | Frame type | See CAN Frame Type. |
| Enabled | uint8_t | Slot enable/disable | See CAN Slot Enable/Disable. |
| Reserved | uint8_t | Reserved | |
| Option | StMPXCANFrameOption | CAN frame option information |
StMPXCANID
Members of StMPXCANID (CAN ID information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | uint32_t | CAN ID (standard or extended) | For standard ID, set lower 11 bits (bit10 to bit0). |
| RTR | uint8_t | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | uint8_t | ID format (IDE) | See CAN ID Format. |
| Reserved | uint8_t [2] | Reserved |
StMPXCANFrame
Members of StMPXCANFrame (CAN frame information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | StMPXCANID | CAN ID information | |
| DL | uint8_t | Data length (DL) | Available values are 0 to 8, 12, 16, 20, 24, 32, 48, and 64. |
| Reserved | uint8_t [3] | Reserved | |
| Data | uint8_t [64] | Data (D1 to D64) | Element indices 0 to 63 correspond to D1 to D64. |
StMPXCANSlot
Members of StMPXCANSlot (slot information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| SlotNo | uint8_t | Slot number (1 to 28) | |
| TriggerType | uint8_t | Transmission trigger type | See CAN Transmission Trigger Type. |
| Reserved1 | uint8_t [2] | Reserved | |
| FrameType | StMPXCANFrameType | CAN frame attribute information | |
| TriggerID | StMPXCANID | Reception trigger ID | |
| msSendDelay | uint32_t | Delay for event transmission (ms) | Delay for event transmission, transmit offset, transmit cycle, and minimum guaranteed transmit interval are represented as follows. [Delay for event transmission] msSendDelay, usSendDelay[Transmit offset] msSendOffset, usSendOffset[Transmit cycle] msSendCycle, usSendCycle[Minimum guaranteed transmit interval] msMinTransInterval, usMinTransIntervalFor example, to set transmit offset to 12.345 ms (12 ms + 345 us), set msSendOffset=12 and usSendOffset=345. |
| msSendOffset | uint32_t | Transmit offset (ms) | |
| msSendCycle | uint32_t | Transmit cycle (ms) | |
| msMinTransInterval | uint32_t | Minimum guaranteed transmit interval (ms) | |
| usSendDelay | uint16_t | Delay for event transmission (us) | |
| usSendOffset | uint16_t | Transmit offset (us) | |
| usSendCycle | uint16_t | Transmit cycle (us) | |
| usMinTransInterval | uint16_t | Minimum guaranteed transmit interval (us) | |
| SendCounter | uint16_t | Transmission count | If set to 0, transmission count is unlimited. |
| Reserved2 | uint8_t [2] | Reserved | |
| Frame | StMPXCANFrame | CAN frame information | |
| Increment | uint8_t [64] | Increment enabled/disabled | Element indices 0 to 63 correspond to D1 to D64. See CAN Increment Enable/Disable. |
StMPXCANDirect
Members of StMPXCANDirect (CAN direct transmission information) are as follows.
| Variable | Type | Description |
|---|---|---|
| FrameType | StMPXCANFrameType | CAN frame attribute information |
| Frame | StMPXCANFrame | CAN frame information |