1
0
Fork 0

Fix and update doxygen documentation.

This commit is contained in:
Janez 2024-08-07 00:17:39 +02:00
parent 076557a485
commit 05931a6b76
18 changed files with 592 additions and 339 deletions

View file

@ -298,22 +298,22 @@ CO_EM_receive(void* object, void* msg) {
CO_ReturnError_t
CO_EM_init(CO_EM_t* em, CO_CANmodule_t* CANdevTx, const OD_entry_t* OD_1001_errReg,
#if ((CO_CONFIG_EM) & (CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY)) != 0
#if (((CO_CONFIG_EM) & (CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY)) != 0) || defined CO_DOXYGEN
CO_EM_fifo_t* fifo, uint8_t fifoSize,
#endif
#if ((CO_CONFIG_EM)&CO_CONFIG_EM_PRODUCER) != 0
#if (((CO_CONFIG_EM)&CO_CONFIG_EM_PRODUCER) != 0) || defined CO_DOXYGEN
OD_entry_t* OD_1014_cobIdEm, uint16_t CANdevTxIdx,
#if ((CO_CONFIG_EM)&CO_CONFIG_EM_PROD_INHIBIT) != 0
#if (((CO_CONFIG_EM)&CO_CONFIG_EM_PROD_INHIBIT) != 0) || defined CO_DOXYGEN
OD_entry_t* OD_1015_InhTime,
#endif
#endif
#if ((CO_CONFIG_EM)&CO_CONFIG_EM_HISTORY) != 0
#if (((CO_CONFIG_EM)&CO_CONFIG_EM_HISTORY) != 0) || defined CO_DOXYGEN
OD_entry_t* OD_1003_preDefErr,
#endif
#if ((CO_CONFIG_EM)&CO_CONFIG_EM_STATUS_BITS) != 0
#if (((CO_CONFIG_EM)&CO_CONFIG_EM_STATUS_BITS) != 0) || defined CO_DOXYGEN
OD_entry_t* OD_statusBits,
#endif
#if ((CO_CONFIG_EM)&CO_CONFIG_EM_CONSUMER) != 0
#if (((CO_CONFIG_EM)&CO_CONFIG_EM_CONSUMER) != 0) || defined CO_DOXYGEN
CO_CANmodule_t* CANdevRx, uint16_t CANdevRxIdx,
#endif
const uint8_t nodeId, uint32_t* errInfo) {

View file

@ -72,7 +72,7 @@ OD_write_1017(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t*
CO_ReturnError_t
CO_NMT_init(CO_NMT_t* NMT, OD_entry_t* OD_1017_ProducerHbTime, CO_EM_t* em, uint8_t nodeId, uint16_t NMTcontrol,
uint16_t firstHBTime_ms, CO_CANmodule_t* NMT_CANdevRx, uint16_t NMT_rxIdx, uint16_t CANidRxNMT,
#if ((CO_CONFIG_NMT)&CO_CONFIG_NMT_MASTER) != 0
#if (((CO_CONFIG_NMT)&CO_CONFIG_NMT_MASTER) != 0) || defined CO_DOXYGEN
CO_CANmodule_t* NMT_CANdevTx, uint16_t NMT_txIdx, uint16_t CANidTxNMT,
#endif
CO_CANmodule_t* HB_CANdevTx, uint16_t HB_txIdx, uint16_t CANidTxHB, uint32_t* errInfo) {

View file

@ -33,7 +33,7 @@ extern "C" {
*
* @ingroup CO_CANopen_301
* @{
* See @ref doc/objectDictionary.md
* See @ref md_doc_2objectDictionary
*/
#ifndef CO_OD_OWN_TYPES

View file

@ -31,6 +31,8 @@
#ifndef CO_CONFIG_SDO_CLI
#define CO_CONFIG_SDO_CLI (0)
#endif
#ifndef CO_DOXYGEN
#ifndef CO_CONFIG_SDO_CLI_BUFFER_SIZE
#if ((CO_CONFIG_SDO_CLI)&CO_CONFIG_SDO_CLI_BLOCK) != 0
#define CO_CONFIG_SDO_CLI_BUFFER_SIZE 1000U
@ -38,6 +40,7 @@
#define CO_CONFIG_SDO_CLI_BUFFER_SIZE 32U
#endif
#endif
#endif
#if (((CO_CONFIG_SDO_CLI)&CO_CONFIG_SDO_CLI_ENABLE) != 0) || defined CO_DOXYGEN

View file

@ -44,7 +44,7 @@ extern "C" {
*
* @ingroup CO_CANopen_301
* @{
* For CAN identifier see #CO_Default_CAN_ID_t
* For CAN identifier see @ref CO_Default_CAN_ID_t
*
* SYNC message is used for synchronization of the nodes on network. One node can be SYNC producer, others can be SYNC
* consumers. Synchronous TPDOs are transmitted after the CANopen SYNC message. Synchronous received PDOs are

View file

@ -61,13 +61,14 @@ extern "C" {
* - quadruple flash: PDO has not been received before the event timer elapsed
* - on: CAN bus off
*
* To apply on/off state to led diode, use #CO_LED_RED and #CO_LED_GREEN macros. For CANopen leds use CO_LED_BITFIELD_t
* CO_LED_CANopen. Other bitfields are available for implementing custom leds.
* To apply on/off state to the led diode, use #CO_LED_RED or #CO_LED_GREEN macros with one of the @ref CO_LED_bitmasks.
* For CANopen leds use #CO_LED_CANopen bitmask.
*/
/**
* @defgroup CO_LED_BITFIELD_t Bitfield for combining with red or green led
* @defgroup CO_LED_bitmasks CO_LED bitmasks
* @{
* Bitmasks for the LED indicators
*/
#define CO_LED_flicker 0x01U /**< LED flickering 10Hz */
#define CO_LED_blink 0x02U /**< LED blinking 2,5Hz */
@ -76,13 +77,12 @@ extern "C" {
#define CO_LED_flash_3 0x10U /**< LED triple flash */
#define CO_LED_flash_4 0x20U /**< LED quadruple flash */
#define CO_LED_CANopen 0x80U /**< LED CANopen according to CiA 303-3 */
/** @} */
/** @} */ /* CO_LED_BITFIELD_t */
/** Get on/off state for green led for specified bitfield */
#define CO_LED_RED(LEDs, BITFIELD) ((((LEDs)->LEDred & BITFIELD) != 0U) ? 1U : 0U)
/** Get on/off state for green led for specified bitfield */
#define CO_LED_GREEN(LEDs, BITFIELD) ((((LEDs)->LEDgreen & BITFIELD) != 0U) ? 1U : 0U)
/** Get on/off state for red led for one of the @ref CO_LED_bitmasks */
#define CO_LED_RED(LEDs, BITMASK) ((((LEDs)->LEDred & BITMASK) != 0U) ? 1U : 0U)
/** Get on/off state for green led for one of the @ref CO_LED_bitmasks */
#define CO_LED_GREEN(LEDs, BITMASK) ((((LEDs)->LEDgreen & BITMASK) != 0U) ? 1U : 0U)
/**
* LEDs object, initialized by CO_LEDs_init()
@ -94,8 +94,8 @@ typedef struct {
uint8_t LEDtmrflash_2; /**< double flash led timer */
uint8_t LEDtmrflash_3; /**< triple flash led timer */
uint8_t LEDtmrflash_4; /**< quadruple flash led timer */
uint8_t LEDred; /**< red led #CO_LED_BITFIELD_t */
uint8_t LEDgreen; /**< green led #CO_LED_BITFIELD_t */
uint8_t LEDred; /**< red led bitfield, to be combined with @ref CO_LED_bitmasks */
uint8_t LEDgreen; /**< green led bitfield, to be combined with @ref CO_LED_bitmasks */
} CO_LEDs_t;
/**

View file

@ -5,7 +5,7 @@
* @ingroup CO_SRDO
* @author Robert Grüning
* @copyright 2020 Robert Grüning
* @copyright 2024 temi54c1l8@github
* @copyright 2024 temi54c1l8(at)github
* @copyright 2024 Janez Paternoster
*
* This file is part of <https://github.com/CANopenNode/CANopenNode>, a CANopen Stack.

View file

@ -5,7 +5,7 @@
* @ingroup CO_SRDO
* @author Robert Grüning
* @copyright 2020 Robert Grüning
* @copyright 2024 temi54c1l8@github
* @copyright 2024 temi54c1l8(at)github
* @copyright 2024 Janez Paternoster
*
* This file is part of <https://github.com/CANopenNode/CANopenNode>, a CANopen Stack.
@ -52,24 +52,23 @@ extern "C" {
* distinction between sending and receiving SRDO is made at runtime (for PDO it is compile time). If the security
* protocol is used, at least one SRDO is mandatory.
*
* If there is erroneous structure of OD entries for SRDO parameters, then @CO_SRDO_init() function returns error and
* If there is erroneous structure of OD entries for SRDO parameters, then CO_SRDO_init() function returns error and
* CANopen device doesn't work. It is necessary to repair Object Dictionary and reprogram the device.
*
* If there are erroneous values inside SRDO parameters, then Emergency message CO_EM_SRDO_CONFIGURATION is sent. Info
* code (32bit) contains OD index, subindex and additional byte, which helps to determine erroneous OD object.
* If there are erroneous values inside SRDO parameters, then Emergency message @ref CO_EM_SRDO_CONFIGURATION is sent.
* Info code (32bit) contains OD index, subindex and additional byte, which helps to determine erroneous OD object.
*
* SRDO configuration consists of one @CO_SRDO_init_start(), @CO_SRDO_init() for each SRDO and one @CO_SRDO_init_end().
* These may be called in CANopen initialization section after all other CANopen objects are initialized. If SRDO OD
* parameters are edited (in NMT pre-operational state), NMT communication reset is necessary. Alternatively SRDO
* configuration may be executed just after transition to NMT operational state.
* SRDO is first configured in CANopen in CANopen initialization section after all other CANopen objects are
* initialized. It consists of one CO_SRDOGuard_init() and CO_SRDO_init() for each SRDO. On transition to NMT
* operational CO_SRDO_config() must be called for each SRDO.
*
* @CO_SRDO_process() must be executed cyclically, similar as PDO processing. Function is fast, no time consuming tasks.
* Function returns @CO_SRDO_state_t value, which may be used to determine working-state or safe-state of safety related
* device. If return values from all SRDO objects are >= CO_SRDO_state_communicationEstablished, then working state is
* allowed. Otherwise SR device must be in safe state.
* CO_SRDO_process() must be executed cyclically, similar as PDO processing. Function is fast, no time consuming tasks.
* Function returns @ref CO_SRDO_state_t value, which may be used to determine working-state or safe-state of safety
* related device. If return values from all SRDO objects are >= @ref CO_SRDO_state_communicationEstablished, then
* working state is allowed. Otherwise SR device must be in safe state.
*
* Requirement for mapped objects:
* - @OD_attributes_t must have set bit ODA_RSRDO or ODA_RSRDO or ODA_TRSRDO (by CANopenEditor).
* - @ref OD_attributes_t must have set bit ODA_RSRDO or ODA_RSRDO or ODA_TRSRDO (by CANopenEditor).
*/
/** Maximum size of SRDO message, 8 for standard CAN */
@ -84,7 +83,7 @@ extern "C" {
#endif
#ifndef CO_SRDO_OWN_TYPES
/** Variable of type CO_SRDO_size_t contains data length in bytes of SRDO */
/** Variable of type @ref CO_SRDO_size_t contains data length in bytes of SRDO */
typedef uint8_t CO_SRDO_size_t;
#endif
@ -100,7 +99,7 @@ typedef enum {
CO_SRDO_state_error_rxTimeoutSCT = -3, /**< SRDO inverted message didn't receive inside SCT time */
CO_SRDO_state_error_rxNotInverted = -2, /**< Received SRDO messages was not inverted */
CO_SRDO_state_error_rxShort = -1, /**< Received SRDO message is too short */
CO_SRDO_state_unknown = 0, /**< unknown state, set by @CO_SRDO_init */
CO_SRDO_state_unknown = 0, /**< unknown state, set by CO_SRDO_init() */
CO_SRDO_state_nmtNotOperational = 1, /**< Internal NMT operating state is not NMT operational */
CO_SRDO_state_initializing = 2, /**< Just entered NMT operational state, SRDO message not yet received or
transmitted */
@ -119,7 +118,7 @@ typedef enum {
typedef struct {
bool_t NMTisOperational; /**< True if NMT operating state is operational */
bool_t configurationValid; /**< True if all SRDO objects are properly configured. Set after successful finish of all
@CO_SRDO_init() functions. Cleared on configuration change. */
CO_SRDO_init() functions. Cleared on configuration change. */
OD_IO_t OD_IO_configurationValid; /**< Object for input / output on the OD variable 13FE:00. Configuration of any of
the the SRDO parameters will write 0 to that variable. */
OD_entry_t* OD_13FE_entry; /**< From CO_SRDOGuard_init() */
@ -176,7 +175,7 @@ typedef struct {
/**
* Initialize SRDOGuard object.
*
* Function must be called in the communication reset section before @CO_SRDO_init functions.
* Function must be called in the communication reset section before CO_SRDO_init() functions.
*
* @param SRDOGuard This object will be initialized.
* @param OD_13FE_configurationValid Pointer to _Configuration valid_ variable from Object dictionary (index 0x13FE).
@ -203,15 +202,14 @@ CO_ReturnError_t CO_SRDOGuard_init(CO_SRDOGuard_t* SRDOGuard, OD_entry_t* OD_13F
* @param defaultCOB_ID Default COB ID for this SRDO for plain data (without NodeId).
* @param OD_130x_SRDOCommPar Pointer to _SRDO communication parameter_ record from Object dictionary (index 0x1301+).
* @param OD_138x_SRDOMapPar Pointer to _SRDO mapping parameter_ record from Object dictionary (index 0x1381+).
* @param OD_13FE_configurationValid Pointer to _Configuration valid_ variable from Object dictionary (index 0x13FE).
* @param OD_13FF_safetyConfigurationSignature Pointer to _Safety configuration signature_ variable from Object
* dictionary (index 0x13FF).
* @param CANdevRx CAN device used for SRDO reception.
* @param CANdevRxIdxNormal Index of receive buffer in the above CAN device.
* @param CANdevRxIdxInverted Index of receive buffer in the above CAN device.
* @param CANdevTx CAN device used for SRDO transmission.
* @param CANdevTxIdxNormal Index of transmit buffer in the above CAN device.
* @param CANdevTxIdxInverted Index of transmit buffer in the above CAN device.
* @param CANdevRxNormal CAN device used for SRDO reception for normal object.
* @param CANdevRxInverted CAN device used for SRDO reception for inverted object.
* @param CANdevRxIdxNormal Index of receive buffer in the above CAN device (normal).
* @param CANdevRxIdxInverted Index of receive buffer in the above CAN device (inverted).
* @param CANdevTxNormal CAN device used for SRDO transmission for normal object.
* @param CANdevTxInverted CAN device used for SRDO transmission for inverted object.
* @param CANdevTxIdxNormal Index of transmit buffer in the above CAN device (normal).
* @param CANdevTxIdxInverted Index of transmit buffer in the above CAN device (inverted).
* @param [out] errInfo Additional information in case of error, may be NULL.
*
* @return #CO_ReturnError_t: CO_ERROR_NO, CO_ERROR_ILLEGAL_ARGUMENT or CO_ERROR_OD_PARAMETERS.
@ -238,19 +236,31 @@ CO_ReturnError_t CO_SRDO_init(CO_SRDO_t* SRDO, uint8_t SRDO_Index, CO_SRDOGuard_
void CO_SRDO_initCallbackPre(CO_SRDO_t* SRDO, void* object, void (*pFunctSignalPre)(void* object));
#endif
/**
* Configure SRDO object.
*
* Function must be called in on transition to NMT operational. Function is also called from CO_SRDO_init() function.
*
* @param SRDO This object will be configured.
* @param SRDO_Index OD index of this SRDO, 0 for the first.
* @param SRDOGuard SRDOGuard object.
* @param [out] errInfo Additional information in case of error, may be NULL.
*
* @return #CO_ReturnError_t: CO_ERROR_NO, CO_ERROR_ILLEGAL_ARGUMENT or CO_ERROR_OD_PARAMETERS.
*/
CO_ReturnError_t CO_SRDO_config(CO_SRDO_t* SRDO, uint8_t SRDO_Index, CO_SRDOGuard_t* SRDOGuard, uint32_t* errInfo);
/**
* Send SRDO on event
*
* Sends SRDO before the next refresh timer tiggers. The message itself is send in @CO_SRDO_process(). Note that RTOS
* Sends SRDO before the next refresh timer tiggers. The message itself is send in CO_SRDO_process(). Note that RTOS
* have to trigger its processing quickly. After the transmission the timer is reset to the full refresh time.
*
* @param SRDO This object.
* @return CO_ReturnError_t CO_ERROR_NO if request is granted
* @return #CO_ReturnError_t: CO_ERROR_NO if request is granted
*/
CO_ReturnError_t CO_SRDO_requestSend(CO_SRDO_t* SRDO);
CO_ReturnError_t CO_SRDO_config(CO_SRDO_t* SRDO, uint8_t SRDO_Index, CO_SRDOGuard_t* SRDOGuard, uint32_t* errInfo);
/**
* Process transmitting/receiving individual SRDO message.
*

View file

@ -61,11 +61,11 @@ extern "C" {
*
* Using this implementation, only master or slave can be included in one node at a time.
*
* For CAN identifiers see #CO_Default_CAN_ID_t
* For CAN identifiers see @ref CO_Default_CAN_ID_t
*/
/**
* @defgroup CO_LSS_cs_t LSS protocol command specifiers
* @defgroup CO_LSS_command_specifiers CO_LSS command specifiers
* @{
*
* The LSS protocols are executed between the LSS master device and the LSS slave device(s) to implement the LSS
@ -90,56 +90,59 @@ extern "C" {
#define CO_LSS_INQUIRE_REV 0x5CU /**< Inquire identity revision-number protocol */
#define CO_LSS_INQUIRE_SERIAL 0x5DU /**< Inquire identity serial-number protocol */
#define CO_LSS_INQUIRE_NODE_ID 0x5EU /**< Inquire node-ID protocol */
/** @} */ /* CO_LSS_cs_t */
/** @} */
/**
* @defgroup CO_LSS_cfgNodeId_t Error codes for Configure node ID protocol
* @defgroup CO_LSS_CFG_NODE_ID_status CO_LSS_CFG_NODE_ID status
* @{
* Error codes for Configure node ID protocol
*/
#define CO_LSS_CFG_NODE_ID_OK 0x00U /**< Protocol successfully completed */
#define CO_LSS_CFG_NODE_ID_OUT_OF_RANGE 0x01U /**< NID out of range */
#define CO_LSS_CFG_NODE_ID_MANUFACTURER 0xFFU /**< Manufacturer specific error. No further support */
/** @} */ /* CO_LSS_cfgNodeId_t */
/** @} */
/**
* @defgroup CO_LSS_cfgBitTiming_t Error codes for Configure bit timing parameters protocol
* @defgroup CO_LSS_CFG_BIT_TIMING_status CO_LSS_CFG_BIT_TIMING status
* @{
* Error codes for Configure bit timing parameters protocol
*/
#define CO_LSS_CFG_BIT_TIMING_OK 0x00U /**< Protocol successfully completed */
#define CO_LSS_CFG_BIT_TIMING_OUT_OF_RANGE 0x01U /**< Bit timing / Bit rate not supported */
#define CO_LSS_CFG_BIT_TIMING_MANUFACTURER 0xFFU /**< Manufacturer specific error. No further support */
/** @} */ /* CO_LSS_cfgBitTiming_t */
/** @} */
/**
* @defgroup CO_LSS_cfgStore_t Error codes for Store configuration protocol
* @defgroup CO_LSS_CFG_STORE_status CO_LSS_CFG_STORE status
* @{
* Error codes for Store configuration protocol
*/
#define CO_LSS_CFG_STORE_OK 0x00U /**< Protocol successfully completed */
#define CO_LSS_CFG_STORE_NOT_SUPPORTED 0x01U /**< Store configuration not supported */
#define CO_LSS_CFG_STORE_FAILED 0x02U /**< Storage media access error */
#define CO_LSS_CFG_STORE_MANUFACTURER 0xFFU /**< Manufacturer specific error. No further support */
/** @} */ /* CO_LSS_cfgStore_t */
/** @} */
/**
* @defgroup CO_LSS_fastscan_bitcheck Fastscan BitCheck. BIT0 means all bits are checked for equality by slave
* @defgroup CO_LSS_FASTSCAN_bitcheck CO_LSS_FASTSCAN bitcheck
* @{
* Fastscan BitCheck. BIT0 means all bits are checked for equality by slave
*/
#define CO_LSS_FASTSCAN_BIT0 0x00U /**< Least significant bit of IDnumbners bit area to be checked */
/* ... */
#define CO_LSS_FASTSCAN_BIT31 0x1FU /**< dito */
#define CO_LSS_FASTSCAN_CONFIRM 0x80U /**< All LSS slaves waiting for scan respond and previous scan is reset */
/** @} */ /* CO_LSS_fastscan_bitcheck */
/** @} */
/**
* @defgroup CO_LSS_fastscan_lss_sub_next Fastscan LSSsub, LSSnext
* @defgroup CO_LSS_FASTSCAN_lssSub_lssNext CO_LSS_FASTSCAN lssSub lssNext
* @{
*/
#define CO_LSS_FASTSCAN_VENDOR_ID 0x00U /**< Vendor ID */
#define CO_LSS_FASTSCAN_PRODUCT 0x01U /**< Product code */
#define CO_LSS_FASTSCAN_REV 0x02U /**< Revision number */
#define CO_LSS_FASTSCAN_SERIAL 0x03U /**< Serial number */
/** @} */ /* CO_LSS_fastscan_lss_sub_next */
/** @} */
/**
* The LSS address is a 128 bit number, uniquely identifying each node. It consists of the values in object 0x1018.
@ -156,7 +159,7 @@ typedef union {
} CO_LSS_address_t;
/**
* @defgroup CO_LSS_state_t LSS finite state automaton
* @defgroup CO_LSS_STATE_state CO_LSS_STATE state
* @{
*
* The LSS FSA shall provide the following states:
@ -167,11 +170,12 @@ typedef union {
*/
#define CO_LSS_STATE_WAITING 0x00U /**< LSS FSA waiting for requests */
#define CO_LSS_STATE_CONFIGURATION 0x01U /**< LSS FSA waiting for configuration */
/** @} */ /* CO_LSS_state_t */
/** @} */
/**
* @defgroup CO_LSS_bitTimingTable_t Definition of table_index for /CiA301/ bit timing table
* @defgroup CO_LSS_BIT_TIMING_table CO_LSS_BIT_TIMING table
* @{
* Definition of table_index for /CiA301/ bit timing table
*/
#define CO_LSS_BIT_TIMING_1000 0U /**< 1000kbit/s */
#define CO_LSS_BIT_TIMING_800 1U /**< 800kbit/s */
@ -183,7 +187,7 @@ typedef union {
#define CO_LSS_BIT_TIMING_20 7U /**< 20kbit/s */
#define CO_LSS_BIT_TIMING_10 8U /**< 10kbit/s */
#define CO_LSS_BIT_TIMING_AUTO 9U /**< Automatic bit rate detection */
/** @} */ /* CO_LSS_bitTimingTable_t */
/** @} */
/**
* Lookup table for conversion between bit timing table and numerical bit rate

View file

@ -28,7 +28,7 @@
/*
* @defgroup CO_LSSmaster_state_t
* @{
* LSS master slave select state machine. Compared to #CO_LSS_state_t this has information if we
* LSS master slave select state machine. Compared to @ref CO_LSS_STATE_state this has information if we
* currently have selected one or all slaves. This allows for some basic error checking.
*/
#define CO_LSSmaster_STATE_WAITING 0x00U
@ -306,9 +306,9 @@ CO_LSSmaster_swStateDeselect(CO_LSSmaster_t* LSSmaster) {
* - byte 2 -> Manufacturer Error, currently not used
*
* enums for the errorCode are
* - CO_LSS_cfgNodeId_t
* - CO_LSS_cfgBitTiming_t
* - CO_LSS_cfgStore_t
* - CO_LSS_CFG_NODE_ID_status
* - CO_LSS_CFG_BIT_TIMING
* - CO_LSS_CFG_STORE_status
*/
static CO_LSSmaster_return_t
CO_LSSmaster_configureCheckWait(CO_LSSmaster_t* LSSmaster, uint32_t timeDifference_us, uint8_t csWait) {

View file

@ -144,7 +144,7 @@ CO_ReturnError_t CO_LSSmaster_init(CO_LSSmaster_t* LSSmaster, uint16_t timeout_m
*
* On LSS, a "negative ack" is signaled by the slave not answering. Because of that, a low timeout value can
* significantly increase protocol speed in some cases (e.g. fastscan). However, as soon as there is activity on the
* bus, LSS messages can be delayed because of their low CAN network priority (see #CO_Default_CAN_ID_t).
* bus, LSS messages can be delayed because of their low CAN network priority (see @ref CO_Default_CAN_ID_t).
*
* @remark Be aware that a "late response" will seriously mess up LSS, so this value must be selected "as high as
* necessary and as low as possible". CiA does neither specify nor recommend a value.
@ -300,7 +300,7 @@ CO_LSSmaster_return_t CO_LSSmaster_InquireLssAddress(CO_LSSmaster_t* LSSmaster,
*
* @param LSSmaster This object.
* @param timeDifference_us Time difference from previous function call in [microseconds]. Zero when request is started.
* @param lssInquireCs One of CO_LSS_INQUIRE_xx commands from #CO_LSS_cs_t.
* @param lssInquireCs One of CO_LSS_INQUIRE_xx commands from @ref CO_LSS_command_specifiers.
* @param [out] value read result when function returns successfully
* @return #CO_LSSmaster_ILLEGAL_ARGUMENT, #CO_LSSmaster_INVALID_STATE, #CO_LSSmaster_WAIT_SLAVE, #CO_LSSmaster_OK,
* #CO_LSSmaster_TIMEOUT

View file

@ -75,7 +75,7 @@ extern "C" {
*/
typedef struct {
CO_LSS_address_t lssAddress; /**< From #CO_LSSslave_init */
uint8_t lssState; /**< #CO_LSS_state_t */
uint8_t lssState; /**< @ref CO_LSS_STATE_state */
CO_LSS_address_t lssSelect; /**< Received LSS Address by select */
CO_LSS_address_t lssFastscan; /**< Received LSS Address by fastscan */
uint8_t fastscanPos; /**< Current state of fastscan */
@ -160,7 +160,7 @@ bool_t CO_LSSslave_process(CO_LSSslave_t* LSSslave);
* Get current LSS state
*
* @param LSSslave This object.
* @return #CO_LSS_state_t
* @return @ref CO_LSS_STATE_state
*/
static inline uint8_t
CO_LSSslave_getState(CO_LSSslave_t* LSSslave) {

View file

@ -395,8 +395,6 @@ void CO_GTWA_log_print(CO_GTWA_t* gtwa, const char* message);
* is possible. Can be connected to hardware switch, for example.
* @param timeDifference_us Time difference from previous function call in [microseconds].
* @param [out] timerNext_us info to OS - see CO_process().
*
* @return CO_ReturnError_t: CO_ERROR_NO on success or CO_ERROR_ILLEGAL_ARGUMENT
*/
void CO_GTWA_process(CO_GTWA_t* gtwa, bool_t enable, uint32_t timeDifference_us, uint32_t* timerNext_us);

View file

@ -334,8 +334,8 @@ typedef struct {
#endif
#endif
#if (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0) || defined CO_DOXYGEN
CO_SRDOGuard_t* SRDOGuard; /**< SRDO guard object, initialised by @ref CO_SRDO_init_start(), single SRDOGuard object
is included inside all SRDO objects */
CO_SRDOGuard_t* SRDOGuard; /**< SRDO guard object, initialised by CO_SRDOGuard_init(), single SRDOGuard object is
included inside all SRDO objects */
CO_SRDO_t* SRDO; /**< SRDO objects, initialised by @ref CO_SRDO_init() */
#if defined CO_MULTIPLE_OD || defined CO_DOXYGEN
uint16_t RX_IDX_SRDO; /**< Start index in CANrx. */
@ -491,9 +491,10 @@ CO_ReturnError_t CO_CANopenInitPDO(CO_t* co, CO_EM_t* em, OD_t* od, uint8_t node
* nor processed.
* @param [out] errInfo Additional information in case of error, may be NULL.
*
* @return CO_ERROR_NO in case of success.
* @return #CO_ERROR_NO in case of success.
*/
#if (((CO_CONFIG_GFC)&CO_CONFIG_GFC_ENABLE) != 0) || (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0)
#if (((CO_CONFIG_GFC)&CO_CONFIG_GFC_ENABLE) != 0) || (((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0) \
|| defined CO_DOXYGEN
CO_ReturnError_t CO_CANopenInitSRDO(CO_t* co, CO_EM_t* em, OD_t* od, uint8_t nodeId, uint32_t* errInfo);
#endif
@ -573,7 +574,7 @@ void CO_process_TPDO(CO_t* co, bool_t syncWas, uint32_t timeDifference_us, uint3
* @param timeDifference_us Time difference from previous function call in microseconds.
* @param [out] timerNext_us info to OS - see CO_process().
*
* @return @CO_SRDO_state_t lowest state of the SRDO objects.
* @return #CO_SRDO_state_t: lowest state of the SRDO objects.
*/
CO_SRDO_state_t CO_process_SRDO(CO_t* co, uint32_t timeDifference_us, uint32_t* timerNext_us);
#endif

719
Doxyfile

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@ Documentation, support and contributions
----------------------------------------
All code is documented in the source header files. Some additional documents are in `doc` directory.
To generate complete html documentation, run [doxygen](http://www.doxygen.nl/) in the project base directory: `sudo apt install doxygen graphviz pdf2svg; doxygen > /dev/null`
To generate complete html documentation, run [doxygen](https://www.doxygen.nl/index.html) in the project base directory: `sudo apt install doxygen graphviz pdf2svg; doxygen > /dev/null`
Complete generated documentation is also available online: https://canopennode.github.io
@ -65,8 +65,6 @@ Tutorial, demo device and tests are available in [CANopenDemo](https://github.co
Report issues on https://github.com/CANopenNode/CANopenNode/issues
Older discussion group is on Sourceforge: http://sourceforge.net/p/canopennode/discussion/387151/
Contributions are welcome. Best way to contribute your code is to fork a project, modify it and then send a pull request. Please follow the [Recommended C style and coding rules](https://github.com/MaJerle/c-code-style), use .clang-format file for automatic code formatting.
The CANopenNode files conform to the [MISRA C:2012](https://www.misra.org.uk) guidelines, with some noted exceptions, as indicated in [MISRA.md](MISRA.md).

View file

@ -1,8 +1,8 @@
Object Dictionary
=================
Definitions from CiA 301 {#definitions-from-cia-301}
----------------------------------------------------
Definitions from CiA 301
------------------------
The **Object Dictionary** is a collection of all the data items which have an influence on the behavior of the application objects, the communication objects and the state machine used on this device. It serves as an interface between the communication and the application.
The object dictionary is essentially a grouping of objects accessible via the network in an ordered pre-defined fashion. Each object within the object dictionary is addressed using a 16-bit index and a 8-bit sub-index.
@ -11,8 +11,8 @@ A **SDO** (Service Data Object) is providing direct access to object entries of
A **PDO** (Process Data Object) is providing real-time data transfer of object entries of a CANopen device's object dictionary. The transfer of PDO is performed with no protocol overhead. The PDO correspond to objects in the object dictionary and provide the interface to the application objects. Data type and mapping of application objects into a PDO is determined by a corresponding PDO mapping structure within the object dictionary.
Operation {#operation}
----------------------
Operation
---------
### Terms
The term **OD object** means object from object dictionary located at specific 16-bit index. There are different types of OD objects in CANopen: variables, arrays and records (structures). Each OD object contains pointer to actual data, data length(s) and attribute(s). See @ref OD_objectTypes_t.
@ -85,8 +85,8 @@ void myFuncGlob(void) {
```
Object Dictionary Example {#object-dictionary-example}
------------------------------------------------------
Object Dictionary Example
-------------------------
Actual Object dictionary for one CANopen device is defined by pair of OD_xyz.h and ODxyz.c files.
Suffix "xyz" is unique name of the object dictionary. If single default object dictionary is used, suffix is omitted. Such way configuration with multiple object dictionaries is possible.
@ -239,8 +239,8 @@ OD_t *ODxyz = &_ODxyz;
```
XML Device Description {#xml-device-description}
------------------------------------------------
XML Device Description
----------------------
CANopen device description - XML schema definition - is specified by CiA 311 standard.
CiA 311 complies with standard ISO 15745-1:2005/Amd1 (Industrial automation systems and integration - Open systems application integration framework).
@ -450,8 +450,8 @@ Other elements listed in the above XML example are required by the standard. The
(4) Default value for DOMAIN is stored as empty string.
Object Dictionary Requirements By CANopenNode {#object-dictionary-requirements-by-canopennode}
----------------------------------------------------------------------------------------------
Object Dictionary Requirements By CANopenNode
---------------------------------------------
* **Used by** column indicates CANopenNode object or its part, which uses the OD object. It also indicates, if OD object is required or optional for actual configuration. For the configuration of the CANopenNode objects see [Stack configuration](301/CO_config.h). If CANopenNode object or its part is disabled in stack configuration, then OD object is not used. Note that OD objects: 1000, 1001 and 1017 and 1018 are mandatory for CANopen.
* **CO_countLabel** column indicates, which value must have property "CO_countLabel" inside OD object.

View file

@ -128,8 +128,6 @@ typedef struct {
* @param triggerTime Pointer to variable, which will show last trigger time of the variable.
* @param idx_OD_traceConfig Index in Object Dictionary.
* @param idx_OD_trace Index in Object Dictionary.
*
* @return 0 on success, -1 on error.
*/
void CO_trace_init(
CO_trace_t *trace,
@ -157,8 +155,6 @@ void CO_trace_init(
*
* @param trace This object.
* @param timestamp Timestamp (usually in millisecond resolution).
*
* @return 0 on success, -1 on error.
*/
void CO_trace_process(CO_trace_t *trace, uint32_t timestamp);