1.1.4 Library Interface

Metrology driver library provides the following interfaces:

Functions

NameDescription
DRV_METROLOGY_InitializeInitializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_METROLOGY_ReinitializeRe-initializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_METROLOGY_OpenOpens the metrology driver
DRV_METROLOGY_CloseCloses an opened instance of the metrology driver
DRV_METROLOGY_StartStarts running the metrology library in coprocessor
DRV_METROLOGY_TasksPerforms the tasks necessary to maintain a state machine of the metrology driver
DRV_METROLOGY_IntegrationCallbackRegisterAllows a client to set an event handling function for the driver to call back when the integration period has completed
DRV_METROLOGY_CalibrationCallbackRegisterAllows a client to set an event handling function for the driver to call back when the calibration process has finished
DRV_METROLOGY_HarmonicAnalysisCallbackRegisterAllows 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_GetStatusGets the current status of the metrology driver
DRV_METROLOGY_GetAFEDescriptionGets an enumerate value which defines the AFE connected to the metrology library
DRV_METROLOGY_GetChannelDescriptionGets the pointer to a table containing information about how channels have been configured
DRV_METROLOGY_GetStatusDataGet the pointer to the status registers of the metrology library
DRV_METROLOGY_GetControlDataGets the pointer to the control registers of the metrology library
DRV_METROLOGY_GetControlByDefaultGets the pointer to the control registers default value, as defined by MCC configurator
DRV_METROLOGY_GetAccDataGets the pointer to the integration period accumulated quantities of the metrology library
DRV_METROLOGY_GetPerCycleAccDataGets the pointer to the per-cycle accumulated quantities of the metrology library
DRV_METROLOGY_GetHarDataGets the pointer to the harmonic analysis quantities of the metrology library
DRV_METROLOGY_SetControlSets the value of all the control registers of the metrology library
DRV_METROLOGY_GetEnergyValueGets the last energy calculated value
DRV_METROLOGY_GetMeasureValueGets the value of the desired measurement
DRV_METROLOGY_GetEventsDataGets the last events information obtained from the metrology library
DRV_METROLOGY_GetCalibrationReferencesGets the pointer to calibration references used in the calibration process
DRV_METROLOGY_StartCalibrationStarts internal calibration process
DRV_METROLOGY_StartHarmonicAnalysisRequest a new harmonic analysis
DRV_METROLOGY_StopHarmonicAnalysisStops the running harmonic analysis
DRV_METROLOGY_CaptureSetOptionsSets the configuration options of the waveform capture process
DRV_METROLOGY_CaptureEnableChannelsEnables the channels to be captured
DRV_METROLOGY_CaptureDisableChannelsDisables the capture on selected channels
DRV_METROLOGY_CaptureStartStarts the capture process in the selected buffer with a given length
DRV_METROLOGY_CaptureStopStops the capture process
DRV_METROLOGY_CaptureGetStateGets the current state of the capture process
DRV_METROLOGY_CaptureGetOffsetGets the offset in buffer of the capture process
DRV_METROLOGY_CaptureCheckIsWrapChecks whether buffer has been filled and wrapped by the capture process

Data Types and Constants

NameTypeDescription
DRV_METROLOGY_RESULTEnumResult of a Metrology driver interface operation
DRV_METROLOGY_START_MODEEnumIdentifies types of start-up process
DRV_METROLOGY_CALLBACKTypedefPointer to a metrology event handler function
DRV_METROLOGY_CALIBRATION_CALLBACKTypedefPointer to a calibration event handler function
DRV_METROLOGY_HARMONICS_CALLBACKTypedefPointer to a harmonic analysis event handler function
DRV_METROLOGY_AFE_TYPEEnumIdentifies types of metrology AFEs
DRV_METROLOGY_SENSOR_TYPEEnumIdentifies types of metrology sensors
DRV_METROLOGY_GAIN_TYPEEnumIdentifies possible gain values for the AFE
DRV_METROLOGY_CHANNELStructIdentifies a Channel with its name, gain and sensor type
DRV_METROLOGY_DOMINANT_V_SELEnumIdentifies the Dominant Voltage selection
DRV_METROLOGY_CALIBRATION_MASKStructMask to select which metrology parameters are calibrated
DRV_METROLOGY_CAPTURE_CHN_MASKEnumChannel identifier used in the waveform capture process
DRV_METROLOGY_CAPTURE_SOURCEEnumSource data used in the waveform capture process
DRV_METROLOGY_CAPTURE_TYPEEnumIdentifies the type of the capture process
DRV_METROLOGY_CAPTURE_STATEEnumState of the capture process
DRV_METROLOGY_CALIBRATION_REFSStructSpecifies the all reference values used for the auto calibration process
DRV_METROLOGY_CALIBRATIONStructSpecifies all data internally needed for the auto calibration process
DRV_METROLOGY_HARMONIC_RMSStructIdentifies the result of the harmonic analysis process
DRV_METROLOGY_HARMONIC_ANALYSISStructInternal data used to perform an harmonic analysis
DRV_METROLOGY_SYN_CONTROLStructControl field for the synthesizer function
DRV_METROLOGY_SYN_DESCRIPTORStructData descriptor used to configure the synthesizer function
DRV_METROLOGY_AFE_EVENTSStructIdentifies all events related to metrology library
DRV_METROLOGY_MEASURE_TYPEEnumIdentifies the all types of measurements
DRV_METROLOGY_AFE_DATAStructIdentifies the data calculated from the metrology AFE measurements
DRV_METROLOGY_STATUSEnumIdentifies the status of the metrology library
DRV_METROLOGY_INITStructIdentifies values needed for the initialization routine