1.1.3.4.1 DRV_METROLOGY_Initialize Function
C
SYS_MODULE_OBJ DRV_METROLOGY_Initialize ( SYS_MODULE_INIT * init, uint32_t resetValue );
Summary
Initializes the metrology driver according to the init parameter and the cause of the reset of the main processor.
Description
This routine initializes the metrology driver making it ready for clients to open and use. The initialization data is specified by the init parameter. It is a single instance driver.
Parameters
Param | Description |
---|---|
init | Pointer to the init data structure containing any data necessary to initialize the driver. |
resetValue | Reset cause of the main processor. |
Returns
If successful, returns a valid handle to a driver instance object. Otherwise, it returns SYS_MODULE_OBJ_INVALID.
Example
SYS_MODULE_OBJ sysObjDrvMet; extern uint8_t met_bin_start; extern uint8_t met_bin_end; /* Metrology Driver Initialization Data */ DRV_METROLOGY_INIT drvMetrologyInitData = { /* MET bin destination address */ .regBaseAddress = DRV_METROLOGY_REG_BASE_ADDRESS, /* MET Binary start address */ .binStartAddress = (uint32_t)&met_bin_start, /* MET Binary end address */ .binEndAddress = (uint32_t)&met_bin_end, }; sysObjDrvMet = DRV_METROLOGY_Initialize((SYS_MODULE_INIT *)&drvMetrologyInitData, RSTC_ResetCauseGet());
Remarks
This routine must be called before any other DRV_METROLOGY routine is called.