Skip to content

File syn_lss.c

FileList > proto > syn_lss.c

Go to the source code of this file

CANopen CiA 305 Layer Setting Services (LSS) Implementation.

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

Public Functions

Type Name
void syn_lss_master_build_config_bit_timing (SYN_CAN_Frame * frame, uint8_t baud_table_idx)
Build an LSS Master request frame to configure Bit Timing / Baud rate.
void syn_lss_master_build_config_node_id (SYN_CAN_Frame * frame, uint8_t new_node_id)
Build an LSS Master request frame to configure Node-ID.
void syn_lss_master_build_store_config (SYN_CAN_Frame * frame)
Build an LSS Master request frame to store configuration to NVM.
void syn_lss_master_build_switch_mode (SYN_CAN_Frame * frame, uint8_t mode)
Build an LSS Master request frame to switch global mode.
void syn_lss_slave_init (SYN_LSSSlave * slave, const SYN_LSSAddress * addr, uint8_t initial_node_id)
Initialize LSS Slave state instance.
bool syn_lss_slave_process (SYN_LSSSlave * slave, const SYN_CAN_Frame * frame, SYN_CAN_Frame * resp)
Process an incoming CAN frame for LSS Slave processing.

Public Functions Documentation

function syn_lss_master_build_config_bit_timing

Build an LSS Master request frame to configure Bit Timing / Baud rate.

void syn_lss_master_build_config_bit_timing (
    SYN_CAN_Frame * frame,
    uint8_t baud_table_idx
) 

Parameters:

  • frame Output frame buffer.
  • baud_table_idx Baud rate index (SYN_LSS_BAUD_*).

function syn_lss_master_build_config_node_id

Build an LSS Master request frame to configure Node-ID.

void syn_lss_master_build_config_node_id (
    SYN_CAN_Frame * frame,
    uint8_t new_node_id
) 

Parameters:

  • frame Output frame buffer.
  • new_node_id Target Node-ID (1..127).

function syn_lss_master_build_store_config

Build an LSS Master request frame to store configuration to NVM.

void syn_lss_master_build_store_config (
    SYN_CAN_Frame * frame
) 

Parameters:

  • frame Output frame buffer.

function syn_lss_master_build_switch_mode

Build an LSS Master request frame to switch global mode.

void syn_lss_master_build_switch_mode (
    SYN_CAN_Frame * frame,
    uint8_t mode
) 

Parameters:

  • frame Output frame buffer.
  • mode Target LSS mode (SYN_LSS_MODE_OPERATION or SYN_LSS_MODE_CONFIGURATION).

function syn_lss_slave_init

Initialize LSS Slave state instance.

void syn_lss_slave_init (
    SYN_LSSSlave * slave,
    const SYN_LSSAddress * addr,
    uint8_t initial_node_id
) 

Parameters:

  • slave Pointer to slave handle.
  • addr Pointer to LSS unique 128-bit identity address.
  • initial_node_id Starting node-ID (or 0xFF for unconfigured).

function syn_lss_slave_process

Process an incoming CAN frame for LSS Slave processing.

bool syn_lss_slave_process (
    SYN_LSSSlave * slave,
    const SYN_CAN_Frame * frame,
    SYN_CAN_Frame * resp
) 

Parameters:

  • slave Pointer to LSS Slave handle.
  • frame Incoming CAN frame (COB-ID 0x7E5).
  • resp Output CAN frame buffer (populated with 0x7E4 response if required).

Returns:

True if a response frame should be transmitted over CAN.



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