Skip to content

File syn_ccp.c

FileList > proto > syn_ccp.c

Go to the source code of this file

ASAM CAN Calibration Protocol v2.1 (CCP) Slave Implementation.

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

Public Functions

Type Name
void syn_ccp_init (SYN_CCP_Slave * slave, uint16_t station_addr)
Initialize CCP slave instance.
bool syn_ccp_process_cro (SYN_CCP_Slave * slave, const uint8_t cro, uint8_t dto_out)
Process incoming Command Receive Object (CRO) frame.
bool syn_ccp_service_daq (SYN_CCP_Slave * slave, uint8_t event_channel, uint8_t dto_out, uint8_t * list_idx, uint8_t * odt_idx)
Service periodic DAQ sampling tick.
void syn_ccp_set_mta (SYN_CCP_Slave * slave, uint8_t mta_num, uint8_t ext, uintptr_t addr)
Set Memory Transfer Address (MTA0 or MTA1).

Public Functions Documentation

function syn_ccp_init

Initialize CCP slave instance.

void syn_ccp_init (
    SYN_CCP_Slave * slave,
    uint16_t station_addr
) 

Parameters:

  • slave Pointer to CCP slave handle.
  • station_addr 16-bit CCP station address.

function syn_ccp_process_cro

Process incoming Command Receive Object (CRO) frame.

bool syn_ccp_process_cro (
    SYN_CCP_Slave * slave,
    const uint8_t cro,
    uint8_t dto_out
) 

Parameters:

  • slave Pointer to CCP slave handle.
  • cro 8-byte CRO input CAN payload.
  • dto_out 8-byte buffer to receive Command Return Message (DTO/CRM).

Returns:

True if DTO response frame is ready to transmit.


function syn_ccp_service_daq

Service periodic DAQ sampling tick.

bool syn_ccp_service_daq (
    SYN_CCP_Slave * slave,
    uint8_t event_channel,
    uint8_t dto_out,
    uint8_t * list_idx,
    uint8_t * odt_idx
) 

Parameters:

  • slave Pointer to CCP slave handle.
  • event_channel Trigger event channel index.
  • dto_out Output buffer for DAQ DTO packet.
  • list_idx Output index of transmitting DAQ list.
  • odt_idx Output index of transmitting ODT.

Returns:

True if a DAQ packet is ready to send.


function syn_ccp_set_mta

Set Memory Transfer Address (MTA0 or MTA1).

void syn_ccp_set_mta (
    SYN_CCP_Slave * slave,
    uint8_t mta_num,
    uint8_t ext,
    uintptr_t addr
) 

Parameters:

  • slave Pointer to CCP slave handle.
  • mta_num 0 for MTA0, 1 for MTA1.
  • ext Address extension.
  • addr Target memory address.


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