1.4.3.1 PAL_PLC_Initialize Function

C

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

Summary

Initializes the PLC PAL module.

Description

This routine initializes the PLC PAL module, making it ready for clients to use it. The initialization data is specified by the init parameter. It is a single instance module, so this function should be called only once (unless PAL_PLC_Deinitialize is called).

Precondition

None.

Parameters

ParamDescription
indexIdentifier for the instance to be initialized. Only one instance (index 0) supported.
initPointer to the initialization data structure containing the data necessary to initialize the module.

Returns

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

Example

PAL_PLC_INIT palPlcInitData;
SYS_MODULE_OBJ palPlcObj;

palPlcInitData.macRtBand = G3_FCC;
palPlcInitData.macRtHandlers.palPlcDataIndication = _plcDataIndication;
palPlcInitData.macRtHandlers.palPlcTxConfirm = _plcTxConfirm;
palPlcInitData.macRtHandlers.palPlcCommStatusIndication = _plcCommStatusIndication;
palPlcInitData.macRtHandlers.palPlcRxParamsIndication = _plcRxParamsIndication;
palPlcInitData.initMIB = true;
// Initialize the PLC PAL module
palPlcObj = PAL_PLC_Initialize(PAL_PLC_PHY_INDEX, (const SYS_MODULE_INIT *) &palPlcInitData);

Remarks

This routine must be called before any other PLC PAL routine is called.