ConOpSys V2970  P004.07
ANVILEX control operating system
ad_obj.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ********************************************************************************
3 ** **
4 ** ABCC Starter Kit version 3.04.01 (2018-01-23) **
5 ** **
6 ** Delivered with: **
7 ** ABP 7.55.01 (2017-12-20) **
8 ** ABCC Driver 5.04.01 (2017-12-18) **
9 ** */
10 /*******************************************************************************
11 ********************************************************************************
12 ** COPYRIGHT NOTIFICATION (c) 2015 HMS Industrial Networks AB **
13 ** **
14 ** This code is the property of HMS Industrial Networks AB. **
15 ** The source code may not be reproduced, distributed, or used without **
16 ** permission. When used together with a product from HMS, permission is **
17 ** granted to modify, reproduce and distribute the code in binary form **
18 ** without any restrictions. **
19 ** **
20 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT **
21 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR **
22 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR **
23 ** THAT DEFECTS IN IT CAN BE CORRECTED. **
24 ********************************************************************************
25 ********************************************************************************
26 ** Application Data Object 0xFE (ADI) - Public interfaces
27 ********************************************************************************
28 ********************************************************************************
29 ** Services :
30 ** AD_Init() - Initiate AD object.
31 ** AD_ProcObjectRequest() - Object request handling.
32 ** AD_RemapDone() - Remap finished.
33 ** AD_UpdatePdReadData() - Update of read process data.
34 ** AD_UpdatePdWriteData() - Update of write process data.
35 ********************************************************************************
36 ********************************************************************************
37 */
38 #ifndef AD_OBJ_H
39 #define AD_OBJ_H
40 
41 #include "abcc_drv_cfg.h"
42 
43 #include "abp.h"
44 
45 #include "abcc_ad_if.h"
46 
47 #include "ABCC_Base.h"
48 
49 /*******************************************************************************
50 ** Typedefs
51 ********************************************************************************
52 */
53 
54 /*******************************************************************************
55 ** Public Services
56 ********************************************************************************
57 */
58 /*------------------------------------------------------------------------------
59 ** Initiates the AD object.
60 **------------------------------------------------------------------------------
61 ** Arguments:
62 ** psAdiEntry - Pointer to used ADI entry table.
63 ** iNumAdi - Number of ADI:s in ADI entry table.
64 ** psDefaultMap - Pointer to default map. Set to NULL if no default map
65 ** shall be used.
66 **
67 ** Returns:
68 ** APPL_ErrCodeType
69 **------------------------------------------------------------------------------
70 */
71 EXTFUNC APPL_ErrCodeType AD_Init( const AD_AdiEntryType* psAdiEntry,
72  U16 iNumAdi,
73  const AD_DefaultMapType* psDefaultMap );
74 
75 /*------------------------------------------------------------------------------
76 ** Retrieve default mapping information from AD object. The AD objects also
77 ** prepares for network endian conversion if needed. The function may only be
78 ** called when requested by driver through the callback ABCC_CbfAdiMappingReq()
79 **------------------------------------------------------------------------------
80 ** Arguments:
81 ** ppsAdiEntry - Pointer to retrieve ADI entry table.
82 ** NULL is returned if no default map is available.
83 ** ppsDefaultMap - Pointer to retrieve default map information.
84 ** NULL is returned if no default map is available.
85 **
86 ** Returns:
87 ** Number of ADI:s in psAdiEntry table.
88 **------------------------------------------------------------------------------
89 */
90 EXTFUNC U16 AD_AdiMappingReq( const AD_AdiEntryType** ppsAdiEntry,
91  const AD_DefaultMapType** ppsDefaultMap );
92 
93 /*------------------------------------------------------------------------------
94 ** Indicate to AD object that the remap is finished
95 **------------------------------------------------------------------------------
96 ** Arguments:
97 ** None
98 **
99 ** Returns:
100 ** None
101 **------------------------------------------------------------------------------
102 */
103 #if( ABCC_CFG_REMAP_SUPPORT_ENABLED )
104 EXTFUNC void AD_RemapDone( void );
105 #endif
106 
107 /*------------------------------------------------------------------------------
108 ** Process an object request against the Application Data Object.
109 **------------------------------------------------------------------------------
110 ** Arguments:
111 ** psMsgBuffer - Pointer to ABCC command message.
112 **
113 ** Returns:
114 ** None
115 **------------------------------------------------------------------------------
116 */
117 EXTFUNC void AD_ProcObjectRequest( ABP_MsgType* psMsgBuffer );
118 
119 /*------------------------------------------------------------------------------
120 ** Update AD object with new read process data received from the ABCC.
121 **------------------------------------------------------------------------------
122 ** Arguments:
123 ** pxPdDataBuf - Pointer read process data buffer.
124 **
125 ** Returns:
126 ** None
127 **------------------------------------------------------------------------------
128 */
129 EXTFUNC void AD_UpdatePdReadData( void* pxPdDataBuf );
130 
131 /*------------------------------------------------------------------------------
132 ** Fetch write process data from AD object.
133 **------------------------------------------------------------------------------
134 ** Arguments:
135 ** pxPdDataBuf - Pointer write process data buffer.
136 **
137 ** Returns:
138 ** TRUE - Write process data buffer is updated.
139 ** FALSE - No update was made.
140 **
141 **------------------------------------------------------------------------------
142 */
143 EXTFUNC BOOL AD_UpdatePdWriteData( void* pxPdDataBuf );
144 #endif /* inclusion lock */
ANYBUS module base class header file.
enum APPL_ErrCode APPL_ErrCodeType
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
#define EXTFUNC
Definition: Defines.h:998
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
void AD_RemapDone(void)
Definition: ad_obj.c:2613
EXTFUNC void AD_UpdatePdReadData(void *pxPdDataBuf)
Definition: ad_obj.c:2509
EXTFUNC void AD_ProcObjectRequest(ABP_MsgType *psMsgBuffer)
Definition: ad_obj.c:1891
EXTFUNC APPL_ErrCodeType AD_Init(const AD_AdiEntryType *psAdiEntry, U16 iNumAdi, const AD_DefaultMapType *psDefaultMap)
Definition: ad_obj.c:1756
EXTFUNC BOOL AD_UpdatePdWriteData(void *pxPdDataBuf)
Definition: ad_obj.c:2550
EXTFUNC U16 AD_AdiMappingReq(const AD_AdiEntryType **ppsAdiEntry, const AD_DefaultMapType **ppsDefaultMap)
Definition: ad_obj.c:2592