1.2.5.1 ADP_Initialize Function

C

SYS_MODULE_OBJ ADP_Initialize (
    const SYS_MODULE_INDEX index,
    const SYS_MODULE_INIT * const init
);

Summary

Initializes the ADP module for the specified Index.

Description

This routine initializes the ADP module making it ready for clients to open and use. It is called from System Initialization routine, application does not have to call this initialization function.

Parameters

ParamDescription
indexIndex for the instance to be initialized (single instance allowed)
initPointer to the init data structure containing any data necessary to initialize the module. See ADP_INIT for details

Returns

If successful, returns a valid module instance object. Otherwise, returns SYS_MODULE_OBJ_INVALID.

Example

ADP_INIT initData;
SYS_MODULE_OBJ sysObjAdp;

// Populate initData if needed

sysObjAdp = ADP_Initialize(G3_ADP_INDEX_0, (SYS_MODULE_INIT *)&initData);
if (sysObjAdp == SYS_MODULE_OBJ_INVALID)
{
    // Handle error
}

Remarks

This routine must be called before any other ADP routine is called.