CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
Modules | Macros | Enumerations
Definitions and enumerations
+ Collaboration diagram for Definitions and enumerations:

Modules

 SDO error codes
 

Macros

#define COM_SDO_CLIENT_MAX   ((uint8_t) 2)
 

Enumerations

enum  ComErr_e {
  eCOM_ERR_NONE = 0 ,
  eCOM_ERR_CAN = -1,
  eCOM_ERR_CAN_BITRATE = -2,
  eCOM_ERR_CAN_FUNCTION = -3,
  eCOM_ERR_PARM = -10,
  eCOM_ERR_NET = -20,
  eCOM_ERR_NET_VALUE = -21,
  eCOM_ERR_NODE = -30,
  eCOM_ERR_NODE_ID = -31,
  eCOM_ERR_NODE_DEFINED = -32,
  eCOM_ERR_NODE_UNDEFINED = -33,
  eCOM_ERR_COB = -40,
  eCOM_ERR_COB_ID_VALUE = -41,
  eCOM_ERR_COB_TYPE = -42,
  eCOM_ERR_COB_DLC = -43,
  eCOM_ERR_SERVICE = -50,
  eCOM_ERR_SERVICE_MODE = -52,
  eCOM_ERR_SERVICE_PARAM = -53,
  eCOM_ERR_SDO_CLIENT = -60,
  eCOM_ERR_SDO_CLIENT_VALUE = -61,
  eCOM_ERR_SDO_CLIENT_BUSY = -62,
  eCOM_ERR_PDO = -70,
  eCOM_ERR_PDO_NUMBER = -71
}
 
enum  ComLssMode_e {
  eCOM_LSS_MODE_WAITING = 0,
  eCOM_LSS_MODE_CONFIGURATION
}
 
enum  ComLssProt_e {
  eCOM_LSS_PROT_SWI_GLB = 1,
  eCOM_LSS_PROT_SWI_VID,
  eCOM_LSS_PROT_SWI_PRD,
  eCOM_LSS_PROT_SWI_REV,
  eCOM_LSS_PROT_SWI_SRN,
  eCOM_LSS_PROT_INQ_VID,
  eCOM_LSS_PROT_INQ_PRD,
  eCOM_LSS_PROT_INQ_REV,
  eCOM_LSS_PROT_INQ_SRN,
  eCOM_LSS_PROT_INQ_NID,
  eCOM_LSS_PROT_CONF_STORE,
  eCOM_LSS_PROT_CONF_ID,
  eCOM_LSS_PROT_CONF_BIT,
  eCOM_LSS_PROT_FASTSCAN,
  eCOM_LSS_PROT_IDENTIFY
}
 
enum  ComLssStat_e {
  eCOM_LSS_STAT_ACTIVE = 1,
  eCOM_LSS_STAT_SUCCESS,
  eCOM_LSS_STAT_ERROR,
  eCOM_LSS_STAT_TIMEOUT
}
 
enum  ComLssInqSrv_e {
  eCOM_LSS_INQ_SRV_VID = 0,
  eCOM_LSS_INQ_SRV_PRD,
  eCOM_LSS_INQ_SRV_REV,
  eCOM_LSS_INQ_SRV_SRN,
  eCOM_LSS_INQ_SRV_NID
}
 
enum  ComMode_e {
  eCOM_MODE_NMT_SLAVE = 0x0000,
  eCOM_MODE_NMT_MASTER = 0x0001,
  eCOM_MODE_NMT_START_ALL = 0x0002,
  eCOM_MODE_NMT_PREOPERATIONAL = 0x0004,
  eCOM_MODE_NMT_APP_START_NODE = 0x0008,
  eCOM_MODE_NMT_RESET_ALL = 0x0010,
  eCOM_MODE_NMT_FLYING_MASTER = 0x0020,
  eCOM_MODE_NMT_STOP_ALL = 0x0040,
  eCOM_MODE_NMT_MASTER_DETECT = 0x0100,
  eCOM_MODE_CAN_RAW = 0x1000,
  eCOM_MODE_J1939 = 0x2000
}
 
