Structure Definitions (struct)
This section describes the structure definitions of this product.
Definition List
| Structure Type Name | Description |
|---|---|
| StMPXAPIVersion | API version information |
| StMPXCoreVersion | MicroPeckerX version information |
| StMPXDeviceInfo | MicroPeckerX device information |
| StMPXCANParam | Parameter configuration information |
| StMPXCANLogCB | Callback log information |
| StMPXCANLog | Log information for log acquisition APIs |
| StMPXCANFrameOption | CAN/CAN FD frame option information |
| StMPXCANFrameType | CAN/CAN FD frame attribute information |
| StMPXCANID | CAN ID information |
| StMPXCANFrame | CAN/CAN FD frame information |
| StMPXCANSlot | Slot information |
| StMPXCANDirect | Direct transmission information |
| StMPXCANReplayLog | Log replay transmission information |
Definition Details
StMPXAPIVersion
Members of the StMPXAPIVersion structure (API version information) are as follows.
| Variable Name | Type Name | Description |
|---|---|---|
| APIVersion | int8_t [32] | API version number |
StMPXCoreVersion
Members of the StMPXCoreVersion structure (MicroPeckerX version information) are as follows.
| Variable Name | Type Name | 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 as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| Serial | uint32_t | Serial number | Same as the serial number shown on the serial label attached to MicroPeckerX. |
| Model | int8_t [64] | Product model name (example: S810-MX-FD2) |
StMPXCANParam
Members of the StMPXCANParam structure (parameter configuration information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| EnableTerminate | uint8_t | Termination resistor enable/disable | For setting values, see Termination resistor. |
| Mode | uint8_t | Operation mode | For setting values, see Operation modes. |
| ArbitrationBaudrate | uint8_t | Arbitration baud rate | For setting values, see Arbitration baud rates. |
| ArbitrationSamplepoint | uint8_t | Arbitration sample point | For setting values, see Sample points. |
| DataBaudrate | uint8_t | Data baud rate | For setting values, see Data baud rates. |
| DataSamplepoint | uint8_t | Data sample point | For setting values, see Sample points. |
| Reserved | uint8_t [2] | Reserved area |
StMPXCANLogCB
Members of the StMPXCANLogCB structure (callback log information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | uint32_t | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | uint16_t | Timestamp (microseconds) | |
| LogType | uint8_t | Log type | Bit-field structure (see LogType). |
| DL | uint8_t | Data length | Bit-field structure (see DL). |
| CAN | uint32_t | CAN information | Union of ID (ID information) and ErrorInfo (error information).When handled as ErrorInfo, it is uint32_t (see Error information).When handled as ID, it is a bit-field structure (see ID). |
| Data | uint8_t [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANLog
Members of the StMPXCANLog structure (log information for log acquisition APIs) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | uint32_t | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | uint16_t | Timestamp (microseconds) | |
| Protocol | uint8_t | Protocol | For value meanings, see Log types. |
| Dir | uint8_t | Direction | For value meanings, see Log direction. |
| ID | uint32_t | CAN ID (standard ID or extended ID) | For a standard ID, use the lower 11 bits (bit 10 to bit 0). |
| RTR | uint8_t | Remote transmission request (RTR) | For value meanings, see Remote transmission request. |
| IDE | uint8_t | ID format (IDE) | For value meanings, see ID format. |
| DL | uint8_t | Data length (DL) | |
| Error | uint8_t | Error flag | For value meanings, see Error flag. |
| ErrorInfo | uint32_t | Error information | For value meanings, see Error information. |
| Data | uint8_t [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANFrameOption
Members of the StMPXCANFrameOption structure (CAN/CAN FD frame option information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| Protocol | uint8_t | Protocol | For setting values, see Protocols. |
| BRS | uint8_t | Bit rate switch (BRS) | For setting values, see Bit rate switch. |
| ErrorAction | uint8_t | Error behavior | For setting values, see Error behavior. |
| Reserved | uint8_t | Reserved area |
StMPXCANFrameType
Members of the StMPXCANFrameType structure (CAN/CAN FD frame attribute information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| isOneShot | uint8_t | One-shot transmission enable/disable | For setting values, see One-shot transmission. |
| FrameType | uint8_t | Frame type | For setting values, see Frame types. |
| Enabled | uint8_t | Slot enable/disable | For setting values, see Slot enablement. |
| isLastData | uint8_t | Final frame determination | Valid only when operation mode is log replay mode or burst transfer mode (log replay). For setting values, see Final frame flag. |
| Option | StMPXCANFrameOption | CAN/CAN FD frame option information |
StMPXCANID
Members of the StMPXCANID structure (CAN ID information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| ID | uint32_t | CAN ID (standard ID or extended ID) | For a standard ID, set the lower 11 bits (bit 10 to bit 0). |
| RTR | uint8_t | Remote transmission request (RTR) | For setting values, see Remote transmission request. |
| IDE | uint8_t | ID format (IDE) | For setting values, see ID format. |
| Reserved | uint8_t [2] | Reserved area |
StMPXCANFrame
Members of the StMPXCANFrame structure (CAN/CAN FD frame information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| ID | StMPXCANID | CAN ID information | |
| DL | uint8_t | Data length (DL) | |
| Reserved | uint8_t [3] | Reserved area | |
| Data | uint8_t [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANSlot
Members of the StMPXCANSlot structure (slot information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| SlotNo | uint8_t | Slot number (1 to 28) | |
| TriggerType | uint8_t | Transmission trigger type | For setting values, see Trigger types. |
| Reserved1 | uint8_t [2] | Reserved area | |
| FrameType | StMPXCANFrameType | Frame attribute information | |
| TriggerID | StMPXCANID | Reception trigger ID | |
| msSendDelay | uint32_t | Delay time for event transmission (milliseconds) | Delay time for event transmission, transmission offset, transmission cycle, and minimum guaranteed transmission interval are represented by combining each pair below. [Delay time for event transmission] msSendDelay, usSendDelay[Transmission offset] msSendOffset, usSendOffset[Transmission cycle] msSendCycle, usSendCycle[Minimum guaranteed transmission interval] usMinTransInterval, usMinTransIntervalFor example, to set 12.345 ms (12 ms and 345 us) for transmission offset, set msSendOffset = 12 and usSendOffset = 345. |
| msSendOffset | uint32_t | Transmission offset (milliseconds) | |
| msSendCycle | uint32_t | Transmission cycle (milliseconds) | |
| msMinTransInterval | uint32_t | Minimum guaranteed transmission interval (milliseconds) | |
| usSendDelay | uint16_t | Delay time for event transmission (microseconds) | |
| usSendOffset | uint16_t | Transmission offset (microseconds) | |
| usSendCycle | uint16_t | Transmission cycle (microseconds) | |
| usMinTransInterval | uint16_t | Minimum guaranteed transmission interval (microseconds) | |
| SendCounter | uint16_t | Transmission count | If set to 0, transmissions are unlimited. |
| Reserved2 | uint8_t [2] | Reserved area | |
| Frame | StMPXCANFrame | Transmission frame information | |
| Increment | uint8_t [64] | Increment enabled/disabled | Array indexes 0 to 63 correspond to data bytes D1 to D64.For setting values, see Increment enablement. |
StMPXCANDirect
Members of the StMPXCANDirect structure (direct transmission information) are as follows.
| Variable Name | Type Name | Description |
|---|---|---|
| FrameType | StMPXCANFrameType | Frame attribute information |
| Frame | StMPXCANFrame | Transmission frame information |
StMPXCANReplayLog
Members of the StMPXCANReplayLog structure (log replay transmission information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | uint32_t | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | uint16_t | Timestamp (microseconds) | |
| ID | uint32_t | ID information | Bit-field structure (see ID). |
| DL | uint8_t | Data length (DL) | Bit-field structure (see DL). |
| FrameType | uint8_t | Frame attribute information | Bit-field structure (see FrameType). |
| Data | uint8_t [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
Supplementary Information
Bit-field Structures
LogType
LogType is a bit-field structure of type uint8_t.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| Type | 6 | Log type | For value meanings, see Log types. |
| Dir | 1 | Direction | For value meanings, see Log direction. |
| Error | 1 | Error flag | For value meanings, see Error flag. |
DL
DL is a bit-field structure of type uint8_t.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| NotUsed | 4 | Not used | |
| DLC | 4 | Data length code (DLC) | For the relation between DLC and data length, see Data Length Code and Data Length. |
ID
ID is a bit-field structure of type uint32_t.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| ID | 29 | CAN ID (standard ID or extended ID) | For a standard ID, use the lower 11 bits (bit 10 to bit 0). |
| Reserved | 1 | Reserved area | |
| RTR | 1 | Remote transmission request (RTR) | For value meanings, see Remote transmission request. |
| IDE | 1 | ID format (IDE) | For value meanings, see ID format. |
FrameType
FrameType is a bit-field structure of type uint8_t.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| ErrorPassive | 1 | Error behavior | For setting values, see Error behavior. |
| BRS | 1 | Bit rate switch (BRS) | For setting values, see Bit rate switch. |
| FDF | 1 | FD format (FDF) | For setting values, see FD format. |
| Terminator | 1 | Final frame determination | For setting values, see Final frame flag. |
| Reserved | 4 | Not used (reserved area) |
Data Length Code and Data Length
The relation between data length code (DLC) and data length (DL) is as follows.
| 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 |