File syn_lss.h¶
Go to the source code of this file
CANopen CiA 305 Layer Setting Services (LSS) & Protocols. More...
#include "../common/syn_defs.h"#include "../drivers/syn_can.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_LSSAddress LSS Address Structure (Unique 128-bit identity) |
| struct | SYN_LSSSlave LSS Slave Instance State. |
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. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_LSS_BAUD_1000K 0x00ULSS Bit Timing Table Entries (CiA 305 Standard Baud Rates) |
| define | SYN_LSS_BAUD_100K 0x05U |
| define | SYN_LSS_BAUD_10K 0x08U |
| define | SYN_LSS_BAUD_125K 0x04U |
| define | SYN_LSS_BAUD_20K 0x07U |
| define | SYN_LSS_BAUD_250K 0x03U |
| define | SYN_LSS_BAUD_500K 0x02U |
| define | SYN_LSS_BAUD_50K 0x06U |
| define | SYN_LSS_BAUD_800K 0x01U |
| define | SYN_LSS_COB_ID_MASTER 0x7E5ULSS CAN Identifier Definitions. |
| define | SYN_LSS_COB_ID_SLAVE 0x7E4U |
| define | SYN_LSS_CS_ACTIVATE_BIT_TIMING 0x15U |
| define | SYN_LSS_CS_CONFIGURE_BIT_TIMING 0x13U |
| define | SYN_LSS_CS_CONFIGURE_NODE_ID 0x11U |
| define | SYN_LSS_CS_INQUIRE_PRODUCT 0x5BU |
| define | SYN_LSS_CS_INQUIRE_REV 0x5CU |
| define | SYN_LSS_CS_INQUIRE_SERIAL 0x5DU |
| define | SYN_LSS_CS_INQUIRE_VENDOR 0x5AU |
| define | SYN_LSS_CS_STORE_CONFIG 0x17U |
| define | SYN_LSS_CS_SWITCH_MODE_GLOBAL 0x04ULSS Command Specifiers (CS) |
| define | SYN_LSS_CS_SWITCH_MODE_SELECT 0x40U |
| define | SYN_LSS_MODE_CONFIGURATION 0x01U |
| define | SYN_LSS_MODE_OPERATION 0x00ULSS Operating Modes. |
Detailed Description¶
Implements non-blocking, zero-malloc LSS slave & master protocol engines for dynamic Node-ID allocation, bit-timing (baud rate) configuration, LSS Fastscan, and NVM configuration storage over CAN.
Public Functions Documentation¶
function syn_lss_master_build_config_bit_timing¶
Build an LSS Master request frame to configure Bit Timing / Baud rate.
Parameters:
frameOutput frame buffer.baud_table_idxBaud rate index (SYN_LSS_BAUD_*).
function syn_lss_master_build_config_node_id¶
Build an LSS Master request frame to configure Node-ID.
Parameters:
frameOutput frame buffer.new_node_idTarget Node-ID (1..127).
function syn_lss_master_build_store_config¶
Build an LSS Master request frame to store configuration to NVM.
Parameters:
frameOutput frame buffer.
function syn_lss_master_build_switch_mode¶
Build an LSS Master request frame to switch global mode.
Parameters:
frameOutput frame buffer.modeTarget 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:
slavePointer to slave handle.addrPointer to LSS unique 128-bit identity address.initial_node_idStarting 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:
slavePointer to LSS Slave handle.frameIncoming CAN frame (COB-ID 0x7E5).respOutput CAN frame buffer (populated with 0x7E4 response if required).
Returns:
True if a response frame should be transmitted over CAN.
Macro Definition Documentation¶
define SYN_LSS_BAUD_1000K¶
LSS Bit Timing Table Entries (CiA 305 Standard Baud Rates)
1000 kbit/s
define SYN_LSS_BAUD_100K¶
100 kbit/s
define SYN_LSS_BAUD_10K¶
10 kbit/s
define SYN_LSS_BAUD_125K¶
125 kbit/s
define SYN_LSS_BAUD_20K¶
20 kbit/s
define SYN_LSS_BAUD_250K¶
250 kbit/s
define SYN_LSS_BAUD_500K¶
500 kbit/s
define SYN_LSS_BAUD_50K¶
50 kbit/s
define SYN_LSS_BAUD_800K¶
800 kbit/s
define SYN_LSS_COB_ID_MASTER¶
LSS CAN Identifier Definitions.
Master to Slave Request COB-ID
define SYN_LSS_COB_ID_SLAVE¶
Slave to Master Response COB-ID
define SYN_LSS_CS_ACTIVATE_BIT_TIMING¶
Activate Bit Timing
define SYN_LSS_CS_CONFIGURE_BIT_TIMING¶
Configure Bit Timing
define SYN_LSS_CS_CONFIGURE_NODE_ID¶
Configure Node-ID
define SYN_LSS_CS_INQUIRE_PRODUCT¶
Inquire Product-Code
define SYN_LSS_CS_INQUIRE_REV¶
Inquire Revision-Number
define SYN_LSS_CS_INQUIRE_SERIAL¶
Inquire Serial-Number
define SYN_LSS_CS_INQUIRE_VENDOR¶
Inquire Vendor-ID
define SYN_LSS_CS_STORE_CONFIG¶
Store Configuration
define SYN_LSS_CS_SWITCH_MODE_GLOBAL¶
LSS Command Specifiers (CS)
Switch mode global
define SYN_LSS_CS_SWITCH_MODE_SELECT¶
Switch mode selective vendor
define SYN_LSS_MODE_CONFIGURATION¶
LSS Configuration Mode
define SYN_LSS_MODE_OPERATION¶
LSS Operating Modes.
LSS Operation Mode
The documentation for this class was generated from the following file src/syntropic/proto/syn_lss.h