enum  ComNmtState_e {
  eCOM_NMT_STATE_UNKNOWN = 0,
  eCOM_NMT_STATE_STOPPED,
  eCOM_NMT_STATE_PREOPERATIONAL,
  eCOM_NMT_STATE_OPERATIONAL,
  eCOM_NMT_STATE_RESET_NODE,
  eCOM_NMT_STATE_RESET_COM,
  eCOM_NMT_STATE_BOOTUP,
  eCOM_NMT_STATE_INIT
}
 
enum  PgnDir_e {
  ePGN_DIR_RCV = 0,
  ePGN_DIR_TRM
}
 
enum  PdoDir_e {
  ePDO_DIR_RCV = 0,
  ePDO_DIR_TRM
}
 
enum  PdoType_e {
  ePDO_TYPE_SYNC_0 = 0,
  ePDO_TYPE_SYNC_1,
  ePDO_TYPE_SYNC_2,
  ePDO_TYPE_SYNC_3,
  ePDO_TYPE_SYNC_4 ,
  ePDO_TYPE_SYNC_240 = 240 ,
  ePDO_TYPE_EVENT_MANUFACTURER,
  ePDO_TYPE_EVENT_PROFILE
}
 
enum  ComSdoStat_e {
  eCOM_SDO_STAT_EMPTY = 0,
  eCOM_SDO_STAT_EXP_RD,
  eCOM_SDO_STAT_SEG_RD,
  eCOM_SDO_STAT_BLK_RD,
  eCOM_SDO_STAT_EXP_WR,
  eCOM_SDO_STAT_SEG_WR,
  eCOM_SDO_STAT_BLK_WR,
  eCOM_SDO_STAT_SUCCESS,
  eCOM_SDO_STAT_ABORT,
  eCOM_SDO_STAT_TIMEOUT,
  eCOM_SDO_STAT_ERR,
  eCOM_SDO_STAT_SIZE
}
 
enum  ComSdoConfig_e {
  eCOM_SDO_CONFIG_DEFAULT = 0,
  eCOM_SDO_CONFIG_CMD_LEN = 1,
  eCOM_SDO_CONFIG_BLOCK = 2
}
 
enum  ComSdoMarker_e {
  eCOM_SDO_MARKER_USER_END = 200,
  eCOM_SDO_MARKER_NODE_GET_INFO,
  eCOM_SDO_MARKER_NODE_SET_HEARTBEAT,
  eCOM_SDO_MARKER_NODE_STORE,
  eCOM_SDO_MARKER_NODE_RESTORE,
  eCOM_SDO_MARKER_SRDO_GET_CONFIG,
  eCOM_SDO_MARKER_SRDO_GET_SIGNATURE,
  eCOM_SDO_MARKER_SRDO_SET_CONFIG,
  eCOM_SDO_MARKER_SRDO_SET_SIGNATURE,
  eCOM_SDO_MARKER_SRDO_SET_VALID
}
 
enum  ComVersion_e {
  eCOM_VERSION_STACK = 1,
  eCOM_VERSION_COMPILER,
  eCOM_VERSION_SYSTEM
}
 
enum  CpBitrate_e {
  eCP_BITRATE_NONE = -1,
  eCP_BITRATE_10K = 0,
  eCP_BITRATE_20K = 1,
  eCP_BITRATE_50K = 2,
  eCP_BITRATE_100K = 3,
  eCP_BITRATE_125K = 4,
  eCP_BITRATE_250K = 5,
  eCP_BITRATE_500K = 6,
  eCP_BITRATE_800K = 7,
  eCP_BITRATE_1M = 8,
  eCP_BITRATE_2M = 10,
  eCP_BITRATE_4M = 11,
  eCP_BITRATE_5M = 12,
  eCP_BITRATE_AUTO = 9
}
 
enum  CpChannel_e {
  eCP_CHANNEL_NONE = 0,
  eCP_CHANNEL_1,
  eCP_CHANNEL_2,
  eCP_CHANNEL_3,
  eCP_CHANNEL_4,
  eCP_CHANNEL_5,
  eCP_CHANNEL_6,
  eCP_CHANNEL_7,
  eCP_CHANNEL_8
}
 
