API Details (LIN)
This page describes details of LIN-specific APIs available in this product.
Read This First
- If you need task-based API mapping: LIN API Mapping
- If you need common API prerequisites first: Common API by Task
- If you need LIN constants: Constant Definitions (LIN)
- If you need LIN structures: Structure Definitions (LIN)
API Quick Reference (Constants / Structures / Preconditions / Minimal Examples)
Notation
On this page, each API is described in the following format.
| Format | [Function type] [Function name]([argument], ...) | |||
|---|---|---|---|---|
| Argument | [Argument type] | [Argument name] | [in/out] | [Argument description] |
| Return value | [Return type] | [Return value (error code)] | [Description of return value (error code)] | |
| Function | [Function behavior] | |||
| Note | [Supplementary information] | |||
If an argument type is a structure, refer to Structure Definitions (struct) (LIN) and Structure Definitions (struct) (common).
For [in/out], in means set by caller before invocation, and out means set by the function during processing.
API Details
MPXLINSetParam
Sets LIN communication parameters.
| Format | ER MPXLINSetParam(uint32_t Serial, StMPXLINParam * Param) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| StMPXLINParam * | Param | in | Pointer to parameter setting structure | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets LIN communication parameters for CH1 of the MicroPeckerX device specified by Serial using values in Param. | |||
| Note | Calling this API changes MicroPeckerX status to MPX_STATUS_PARAM (waiting for parameter configuration). | |||
MPXLINGetLogEx
Gets monitoring log data (TX/RX data) into caller-provided LIN log structure array.
| Format | ER MPXLINGetLogEx(uint32_t Serial, StMPXLINLog * Log, uint16_t Num, uint16_t * Count, uint8_t * BufferOver) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| StMPXLINLog * | Log | in/out | Log structure array | |
| uint16_t | Num | in | Number of elements in log structure array | |
| uint16_t * | Count | out | Number of acquired logs | |
| uint8_t * | BufferOver | out | Buffer overrun (see Buffer Overrun Presence) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| Function | Gets LIN logs from CH1 of the MicroPeckerX device specified by Serial.Set Log to the destination structure array and set Num to the number of elements in that array.The number of acquired log entries is set to Count.If Count exceeds Num, buffer overrun occurs and BufferOver is set to MPX_LOG_BUFOVER_TRUE. | |||
| Note | Caller must prepare destination structure array. | |||
MPXLINSetStatus
Sets LIN status.
| Format | ER MPXLINSetStatus(uint32_t Serial, uint8_t Status) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | Status | in | LIN status (see LIN Status) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets LIN status for CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | This API is valid only when LIN operation mode is set to master simulation mode. | |||
MPXLINSetMasterSim
Sets LIN master simulation settings per schedule.
| Format | ER MPXLINSetMasterSim(uint32_t Serial, uint8_t SchNo, StMPXLINMasterSim * MasterSim, uint8_t Num) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | SchNo | in | Schedule number (0 to 31) | |
| StMPXLINMasterSim * | MasterSim | in | Pointer to LIN master simulation list structure | |
| uint8_t | Num | in | Number of elements in LIN master simulation structure array | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets LIN master simulation for schedule SchNo on CH1 of the MicroPeckerX device specified by Serial.Set Num to element count of LIN master simulation structure array included in simulation list structure. | |||
| Note | Valid only when LIN mode is set to master simulation mode. | |||
MPXLINSetMasterItem
Changes enable/disable of LIN master simulation setting per item.
| Format | ER MPXLINSetMasterItem(uint32_t Serial, uint8_t SchNo, uint8_t ItemNo, uint8_t Ena) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | SchNo | in | Schedule number (0 to 31) | |
| uint8_t | ItemNo | in | Item number (0 to 63) | |
| uint8_t | Ena | in | Item enable/disable (see LIN Simulation Enable/Disable) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets enable/disable for item ItemNo in schedule SchNo on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is master simulation mode. This API changes only enable/disable by item. To change other settings, call MPXLINChangeMasterItem. | |||
MPXLINChangeMasterItem
Changes settings of specified LIN master simulation item.
| Format | ER MPXLINChangeMasterItem(uint32_t Serial, uint8_t SchNo, uint8_t ItemNo, StMPXLINMasterSimItem * MasterSimItem) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | SchNo | in | Schedule number (0 to 31) | |
| uint8_t | ItemNo | in | Item number (0 to 63) | |
| StMPXLINMasterSimItem * | MasterSimItem | in | Pointer to LIN master simulation item structure | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Changes settings of item ItemNo in schedule SchNo on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is master simulation mode. | |||
MPXLINSetMasterSchedule
Changes enable/disable and one-time transmission setting per LIN master schedule.
| Format | ER MPXLINSetMasterSchedule(uint32_t Serial, uint8_t SchNo, uint8_t Ena, uint8_t OneTime) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | SchNo | in | Schedule number (0 to 31) | |
| uint8_t | Ena | in | Schedule enable/disable (see LIN Simulation Enable/Disable) | |
| uint8_t | OneTime | in | One-time transmission enable/disable (see LIN Simulation Enable/Disable) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Changes enable/disable and one-time transmission settings of schedule SchNo on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is master simulation mode. | |||
MPXLINChangeMasterSchedule
Changes currently executed schedule in LIN master simulation.
| Format | ER MPXLINChangeMasterSchedule(uint32_t Serial, uint8_t SchNo) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | SchNo | in | Schedule number (0 to 31) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Changes active schedule to schedule number SchNo on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is master simulation mode. | |||
MPXLINPauseMasterSchedule
Pauses or resumes currently running schedule in LIN master simulation.
| Format | ER MPXLINPauseMasterSchedule(uint32_t Serial, uint8_t Ena) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | Ena | in | Schedule pause enable/disable (see LIN Simulation Enable/Disable) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Changes pause/resume state of current schedule on CH1 of the MicroPeckerX device specified by Serial.If Ena is MPX_LIN_SIM_ENA, running schedule is paused. If Ena is MPX_LIN_SIM_DIS, schedule execution resumes. | |||
| Note | Valid only when LIN mode is master simulation mode. | |||
MPXLINMasterInterrupt
Performs interrupt transmission in LIN master simulation.
| Format | ER MPXLINMasterInterrupt(uint32_t Serial, StMPXLINMasterSimItem * MasterSimItem) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| StMPXLINMasterSimItem * | MasterSimItem | in | Pointer to LIN master simulation item structure | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Performs master simulation interrupt transmission on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is master simulation mode. | |||
MPXLINSetSlaveSim
Sets LIN slave simulation settings for all items.
| Format | ER MPXLINSetSlaveSim(uint32_t Serial, StMPXLINSlaveSim * SlaveSim) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| StMPXLINSlaveSim * | SlaveSim | in | Pointer to LIN master simulation list structure | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets LIN slave simulation settings for all items on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is slave simulation mode. | |||
MPXLINSetSlaveItem
Changes enable/disable of LIN slave simulation setting per item.
| Format | ER MPXLINSetSlaveItem(uint32_t Serial, uint8_t ResponseID, uint8_t Ena) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | ResponseID | in | Target LIN ID | |
| uint8_t | Ena | in | Item enable/disable (see LIN Simulation Enable/Disable) | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Sets enable/disable for item of LIN ID specified by ResponseID on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is slave simulation mode. This API changes only enable/disable by item. To change other settings, call MPXLINChangeSlaveItem. | |||
MPXLINChangeSlaveItem
Changes settings of specified LIN slave simulation item.
| Format | ER MPXLINChangeSlaveItem(uint32_t Serial, uint8_t ResponseID, StMPXLINSlaveSimItem * SlaveSimItem) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| uint8_t | ResponseID | in | Target LIN ID | |
| StMPXLINSlaveSimItem * | SlaveSimItem | in | Pointer to LIN slave simulation item structure | |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Changes settings of item for LIN ID specified by ResponseID on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is slave simulation mode. | |||
MPXLINSlaveWakeup
Performs wakeup transmission in LIN slave simulation.
| Format | ER MPXLINSlaveWakeup(uint32_t Serial) | |||
|---|---|---|---|---|
| Argument | uint32_t | Serial | in | Serial number of target MicroPeckerX device |
| Return value | ER | E_OK | Success | |
| E_PARAM | Parameter error | |||
| E_DEVICE | Device not found | |||
| E_COMM | Communication error | |||
| E_STATUS | Status error | |||
| E_TIMEOUT | Communication timeout | |||
| Function | Performs slave simulation wakeup transmission on CH1 of the MicroPeckerX device specified by Serial. | |||
| Note | Valid only when LIN mode is slave simulation mode. | |||