ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Macros | Typedefs | Functions | Variables
ad_obj.c File Reference
#include "abcc_obj_cfg.h"
#include "abp.h"
#include "abcc_ad_if.h"
#include "abcc.h"
#include "ABCC_Base.h"
#include "ad_obj.h"
Include dependency graph for ad_obj.c:

Classes

union  ad_AllProperties
 
union  ad_AllData
 
struct  ad_Map
 
struct  ad_MapInfo
 

Macros

#define AD_OA_REV_VALUE   3
 
#define AD_MAP_PAD_INDEX   ( 0xfffe )
 
#define AD_INVALID_ADI_INDEX   ( 0xffff )
 
#define AD_ALL_ADI_INDEX   ( 0xffff )
 
#define OctetToByteOffset(x)   ( x )
 
#define Is_BITx_Or_PADx(type)   ( ABP_Is_PADx( type ) || ABP_Is_BITx( type ) )
 
#define MIN_MAX_DEFAULT_NOT_SUPPORTED(type)   ( ( (type) == ABP_CHAR ) || Is_BITx_Or_PADx( type ) )
 
#define AddBitsToOctetSize(octet, bits)
 
#define SizeInOctets(octet, bits)   ( (octet) + ( (bits) + 7 ) / 8 )
 
#define BitToOctetOffset(bitOffset)   ( (bitOffset) >> 3 )
 

Typedefs

typedef union ad_AllProperties ad_AllPropertiesType
 
typedef union ad_AllData ad_AllDataType
 
typedef struct ad_Map ad_MapType
 
typedef struct ad_MapInfo ad_MapInfoType
 

Functions

static void Copy16WithEndianSwap (void *pxDest, U16 iDestOctetOffset, const void *pxSrc, U16 iSrcOctetOffset, U16 iNumElem)
 
static void Copy32WithEndianSwap (void *pxDest, U16 iDestOctetOffset, const void *pxSrc, U16 iSrcOctetOffset, U16 iNumElem)
 
static U16 GetAdiSizeInOctets (const AD_AdiEntryType *psAdiEntry)
 
static U16 GetAdiMapSizeInBits (const AD_AdiEntryType *psAdiEntry, U8 bNumElem, U8 bElemStartIndex)
 
static void UpdateMapSize (ad_MapInfoType *psMap)
 
static U16 GetAdiIndex (U16 iInstance)
 
static U16 CopyBitData (void *pxDest, U16 iDestBitOffset, const void *pxSrc, U16 iSrcBitOffset, U8 bDataType, U16 iNumElem)
 
static U16 CopyValue (void *pxDst, U16 iDestBitOffset, const void *pxSrc, U16 iSrcBitOffset, U8 bDataType, U16 iNumElem)
 
static void GetAdiValue (const AD_AdiEntryType *psAdiEntry, void *pxDest, U8 bNumElements, U8 bStartIndex, U16 *piDestBitOffset, BOOL fExplicit)
 
static void SetAdiValue (const AD_AdiEntryType *psAdiEntry, void *pxData, U8 bNumElements, U8 bStartIndex, U16 *piSrcBitOffset, BOOL fExplicit)
 
EXTFUNC APPL_ErrCodeType AD_Init (const AD_AdiEntryType *psAdiEntry, U16 iNumAdi, const AD_DefaultMapType *psDefaultMap)
 
const AD_AdiEntryType * AD_GetAdiInstEntry (U16 iInstance)
 
void AD_ProcObjectRequest (ABP_MsgType *psMsgBuffer)
 
void AD_UpdatePdReadData (void *pxPdDataBuf)
 
BOOL AD_UpdatePdWriteData (void *pxPdDataBuf)
 
U16 AD_AdiMappingReq (const AD_AdiEntryType **ppsAdiEntry, const AD_DefaultMapType **ppsDefaultMap)
 
void AD_RemapDone (void)
 

Variables

static BOOL ad_fDoNetworkEndianSwap = false
 
static const AD_DefaultMapType * ad_asDefaultMap = NULL
 
static const AD_AdiEntryType * ad_asADIEntryList = NULL
 