enum  CpState_e {
  eCP_STATE_INIT = 0 ,
  eCP_STATE_SLEEPING = 1,
  eCP_STATE_BUS_ACTIVE = 2,
  eCP_STATE_BUS_WARN = 3,
  eCP_STATE_BUS_PASSIVE = 4,
  eCP_STATE_BUS_OFF = 5,
  eCP_STATE_PHY_FAULT = 10,
  eCP_STATE_PHY_H = 11,
  eCP_STATE_PHY_L = 12
}
 
enum  CpErrType_e {
  eCP_ERR_TYPE_NONE = 0,
  eCP_ERR_TYPE_BIT0,
  eCP_ERR_TYPE_BIT1,
  eCP_ERR_TYPE_STUFF,
  eCP_ERR_TYPE_FORM,
  eCP_ERR_TYPE_CRC,
  eCP_ERR_TYPE_ACK
}
 

Detailed Description

Macro Definition Documentation

◆ COM_SDO_CLIENT_MAX

#define COM_SDO_CLIENT_MAX   ((uint8_t) 2)

The symbol defines the number of SDO clients that are supported.

Enumeration Type Documentation

◆ ComErr_e

enum ComErr_e

Error Codes of CANopen Master protocol stack.

All error codes of the CANopen Master protocol stack have the prefix eCOM_ERR_. Error return values are always negative, so it is quite simple to check in general if a functions fails.

Example:

{
// handle error here
}
Enumerator
eCOM_ERR_NONE 

No error

eCOM_ERR_CAN 

Generic CAN driver error

eCOM_ERR_CAN_BITRATE 

Setting of CAN bit-rate failed

eCOM_ERR_CAN_FUNCTION 

CAN function failed

eCOM_ERR_PARM 

Parameter out of range (generic)

eCOM_ERR_NET 

Generic Network error

eCOM_ERR_NET_VALUE 

Network index out of range, not valid

eCOM_ERR_NODE 

Generic Node error

eCOM_ERR_NODE_ID 

Node ID (device address) is not valid or out of range

eCOM_ERR_NODE_DEFINED 

Node is already defined

eCOM_ERR_NODE_UNDEFINED 

Node is not defined

eCOM_ERR_COB 

Generic COB error

eCOM_ERR_COB_ID_VALUE 

Identifier is out of range

eCOM_ERR_COB_TYPE 

COB type out of range

eCOM_ERR_COB_DLC 

COB DLC out of range

eCOM_ERR_SERVICE 

Generic Service error

eCOM_ERR_SERVICE_MODE 

Service mode error The service (NMT, SYNC, etc) is in a mode that does not allow this operation

eCOM_ERR_SERVICE_PARAM 

Service parameter error The service (NMT, SYNC, etc) does not accept this parameter

eCOM_ERR_SDO_CLIENT 

Generic SDO client error

eCOM_ERR_SDO_CLIENT_VALUE 

Value for SDO client is out of range

eCOM_ERR_SDO_CLIENT_BUSY 

All available SDO clients are busy

eCOM_ERR_PDO 

Generic PDO error

eCOM_ERR_PDO_NUMBER 

Number for PDO is out of range

◆ ComLssInqSrv_e

CANopen Master LSS inquire services

Enumerator
eCOM_LSS_INQ_SRV_VID 

inquire vendor ID

eCOM_LSS_INQ_SRV_PRD 

inquire product code

eCOM_LSS_INQ_SRV_REV 

inquire revision number

eCOM_LSS_INQ_SRV_SRN 

inquire serial number

eCOM_LSS_INQ_SRV_NID 

inquire node ID

◆ ComLssMode_e

See also
ComLssSwitchModeGlobal() LSS mode

This enumeration defines the allowed modes for the LSS switch mode global command.

Enumerator
eCOM_LSS_MODE_WAITING 

switch LSS state machine to LSS waiting mode

eCOM_LSS_MODE_CONFIGURATION 

switch LSS state machine to LSS configuration mode

◆ ComLssProt_e

CANopen Master LSS protocol

Enumerator
eCOM_LSS_PROT_SWI_GLB 

switch global command

