CANopenNode
CANopen protocol stack
Loading...
Searching...
No Matches
CO_LSSslave.h
Go to the documentation of this file.
1
23#ifndef CO_LSSslave_H
24#define CO_LSSslave_H
25
26#include "305/CO_LSS.h"
27
28#if (((CO_CONFIG_LSS)&CO_CONFIG_LSS_SLAVE) != 0) || defined CO_DOXYGEN
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
76typedef struct {
85 volatile void*
88 uint8_t CANdata[8];
90#if (((CO_CONFIG_LSS)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0) || defined CO_DOXYGEN
91 void (*pFunctSignalPre)(void* object);
93#endif
94 bool_t (*pFunctLSScheckBitRate)(void* object,
95 uint16_t bitRate);
96 void* functLSScheckBitRateObject;
97 void (*pFunctLSSactivateBitRate)(
98 void* object, uint16_t delay);
99 void* functLSSactivateBitRateObject;
100 bool_t (*pFunctLSScfgStore)(void* object, uint8_t id,
101 uint16_t bitRate);
102 void* functLSScfgStoreObject;
106
142 uint8_t* pendingNodeID, CO_CANmodule_t* CANdevRx, uint16_t CANdevRxIdx,
143 uint16_t CANidLssMaster, CO_CANmodule_t* CANdevTx, uint16_t CANdevTxIdx,
144 uint16_t CANidLssSlave);
145
158
165static inline uint8_t
167 return (LSSslave == NULL) ? CO_LSS_STATE_WAITING : LSSslave->lssState;
168}
169
170#if (((CO_CONFIG_LSS)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0) || defined CO_DOXYGEN
181void CO_LSSslave_initCallbackPre(CO_LSSslave_t* LSSslave, void* object, void (*pFunctSignalPre)(void* object));
182#endif
183
196void CO_LSSslave_initCkBitRateCall(CO_LSSslave_t* LSSslave, void* object,
197 bool_t (*pFunctLSScheckBitRate)(void* object, uint16_t bitRate));
198
212 void (*pFunctLSSactivateBitRate)(void* object, uint16_t delay));
213
227void CO_LSSslave_initCfgStoreCall(CO_LSSslave_t* LSSslave, void* object,
228 bool_t (*pFunctLSScfgStore)(void* object, uint8_t id, uint16_t bitRate));
229
230 /* @defgroup CO_LSSslave */
231
232#ifdef __cplusplus
233}
234#endif /* __cplusplus */
235
236#endif /* (CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE */
237
238#endif /* CO_LSSslave_H */
CANopen Layer Setting Services protocol (common).
#define CO_LSS_STATE_WAITING
LSS FSA waiting for requests.
Definition CO_LSS.h:171
void CO_LSSslave_initCkBitRateCall(CO_LSSslave_t *LSSslave, void *object, bool_t(*pFunctLSScheckBitRate)(void *object, uint16_t bitRate))
Initialize verify bit rate callback.
static uint8_t CO_LSSslave_getState(CO_LSSslave_t *LSSslave)
Get current LSS state.
Definition CO_LSSslave.h:166
void CO_LSSslave_initCallbackPre(CO_LSSslave_t *LSSslave, void *object, void(*pFunctSignalPre)(void *object))
Initialize LSSslaveRx callback function.
CO_ReturnError_t CO_LSSslave_init(CO_LSSslave_t *LSSslave, CO_LSS_address_t *lssAddress, uint16_t *pendingBitRate, uint8_t *pendingNodeID, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, uint16_t CANidLssMaster, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx, uint16_t CANidLssSlave)
Initialize LSS object.
void CO_LSSslave_initActBitRateCall(CO_LSSslave_t *LSSslave, void *object, void(*pFunctLSSactivateBitRate)(void *object, uint16_t delay))
Initialize activate bit rate callback.
void CO_LSSslave_initCfgStoreCall(CO_LSSslave_t *LSSslave, void *object, bool_t(*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate))
Store configuration callback.
bool_t CO_LSSslave_process(CO_LSSslave_t *LSSslave)
Process LSS communication.
#define NULL
NULL, for general usage.
Definition CO_driver.h:123
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition CO_driver.h:132
uint_fast8_t bool_t
Boolean data type for general use.
Definition CO_driver.h:126
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition CO_driver.h:131
CO_ReturnError_t
Return values of some CANopen functions.
Definition CO_driver.h:449
Complete CAN module object.
Definition CO_driver.h:268
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition CO_driver.h:250
LSS slave object.
Definition CO_LSSslave.h:76
CO_CANtx_t * TXbuff
CAN transmit buffer.
Definition CO_LSSslave.h:104
void * functSignalObjectPre
Pointer to object.
Definition CO_LSSslave.h:92
CO_LSS_address_t lssSelect
Received LSS Address by select.
Definition CO_LSSslave.h:79
CO_LSS_address_t lssFastscan
Received LSS Address by fastscan.
Definition CO_LSSslave.h:80
uint8_t lssState
CO_LSS_STATE state
Definition CO_LSSslave.h:78
CO_CANmodule_t * CANdevTx
Pointer to object.
Definition CO_LSSslave.h:103
uint16_t * pendingBitRate
Bit rate value that is temporarily configured.
Definition CO_LSSslave.h:82
uint8_t activeNodeID
Node ID used at the CAN interface.
Definition CO_LSSslave.h:84
uint8_t * pendingNodeID
Node ID that is temporarily configured.
Definition CO_LSSslave.h:83
uint8_t service
Service, which will have to be processed by mainline processing function.
Definition CO_LSSslave.h:87
CO_LSS_address_t lssAddress
From CO_LSSslave_init.
Definition CO_LSSslave.h:77
uint8_t fastscanPos
Current state of fastscan.
Definition CO_LSSslave.h:81
volatile void * sendResponse
Variable indicates, if LSS response has to be sent by mainline processing function.
Definition CO_LSSslave.h:86
The LSS address is a 128 bit number, uniquely identifying each node.
Definition CO_LSS.h:150