Jump to main content

# 1.1.4 Library Interface

Metrology driver library provides the following interfaces:

Functions

Name | Description
--- | ---
DRV_METROLOGY_Initialize | Initializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_METROLOGY_Reinitialize | Re-initializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_METROLOGY_Open | Opens the metrology driver
DRV_METROLOGY_Close | Closes an opened instance of the metrology driver
DRV_METROLOGY_Start | Starts running the metrology library in coprocessor
DRV_METROLOGY_Tasks | Performs the tasks necessary to maintain a state machine of the metrology driver
DRV_METROLOGY_IntegrationCallbackRegister | Allows a client to set an event handling function for the driver to call back when the integration period has completed
DRV_METROLOGY_CalibrationCallbackRegister | Allows a client to set an event handling function for the driver to call back when the calibration process has finished
DRV_METROLOGY_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_METROLOGY_GetStatus | Gets the current status of the metrology driver
DRV_METROLOGY_GetAFEDescription | Gets an enumerate value which defines the AFE connected to the metrology library
DRV_METROLOGY_GetChannelDescription | Gets the pointer to a table containing information about how channels have been configured
DRV_METROLOGY_GetStatusData | Get the pointer to the status registers of the metrology library
DRV_METROLOGY_GetControlData | Gets the pointer to the control registers of the metrology library
DRV_METROLOGY_GetControlByDefault | Gets the pointer to the control registers default value, as defined by MCC configurator
DRV_METROLOGY_GetAccData | Gets the pointer to the integration period accumulated quantities of the metrology library
DRV_METROLOGY_GetPerCycleAccData | Gets the pointer to the per-cycle accumulated quantities of the metrology library
DRV_METROLOGY_GetHarData | Gets the pointer to the harmonic analysis quantities of the metrology library
DRV_METROLOGY_SetControl | Sets the value of all the control registers of the metrology library
DRV_METROLOGY_GetEnergyValue | Gets the last energy calculated value
DRV_METROLOGY_GetMeasureValue | Gets the value of the desired measurement
DRV_METROLOGY_GetEventsData | Gets the last events information obtained from the metrology library
DRV_METROLOGY_GetCalibrationReferences | Gets the pointer to calibration references used in the calibration process
DRV_METROLOGY_StartCalibration | Starts internal calibration process
DRV_METROLOGY_StartHarmonicAnalysis | Request a new harmonic analysis
DRV_METROLOGY_StopHarmonicAnalysis | Stops the running harmonic analysis
DRV_METROLOGY_CaptureSetOptions | Sets the configuration options of the waveform capture process
DRV_METROLOGY_CaptureEnableChannels | Enables the channels to be captured
DRV_METROLOGY_CaptureDisableChannels | Disables the capture on selected channels
DRV_METROLOGY_CaptureStart | Starts the capture process in the selected buffer with a given length
DRV_METROLOGY_CaptureStop | Stops the capture process
DRV_METROLOGY_CaptureGetState | Gets the current state of the capture process
DRV_METROLOGY_CaptureGetOffset | Gets the offset in buffer of the capture process
DRV_METROLOGY_CaptureCheckIsWrap | Checks whether buffer has been filled and wrapped by the capture process

Data Types and Constants

Name | Type | Description
--- | --- | ---
DRV_METROLOGY_RESULT | Enum | Result of a Metrology driver interface operation
DRV_METROLOGY_START_MODE | Enum | Identifies types of start-up process
DRV_METROLOGY_CALLBACK | Typedef | Pointer to a metrology event handler function
DRV_METROLOGY_CALIBRATION_CALLBACK | Typedef | Pointer to a calibration event handler function
DRV_METROLOGY_HARMONICS_CALLBACK | Typedef | Pointer to a harmonic analysis event handler function
DRV_METROLOGY_AFE_TYPE | Enum | Identifies types of metrology AFEs
DRV_METROLOGY_SENSOR_TYPE | Enum | Identifies types of metrology sensors
DRV_METROLOGY_GAIN_TYPE | Enum | Identifies possible gain values for the AFE
DRV_METROLOGY_CHANNEL | Struct | Identifies a Channel with its name, gain and sensor type
DRV_METROLOGY_DOMINANT_V_SEL | Enum | Identifies the Dominant Voltage selection
DRV_METROLOGY_CALIBRATION_MASK | Struct | Mask to select which metrology parameters are calibrated
DRV_METROLOGY_CAPTURE_CHN_MASK | Enum | Channel identifier used in the waveform capture process
DRV_METROLOGY_CAPTURE_SOURCE | Enum | Source data used in the waveform capture process
DRV_METROLOGY_CAPTURE_TYPE | Enum | Identifies the type of the capture process
DRV_METROLOGY_CAPTURE_STATE | Enum | State of the capture process
DRV_METROLOGY_CALIBRATION_REFS | Struct | Specifies the all reference values used for the auto calibration process
DRV_METROLOGY_CALIBRATION | Struct | Specifies all data internally needed for the auto calibration process
DRV_METROLOGY_HARMONIC_RMS | Struct | Identifies the result of the harmonic analysis process
DRV_METROLOGY_HARMONIC_ANALYSIS | Struct | Internal data used to perform an harmonic analysis
DRV_METROLOGY_SYN_CONTROL | Struct | Control field for the synthesizer function
DRV_METROLOGY_SYN_DESCRIPTOR | Struct | Data descriptor used to configure the synthesizer function
DRV_METROLOGY_AFE_EVENTS | Struct | Identifies all events related to metrology library
DRV_METROLOGY_MEASURE_TYPE | Enum | Identifies the all types of measurements
DRV_METROLOGY_AFE_DATA | Struct | Identifies the data calculated from the metrology AFE measurements
DRV_METROLOGY_STATUS | Enum | Identifies the status of the metrology library
DRV_METROLOGY_INIT | Struct | Identifies values needed for the initialization routine

Rev: E