eCOM_LSS_PROT_SWI_VID 

switch mode selective, vendor ID

eCOM_LSS_PROT_SWI_PRD 

switch mode selective, product code

eCOM_LSS_PROT_SWI_REV 

switch mode selective, revision number

eCOM_LSS_PROT_SWI_SRN 

switch mode selective, serial number

eCOM_LSS_PROT_INQ_VID 

inquire vendor ID

eCOM_LSS_PROT_INQ_PRD 

inquire product code

eCOM_LSS_PROT_INQ_REV 

inquire revision number

eCOM_LSS_PROT_INQ_SRN 

inquire serial number

eCOM_LSS_PROT_INQ_NID 

inquire node ID

eCOM_LSS_PROT_CONF_STORE 

store configuration

eCOM_LSS_PROT_CONF_ID 

configure node ID

eCOM_LSS_PROT_CONF_BIT 

configure bit-timing

eCOM_LSS_PROT_FASTSCAN 

execute fastscan procedure

eCOM_LSS_PROT_IDENTIFY 

identify non-configured slave

◆ ComLssStat_e

CANopen Master LSS status

Enumerator
eCOM_LSS_STAT_ACTIVE 

LSS communication active

eCOM_LSS_STAT_SUCCESS 

LSS communication success

eCOM_LSS_STAT_ERROR 

LSS protocol error

eCOM_LSS_STAT_TIMEOUT 

LSS communication timeout

◆ ComMode_e

enum ComMode_e

NMT startup mode.

The enumeration defines the values for starting the CANopen Master with the function ComMgrInit(). The CANopen NMT configuration is reflected by object 1F80h (least significant 8 bits).

Enumerator
eCOM_MODE_NMT_SLAVE 

Device is NMT slave

eCOM_MODE_NMT_MASTER 

Device is the NMT master

eCOM_MODE_NMT_START_ALL 

NMT service start remote node with Node-ID = 0

eCOM_MODE_NMT_PREOPERATIONAL 

Device does not switch into Operational by itself

eCOM_MODE_NMT_APP_START_NODE 

Application shall start the nodes

eCOM_MODE_NMT_RESET_ALL 

In case of an error event the NMT service "reset all nodes" shall be executed.

eCOM_MODE_NMT_FLYING_MASTER 

CANopen device shall participate the NMT flying master negotiation.

eCOM_MODE_NMT_STOP_ALL 

In case of an error event the NMT service "stop remote node" shall be executed.

eCOM_MODE_NMT_MASTER_DETECT 

Device shall execute the NMT master detection protocol

eCOM_MODE_CAN_RAW 

Device shall start in CAN-Raw mode, no CANopen services (SDO, NMT, etc.) are executed. CAN messages are received and send via the PDO module. This is a mutually exclusive mode of operation.

eCOM_MODE_J1939 

Device shall start in SAE J1939 mode

◆ ComNet_e

enum ComNet_e

Network channel definition.

Enumerator
eCOM_NET_1 

CANopen Master network #1

eCOM_NET_2 

CANopen Master network #2

eCOM_NET_3 

CANopen Master network #3

eCOM_NET_4 

CANopen Master network #4

◆ ComNmtState_e

NMT state codes.

The enumeration defines the values for setting the NMT state of a CANopen device via ComNmtSetNodeState() as well as for requesting the device state via ComNmtGetNodeState(). The values in this enumeration are not equal to the NMT command specifiers.

Enumerator
eCOM_NMT_STATE_UNKNOWN 

Unknown NMT state

eCOM_NMT_STATE_STOPPED 

NMT command / state "Stopped"

eCOM_NMT_STATE_PREOPERATIONAL 

NMT command / state "Pre-Operational"

eCOM_NMT_STATE_OPERATIONAL 

NMT command / state "Operational"

eCOM_NMT_STATE_RESET_NODE 

NMT command "Reset node"

eCOM_NMT_STATE_RESET_COM 

NMT command "Reset communication"

eCOM_NMT_STATE_BOOTUP 

Device has sent Bootup message

eCOM_NMT_STATE_INIT 

Device is in Initialisation state (Master only)

◆ ComSdoConfig_e