static U16 ad_iNumOfADIs
 
static U16 ad_iHighestInstanceNumber
 
static ad_MapType ad_PdReadMapping [AD_MAX_NUM_READ_MAP_ENTRIES]
 
static ad_MapType ad_PdWriteMapping [AD_MAX_NUM_WRITE_MAP_ENTRIES]
 
static ad_MapInfoType ad_ReadMapInfo
 
static ad_MapInfoType ad_WriteMapInfo
 

Macro Definition Documentation

◆ AD_ALL_ADI_INDEX

#define AD_ALL_ADI_INDEX   ( 0xffff )

◆ AD_INVALID_ADI_INDEX

#define AD_INVALID_ADI_INDEX   ( 0xffff )

◆ AD_MAP_PAD_INDEX

#define AD_MAP_PAD_INDEX   ( 0xfffe )

◆ AD_OA_REV_VALUE

#define AD_OA_REV_VALUE   3

◆ AddBitsToOctetSize

#define AddBitsToOctetSize (   octet,
  bits 
)
Value:
do \
{ \
(octet) += (bits) >> 3; \
(bits) %= 8; \
} \
while( 0 )

◆ BitToOctetOffset

#define BitToOctetOffset (   bitOffset)    ( (bitOffset) >> 3 )

◆ Is_BITx_Or_PADx

#define Is_BITx_Or_PADx (   type)    ( ABP_Is_PADx( type ) || ABP_Is_BITx( type ) )

◆ MIN_MAX_DEFAULT_NOT_SUPPORTED

#define MIN_MAX_DEFAULT_NOT_SUPPORTED (   type)    ( ( (type) == ABP_CHAR ) || Is_BITx_Or_PADx( type ) )

◆ OctetToByteOffset

#define OctetToByteOffset (   x)    ( x )

◆ SizeInOctets

#define SizeInOctets (   octet,
  bits 
)    ( (octet) + ( (bits) + 7 ) / 8 )

Typedef Documentation

◆ ad_AllDataType

typedef union ad_AllData ad_AllDataType

◆ ad_AllPropertiesType

◆ ad_MapInfoType

typedef struct ad_MapInfo ad_MapInfoType

◆ ad_MapType

typedef struct ad_Map ad_MapType

Function Documentation

◆ AD_AdiMappingReq()

U16 AD_AdiMappingReq ( const AD_AdiEntryType **  ppsAdiEntry,
const AD_DefaultMapType **  ppsDefaultMap 
)

References ad_iNumOfADIs.

◆ AD_GetAdiInstEntry()

const AD_AdiEntryType* AD_GetAdiInstEntry ( U16  iInstance)

References ad_asADIEntryList, GetAdiIndex(), and NULL.

Referenced by AD_ProcObjectRequest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AD_Init()

EXTFUNC APPL_ErrCodeType AD_Init ( const AD_AdiEntryType *  psAdiEntry,
U16  iNumAdi,
const AD_DefaultMapType *  psDefaultMap 
)

◆ AD_ProcObjectRequest()

void AD_ProcObjectRequest ( ABP_MsgType *  psMsgBuffer)

References AD_ALL_ADI_INDEX, ad_asADIEntryList, AD_GetAdiInstEntry(), ad_iNumOfADIs, ad_ReadMapInfo, ad_WriteMapInfo, GetAdiSizeInOctets(), GetAdiValue(), NULL, SetAdiValue(), and SizeInOctets.

Referenced by ABCC_CbfReceiveMsg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AD_RemapDone()

void AD_RemapDone ( void  )

◆ AD_UpdatePdReadData()

void AD_UpdatePdReadData ( void *  pxPdDataBuf)

◆ AD_UpdatePdWriteData()

BOOL AD_UpdatePdWriteData ( void *  pxPdDataBuf)

◆ Copy16WithEndianSwap()

static void Copy16WithEndianSwap ( void *  pxDest,
U16  iDestOctetOffset,
const void *  pxSrc,
U16  iSrcOctetOffset,
U16  iNumElem 
)
static

Referenced by CopyValue().

Here is the caller graph for this function:

