|
|
|
Component
MeasurementEngine
MeasurementEngine
Methods:
(Methods are user-callable functions/subroutines intended for
the component functions control. Please see the Embedded Components page for more information.)
-
EnableModules
- This method either enable single Measurement engine module according to the ModuleID or it can enable several modules using OR function
between each single ModuleID.
This method is available only if at least one Measurement engine module is set to 'Used', 'Used in Static configuration' or 'Used in Dynamic configuration' respectively (except GPIO and ADC modules).
ANSIC prototype: uint8_t EnableModules(ComponentName_TModuleIDType ModuleID)
- ModuleID:ComponentName_TModuleIDType - Identification of the used module(s). Please see Component_MODULE_{identification} constant. If only one module is set to 'Used' (except GPIO, and ADC module) this parameter is ignored and the method returns ERR_OK only.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter ModuleID out of range
-
DisableModules
- This method either disable single Measurement engine module according to the ModuleID or it can disable several modules using OR function
between each single ModuleID.
This method is available only if at least one Measurement engine module is set to 'Used', 'Used in Static configuration' or 'Used in Dynamic configuration' respectively (except GPIO and ADC modules).
ANSIC prototype: uint8_t DisableModules(ComponentName_TModuleIDType ModuleID)
- ModuleID:ComponentName_TModuleIDType - Identification of the used module(s). Please see Component_MODULE_{identification} constant. If only one module is set to 'Used' (except GPIO, and ADC module) this parameter is ignored and the method returns the method returns ERR_OK only.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter ModuleID out of range
-
SetTrigger
- This method selects and sets parameters for a selected ADC hardware trigger source (ADC module respectively) according to TriggerID parameter. Parameters are TriggerID and TriggerSetting structure.
This method is available only if PDB module or TOD module is set to 'Used'.
ANSIC prototype: uint8_t SetTrigger(uint8_t TriggerID, ComponentName_TTrgSettingType *TriggerSetting)
- TriggerID:uint8_t - Identification of the trigger. Please see Component_TRIGGER_{xy} constant. This parameter is ignored if PDB module is set to 'Unused'.
- TriggerSetting: Pointer to ComponentName_TTrgSettingType - Pointer to structure of trigger settings.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter TriggerID out of range ERR_FAILED - Selected ADC Module has not assigned ISR and interrupt is required from method parameter
-
PDB_EnableTrigger
- This method enables selected trigger according to TriggerID parameter.
This method is available only if PDB module is set to 'Used' and at least one Trigger 'letter' property is set to 'Used'.
ANSIC prototype: uint8_t PDB_EnableTrigger(uint8_t TriggerID)
- TriggerID:uint8_t - Identification of the trigger. Please see Component_TRIGGER_{xy} constant.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter TriggerID out of range
-
PDB_DisableTrigger
- This method disables selected trigger according to TriggerID parameter.
This method is available only if a hardware trigger (PDB module, TOD module) is set to 'Used' and at least one Trigger 'letter' property is set to 'Used' accordingly.
ANSIC prototype: uint8_t PDB_DisableTrigger(uint8_t TriggerID)
- TriggerID:uint8_t - Identification of the trigger. Please see Component_TRIGGER_{xy} constant.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter TriggerID out of range
-
PDB_SWTrigger
- This method creates software trigger event for PDB module. The method is available only if PDB module supports SW triggering, PDB module is set to 'Used' in Measurement engine component, and
ANSIC prototype: uint8_t PDB_SWTrigger(void)
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_NOTAVAIL - "PDB_SWTRIG" is not currently selected. To select it use either PDB_SetTriggerSource method or Trigger source type property within initialization. ERR_DISABLED - PDB module is currently disabled
-
PDB_SetTriggerSource
- This method sets 'Trigger Source' for PDB device according to TriggerSourceID parameter.
This method is available only if PDB module is set to 'Used'.
ANSIC prototype: uint8_t PDB_SetTriggerSource(uint8_t TriggerSourceID)
- TriggerSourceID:uint8_t - Identification of the trigger source. Please see Component_PDB_TRIGGER_{identification'z'} constant.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter TriggerSourceID out of range
-
DAC_SWTrigger
- This method creates software trigger event for DAC peripheral. The method is available only if DAC module supports SW triggering and DAC module is used in 'Dynamic configuration' in Measurement engine component and DAC 'Trigger selection' property is set to 'SW'.
ANSIC prototype: void DAC_SWTrigger(void)
-
DAC_UpdateFIFO
- This method updates selected DAC FIFO register. This method is available only if DAC module is used in 'Dynamic configuration' or in 'Static configuration'.
ANSIC prototype: uint8_t DAC_UpdateFIFO(uint8_t FIFORegIndex, uint16_t Value)
- FIFORegIndex:uint8_t - Index of FIFO DAC Data register.
- Value:uint16_t - Value which is written into DAC Data register.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter "FIFORegIndex" out of range
-
ADC_StartSingleConversion
- This methods selects SW triggering for ADC module and immediately starts measurement on selected ADC module, and channel in differential/single mode, with enabled/disabled interrupt.
ANSIC prototype: uint8_t ADC_StartSingleConversion(uint8_t ADCModuleIndex, ComponentName_TTrgSettingType *TriggerSetting)
- ADCModuleIndex:uint8_t - ADC module index, which starts the single conversion. If there is only one ADC module this parameter is ignored. For more details please see ADC module 'x' group(s).
- TriggerSetting: Pointer to ComponentName_TTrgSettingType - Pointer to structure of trigger settings.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter "ADCModuleIndex" or "ADCChannel" out of range ERR_FAILED - Selected ADC module has not assigned ISR and interrupt is required from method parameter
-
ADC_Calibrate
- This method starts the ADC calibration sequence. This method is available only if hardware supports the calibration feature. Calibration is typically used to remove the effects of the gain and offset from a specific reading.
ANSIC prototype: uint8_t ADC_Calibrate(uint8_t ADCModuleIndex)
- ADCModuleIndex:uint8_t - Number of ADC module that will be calibrated. If there is only one ADC module this parameter is ignored.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter "ADCmoduleIndex" out of range ERR_FAILED - Calibration hasn't been finished correctly
-
ADC_GetConvCompleteStatus
- This method returns status of A/D conversion according to the selected TriggerID parameter.
ANSIC prototype: bool ADC_GetConvCompleteStatus(uint8_t TriggerID)
- TriggerID:uint8_t - Identification of the trigger. Please see Component_TRIGGER_{xy} constant. This parameter is ignored if PDB module is set to 'Unused'.
- Return value:bool -
true - conversion complete flag from selected TriggerID occured, value was measured
false - conversion complete flag from selected TriggerID didnīt occur or parameter TriggerID is out of range
-
ADC_GetMeasuredValue
- This method returns measured value from the selected result register. Naming of result registers is coded into using TriggerID parameter. For proper reading measured value it is recommended to use this method together with ADC_GetConvCompleteStatus method.
ANSIC prototype: uint8_t ADC_GetMeasuredValue(uint8_t TriggerID, ComponentName_TResultType *Value)
- TriggerID:uint8_t - Identification of the trigger. Please see Component_TRIGGER_{xy} constant.
- Value: Pointer to ComponentName_TResultType - Pointer to the measured Value.
- Return value:uint8_t - Error code, possible codes:
ERR_OK - OK ERR_RANGE - Parameter TriggerID out of range
Note: Some methods can be implemented as macros.
|