SDO client configuration.

The enumeration defines configuration values for the SDO client behaviour, which is set via the function ComSdoSetConfiguration().

Enumerator
eCOM_SDO_CONFIG_DEFAULT 

Use SDO client default configuration

eCOM_SDO_CONFIG_CMD_LEN 

Set data length for command byte in expedited transfer

eCOM_SDO_CONFIG_BLOCK 

Set SDO block transfer for data length > 4 bytes

◆ ComSdoMarker_e

SDO transfer marker.

The enumeration defines values for the marker field inside the CANopen object structure CoObject_s. The marker field can be evaluated inside the ComSdoEventObjectReady() function.

Enumerator
eCOM_SDO_MARKER_USER_END 

Last possible value for user-defined marker

eCOM_SDO_MARKER_NODE_GET_INFO 

Marker for ComNodeGetInfo() function call

eCOM_SDO_MARKER_NODE_SET_HEARTBEAT 

Marker for ComNodeSetHbProdTime() function call

eCOM_SDO_MARKER_NODE_STORE 

Marker for ComNodeStore() function call

eCOM_SDO_MARKER_NODE_RESTORE 

Marker for ComNodeRestore() function call

eCOM_SDO_MARKER_SRDO_GET_CONFIG 

Marker for ComSafetyGetConfiguration() function call

eCOM_SDO_MARKER_SRDO_GET_SIGNATURE 

Marker for ComSafetyGetSignature() function call

eCOM_SDO_MARKER_SRDO_SET_CONFIG 

Marker for ComSafetySetConfiguration() function call

eCOM_SDO_MARKER_SRDO_SET_SIGNATURE 

Marker for ComSafetySetSignature() function call

eCOM_SDO_MARKER_SRDO_SET_VALID 

Marker for ComSafetySetConfigurationValid() function call

◆ ComSdoStat_e

SDO transfer status.

The enumeration defines the status of a SDO client connection. It can be requested with the ComSdoGetStatus() function.

Enumerator
eCOM_SDO_STAT_EMPTY 

SDO client is free, no SDO communication present

eCOM_SDO_STAT_EXP_RD 

Expedited transfer in progress (read)

eCOM_SDO_STAT_SEG_RD 

Segmented transfer in progress (read)

eCOM_SDO_STAT_BLK_RD 

Block transfer in progress (read)

eCOM_SDO_STAT_EXP_WR 

Expedited transfer in progress (write)

eCOM_SDO_STAT_SEG_WR 

Segmented transfer in progress (write)

eCOM_SDO_STAT_BLK_WR 

Block transfer in progress (write)

eCOM_SDO_STAT_SUCCESS 

SDO communication success

eCOM_SDO_STAT_ABORT 

SDO communication aborted

eCOM_SDO_STAT_TIMEOUT 

SDO communication timeout

eCOM_SDO_STAT_ERR 

SDO protocol error

eCOM_SDO_STAT_SIZE 

Data size for client/server does not match

◆ ComVersion_e

Get library information.

The enumeration defines values for function ComMgrGetVersionString().

Enumerator
eCOM_VERSION_STACK 

Get information about the stack version

eCOM_VERSION_COMPILER 

Get information about the used compiler

eCOM_VERSION_SYSTEM 

Get information about the operating system

◆ CpBitrate_e

Fixed bit-rates.

The values of the enumeration CpBitrate_e are used as parameter for the function CpCoreBitrate().

Enumerator
eCP_BITRATE_NONE 

No bit-rate defined

eCP_BITRATE_10K 

bit-rate 10 kBit/s

eCP_BITRATE_20K 

bit-rate 20 kBit/s

eCP_BITRATE_50K 

bit-rate 50 kBit/s

eCP_BITRATE_100K 

bit-rate 100 kBit/s

eCP_BITRATE_125K 

bit-rate 125 kBit/s

eCP_BITRATE_250K 

bit-rate 250 kBit/s

eCP_BITRATE_500K 

bit-rate 500 kBit/s

eCP_BITRATE_800K 

bit-rate 800 kBit/s

eCP_BITRATE_1M 

bit-rate 1 MBit/s

eCP_BITRATE_2M 

