CANopenNode
CO_LSSslave.h
Go to the documentation of this file.
1 
28 #ifndef CO_LSSslave_H
29 #define CO_LSSslave_H
30 
31 #include "305/CO_LSS.h"
32 
33 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
90 typedef struct{
102  volatile void *sendResponse;
104  uint8_t CANdata[8];
106 #if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
107  void (*pFunctSignalPre)(void *object);
109 #endif
110  bool_t (*pFunctLSScheckBitRate)(void *object, uint16_t bitRate);
111  void *functLSScheckBitRateObject;
112  void (*pFunctLSSactivateBitRate)(void *object, uint16_t delay);
113  void *functLSSactivateBitRateObject;
114  bool_t (*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate);
115  void *functLSScfgStoreObject;
120 
161  CO_LSSslave_t *LSSslave,
162  CO_LSS_address_t *lssAddress,
163  uint16_t *pendingBitRate,
164  uint8_t *pendingNodeID,
165  CO_CANmodule_t *CANdevRx,
166  uint16_t CANdevRxIdx,
167  uint32_t CANidLssMaster,
168  CO_CANmodule_t *CANdevTx,
169  uint16_t CANdevTxIdx,
170  uint32_t CANidLssSlave);
171 
186 
194  return (LSSslave == NULL) ? CO_LSS_STATE_WAITING : LSSslave->lssState;
195 }
196 
197 
198 #if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
199 
212  CO_LSSslave_t *LSSslave,
213  void *object,
214  void (*pFunctSignalPre)(void *object));
215 #endif
216 
217 
232  CO_LSSslave_t *LSSslave,
233  void *object,
234  bool_t (*pFunctLSScheckBitRate)(void *object, uint16_t bitRate));
235 
251  CO_LSSslave_t *LSSslave,
252  void *object,
253  void (*pFunctLSSactivateBitRate)(void *object, uint16_t delay));
254 
270  CO_LSSslave_t *LSSslave,
271  void *object,
272  bool_t (*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate));
273  /*@defgroup CO_LSSslave*/
275 
276 #ifdef __cplusplus
277 }
278 #endif /*__cplusplus*/
279 
280 #endif /* (CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE */
281 
282 #endif /*CO_LSSslave_H*/
CO_LSSslave_t::lssFastscan
CO_LSS_address_t lssFastscan
Received LSS Address by fastscan.
Definition: CO_LSSslave.h:95
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_LSSslave_init
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, uint32_t CANidLssMaster, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx, uint32_t CANidLssSlave)
Initialize LSS object.
CO_LSS.h
CANopen Layer Setting Services protocol (common).
CO_LSSslave_initActivateBitRateCallback
void CO_LSSslave_initActivateBitRateCallback(CO_LSSslave_t *LSSslave, void *object, void(*pFunctLSSactivateBitRate)(void *object, uint16_t delay))
Initialize activate bit rate callback.
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_LSSslave_initCfgStoreCallback
void CO_LSSslave_initCfgStoreCallback(CO_LSSslave_t *LSSslave, void *object, bool_t(*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate))
Store configuration callback.
CO_LSSslave_t::CANdevTx
CO_CANmodule_t * CANdevTx
Pointer to object.
Definition: CO_LSSslave.h:117
bool_t
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
CO_LSS_cs_t
CO_LSS_cs_t
LSS protocol command specifiers.
Definition: CO_LSS.h:86
CO_LSSslave_t::service
CO_LSS_cs_t service
Service, which will have to be processed by mainline processing function.
Definition: CO_LSSslave.h:103
CO_LSSslave_process
bool_t CO_LSSslave_process(CO_LSSslave_t *LSSslave)
Process LSS communication.
CO_LSSslave_initCallbackPre
void CO_LSSslave_initCallbackPre(CO_LSSslave_t *LSSslave, void *object, void(*pFunctSignalPre)(void *object))
Initialize LSSslaveRx callback function.
CO_LSSslave_initCheckBitRateCallback
void CO_LSSslave_initCheckBitRateCallback(CO_LSSslave_t *LSSslave, void *object, bool_t(*pFunctLSScheckBitRate)(void *object, uint16_t bitRate))
Initialize verify bit rate callback.
CO_LSS_STATE_WAITING
@ CO_LSS_STATE_WAITING
LSS FSA waiting for requests.
Definition: CO_LSS.h:182
CO_LSSslave_t::lssState
CO_LSS_state_t lssState
CO_LSS_state_t
Definition: CO_LSSslave.h:92
CO_LSSslave_t
LSS slave object.
Definition: CO_LSSslave.h:90
CO_LSSslave_t::fastscanPos
uint8_t fastscanPos
Current state of fastscan.
Definition: CO_LSSslave.h:96
CO_LSS_state_t
CO_LSS_state_t
LSS finite state automaton.
Definition: CO_LSS.h:181
CO_LSSslave_t::lssSelect
CO_LSS_address_t lssSelect
Received LSS Address by select.
Definition: CO_LSSslave.h:93
CO_LSSslave_t::pendingNodeID
uint8_t * pendingNodeID
Node ID that is temporarily configured.
Definition: CO_LSSslave.h:99
CO_LSSslave_t::activeNodeID
uint8_t activeNodeID
Node ID used at the CAN interface.
Definition: CO_LSSslave.h:100
CO_LSSslave_t::functSignalObjectPre
void * functSignalObjectPre
Pointer to object.
Definition: CO_LSSslave.h:108
NULL
#define NULL
NULL, for general usage.
Definition: CO_driver.h:135
CO_CANmodule_t
Complete CAN module object.
Definition: CO_driver.h:319
CO_LSSslave_t::lssAddress
CO_LSS_address_t lssAddress
From CO_LSSslave_init.
Definition: CO_LSSslave.h:91
CO_LSSslave_t::sendResponse
volatile void * sendResponse
Variable indicates, if LSS response has to be sent by mainline processing function.
Definition: CO_LSSslave.h:102
CO_LSSslave_getState
static CO_LSS_state_t CO_LSSslave_getState(CO_LSSslave_t *LSSslave)
Get current LSS state.
Definition: CO_LSSslave.h:193
CO_LSS_address_t
The LSS address is a 128 bit number, uniquely identifying each node.
Definition: CO_LSS.h:162
CO_LSSslave_t::pendingBitRate
uint16_t * pendingBitRate
Bit rate value that is temporarily configured.
Definition: CO_LSSslave.h:98
CO_CANtx_t
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151
CO_LSSslave_t::TXbuff
CO_CANtx_t * TXbuff
CAN transmit buffer.
Definition: CO_LSSslave.h:118