◆ Copy32WithEndianSwap()

static void Copy32WithEndianSwap ( void *  pxDest,
U16  iDestOctetOffset,
const void *  pxSrc,
U16  iSrcOctetOffset,
U16  iNumElem 
)
static

Referenced by CopyValue().

Here is the caller graph for this function:

◆ CopyBitData()

static U16 CopyBitData ( void *  pxDest,
U16  iDestBitOffset,
const void *  pxSrc,
U16  iSrcBitOffset,
U8  bDataType,
U16  iNumElem 
)
static

References AddBitsToOctetSize.

Referenced by CopyValue().

Here is the caller graph for this function:

◆ CopyValue()

static U16 CopyValue ( void *  pxDst,
U16  iDestBitOffset,
const void *  pxSrc,
U16  iSrcBitOffset,
U8  bDataType,
U16  iNumElem 
)
static

References ad_fDoNetworkEndianSwap, BitToOctetOffset, Copy16WithEndianSwap(), Copy32WithEndianSwap(), CopyBitData(), and Is_BITx_Or_PADx.

Referenced by GetAdiValue(), and SetAdiValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAdiIndex()

static U16 GetAdiIndex ( U16  iInstance)
static

References ad_asADIEntryList, ad_iNumOfADIs, AD_INVALID_ADI_INDEX, and AD_MAP_PAD_INDEX.

Referenced by AD_GetAdiInstEntry(), and AD_Init().

Here is the caller graph for this function:

◆ GetAdiMapSizeInBits()

static U16 GetAdiMapSizeInBits ( const AD_AdiEntryType *  psAdiEntry,
U8  bNumElem,
U8  bElemStartIndex 
)
static

References NULL.

Referenced by GetAdiValue(), and UpdateMapSize().

Here is the caller graph for this function:

◆ GetAdiSizeInOctets()

static U16 GetAdiSizeInOctets ( const AD_AdiEntryType *  psAdiEntry)
static

References NULL.

Referenced by AD_ProcObjectRequest().

Here is the caller graph for this function:

◆ GetAdiValue()

static void GetAdiValue ( const AD_AdiEntryType *  psAdiEntry,
void *  pxDest,
U8  bNumElements,
U8  bStartIndex,
U16 piDestBitOffset,
BOOL  fExplicit 
)
static

References CopyValue(), GetAdiMapSizeInBits(), NULL, and SizeInOctets.

Referenced by AD_ProcObjectRequest(), and AD_UpdatePdWriteData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAdiValue()

static void SetAdiValue ( const AD_AdiEntryType *  psAdiEntry,
void *  pxData,
U8  bNumElements,
U8  bStartIndex,
U16 piSrcBitOffset,
BOOL  fExplicit 
)
static

References CopyValue(), and NULL.

Referenced by AD_ProcObjectRequest(), and AD_UpdatePdReadData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMapSize()

static void UpdateMapSize ( ad_MapInfoType psMap)
static

Variable Documentation

◆ ad_asADIEntryList

const AD_AdiEntryType* ad_asADIEntryList = NULL
static

◆ ad_asDefaultMap

const AD_DefaultMapType* ad_asDefaultMap = NULL
static

Referenced by AD_Init().

◆ ad_fDoNetworkEndianSwap

BOOL ad_fDoNetworkEndianSwap = false
static

Referenced by CopyValue().

◆ ad_iHighestInstanceNumber

U16 ad_iHighestInstanceNumber
static

Referenced by AD_Init().

◆ ad_iNumOfADIs

U16 ad_iNumOfADIs
static

◆ ad_PdReadMapping

ad_MapType ad_PdReadMapping[AD_MAX_NUM_READ_MAP_ENTRIES]
static

Referenced by AD_Init().

◆ ad_PdWriteMapping

ad_MapType ad_PdWriteMapping[AD_MAX_NUM_WRITE_MAP_ENTRIES]
static

Referenced by AD_Init().

◆ ad_ReadMapInfo

ad_MapInfoType ad_ReadMapInfo
static

◆ ad_WriteMapInfo

ad_MapInfoType ad_WriteMapInfo
static