bit-rate 2 MBit/s (ISO CAN FD, data phase)

eCP_BITRATE_4M 

bit-rate 4 MBit/s (ISO CAN FD, data phase)

eCP_BITRATE_5M 

bit-rate 5 MBit/s (ISO CAN FD, data phase)

eCP_BITRATE_AUTO 

Use automatic bit-rate detection

◆ CpChannel_e

Channel definition.

The physical CAN interfaces are numbered from 1 .. N (N: total number of physical CAN interfaces on the target system). The enumeration CpChannel_e lists up to 8 physical interfaces. The enumeration value eCP_CHANNEL_NONE denotes an invalid channel value.

Enumerator
eCP_CHANNEL_NONE 

CAN interface invalid

eCP_CHANNEL_1 

CAN interface 1

eCP_CHANNEL_2 

CAN interface 2

eCP_CHANNEL_3 

CAN interface 3

eCP_CHANNEL_4 

CAN interface 4

eCP_CHANNEL_5 

CAN interface 5

eCP_CHANNEL_6 

CAN interface 6

eCP_CHANNEL_7 

CAN interface 7

eCP_CHANNEL_8 

CAN interface 8

◆ CpErrType_e

Error type.

These values are used as return value for the function CpCoreCanState().

Enumerator
eCP_ERR_TYPE_NONE 

No error

eCP_ERR_TYPE_BIT0 

Bit 0 error

eCP_ERR_TYPE_BIT1 

Bit 1 error

eCP_ERR_TYPE_STUFF 

Stuff error

eCP_ERR_TYPE_FORM 

Format error

eCP_ERR_TYPE_CRC 

CRC error

eCP_ERR_TYPE_ACK 

Acknowledge error

◆ CpState_e

enum CpState_e

State of CAN controller.

These values are used as return value for the function CpCoreCanState().

Enumerator
eCP_STATE_INIT 

CAN controller is in stopped mode

eCP_STATE_SLEEPING 

CAN controller is in Sleep mode

eCP_STATE_BUS_ACTIVE 

CAN controller is error active

eCP_STATE_BUS_WARN 

CAN controller is active, warning level is reached

eCP_STATE_BUS_PASSIVE 

CAN controller is error passive

eCP_STATE_BUS_OFF 

CAN controller went into Bus Off

eCP_STATE_PHY_FAULT 

General failure of physical layer detected (if supported by hardware)

eCP_STATE_PHY_H 

Fault on CAN-H detected (Low Speed CAN)

eCP_STATE_PHY_L 

Fault on CAN-L detected (Low Speed CAN)

◆ PdoDir_e

enum PdoDir_e

PDO direction.

The following enumeration values define the direction of a PDO. The direction is seen from the device point of view, hence a RPDO is received by the CANopen Master, while a TPDO is sent by the CANopen Master.

Enumerator
ePDO_DIR_RCV 

Receive-PDO (RPDO)

ePDO_DIR_TRM 

Transmit-PDO (TPDO)

◆ PdoType_e

enum PdoType_e

PDO transmission types.

The common used PDO transmission types are defined in this enumeration.

Enumerator
ePDO_TYPE_SYNC_0 

Synchronous, acyclic PDO

ePDO_TYPE_SYNC_1 

Synchronous, cyclic every SYNC

ePDO_TYPE_SYNC_2 

Synchronous, cyclic every 2nd SYNC

ePDO_TYPE_SYNC_3 

Synchronous, cyclic every 3rd SYNC

ePDO_TYPE_SYNC_4 

Synchronous, cyclic every 4th SYNC

ePDO_TYPE_SYNC_240 

Synchronous, cyclic every 240th SYNC

ePDO_TYPE_EVENT_MANUFACTURER 

Event-driven PDO, manufacturer specific

ePDO_TYPE_EVENT_PROFILE 

Event-driven PDO, profile specific

◆ PgnDir_e

enum PgnDir_e

PGN direction.

The following enumeration values define the direction of a PGN. The direction is seen from the device point of view.

Enumerator
ePGN_DIR_RCV 

Receive PGN

ePGN_DIR_TRM 

Transmit PGN