2.1.4 Library Interface
Multi-channel Metrology driver library provides the following interfaces:
Functions
| Name | Description |
|---|---|
| DRV_MCMETROLOGY_Initialize | Initializes the metrology Driver for PIC32CXMTx dual-core devices |
| DRV_MCMETROLOGY_Reinitialize | Re-initializes the metrology Driver for PIC32CXMTx dual-core devices |
| DRV_MCMETROLOGY_Open | Opens the specified metrology driver |
| DRV_MCMETROLOGY_Close | Closes an opened instance of the metrology driver |
| DRV_MCMETROLOGY_Start | Start running the metrology library in coprocessor |
| DRV_MCMETROLOGY_Tasks | Performs the tasks necessary to maintain a state machine of the metrology driver |
| DRV_MCMETROLOGY_IntegrationCallbackRegister | Allows a client to set an event handling function for the driver to call back when the integration period has completed |
| DRV_MCMETROLOGY_HarmonicAnalysisCallbackRegister | Allows a client to set an event handling function for the driver to call back when the harmonic data is ready as a result of the harmonic analysis |
| DRV_MCMETROLOGY_GetAFEDescription | Get the AFE type. AFE type could be used to get information about the MCP devices configuration. |
| DRV_MCMETROLOGY_GetChannelDescription | Get the pointer to the channel description table. Channel description table could be used to get information about how channels have been configured. |
| DRV_MCMETROLOGY_GetPowersDescription | Get the pointer to the power description table. Power description table could be used to get information about the channel selection as power source for each one. |
| DRV_MCMETROLOGY_GetStatus | Gets the current status of the metrology driver |
| DRV_MCMETROLOGY_GetStatusData | Get the pointer to the status registers of the metrology library |
| DRV_MCMETROLOGY_GetControlData | Gets the pointer to the control registers of the metrology library |
| DRV_MCMETROLOGY_GetControlByDefault | Gets the pointer to the control registers defined by MCC configurator |
| DRV_MCMETROLOGY_GetAccData | Gets the pointer to the accumulated quantities of the metrology library |
| DRV_MCMETROLOGY_GetHarData | Gets the pointer to the Harmonic analysis quantities of the metrology library |
| DRV_MCMETROLOGY_SetControl | Sets the value of all the control registers of the metrology library |
| DRV_MCMETROLOGY_GetEnergyValue | Gets the last energy calculated value |
| DRV_MCMETROLOGY_GetChannelMeasureValue | Gets the last value of the selected measurement type on the selected channel |
| DRV_MCMETROLOGY_GetPowerMeasureValue | Gets the last value of the selected measurement type on the selected power |
| DRV_MCMETROLOGY_GetMeasureValue | Gets the last value of the selected measurement |
| DRV_MCMETROLOGY_SetConfiguration | Not supported in this version |
| DRV_MCMETROLOGY_GetEventsData | Gets the pointer to the last events obtained from the metrology library |
| DRV_MCMETROLOGY_StartHarmonicAnalysis | Request a new Harmonic analysis |
| DRV_MCMETROLOGY_StopHarmonicAnalysis | Stops the running Harmonic analysis |
Data Types and Constants
| Name | Type | Description |
|---|---|---|
| DRV_MCMETROLOGY_RESULT | Enum | Result of a Metrology driver interface operation |
| DRV_MCMETROLOGY_START_MODE | Enum | Identifies types of startup process |
| DRV_MCMETROLOGY_CALLBACK | Typedef | Pointer to a metrology event handler function |
| DRV_MCMETROLOGY_HARMONICS_CALLBACK | Typedef | Pointer to a harmonic analysis event handler function |
| DRV_MCMETROLOGY_SENSOR_TYPE | Enum | Identifies types of metrology sensors |
| DRV_MCMETROLOGY_GAIN_TYPE | Enum | Identifies possible gain values for the AFE (Analog Front End) |
| DRV_MCMETROLOGY_HARMONIC_RMS | Struct | Identifies the result of the Harmonic Analysis process |
| DRV_MCMETROLOGY_HARMONIC_ANALYSIS | Struct | Internal data used to perform an harmonic analysis |
| DRV_MCMETROLOGY_AFE_EVENTS | Struct | Identifies all events related to metrology library |
| DRV_MCMETROLOGY_CHANNEL | Struct | Describes the channel configuration |
| DRV_MCMETROLOGY_POWER_SOURCE | Struct | Describes the power source configuration |
| DRV_MCMETROLOGY_AFE_TYPE | Enum | Describes the connection with MCP devices |
| DRV_MCMETROLOGY_CHANNEL_MEASURE_TYPE | Enum | Identifies all types of channel measurements |
| DRV_MCMETROLOGY_POWER_MEASURE_TYPE | Enum | Identifies all types of power source measurements |
| DRV_MCMETROLOGY_MEASURE_TYPE | Enum | Identifies all types of generic measurements |
| DRV_MCMETROLOGY_AFE_DATA | Struct | Identifies the data calculated from the metrology AFE measurements |
| DRV_MCMETROLOGY_STATUS | Enum | Identifies the status of the metrology library |
| DRV_MCMETROLOGY_INIT | Struct | Identifies values needed for the initialization routine |
