CANopenNode
CO_LSSmaster.h
Go to the documentation of this file.
1 
27 #ifndef CO_LSSmaster_H
28 #define CO_LSSmaster_H
29 
30 #include "305/CO_LSS.h"
31 
32 #if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_MASTER) || defined CO_DOXYGEN
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
91 typedef enum {
103 
104 
108 typedef struct{
120  volatile void *CANrxNew;
121  uint8_t CANrxData[8];
122 #if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
123  void (*pFunctSignal)(void *object);
125 #endif
129 
130 
135 #ifndef CO_LSSmaster_DEFAULT_TIMEOUT
136 #define CO_LSSmaster_DEFAULT_TIMEOUT 1000U /* ms */
137 #endif
138 
139 
157  CO_LSSmaster_t *LSSmaster,
158  uint16_t timeout_ms,
159  CO_CANmodule_t *CANdevRx,
160  uint16_t CANdevRxIdx,
161  uint32_t CANidLssSlave,
162  CO_CANmodule_t *CANdevTx,
163  uint16_t CANdevTxIdx,
164  uint32_t CANidLssMaster);
165 
186  CO_LSSmaster_t *LSSmaster,
187  uint16_t timeout_ms);
188 
189 
190 #if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
191 
204  CO_LSSmaster_t *LSSmaster,
205  void *object,
206  void (*pFunctSignal)(void *object));
207 #endif
208 
209 
228  CO_LSSmaster_t *LSSmaster,
229  uint32_t timeDifference_us,
230  CO_LSS_address_t *lssAddress);
231 
232 
246  CO_LSSmaster_t *LSSmaster);
247 
248 
268  CO_LSSmaster_t *LSSmaster,
269  uint32_t timeDifference_us,
270  uint16_t bit);
271 
272 
293  CO_LSSmaster_t *LSSmaster,
294  uint32_t timeDifference_us,
295  uint8_t nodeId);
296 
297 
317  CO_LSSmaster_t *LSSmaster,
318  uint32_t timeDifference_us);
319 
320 
341  CO_LSSmaster_t *LSSmaster,
342  uint16_t switchDelay_ms);
343 
344 
364  CO_LSSmaster_t *LSSmaster,
365  uint32_t timeDifference_us,
366  CO_LSS_address_t *lssAddress);
367 
368 
389  CO_LSSmaster_t *LSSmaster,
390  uint32_t timeDifference_us,
391  CO_LSS_cs_t lssInquireCs,
392  uint32_t *value);
393 
394 
398 typedef enum {
403 
407 typedef struct{
412 
468  CO_LSSmaster_t *LSSmaster,
469  uint32_t timeDifference_us,
470  CO_LSSmaster_fastscan_t *fastscan);
471  /*@defgroup CO_LSSmaster*/
473 
474 #ifdef __cplusplus
475 }
476 #endif /*__cplusplus*/
477 
478 #endif /* (CO_CONFIG_LSS) & CO_CONFIG_LSS_MASTER */
479 
480 #endif /*CO_LSSmaster_H*/
CO_LSSmaster_OK_MANUFACTURER
@ CO_LSSmaster_OK_MANUFACTURER
LSS success, node rejected argument with manufacturer error code.
Definition: CO_LSSmaster.h:101
uint32_t
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
CO_LSSmaster_t::fsLssSub
uint8_t fsLssSub
Current state of node state machine.
Definition: CO_LSSmaster.h:116
CO_LSSmaster_SCAN_NOACK
@ CO_LSSmaster_SCAN_NOACK
No node found that matches scan request.
Definition: CO_LSSmaster.h:98
CO_LSSmaster_fastscan_t::found
CO_LSS_address_t found
Scan result.
Definition: CO_LSSmaster.h:410
CO_LSS.h
CANopen Layer Setting Services protocol (common).
uint16_t
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
CO_LSSmaster_InquireLssAddress
CO_LSSmaster_return_t CO_LSSmaster_InquireLssAddress(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, CO_LSS_address_t *lssAddress)
Request LSS inquire LSS address.
CO_LSSmaster_t::fsBitChecked
uint8_t fsBitChecked
Current scan bit position.
Definition: CO_LSSmaster.h:117
CO_LSSmaster_ActivateBit
CO_LSSmaster_return_t CO_LSSmaster_ActivateBit(CO_LSSmaster_t *LSSmaster, uint16_t switchDelay_ms)
Request LSS activate bit timing.
CO_ReturnError_t
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
CO_LSSmaster_t::CANdevTx
CO_CANmodule_t * CANdevTx
From CO_LSSmaster_init()
Definition: CO_LSSmaster.h:126
CO_LSSmaster_IdentifyFastscan
CO_LSSmaster_return_t CO_LSSmaster_IdentifyFastscan(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, CO_LSSmaster_fastscan_t *fastscan)
Select a node by LSS identify fastscan.
CO_LSS_cs_t
CO_LSS_cs_t
LSS protocol command specifiers.
Definition: CO_LSS.h:86
CO_LSSmaster_switchStateDeselect
CO_LSSmaster_return_t CO_LSSmaster_switchStateDeselect(CO_LSSmaster_t *LSSmaster)
Request LSS switch state deselect.
CO_LSSmaster_switchStateSelect
CO_LSSmaster_return_t CO_LSSmaster_switchStateSelect(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, CO_LSS_address_t *lssAddress)
Request LSS switch state select.
CO_LSSmaster_t::functSignalObject
void * functSignalObject
Pointer to object.
Definition: CO_LSSmaster.h:124
CO_LSSmaster_OK
@ CO_LSSmaster_OK
Success, end of communication.
Definition: CO_LSSmaster.h:94
CO_LSSmaster_initCallbackPre
void CO_LSSmaster_initCallbackPre(CO_LSSmaster_t *LSSmaster, void *object, void(*pFunctSignal)(void *object))
Initialize LSSmasterRx callback function.
CO_LSSmaster_configureNodeId
CO_LSSmaster_return_t CO_LSSmaster_configureNodeId(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, uint8_t nodeId)
Request LSS configure node ID.
CO_LSSmaster_SCAN_FAILED
@ CO_LSSmaster_SCAN_FAILED
An error occurred while scanning.
Definition: CO_LSSmaster.h:99
CO_LSSmaster_t::fsState
uint8_t fsState
Current state of fastscan master state machine.
Definition: CO_LSSmaster.h:115
CO_LSSmaster_Inquire
CO_LSSmaster_return_t CO_LSSmaster_Inquire(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, CO_LSS_cs_t lssInquireCs, uint32_t *value)
Request LSS inquire node ID or part of LSS address.
CO_LSSmaster_WAIT_SLAVE
@ CO_LSSmaster_WAIT_SLAVE
No response arrived from slave yet.
Definition: CO_LSSmaster.h:93
CO_LSSmaster_t::timeout_us
uint32_t timeout_us
LSS response timeout in us.
Definition: CO_LSSmaster.h:109
CO_LSSmaster_t::state
uint8_t state
Node is currently selected.
Definition: CO_LSSmaster.h:111
CO_LSSmaster_t::fsIdNumber
uint32_t fsIdNumber
Current scan result.
Definition: CO_LSSmaster.h:118
CO_LSSmaster_scantype_t
CO_LSSmaster_scantype_t
Scan type for CO_LSSmaster_fastscan_t scan.
Definition: CO_LSSmaster.h:398
CO_LSSmaster_fastscan_t
Parameters for LSS fastscan CO_LSSmaster_IdentifyFastscan.
Definition: CO_LSSmaster.h:407
CO_LSSmaster_t
LSS master object.
Definition: CO_LSSmaster.h:108
CO_LSSmaster_return_t
CO_LSSmaster_return_t
Return values of LSS master functions.
Definition: CO_LSSmaster.h:91
CO_LSSmaster_FS_SKIP
@ CO_LSSmaster_FS_SKIP
Skip this value.
Definition: CO_LSSmaster.h:400
CO_LSSmaster_changeTimeout
void CO_LSSmaster_changeTimeout(CO_LSSmaster_t *LSSmaster, uint16_t timeout_ms)
Change LSS master timeout.
CO_LSSmaster_ILLEGAL_ARGUMENT
@ CO_LSSmaster_ILLEGAL_ARGUMENT
Invalid argument.
Definition: CO_LSSmaster.h:96
CO_LSSmaster_t::TXbuff
CO_CANtx_t * TXbuff
CAN transmit buffer.
Definition: CO_LSSmaster.h:127
CO_LSSmaster_FS_MATCH
@ CO_LSSmaster_FS_MATCH
Full 32 bit value is given as argument, just verify.
Definition: CO_LSSmaster.h:401
CO_LSSmaster_FS_SCAN
@ CO_LSSmaster_FS_SCAN
Do full 32 bit scan.
Definition: CO_LSSmaster.h:399
CO_LSSmaster_SCAN_FINISHED
@ CO_LSSmaster_SCAN_FINISHED
Scanning finished successful.
Definition: CO_LSSmaster.h:92
CO_LSSmaster_TIMEOUT
@ CO_LSSmaster_TIMEOUT
No reply received.
Definition: CO_LSSmaster.h:95
CO_LSSmaster_fastscan_t::match
CO_LSS_address_t match
Value to match in case of CO_LSSmaster_FS_MATCH.
Definition: CO_LSSmaster.h:409
CO_CANmodule_t
Complete CAN module object.
Definition: CO_driver.h:319
CO_LSSmaster_OK_ILLEGAL_ARGUMENT
@ CO_LSSmaster_OK_ILLEGAL_ARGUMENT
LSS success, node rejected argument because of non-supported value.
Definition: CO_LSSmaster.h:100
CO_LSSmaster_configureStore
CO_LSSmaster_return_t CO_LSSmaster_configureStore(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us)
Request LSS store configuration.
CO_LSSmaster_t::timeoutTimer
uint32_t timeoutTimer
Timeout timer for LSS communication.
Definition: CO_LSSmaster.h:113
CO_LSSmaster_INVALID_STATE
@ CO_LSSmaster_INVALID_STATE
State machine not ready or already processing a request.
Definition: CO_LSSmaster.h:97
CO_LSS_address_t
The LSS address is a 128 bit number, uniquely identifying each node.
Definition: CO_LSS.h:162
CO_LSSmaster_configureBitTiming
CO_LSSmaster_return_t CO_LSSmaster_configureBitTiming(CO_LSSmaster_t *LSSmaster, uint32_t timeDifference_us, uint16_t bit)
Request LSS configure Bit Timing.
CO_CANtx_t
Configuration object for CAN transmit message for specific CANopenNode Object.
Definition: CO_driver.h:299
CO_LSSmaster_t::command
uint8_t command
Active command.
Definition: CO_LSSmaster.h:112
CO_LSSmaster_t::CANrxNew
volatile void * CANrxNew
Indication if new LSS message is received from CAN bus.
Definition: CO_LSSmaster.h:120
CO_LSSmaster_init
CO_ReturnError_t CO_LSSmaster_init(CO_LSSmaster_t *LSSmaster, uint16_t timeout_ms, CO_CANmodule_t *CANdevRx, uint16_t CANdevRxIdx, uint32_t CANidLssSlave, CO_CANmodule_t *CANdevTx, uint16_t CANdevTxIdx, uint32_t CANidLssMaster)
Initialize LSS object.
uint8_t
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition: CO_driver.h:151