File syn_xcp.h¶
Go to the source code of this file
ASAM Universal Measurement and Calibration Protocol v1.x (XCP) Slave. More...
#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_XCP_DAQList DAQ List structure. |
| struct | SYN_XCP_ODT ODT (Object Descriptor Table) structure. |
| struct | SYN_XCP_ODTEntry ODT Element mapping entry. |
| struct | SYN_XCP_Slave XCP Slave instance context. |
Public Functions¶
| Type | Name |
|---|---|
| bool | syn_xcp_init (SYN_XCP_Slave * slave, uint16_t station_id) Initialize XCP slave instance context. |
| bool | syn_xcp_process_cto (SYN_XCP_Slave * slave, const uint8_t cto, uint8_t dto_out) Process incoming XCP CTO command packet and prepare response. |
| bool | syn_xcp_service_daq (SYN_XCP_Slave * slave, uint8_t event_channel, uint8_t dto_out, uint8_t * list_idx, uint8_t * odt_idx) Service periodic XCP DAQ sampling event channel tick. |
| bool | syn_xcp_set_mta (SYN_XCP_Slave * slave, uint8_t ext, uintptr_t addr) Set XCP Memory Transfer Address (MTA). |
Macros¶
Detailed Description¶
Provides a zero-allocation, lightweight XCP v1.x slave protocol stack for ECU calibration, live parameter measurement, memory upload/download, and DAQ (Data Acquisition) list streaming over CAN.
Public Functions Documentation¶
function syn_xcp_init¶
Initialize XCP slave instance context.
Parameters:
slavePointer to XCP slave structure.station_idXCP slave node/station ID.
Returns:
true on success, false if slave is NULL.
function syn_xcp_process_cto¶
Process incoming XCP CTO command packet and prepare response.
Parameters:
slavePointer to XCP slave structure.cto8-byte input CTO CAN frame buffer.dto_out8-byte output response DTO/CRM frame buffer.
Returns:
true if response frame populated, false on invalid parameters.
function syn_xcp_service_daq¶
Service periodic XCP DAQ sampling event channel tick.
bool syn_xcp_service_daq (
SYN_XCP_Slave * slave,
uint8_t event_channel,
uint8_t dto_out,
uint8_t * list_idx,
uint8_t * odt_idx
)
Parameters:
slavePointer to XCP slave structure.event_channelEvent channel index triggered.dto_out8-byte output CAN telemetry buffer.list_idxIn/Out pointer to DAQ list state iterator.odt_idxIn/Out pointer to ODT state iterator.
Returns:
true if a DAQ DTO packet was generated, false if no packet pending.
function syn_xcp_set_mta¶
Set XCP Memory Transfer Address (MTA).
Parameters:
slavePointer to XCP slave structure.extAddress extension byte.addr32-bit/64-bit target memory pointer.
Returns:
true on success, false if slave is NULL.
Macro Definition Documentation¶
define SYN_XCP_CMD_CONNECT¶
Connect command
define SYN_XCP_CMD_DISCONNECT¶
Disconnect command
define SYN_XCP_CMD_DOWNLOAD¶
Download memory block
define SYN_XCP_CMD_DOWNLOAD_MAX¶
Fast max download
define SYN_XCP_CMD_GET_COMM_MODE_INFO¶
Get comm mode info
define SYN_XCP_CMD_GET_ID¶
Get station ID
define SYN_XCP_CMD_GET_SEED¶
Get seed for unlock
define SYN_XCP_CMD_GET_STATUS¶
Get status command
define SYN_XCP_CMD_SET_DAQ_LIST_MODE¶
Set DAQ list mode
define SYN_XCP_CMD_SET_DAQ_PTR¶
Set DAQ pointer
define SYN_XCP_CMD_SET_MTA¶
Set memory transfer address
define SYN_XCP_CMD_SET_REQUEST¶
Set request
define SYN_XCP_CMD_SHORT_UPLOAD¶
Short upload
define SYN_XCP_CMD_START_STOP_DAQ_LIST¶
Start/stop single DAQ list
define SYN_XCP_CMD_START_STOP_SYNCH¶
Start/stop synchronous DAQ
define SYN_XCP_CMD_SYNCH¶
Synchronize command
define SYN_XCP_CMD_UNLOCK¶
Unlock resource with key
define SYN_XCP_CMD_UPLOAD¶
Upload memory block
define SYN_XCP_CMD_WRITE_DAQ¶
Write DAQ entry
define SYN_XCP_ERR_ACCESS_DENIED¶
Access denied
define SYN_XCP_ERR_CMD_SYNTAX¶
Command syntax error
define SYN_XCP_ERR_CMD_UNKNOWN¶
Command unknown
define SYN_XCP_ERR_NOT_CONNECTED¶
Station not connected
define SYN_XCP_ERR_OUT_OF_RANGE¶
Parameter out of range
define SYN_XCP_ERR_SUCCESS¶
Action succeeded
define SYN_XCP_ERR_WRITE_PROTECTED¶
Memory write protected
define SYN_XCP_MAX_DAQ_LISTS¶
Maximum DAQ list count
define SYN_XCP_MAX_ENTRIES_PER_ODT¶
Maximum entries per ODT
define SYN_XCP_MAX_ODT_PER_DAQ¶
Maximum ODTs per DAQ list
define SYN_XCP_PID_ERR¶
Error packet
define SYN_XCP_PID_EV¶
Event packet
define SYN_XCP_PID_RES¶
Response packet
define SYN_XCP_PID_SERV¶
Service packet
define SYN_XCP_RESOURCE_CAL_PAG¶
Calibration/paging resource mask
define SYN_XCP_RESOURCE_DAQ¶
Data acquisition resource mask
define SYN_XCP_RESOURCE_PGM¶
Flash programming resource mask
define SYN_XCP_RESOURCE_STIM¶
Data stimulation resource mask
The documentation for this class was generated from the following file src/syntropic/proto/syn_xcp.h