2.1.4 Library Interface

Multi-channel Metrology driver library provides the following interfaces:

Functions

NameDescription
DRV_MCMETROLOGY_InitializeInitializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_MCMETROLOGY_ReinitializeRe-initializes the metrology Driver for PIC32CXMTx dual-core devices
DRV_MCMETROLOGY_OpenOpens the specified metrology driver
DRV_MCMETROLOGY_CloseCloses an opened instance of the metrology driver
DRV_MCMETROLOGY_StartStart running the metrology library in coprocessor
DRV_MCMETROLOGY_TasksPerforms the tasks necessary to maintain a state machine of the metrology driver
DRV_MCMETROLOGY_IntegrationCallbackRegisterAllows a client to set an event handling function for the driver to call back when the integration period has completed
DRV_MCMETROLOGY_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_MCMETROLOGY_GetAFEDescriptionGet the AFE type. AFE type could be used to get information about the MCP devices configuration.
DRV_MCMETROLOGY_GetChannelDescriptionGet the pointer to the channel description table. Channel description table could be used to get information about how channels have been configured.
DRV_MCMETROLOGY_GetPowersDescriptionGet 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_GetStatusGets the current status of the metrology driver
DRV_MCMETROLOGY_GetStatusDataGet the pointer to the status registers of the metrology library
DRV_MCMETROLOGY_GetControlDataGets the pointer to the control registers of the metrology library
DRV_MCMETROLOGY_GetControlByDefaultGets the pointer to the control registers defined by MCC configurator
DRV_MCMETROLOGY_GetAccDataGets the pointer to the accumulated quantities of the metrology library
DRV_MCMETROLOGY_GetHarDataGets the pointer to the Harmonic analysis quantities of the metrology library
DRV_MCMETROLOGY_SetControlSets the value of all the control registers of the metrology library
DRV_MCMETROLOGY_GetEnergyValueGets the last energy calculated value
DRV_MCMETROLOGY_GetChannelMeasureValue Gets the last value of the selected measurement type on the selected channel
DRV_MCMETROLOGY_GetPowerMeasureValueGets the last value of the selected measurement type on the selected power
DRV_MCMETROLOGY_GetMeasureValueGets the last value of the selected measurement
DRV_MCMETROLOGY_SetConfigurationNot supported in this version
DRV_MCMETROLOGY_GetEventsDataGets the pointer to the last events obtained from the metrology library
DRV_MCMETROLOGY_StartHarmonicAnalysisRequest a new Harmonic analysis
DRV_MCMETROLOGY_StopHarmonicAnalysisStops the running Harmonic analysis

Data Types and Constants

NameTypeDescription
DRV_MCMETROLOGY_RESULTEnumResult of a Metrology driver interface operation
DRV_MCMETROLOGY_START_MODEEnumIdentifies types of startup process
DRV_MCMETROLOGY_CALLBACKTypedefPointer to a metrology event handler function
DRV_MCMETROLOGY_HARMONICS_CALLBACKTypedefPointer to a harmonic analysis event handler function
DRV_MCMETROLOGY_SENSOR_TYPEEnumIdentifies types of metrology sensors
DRV_MCMETROLOGY_GAIN_TYPEEnumIdentifies possible gain values for the AFE (Analog Front End)
DRV_MCMETROLOGY_HARMONIC_RMSStructIdentifies the result of the Harmonic Analysis process
DRV_MCMETROLOGY_HARMONIC_ANALYSISStructInternal data used to perform an harmonic analysis
DRV_MCMETROLOGY_AFE_EVENTSStructIdentifies all events related to metrology library
DRV_MCMETROLOGY_CHANNELStructDescribes the channel configuration
DRV_MCMETROLOGY_POWER_SOURCEStructDescribes the power source configuration
DRV_MCMETROLOGY_AFE_TYPEEnumDescribes the connection with MCP devices
DRV_MCMETROLOGY_CHANNEL_MEASURE_TYPEEnumIdentifies all types of channel measurements
DRV_MCMETROLOGY_POWER_MEASURE_TYPEEnumIdentifies all types of power source measurements
DRV_MCMETROLOGY_MEASURE_TYPEEnumIdentifies all types of generic measurements
DRV_MCMETROLOGY_AFE_DATAStructIdentifies the data calculated from the metrology AFE measurements
DRV_MCMETROLOGY_STATUSEnumIdentifies the status of the metrology library
DRV_MCMETROLOGY_INITStructIdentifies values needed for the initialization routine