Structure Definitions (struct)
This chapter explains the structure definitions provided by this product.
List of Structures
| Structure type | Description |
|---|---|
| StMPXAPIVersion | API version information |
| StMPXCoreVersion | MicroPeckerX version information |
| StMPXDeviceInfo | MicroPeckerX device information |
| StMPXCANParam | Parameter settings |
| StMPXCANLogCB | Log information for callbacks |
| StMPXCANLog | Log information for API mode |
| StMPXCANFrameOption | CAN/CAN FD frame option |
| StMPXCANFrameType | CAN/CAN FD frame attributes |
| StMPXCANID | CAN ID information |
| StMPXCANFrame | CAN/CAN FD frame information |
| StMPXCANSlot | Slot information |
| StMPXCANDirect | Direct transmission information |
| StMPXCANReplayLog | Log replay transmission information |
Structure Details
StMPXAPIVersion
Members of the StMPXAPIVersion structure (API version information) are listed below.
| Member | Type | Description |
|---|---|---|
APIVersion | int8_t [32] | API version number |
StMPXCoreVersion
Members of the StMPXCoreVersion structure (MicroPeckerX version information) are listed below.
| Member | Type | Description |
|---|---|---|
BootVersion | int8_t [16] | Boot version number |
APPVersion | int8_t [32] | APP version number |
FPGAVersion | int8_t [32] | FPGA-IP version number |
StMPXDeviceInfo
Members of the StMPXDeviceInfo structure (MicroPeckerX device information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
Serial | uint32_t | Serial number | Matches the serial number printed on the label attached to the MicroPeckerX unit. |
Model | int8_t [64] | Product model (example: S810-MX-FD2) |
StMPXCANParam
Members of the StMPXCANParam structure (parameter settings) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
EnableTerminate | uint8_t | Termination resistor setting | See Termination Resistor for possible values. |
Mode | uint8_t | Operation mode | See Operation Modes for possible values. |
ArbitrationBaudrate | uint8_t | Arbitration baud rate | See Arbitration Baud Rates for possible values. |
ArbitrationSamplepoint | uint8_t | Arbitration sample point | See Sample Points for possible values. |
DataBaudrate | uint8_t | Data baud rate | See Data Baud Rates for possible values. |
DataSamplepoint | uint8_t | Data sample point | See Sample Points for possible values. |
Reserved | uint8_t [2] | Reserved |
StMPXCANLogCB
Members of the StMPXCANLogCB structure (log information for callbacks) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
mSec | uint32_t | Timestamp (milliseconds) | Combine mSec and uSec to represent the timestamp.For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345. |
uSec | uint16_t | Timestamp (microseconds) | |
LogType | uint8_t | Log type | This is a bitfield structure. See LogType for details. |
DL | uint8_t | Data length | This is a bitfield structure. See DL for details. |
CAN | uint32_t | CAN information | This is a union of ID information and error information. When used as error information, it is a uint32_t value (see Error Information).When used as ID information, it is a bitfield structure (see ID). |
Data | uint8_t [64] | Data (D1 to D64) | Array elements 0–63 correspond to data bytes D1–D64. |
StMPXCANLog
Members of the StMPXCANLog structure (log information for API mode) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
mSec | uint32_t | Timestamp (milliseconds) | Combine mSec and uSec to represent the timestamp.For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345. |
uSec | uint16_t | Timestamp (microseconds) | |
Protocol | uint8_t | Protocol | See Log Types for the meaning of the values. |
Dir | uint8_t | Direction | See Log Direction for the meaning of the values. |
ID | uint32_t | CAN ID (standard or extended) | For a standard ID, set bits 0–10 (the lower 11 bits). |
RTR | uint8_t | Remote transmission request (RTR) | See Remote Transmission Request for the meaning of the values. |
IDE | uint8_t | ID format (IDE) | See ID Format for the meaning of the values. |
DL | uint8_t | Data length (DL) | |
Error | uint8_t | Error flag | See Error Flag for the meaning of the values. |
ErrorInfo | uint32_t | Error information | See Error Information for the meaning of the values. |
Data | uint8_t [64] | Data (D1 to D64) | Array elements 0–63 correspond to data bytes D1–D64. |
StMPXCANFrameOption
Members of the StMPXCANFrameOption structure (CAN/CAN FD frame option information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
Protocol | uint8_t | Protocol | See Protocols for possible values. |
BRS | uint8_t | Bit rate switch (BRS) | See Bit Rate Switch for possible values. |
ErrorAction | uint8_t | Error behavior | See Error Behavior for possible values. |
Reserved | uint8_t | Reserved |
StMPXCANFrameType
Members of the StMPXCANFrameType structure (CAN/CAN FD frame attributes) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
isOneShot | uint8_t | One-shot transmission enablement | See One-Shot Transmission for possible values. |
FrameType | uint8_t | Frame type | See Frame Types for possible values. |
Enabled | uint8_t | Slot enablement | See Slot Enablement for possible values. |
isLastData | uint8_t | Final frame flag | Effective only when the operation mode is log replay mode or burst transfer mode (log replay). See Final Frame Flag for possible values. |
Option | StMPXCANFrameOption | CAN/CAN FD frame option information |
StMPXCANID
Members of the StMPXCANID structure (CAN ID information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
ID | uint32_t | CAN ID (standard or extended) | For a standard ID, set bits 0–10 (the lower 11 bits). |
RTR | uint8_t | Remote transmission request (RTR) | See Remote Transmission Request for possible values. |
IDE | uint8_t | ID format (IDE) | See ID Format for possible values. |
Reserved | uint8_t [2] | Reserved |
StMPXCANFrame
Members of the StMPXCANFrame structure (CAN/CAN FD frame information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
ID | StMPXCANID | CAN ID information | |
DL | uint8_t | Data length (DL) | |
Reserved | uint8_t [3] | Reserved | |
Data | uint8_t [64] | Data (D1 to D64) | Array elements 0–63 correspond to data bytes D1–D64. |
StMPXCANSlot
Members of the StMPXCANSlot structure (slot information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
SlotNo | uint8_t | Slot number (1–28) | |
TriggerType | uint8_t | Transmission trigger type | See Trigger Types for possible values. |
Reserved1 | uint8_t [2] | Reserved | |
FrameType | StMPXCANFrameType | Frame attribute information | |
TriggerID | StMPXCANID | Receive trigger ID | |
msSendDelay | uint32_t | Delay time for event transmissions (milliseconds) | The delay time, offset, period, and minimum guaranteed interval are each represented by a combination of the following members. Delay time: msSendDelay, usSendDelayOffset: msSendOffset, usSendOffsetPeriod: msSendCycle, usSendCycleMinimum interval: msMinTransInterval, usMinTransIntervalFor example, to set a transmission offset of 12.345 ms (12 ms and 345 μs), set msSendOffset to 12 and usSendOffset to 345. |
msSendOffset | uint32_t | Transmission offset (milliseconds) | |
msSendCycle | uint32_t | Transmission period (milliseconds) | |
msMinTransInterval | uint32_t | Minimum guaranteed interval (milliseconds) | |
usSendDelay | uint16_t | Delay time for event transmissions (microseconds) | |
usSendOffset | uint16_t | Transmission offset (microseconds) | |
usSendCycle | uint16_t | Transmission period (microseconds) | |
usMinTransInterval | uint16_t | Minimum guaranteed interval (microseconds) | |
SendCounter | uint16_t | Number of transmissions | Setting 0 allows unlimited transmissions. |
Reserved2 | uint8_t [2] | Reserved | |
Frame | StMPXCANFrame | Frame information for transmission | |
Increment | uint8_t [64] | Increment setting | Array elements 0–63 correspond to data bytes D1–D64. See Increment Setting for possible values. |
StMPXCANDirect
Members of the StMPXCANDirect structure (direct transmission information) are listed below.
| Member | Type | Description |
|---|---|---|
FrameType | StMPXCANFrameType | Frame attribute information |
Frame | StMPXCANFrame | Frame information for transmission |
StMPXCANReplayLog
Members of the StMPXCANReplayLog structure (log replay transmission information) are listed below.
| Member | Type | Description | Notes |
|---|---|---|---|
mSec | uint32_t | Timestamp (milliseconds) | Combine mSec and uSec to represent the timestamp.For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345. |
uSec | uint16_t | Timestamp (microseconds) | |
ID | uint32_t | ID information | This is a bitfield structure. See ID for details. |
DL | uint8_t | Data length (DL) | This is a bitfield structure. See DL for details. |
FrameType | uint8_t | Frame attribute information | This is a bitfield structure. See FrameType for details. |
Data | uint8_t [64] | Data (D1 to D64) | Array elements 0–63 correspond to data bytes D1–D64. |
Additional Information
Bitfield Structures
LogType
LogType is a bitfield structure of type uint8_t.
Its members are listed below.
| Member | Bits | Description | Notes |
|---|---|---|---|
Type | 6 | Log type | See Log Types for the meaning of the values. |
Dir | 1 | Direction | See Log Direction for the meaning of the values. |
Error | 1 | Error flag | See Error Flag for the meaning of the values. |
DL
DL is a bitfield structure of type uint8_t.
Its members are listed below.
| Member | Bits | Description | Notes |
|---|---|---|---|
NotUsed | 4 | Not used | |
DLC | 4 | Data length code (DLC) | For the relationship between data length codes and data lengths, see Data Length Codes and Data Lengths. |
ID
ID is a bitfield structure of type uint32_t.
Its members are listed below.
| Member | Bits | Description | Notes |
|---|---|---|---|
ID | 29 | CAN ID (standard or extended) | For a standard ID, set bits 0–10 (the lower 11 bits). |
Reserved | 1 | Reserved | |
RTR | 1 | Remote transmission request (RTR) | See Remote Transmission Request for the meaning of the values. |
IDE | 1 | ID format (IDE) | See ID Format for the meaning of the values. |
FrameType
FrameType is a bitfield structure of type uint8_t.
Its members are listed below.
| Member | Bits | Description | Notes |
|---|---|---|---|
ErrorPassive | 1 | Error behavior | See Error Behavior for possible values. |
BRS | 1 | Bit rate switch (BRS) | See Bit Rate Switch for possible values. |
FDF | 1 | FD format (FDF) | See FD Format for possible values. |
Terminator | 1 | Final frame flag | See Final Frame Flag for possible values. |
Reserved | 4 | Not used (reserved) |
Data Length Codes and Data Lengths
The relationship between data length codes (DLC) and data lengths (DL) is shown below.
| Data length code | Data length |
|---|---|
| 0 (0x0) | 0 |
| 1 (0x1) | 1 |
| 2 (0x2) | 2 |
| 3 (0x3) | 3 |
| 4 (0x4) | 4 |
| 5 (0x5) | 5 |
| 6 (0x6) | 6 |
| 7 (0x7) | 7 |
| 8 (0x8) | 8 |
| 9 (0x9) | 12 |
| 10 (0xA) | 16 |
| 11 (0xB) | 20 |
| 12 (0xC) | 24 |
| 13 (0xD) | 32 |
| 14 (0xE) | 48 |
| 15 (0xF) | 64 |