Skip to content

File syn_cia401.c

FileList > proto > syn_cia401.c

Go to the source code of this file

Implementation of CANopen CiA 401 Generic I/O Device Profile.

  • #include "syn_cia401.h"
  • #include "../util/syn_assert.h"
  • #include <stdlib.h>
  • #include <string.h>

Public Functions

Type Name
bool syn_cia401_check_analog_delta (SYN_CiA401_Device * dev, uint8_t * channel)
Check if any analog input has exceeded its delta threshold for event-driven TPDO.
void syn_cia401_init (SYN_CiA401_Device * dev, uint8_t dig_in_bytes, uint8_t dig_out_bytes, uint8_t analog_in_ch, uint8_t analog_out_ch)
Initialize a CiA 401 device state instance.
size_t syn_cia401_populate_od (SYN_CiA401_Device * dev, SYN_CANOpenODEntry * od_table, size_t max_entries)
Populate a standard CANopen Object Dictionary array with CiA 401 entries.

Public Functions Documentation

function syn_cia401_check_analog_delta

Check if any analog input has exceeded its delta threshold for event-driven TPDO.

bool syn_cia401_check_analog_delta (
    SYN_CiA401_Device * dev,
    uint8_t * channel
) 

Parameters:

  • dev Pointer to CiA 401 device instance.
  • channel Output channel index (0..analog_in_count-1) that changed.

Returns:

True if a change occurred exceeding delta.


function syn_cia401_init

Initialize a CiA 401 device state instance.

void syn_cia401_init (
    SYN_CiA401_Device * dev,
    uint8_t dig_in_bytes,
    uint8_t dig_out_bytes,
    uint8_t analog_in_ch,
    uint8_t analog_out_ch
) 

Parameters:

  • dev Pointer to CiA 401 device handle.
  • dig_in_bytes Number of 8-bit digital input blocks (1..4).
  • dig_out_bytes Number of 8-bit digital output blocks (1..4).
  • analog_in_ch Number of 16-bit analog input channels (1..8).
  • analog_out_ch Number of 16-bit analog output channels (1..8).

function syn_cia401_populate_od

Populate a standard CANopen Object Dictionary array with CiA 401 entries.

size_t syn_cia401_populate_od (
    SYN_CiA401_Device * dev,
    SYN_CANOpenODEntry * od_table,
    size_t max_entries
) 

Parameters:

  • dev Pointer to initialized CiA 401 device instance.
  • od_table Output array of SYN_CANOpenODEntry elements.
  • max_entries Capacity of od_table array.

Returns:

Number of OD entries populated.



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