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(unsigned long Serial, StMPXLINParam * Param) | |||
|---|---|---|---|---|
| Argument | unsigned long | 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(unsigned long Serial, StMPXLINLog * Log, unsigned short Num, unsigned short * Count, unsigned char * BufferOver) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| StMPXLINLog * | Log | in/out | Log structure array | |
| unsigned short | Num | in | Number of elements in log structure array | |
| unsigned short * | Count | out | Number of acquired logs | |
| unsigned char * | 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 | This API is valid only in log acquisition API mode. Caller must prepare destination structure array. | |||
MPXLINSetStatus
Sets LIN status.
| Format | ER MPXLINSetStatus(unsigned long Serial, unsigned char Status) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | 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(unsigned long Serial, unsigned char SchNo, StMPXLINMasterSim * MasterSim, unsigned char Num) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | SchNo | in | Schedule number (0 to 31) | |
| StMPXLINMasterSim * | MasterSim | in | Pointer to LIN master simulation list structure | |
| unsigned char | 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(unsigned long Serial, unsigned char SchNo, unsigned char ItemNo, unsigned char Ena) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | SchNo | in | Schedule number (0 to 31) | |
| unsigned char | ItemNo | in | Item number (0 to 63) | |
| unsigned char | 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(unsigned long Serial, unsigned char SchNo, unsigned char ItemNo, StMPXLINMasterSimItem * MasterSimItem) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | SchNo | in | Schedule number (0 to 31) | |
| unsigned char | 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(unsigned long Serial, unsigned char SchNo, unsigned char Ena, unsigned char OneTime) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | SchNo | in | Schedule number (0 to 31) | |
| unsigned char | Ena | in | Schedule enable/disable (see LIN Simulation Enable/Disable) | |
| unsigned char | 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(unsigned long Serial, unsigned char SchNo) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | 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(unsigned long Serial, unsigned char Ena) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | 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(unsigned long Serial, StMPXLINMasterSimItem * MasterSimItem) | |||
|---|---|---|---|---|
| Argument | unsigned long | 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(unsigned long Serial, StMPXLINSlaveSim * SlaveSim) | |||
|---|---|---|---|---|
| Argument | unsigned long | 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(unsigned long Serial, unsigned char ResponseID, unsigned char Ena) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | ResponseID | in | Target LIN ID | |
| unsigned char | 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(unsigned long Serial, unsigned char ResponseID, StMPXLINSlaveSimItem * SlaveSimItem) | |||
|---|---|---|---|---|
| Argument | unsigned long | Serial | in | Serial number of target MicroPeckerX device |
| unsigned char | 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(unsigned long Serial) | |||
|---|---|---|---|---|
| Argument | unsigned long | 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. | |||