3.3.4 Peripheral Library Interface

EMAFE peripheral library provides the following interfaces:

Table 3-3. EMAFE Functions
NameDescription
EMAFE_InitializeInitializes the EMAFE peripheral.
EMAFE_ResetResets the EMAFE peripheral by using EMAFE_NRESET GPIO.
EMAFE_SoftResetResets the EMAFE peripheral by using peripheral register.
EMAFE_SetSincDecimationFiltersResetEnters/exits the reset state of low-pass filters.
EMAFE_EnableFilterEnables the corresponding low-pass filter.
EMAFE_DisableFilterDisables the corresponding low-pass filter.
EMAFE_EnableDMAChannelEnables the corresponding DMA channel.
EMAFE_DisableDMAChannelDisables the corresponding DMA channel.
EMAFE_GetDataChannelGet the last sample of the corresponding low-pass filter.
EMAFE_GetAllDataChannelGet the last samples of all low-pass filters.
EMAFE_EnableVariationDetectionEnables the detection of variation of the filtered data.
EMAFE_DisableVariationDetectionDisables the detection of variation of the filtered data.
EMAFE_IsEnableVariationDetectionCheck if the detection of variation has been enabled.
EMAFE_SetDifferenceComparisonModeSet the comparison mode between two channels.
EMAFE_SetDataFormatSet data format of the captured samples.
EMAFE_SetClockPrescalerRatioSet the clock prescaler ratio in the low-pass filter.
EMAFE_SetOSRSet OSR of the decimation filters.
EMAFE_SetComparisonModeChannelASet the comparison mode between channel A and two thresholds.
EMAFE_SetComparisonModeChannelBSet the comparison mode between channel B and two thresholds.
EMAFE_EnableInterruptEnables interrupt flags.
EMAFE_DisableInterruptDisables interrupt flags.
EMAFE_GetInterruptMaskRead interrupt flags mask.
EMAFE_GetInterruptSatusRead interrupt flags status.
EMAFE_GetStatusRead comparison events on Channel A and B.
EMAFE_WriteProtectionSetSet write protection mode.
EMAFE_WriteProtectionGetGet write protection state.
EMAFE_CallbackRegisterSets a callback function that is called when interrupt is raised.
Table 3-4. EMAFE ADC Functions
NameDescription
EMAFE_ADCI0EnableEnable ADC I0.
EMAFE_ADCI0DisableDisable ADC I0.
EMAFE_ADCI0IsEnableCheck if ADC I0 is enabled.
EMAFE_ADCI1EnableEnable ADC I1.
EMAFE_ADCI1DisableDisable ADC I1.
EMAFE_ADCI1IsEnableCheck if ADC I1 is enabled.
EMAFE_ADCV1EnableEnable ADC V1.
EMAFE_ADCV1DisableDisable ADC V1.
EMAFE_ADCV1IsEnableCheck if ADC V1 is enabled.
EMAFE_ADCI2EnableEnable ADC I2.
EMAFE_ADCI2DisableDisable ADC I2.
EMAFE_ADCI2IsEnableCheck if ADC I2 is enabled.
EMAFE_ADCV2EnableEnable ADC V2.
EMAFE_ADCV2DisableDisable ADC V2.
EMAFE_ADCV2IsEnableCheck if ADC V2 is enabled.
EMAFE_ADCSetClockConfigSet ADC clocks configuration.
EMAFE_ADCEnableBIASEnable Current Bias Generator.
EMAFE_ADCDisableBIASDisable Current Bias Generator.
EMAFE_ADCIsBIASEnableCheck if Current Bias Generator is enabled.
EMAFE_ADCEnableREFEnable Voltage Reference.
EMAFE_ADCDisableREFDisable Voltage Reference.
EMAFE_ADCIsREFEnableCheck if Voltage Reference is enabled.
EMAFE_ADCEnableLDOEnable internal LDO.
EMAFE_ADCDisableLDODisable internal LDO
EMAFE_ADCIsLDOEnableCheck if internal LDO is enabled.
EMAFE_ADCIsAnalogSystemReadyCheck if analog system is ready.
EMAFE_ADCEnableSoftResetSet ADCs in reset state.
EMAFE_ADCDisableSoftResetExits the ADCs reset state.
EMAFE_ADCSetSecurityControlsConfigure the security options of the analog system.
EMAFE_ADCGetSecurityControlsGet the security options of the analog system.
EMAFE_ADCGGetVREFLowTempGet the Voltage Reference at low temperature.
EMAFE_ADCGGetTEMPLowTempGet the Temperature Sensor at low temperature.
EMAFE_ADCGGetVREFHighTempGet the Voltage Reference at high temperature.
EMAFE_ADCGGetTEMPHighTempGet the Temperature Sensor at high temperature.
Table 3-5. EMAFE Types
NameTypeDescription
EMAFE_STATUSEnumIdentifies the EMAFE status.
EMAFE_CHANNEL_IDEnumIdentifies the EMAFE channel.
EMAFE_COMP_CHANNEL_IDEnumIdentifies the channel used to perform a comparison.
EMAFE_DIFF_COMPARISON_TYPEEnumIdentifies the type of comparison between two channels.
EMAFE_DIFF_COMPARISON_DATAStructDescribes the data used to perform a comparison between two channels.
EMAFE_CONDITION_TYPEEnumIdentifies the condition applied for detection on channel A/B.
EMAFE_COMPARISON_DATAStructDescribes the data used to perform a comparison between one channel and threshold.