CO_LSSslave.h
Go to the documentation of this file.
#ifndef CO_LSSslave_H
#define CO_LSSslave_H
#include "305/CO_LSS.h"
#if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
#ifdef __cplusplus
extern "C" {
#endif
typedef struct{
CO_LSS_address_t lssAddress;
CO_LSS_state_t lssState;
CO_LSS_address_t lssSelect;
CO_LSS_address_t lssFastscan;
uint8_t fastscanPos;
uint16_t *pendingBitRate;
uint8_t *pendingNodeID;
uint8_t activeNodeID;
volatile void *sendResponse;
CO_LSS_cs_t service;
uint8_t CANdata[8];
#if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
void (*pFunctSignalPre)(void *object);
void *functSignalObjectPre;
#endif
bool_t (*pFunctLSScheckBitRate)(void *object, uint16_t bitRate);
void *functLSScheckBitRateObject;
void (*pFunctLSSactivateBitRate)(void *object, uint16_t delay);
void *functLSSactivateBitRateObject;
bool_t (*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate);
void *functLSScfgStoreObject;
CO_CANmodule_t *CANdevTx;
CO_CANtx_t *TXbuff;
}CO_LSSslave_t;
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);
bool_t CO_LSSslave_process(CO_LSSslave_t *LSSslave);
static inline CO_LSS_state_t CO_LSSslave_getState(CO_LSSslave_t *LSSslave) {
return (LSSslave == NULL) ? CO_LSS_STATE_WAITING : LSSslave->lssState;
}
#if ((CO_CONFIG_LSS) & CO_CONFIG_FLAG_CALLBACK_PRE) || defined CO_DOXYGEN
void CO_LSSslave_initCallbackPre(
CO_LSSslave_t *LSSslave,
void *object,
void (*pFunctSignalPre)(void *object));
#endif
void CO_LSSslave_initCheckBitRateCallback(
CO_LSSslave_t *LSSslave,
void *object,
bool_t (*pFunctLSScheckBitRate)(void *object, uint16_t bitRate));
void CO_LSSslave_initActivateBitRateCallback(
CO_LSSslave_t *LSSslave,
void *object,
void (*pFunctLSSactivateBitRate)(void *object, uint16_t delay));
void CO_LSSslave_initCfgStoreCallback(
CO_LSSslave_t *LSSslave,
void *object,
bool_t (*pFunctLSScfgStore)(void *object, uint8_t id, uint16_t bitRate));
/*@defgroup CO_LSSslave*/
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /* (CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE */
#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