NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
objacces.h File Reference
#include <applicfg.h>

Go to the source code of this file.

Macros

#define getODentry(OD, wIndex, bSubindex, pDestData, pExpectedSize, pDataType, checkAccess)
 
#define readLocalDict(OD, wIndex, bSubindex, pDestData, pExpectedSize, pDataType, checkAccess)
 
#define setODentry(d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess)
 
#define writeLocalDict(d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess)
 

Typedefs

typedef UNS32(* valueRangeTest_t) (UNS8 typeValue, void *Value)
 
typedef void(* storeODSubIndex_t) (CO_Data *d, UNS16 wIndex, UNS8 bSubindex)
 

Functions

void _storeODSubIndex (CO_Data *d, UNS16 wIndex, UNS8 bSubindex)
 <BRIEF>
 
UNS8 accessDictionaryError (UNS16 index, UNS8 subIndex, UNS32 sizeDataDict, UNS32 sizeDataGiven, UNS32 code)
 
UNS32 _getODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS32 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess, UNS8 endianize)
 _getODentry() Reads an entry from the object dictionary.

 
UNS32 _setODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS32 *pExpectedSize, UNS8 checkAccess, UNS8 endianize)
 By this function you can write an entry into the object dictionary.
 
const indextablescanIndexOD (CO_Data *d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback)
 Scan the index of object dictionary. Used only by setODentry and getODentry.
 
UNS32 RegisterSetODentryCallBack (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback)
 <BRIEF>
 

Detailed Description

Created on: Oct 9, 2024 Author: jenej

Definition in file objacces.h.

Macro Definition Documentation

◆ getODentry

#define getODentry ( OD,
wIndex,
bSubindex,
pDestData,
pExpectedSize,
pDataType,
checkAccess )
Value:
_getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
pDataType, checkAccess, 1)
UNS32 _getODentry(CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS32 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess, UNS8 endianize)
_getODentry() Reads an entry from the object dictionary.
Definition objacces.c:111

Definition at line 32 of file objacces.h.

◆ readLocalDict

#define readLocalDict ( OD,
wIndex,
bSubindex,
pDestData,
pExpectedSize,
pDataType,
checkAccess )
Value:
_getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
pDataType, checkAccess, 0)

Definition at line 37 of file objacces.h.

◆ setODentry

#define setODentry ( d,
wIndex,
bSubindex,
pSourceData,
pExpectedSize,
checkAccess )
Value:
_setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, \
checkAccess, 1)
UNS32 _setODentry(CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS32 *pExpectedSize, UNS8 checkAccess, UNS8 endianize)
By this function you can write an entry into the object dictionary.
Definition objacces.c:235

Definition at line 52 of file objacces.h.

◆ writeLocalDict

#define writeLocalDict ( d,
wIndex,
bSubindex,
pSourceData,
pExpectedSize,
checkAccess )
Value:
_setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess, 0)

Definition at line 57 of file objacces.h.

Typedef Documentation

◆ storeODSubIndex_t

typedef void(* storeODSubIndex_t) (CO_Data *d, UNS16 wIndex, UNS8 bSubindex)

Definition at line 14 of file objacces.h.

◆ valueRangeTest_t

typedef UNS32(* valueRangeTest_t) (UNS8 typeValue, void *Value)

Definition at line 13 of file objacces.h.

Function Documentation

◆ _getODentry()

UNS32 _getODentry ( CO_Data * d,
UNS16 wIndex,
UNS8 bSubindex,
void * pDestData,
UNS32 * pExpectedSize,
UNS8 * pDataType,
UNS8 checkAccess,
UNS8 endianize )

_getODentry() Reads an entry from the object dictionary.

use getODentry() macro to read from object and endianize use readLocalDict() macro to read from object and not endianize

// Example usage:
UNS8 *pbData;
UNS8 length;
UNS32 returnValue;
returnValue = getODentry( (UNS16)0x100B, (UNS8)1,
(void * *)&pbData, (UNS8 *)&length );
if( returnValue != SUCCESSFUL )
{
// error handling
}
#define UNS8
Unsigned int8 representation in CANFest.
Definition applicfg.h:25
#define UNS16
Unsigned int16 representation in CANFest.
Definition applicfg.h:26
#define UNS32
Unsigned int32 representation in CANFest.
Definition applicfg.h:27
Parameters
*dPointer to a CAN object data structure
wIndexThe index in the object dictionary where you want to read an entry
bSubindexThe subindex of the Index. e.g. mostly subindex 0 is used to tell you how many valid entries you can find in this index. Look at the canopen standard for further information
*pDestDataPointer to the pointer which points to the variable where the value of this object dictionary entry should be copied
*pExpectedSizeThis function writes the size of the copied value (in Byte) into this variable.
*pDataTypePointer to the type of the data. See objdictdef.h
CheckAccessif other than 0, do not read if the data is Write Only [Not used today. Put always 0].
EndianizeWhen not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness
Returns
  • OD_SUCCESSFUL is returned upon success.
  • SDO abort code is returned if error occurs . (See file def.h)

Definition at line 111 of file objacces.c.

◆ _setODentry()

UNS32 _setODentry ( CO_Data * d,
UNS16 wIndex,
UNS8 bSubindex,
void * pSourceData,
UNS32 * pExpectedSize,
UNS8 checkAccess,
UNS8 endianize )

By this function you can write an entry into the object dictionary.

Parameters
*dPointer to a CAN object data structure
wIndexThe index in the object dictionary where you want to write an entry
bSubindexThe subindex of the Index. e.g. mostly subindex 0 is used to tell you how many valid entries you can find in this index. Look at the canopen standard for further information
*pSourceDataPointer to the variable that holds the value that should be copied into the object dictionary
*pExpectedSizeThe size of the value (in Byte).
checkAccessFlag that indicate if a check rights must be perfomed (0 : no , other than 0 : yes)
endianizeWhen not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness
Returns
  • OD_SUCCESSFUL is returned upon success.
  • SDO abort code is returned if error occurs . (See file def.h)

Definition at line 235 of file objacces.c.

◆ scanIndexOD()

const indextable * scanIndexOD ( CO_Data * d,
UNS16 wIndex,
UNS32 * errorCode,
ODCallback_t ** Callback )

Scan the index of object dictionary. Used only by setODentry and getODentry.

Parameters
*dPointer to a CAN object data structure
wIndex
*errorCode: OD_SUCCESSFUL if index foundor SDO abort code. (See file def.h)
**Callback
Returns
NULL if index not found. Else : return the table part of the object dictionary.

Definition at line 343 of file objacces.c.

Referenced by PDOInit(), and RegisterSetODentryCallBack().

Here is the caller graph for this function: