CANopen Slave Documentation
Version 6.16.04
|
This module implements variables and callback functions for manufacturer specific objects. The header file and the corresponding implementation file provide example code. The code has to be adopted to the application by the manufacturer.
The following table gives an overview of the example objects in this file.
Index | Example | Function / Variable |
---|---|---|
2000h | Access to an array of uint16_t | CosMob_Idx2000 |
2001h | Access to uint8_t with limit check | CosMob_Idx2001 |
2002h | Access to uint8_t value | ubCosMob_Var2002G |
2003h | Access to uint16_t value | uwCosMob_Var2003G |
2004h | Access to uint32_t value | ulCosMob_Var2004G |
2005h | Access to uint64_t value | uqCosMob_Var2005G |
2006h | Deferred SDO response | CosMob_Idx2006 |
2007h | Access to character string | CosMob_Idx2007 |
2008h | Access to character string | szCosMob_Str2008G[] |
2009h | Write-only object, uint32_t value | ulCosMob_Var2009G |
Functions | |
void | CosMob_ParmInit (void) |
uint8_t | CosMob_ParmLoad (void) |
uint8_t | CosMob_ParmSave (void) |
uint8_t | CosMob_Idx2000 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
uint8_t | CosMob_Idx2001 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
uint8_t | CosMob_Idx2006 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
uint8_t | CosMob_Idx2007 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
void | CosMob_PdoRcvHandler (uint32_t ulMapEntryV) |
void | CosMob_PdoTrmHandler (uint32_t ulMapEntryV) |
Variables | |
uint8_t | ubCosMob_Var2002G |
uint16_t | uwCosMob_Var2003G |
uint32_t | ulCosMob_Var2004G |
char | szCosMob_Str2008G [] |
uint32_t | ulCosMob_Var2009G |
uint8_t CosMob_Idx2000 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 2000h - Example function 1.
ubSubIndexV | - sub-index |
ubReqCodeV | - read / write access |
This function provides an example for read/write access to an array of values (16 bit unsigned). The size of the array is defined via the constant value MOB2000_SIZE inside the implementation file.
The function is called by the protocol stack.
The function returns a SDO response code defined by the CosSdo_e enumeration.
uint8_t CosMob_Idx2001 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 2001h - Example function 2.
ubSubIndexV | - sub-index |
ubReqCodeV | - read / write access |
This function provides an example for read/write access to value with limit check.
The function is called by the protocol stack.
The function returns a SDO response code defined by the CosSdo_e enumeration.
uint8_t CosMob_Idx2006 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 2006h - Example function 3.
ubSubIndexV | - sub-index |
ubReqCodeV | - read / write access |
This function provides an example for read/write access to an object with deferred SDO response. The application is responsible to sent a valid response later.
The function is called by the protocol stack.
The function returns a SDO response code defined by the CosSdo_e enumeration.
uint8_t CosMob_Idx2007 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 2007h - Example function 4.
ubSubIndexV | sub-index |
ubReqCodeV | read / write access |
This function provides an example for read/write access to a character string with segmented SDO transfer. On reception, the character string is tested for length and the value of the first character.
The function is called by the protocol stack.
The function returns a SDO response code defined by the CosSdo_e enumeration.
void CosMob_ParmInit | ( | void | ) |
Initialise manufacturer variables.
This function is used to initialise manufacturer variables with default values. The code provides an example and has to be adopted to the application by the manufacturer.
The function is called by the protocol stack (CosMgrParmInit()).
uint8_t CosMob_ParmLoad | ( | void | ) |
Load manufacturer variables from NV-memory.
This function is used to load manufacturer variables with previously stored values.
The function is called by the protocol stack (CosMgrParmLoad()).
uint8_t CosMob_ParmSave | ( | void | ) |
Save manufacturer variables to NV-memory.
This function is used to save manufacturer variables to a non-volatile memory.
The function is called by the protocol stack (CosMgrParmSave()).
void CosMob_PdoRcvHandler | ( | uint32_t | ulMapEntryV | ) |
Demo implementation of callback handler for a mapping entry.
ulMapEntryV | - Mapping entry |
void CosMob_PdoTrmHandler | ( | uint32_t | ulMapEntryV | ) |
Demo implementation of callback handler for a mapping entry.
ulMapEntryV | - Mapping entry |
|
extern |
Global variable for data direct access via SDO (read/write)
|
extern |
Global variable for data direct access via SDO (read/write) and PDO (write only).
|
extern |
Global variable for data direct access via SDO (read/write) and PDO (read only).
|
extern |
Global variable for write-only via SDO
|
extern |
Global variable for data direct access via SDO (read/write) and PDO (write only).