Skip to content

File syn_xcp.c

FileList > proto > syn_xcp.c

Go to the source code of this file

ASAM Universal Measurement and Calibration Protocol v1.x (XCP) Slave Implementation.

  • #include "syn_xcp.h"
  • #include "../util/syn_pack.h"
  • #include <string.h>

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).

Public Functions Documentation

function syn_xcp_init

Initialize XCP slave instance context.

bool syn_xcp_init (
    SYN_XCP_Slave * slave,
    uint16_t station_id
) 

Parameters:

  • slave Pointer to XCP slave structure.
  • station_id XCP 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.

bool syn_xcp_process_cto (
    SYN_XCP_Slave * slave,
    const uint8_t cto,
    uint8_t dto_out
) 

Parameters:

  • slave Pointer to XCP slave structure.
  • cto 8-byte input CTO CAN frame buffer.
  • dto_out 8-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:

  • slave Pointer to XCP slave structure.
  • event_channel Event channel index triggered.
  • dto_out 8-byte output CAN telemetry buffer.
  • list_idx In/Out pointer to DAQ list state iterator.
  • odt_idx In/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).

bool syn_xcp_set_mta (
    SYN_XCP_Slave * slave,
    uint8_t ext,
    uintptr_t addr
) 

Parameters:

  • slave Pointer to XCP slave structure.
  • ext Address extension byte.
  • addr 32-bit/64-bit target memory pointer.

Returns:

true on success, false if slave is NULL.



The documentation for this class was generated from the following file src/syntropic/proto/syn_xcp.c