DL SDFM API

Module: Driverlib (AM13E232X) APIs

Structures

Name

struct

DL_SDFM_CompEventFilterConfig
Comparator event filter configuration structure.

Types

Name

enum

DL_SDFM_FILTER_NUMBER { DL_SDFM_FILTER_1 = 0U, DL_SDFM_FILTER_2 = 1U, DL_SDFM_FILTER_3 = 2U, DL_SDFM_FILTER_4 = 3U}
SDFM Filter Number.

enum

DL_SDFM_FILTER_TYPE { DL_SDFM_FILTER_SINC_FAST = 0x00U, DL_SDFM_FILTER_SINC_1 = 0x10U, DL_SDFM_FILTER_SINC_2 = 0x20U, DL_SDFM_FILTER_SINC_3 = 0x30U}
SDFM Filter Type.

enum

DL_SDFM_MODULATOR_CLOCK_MODE { DL_SDFM_MODULATOR_CLK_EQUAL_DATA_RATE = 0U}
SDFM Modulator Clock Mode.

enum

DL_SDFM_OUTPUT_DATA_FORMAT { DL_SDFM_DATA_FORMAT_16_BIT = 0U, DL_SDFM_DATA_FORMAT_32_BIT = 1U}
SDFM Output Data Format.

enum

DL_SDFM_CLOCK_SOURCE { DL_SDFM_CHANNEL_CLK = 0U, DL_SDFM_SD1_CLK = 1U}
SDFM Clock Source.

enum

DL_SDFM_FIFO_CLEAR_SYNC_MODE { DL_SDFM_FIFO_NOT_CLEARED_ON_SYNC = 0U, DL_SDFM_FIFO_CLEARED_ON_SYNC = 1U}
SDFM FIFO Clear Sync Mode.

enum

DL_SDFM_OUTPUT_THRESHOLD_STATUS { DL_SDFM_OUTPUT_THRESHOLD_STATUS_WITHIN_THRESHOLD = 0U, DL_SDFM_OUTPUT_THRESHOLD_STATUS_ABOVE_THRESHOLD = 1U, DL_SDFM_OUTPUT_THRESHOLD_STATUS_BELOW_THRESHOLD = 2U}
SDFM Output Threshold Status.

enum

DL_SDFM_COMP_EVENT_NUMBER { DL_SDFM_COMP_EVENT_1 = 0U, DL_SDFM_COMP_EVENT_2 = 2U}
SDFM Comparator Event Number.

enum

DL_SDFM_COMP_EVENT_SOURCE { DL_SDFM_COMP_EVENT_SRC_COMPH1 = 0U, DL_SDFM_COMP_EVENT_SRC_COMPH1_L1 = 1U, DL_SDFM_COMP_EVENT_SRC_COMPH2 = 2U, DL_SDFM_COMP_EVENT_SRC_COMPH2_L2 = 3U, DL_SDFM_COMP_EVENT_SRC_COMPL1 = 0U, DL_SDFM_COMP_EVENT_SRC_COMPL2 = 2U}
SDFM Comparator Event Source.

enum

DL_SDFM_COMP_EVENT_HIGH_SOURCE { DL_SDFM_COMPHOUT_SOURCE_COMPHIN = 0x0U, DL_SDFM_COMPHOUT_SOURCE_FILTER = 0x8U}
SDFM Comparator Event High Source.

enum

DL_SDFM_COMP_EVENT_LOW_SOURCE { DL_SDFM_COMPLOUT_SOURCE_COMPLIN = 0x000U, DL_SDFM_COMPLOUT_SOURCE_FILTER = 0x800U}
SDFM Comparator Event Low Source.

enum

DL_SDFM_PWM_SYNC_SOURCE { DL_SDFM_SYNC_MCPWM0_SOCA = 0U, DL_SDFM_SYNC_MCPWM0_SOCB = 1U, DL_SDFM_SYNC_MCPWM0_SOCC = 2U, DL_SDFM_SYNC_MCPWM0_SOCD = 3U, DL_SDFM_SYNC_MCPWM1_SOCA = 4U, DL_SDFM_SYNC_MCPWM1_SOCB = 5U, DL_SDFM_SYNC_MCPWM1_SOCC = 6U, DL_SDFM_SYNC_MCPWM1_SOCD = 7U, DL_SDFM_SYNC_MCPWM2_SOCA = 8U, DL_SDFM_SYNC_MCPWM2_SOCB = 9U, DL_SDFM_SYNC_MCPWM2_SOCC = 10U, DL_SDFM_SYNC_MCPWM2_SOCD = 11U, DL_SDFM_SYNC_EPWM0_SOCA = 20U, DL_SDFM_SYNC_EPWM0_SOCB = 21U, DL_SDFM_SYNC_EPWM1_SOCA = 24U, DL_SDFM_SYNC_EPWM1_SOCB = 25U, DL_SDFM_SYNC_EPWM2_SOCA = 28U, DL_SDFM_SYNC_EPWM2_SOCB = 29U, DL_SDFM_SYNC_EPWM3_SOCA = 32U, DL_SDFM_SYNC_EPWM3_SOCB = 33U, DL_SDFM_SYNC_EPWM4_SOCA = 36U, DL_SDFM_SYNC_EPWM4_SOCB = 37U, DL_SDFM_SYNC_EPWM5_SOCA = 40U, DL_SDFM_SYNC_EPWM5_SOCB = 41U, DL_SDFM_SYNC_EPWM5_CTR_CMP = 63U}
SDFM PWM Sync Source.

enum

DL_SDFM_WAIT_FOR_SYNC_CLEAR_MODE { DL_SDFM_MANUAL_CLEAR_WAIT_FOR_SYNC = 0U, DL_SDFM_AUTO_CLEAR_WAIT_FOR_SYNC = 1U}
SDFM Wait For Sync Clear Mode.

enum

DL_SDFM_DATA_READY_INTERRUPT_SOURCE { DL_SDFM_DATA_READY_SOURCE_DIRECT = 0U, DL_SDFM_DATA_READY_SOURCE_FIFO = 1U}
SDFM Data Ready Interrupt Source.

Functions

Name

__STATIC_INLINE void

DL_SDFM_enableFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable filter.

__STATIC_INLINE void

DL_SDFM_disableFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable filter.

__STATIC_INLINE void

DL_SDFM_enableExternalReset(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable external reset.

__STATIC_INLINE void

DL_SDFM_disableExternalReset(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable external reset.

__STATIC_INLINE void

DL_SDFM_setFilterType(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_FILTER_TYPE filterType)
Set filter type.

__STATIC_INLINE void

DL_SDFM_setFilterOverSamplingRatio(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t overSamplingRatio)
Set data filter over sampling ratio.

__STATIC_INLINE void

DL_SDFM_setupModulatorClock(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_MODULATOR_CLOCK_MODE clockMode)
Set modulator clock mode.

__STATIC_INLINE void

DL_SDFM_setOutputDataFormat(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_OUTPUT_DATA_FORMAT dataFormat)
Set the output data format.

__STATIC_INLINE void

DL_SDFM_setDataShiftValue(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t shiftValue)
Set data shift value.

__STATIC_INLINE void

DL_SDFM_selectClockSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_CLOCK_SOURCE clkSource)
Selects clock source for SDFM channels.

__STATIC_INLINE void

DL_SDFM_enableSynchronizer(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t syncConfig)
Enables Input Synchronizer.

__STATIC_INLINE void

DL_SDFM_disableSynchronizer(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t syncConfig)
Disables Input Synchronizer.

__STATIC_INLINE void

DL_SDFM_enableFIFOBuffer(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable FIFO buffer.

__STATIC_INLINE void

DL_SDFM_disableFIFOBuffer(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable FIFO buffer.

__STATIC_INLINE void

DL_SDFM_setFIFOInterruptLevel(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t fifoLevel)
Set the FIFO interrupt level.

__STATIC_INLINE uint16_t

DL_SDFM_getFIFODataCount(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Return the FIFO data count.

__STATIC_INLINE uint32_t

DL_SDFM_getFIFOData(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Return the FIFO data.

__STATIC_INLINE bool

DL_SDFM_getFIFOOverflowStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Check if FIFO buffer is overflowed.

__STATIC_INLINE bool

DL_SDFM_getFIFOISRStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Check FIFO buffer interrupt status.

__STATIC_INLINE void

DL_SDFM_setFIFOClearOnSyncMode(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_FIFO_CLEAR_SYNC_MODE fifoClearSyncMode)
Set FIFO clear on sync mode.

__STATIC_INLINE void

DL_SDFM_enableComparator(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable Comparator.

__STATIC_INLINE void

DL_SDFM_disableComparator(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable Comparator.

__STATIC_INLINE void

DL_SDFM_setComparatorFilterType(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_FILTER_TYPE filterType)
Set the comparator filter type.

__STATIC_INLINE void

DL_SDFM_setCompFilterOverSamplingRatio(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t overSamplingRatio)
Set Comparator filter over sampling ratio.

__STATIC_INLINE void

DL_SDFM_setCompFilterHighThreshold(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint32_t highThreshold)
Set Filter output high-level threshold.

__STATIC_INLINE void

DL_SDFM_setCompFilterLowThreshold(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint32_t lowThreshold)
Set Filter output low-level threshold.

__STATIC_INLINE void

DL_SDFM_setCompFilterZeroCrossThreshold(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t zeroCrossThreshold)
Set Filter output zero-cross threshold.

__STATIC_INLINE void

DL_SDFM_selectCompEventSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_COMP_EVENT_NUMBER compEventNum, DL_SDFM_COMP_EVENT_SOURCE compEventSource)
Selects Comparator Event Source.

__STATIC_INLINE void

DL_SDFM_selectCompEventHighSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_COMP_EVENT_HIGH_SOURCE source)
Selects comparator event high source.

__STATIC_INLINE void

DL_SDFM_selectCompEventLowSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_COMP_EVENT_LOW_SOURCE source)
Selects comparator event low source.

__STATIC_INLINE void

DL_SDFM_initCompEventLowFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Initializes Comparator Event Low Filter.

__STATIC_INLINE void

DL_SDFM_initCompEventHighFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Initializes Comparator Event High Filter.

__STATIC_INLINE void

DL_SDFM_lockCompEventFilterConfig(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t lockConfig)
Lock Comparator Event Filter Configurations.

__STATIC_INLINE void

DL_SDFM_enableZeroCrossEdgeDetect(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable zero crossing detection.

__STATIC_INLINE void

DL_SDFM_disableZeroCrossEdgeDetect(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable zero crossing detection.

__STATIC_INLINE bool

DL_SDFM_getZeroCrossTripStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Return the Zero Cross Trip status.

__STATIC_INLINE void

DL_SDFM_clearZeroCrossTripStatus(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Clear the Zero Cross Trip status.

__STATIC_INLINE void

DL_SDFM_enableInterrupt(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t intFlags)
Enable SDFM interrupts.

__STATIC_INLINE void

DL_SDFM_disableInterrupt(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, uint16_t intFlags)
Disable SDFM interrupts.

__STATIC_INLINE void

DL_SDFM_enableMainInterrupt(SDFM_Regs * sdfmHwRegsPtr)
Enable main interrupt.

__STATIC_INLINE void

DL_SDFM_disableMainInterrupt(SDFM_Regs * sdfmHwRegsPtr)
Disable main interrupt.

__STATIC_INLINE void

DL_SDFM_clearInterruptFlag(SDFM_Regs * sdfmHwRegsPtr, uint32_t flag)
Clear pending flags.

__STATIC_INLINE bool

DL_SDFM_getIsrStatus(const SDFM_Regs * sdfmHwRegsPtr)
Get pending interrupt.

__STATIC_INLINE uint32_t

DL_SDFM_getFilterData(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Get the filter data output.

__STATIC_INLINE uint16_t

DL_SDFM_getComparatorSincData(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Return the Comparator sinc filter data.

__STATIC_INLINE DL_SDFM_OUTPUT_THRESHOLD_STATUS

DL_SDFM_getThresholdStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Get the Comparator threshold status.

__STATIC_INLINE bool

DL_SDFM_getModulatorStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Get the Modulator status.

__STATIC_INLINE bool

DL_SDFM_getNewFilterDataStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Check if new Filter data is available.

__STATIC_INLINE void

DL_SDFM_enableWaitForSync(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Enable wait for sync mode.

__STATIC_INLINE void

DL_SDFM_disableWaitForSync(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Disable wait for sync mode.

__STATIC_INLINE bool

DL_SDFM_getWaitForSyncStatus(const SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Get the wait-for-sync event status.

__STATIC_INLINE void

DL_SDFM_clearWaitForSyncFlag(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber)
Clear the Wait-for-sync event status.

__STATIC_INLINE void

DL_SDFM_setWaitForSyncClearMode(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_WAIT_FOR_SYNC_CLEAR_MODE syncClearMode)
Set Wait-for-sync clear mode.

__STATIC_INLINE void

DL_SDFM_setPWMSyncSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_PWM_SYNC_SOURCE syncSource)
Set the PWM sync mode.

__STATIC_INLINE void

DL_SDFM_enableMainFilter(SDFM_Regs * sdfmHwRegsPtr)
Enable main filter.

__STATIC_INLINE void

DL_SDFM_disableMainFilter(SDFM_Regs * sdfmHwRegsPtr)
Disable main filter.

__STATIC_INLINE void

DL_SDFM_setDataReadyInterruptSource(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, DL_SDFM_DATA_READY_INTERRUPT_SOURCE dataReadySource)
Set data ready interrupt source.

void

DL_SDFM_configComparator(SDFM_Regs * sdfmHwRegsPtr, uint16_t config1, uint32_t config2, uint16_t config3)
Configures SDFM comparator for filter config & threshold values.

void

DL_SDFM_configEnhancedComparator(SDFM_Regs * sdfmHwRegsPtr, uint16_t filterConfig, uint32_t highLowThreshold1, uint32_t highLowThreshold2, uint16_t zeroCrossThreshold)
Configure SDFM enhanced comparator for filter config & threshold values.

void

DL_SDFM_configDataFilter(SDFM_Regs * sdfmHwRegsPtr, uint16_t config1, uint16_t config2)
Configure SDFM data filter.

void

DL_SDFM_configZeroCrossComparator(SDFM_Regs * sdfmHwRegsPtr, uint16_t config1, uint16_t config2)
Configure SDFM data filter Zero Cross threshold.

void

DL_SDFM_configDataFilterFIFO(SDFM_Regs * sdfmHwRegsPtr, uint16_t config1, uint16_t config2)
Configure SDFM data filter FIFO.

void

DL_SDFM_configCompEventLowFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, const DL_SDFM_CompEventFilterConfig * config)
Configure Comparator Event Low Filter.

void

DL_SDFM_configCompEventHighFilter(SDFM_Regs * sdfmHwRegsPtr, DL_SDFM_FILTER_NUMBER filterNumber, const DL_SDFM_CompEventFilterConfig * config)
Configure Comparator Event High Filter.

Defines

Name

DL_SDFM_CLOCK_SYNCHRONIZER
Define for Clock synchronizer Configuration.

DL_SDFM_DATA_SYNCHRONIZER
Define for Data Synchronizer Configuration.

DL_SDFM_COMPEVT_FILTER_CONFIG_M
Define to mask out the bits in the SDCOMPHFILCTL register that aren’t associated with comparator event filter configurations.

DL_SDFM_COMPEVT_FILTER_LOCK_M
Define to mask out the bits in the SDCOMPLOCK register that aren’t associated with lock configuration.

DL_SDFM_MODULATOR_FAILURE_INTERRUPT
Interrupt is generated if Modulator fails.

DL_SDFM_LOW_LEVEL_THRESHOLD_INTERRUPT
Interrupt on Comparator low-level threshold.

DL_SDFM_HIGH_LEVEL_THRESHOLD_INTERRUPT
Interrupt on Comparator high-level threshold.

DL_SDFM_DATA_FILTER_ACKNOWLEDGE_INTERRUPT
Interrupt on Acknowledge flag.

DL_SDFM_FIFO_INTERRUPT
Interrupt on FIFO level.

DL_SDFM_FIFO_OVERFLOW_INTERRUPT
Interrupt on FIFO overflow.

DL_SDFM_MAIN_INTERRUPT_FLAG
Main interrupt flag.

DL_SDFM_FILTER_1_HIGH_THRESHOLD_FLAG
Filter 1 high-level threshold flag.

DL_SDFM_FILTER_1_LOW_THRESHOLD_FLAG
Filter 1 low -level threshold flag.

DL_SDFM_FILTER_2_HIGH_THRESHOLD_FLAG
Filter 2 high-level threshold flag.

DL_SDFM_FILTER_2_LOW_THRESHOLD_FLAG
Filter 2 low -level threshold flag.

DL_SDFM_FILTER_3_HIGH_THRESHOLD_FLAG
Filter 3 high-level threshold flag.

DL_SDFM_FILTER_3_LOW_THRESHOLD_FLAG
Filter 3 low -level threshold flag.

DL_SDFM_FILTER_4_HIGH_THRESHOLD_FLAG
Filter 4 high-level threshold flag.

DL_SDFM_FILTER_4_LOW_THRESHOLD_FLAG
Filter 4 low -level threshold flag.

DL_SDFM_FILTER_1_MOD_FAILED_FLAG
Filter 1 modulator failed flag.

DL_SDFM_FILTER_2_MOD_FAILED_FLAG
Filter 2 modulator failed flag.

DL_SDFM_FILTER_3_MOD_FAILED_FLAG
Filter 3 modulator failed flag.

DL_SDFM_FILTER_4_MOD_FAILED_FLAG
Filter 4 modulator failed flag.

DL_SDFM_FILTER_1_NEW_DATA_FLAG
Filter 1 new data flag.

DL_SDFM_FILTER_2_NEW_DATA_FLAG
Filter 2 new data flag.

DL_SDFM_FILTER_3_NEW_DATA_FLAG
Filter 3 new data flag.

DL_SDFM_FILTER_4_NEW_DATA_FLAG
Filter 4 new data flag.

DL_SDFM_FILTER_1_FIFO_OVERFLOW_FLAG
Filter 1 FIFO overflow flag.

DL_SDFM_FILTER_2_FIFO_OVERFLOW_FLAG
Filter 2 FIFO overflow flag.

DL_SDFM_FILTER_3_FIFO_OVERFLOW_FLAG
Filter 3 FIFO overflow flag.

DL_SDFM_FILTER_4_FIFO_OVERFLOW_FLAG
Filter 4 FIFO overflow flag.

DL_SDFM_FILTER_1_FIFO_INTERRUPT_FLAG
Filter 1 FIFO interrupt flag.

DL_SDFM_FILTER_2_FIFO_INTERRUPT_FLAG
Filter 2 FIFO interrupt flag.

DL_SDFM_FILTER_3_FIFO_INTERRUPT_FLAG
Filter 3 FIFO interrupt flag.

DL_SDFM_FILTER_4_FIFO_INTERRUPT_FLAG
Filter 4 FIFO interrupt flag.

DL_SDFM_GET_LOW_THRESHOLD©
Macro to get the low threshold.

DL_SDFM_GET_HIGH_THRESHOLD©
Macro to get the high threshold.

DL_SDFM_GET_LOW_THRESHOLD_BOTH(C1, C2)
Macro to get the low threshold 1 & 2 to be passed as lowThreshold parameter.

DL_SDFM_GET_HIGH_THRESHOLD_BOTH(C1, C2)
Macro to get the high threshold 1 & 2 to be passed as highThreshold parameter.

DL_SDFM_THRESHOLD(H, L)
Macro to combine high threshold and low threshold values.

DL_SDFM_SET_OSR(X)
Macro to convert comparator over sampling ratio to acceptable bit location.

DL_SDFM_SHIFT_VALUE(X)
Macro to convert the data shift bit values to acceptable bit location.

DL_SDFM_SET_FIFO_LEVEL(X)
Macro to set the FIFO level to acceptable bit location.

DL_SDFM_SET_ZERO_CROSS_THRESH_VALUE(X)
Macro to set and enable the zero cross threshold value.

DL_SDFM_FILTER_DISABLE
Macro to disable filter.

DL_SDFM_FILTER_ENABLE
Macro to enable filter.

DL_SDFM_GET_OSR©
Get filter oversampling ratio.

DL_SDFM_GET_FILTER_TYPE©
Get the filter type.

DL_SDFM_GET_FILTER_NUMBER©
Get the filter number.

DL_SDFM_GET_ZHIGH_THRESHOLD©
Get the zero-crossing high threshold.

DL_SDFM_ZHIGH_ENABLE_MASK
Zero-crossing high threshold mask.

DL_SDFM_GET_SHIFT_VALUE©
Get data shift value.

DL_SDFM_SDFIL_OFFSET
SD filter offset.

DL_SDFM_DIGFIL_OFFSET
Event Digital filter offset.

DL_SDFM_SDFLT1CMPHx_OFFSET
Offset between high threshold 1 & 2 registers.

DL_SDFM_SDFLT1CMPLx_OFFSET
Offset between low threshold 1 & 2 registers.

DL_SDFM_MAX_COMP_FILTER_OSR
Maximum acceptable comparator filter oversampling ratio.

DL_SDFM_MAX_DATA_FILTER_OSR
Maximum acceptable data filter oversampling ratio.

DL_SDFM_MAX_DATA_SHIFT_VALUE
Maximum acceptable data shift value.

DL_SDFM_MAX_FIFO_LEVEL
Maximum acceptable FIFO interrupt level.

DL_SDFM_ALL_INTERRUPT_FLAGS_MASK
Mask of all valid SDIFLG/SDIFLGCLR interrupt flag bits.

Types Documentation

enum DL_SDFM_FILTER_NUMBER

Enumerator

Value

Description

DL_SDFM_FILTER_1

0U

Digital filter 1.

DL_SDFM_FILTER_2

1U

Digital filter 2.

DL_SDFM_FILTER_3

2U

Digital filter 3.

DL_SDFM_FILTER_4

3U

Digital filter 4.

SDFM Filter Number.

enum DL_SDFM_FILTER_TYPE

Enumerator

Value

Description

DL_SDFM_FILTER_SINC_FAST

0x00U

Digital filter with SincFast structure.

DL_SDFM_FILTER_SINC_1

0x10U

Digital filter with Sinc1 structure.

DL_SDFM_FILTER_SINC_2

0x20U

Digital filter with Sinc3 structure.

DL_SDFM_FILTER_SINC_3

0x30U

Digital filter with Sinc4 structure.

SDFM Filter Type.

enum DL_SDFM_MODULATOR_CLOCK_MODE

Enumerator

Value

Description

DL_SDFM_MODULATOR_CLK_EQUAL_DATA_RATE

0U

Modulator clock is identical to the data rate.

SDFM Modulator Clock Mode.

enum DL_SDFM_OUTPUT_DATA_FORMAT

Enumerator

Value

Description

DL_SDFM_DATA_FORMAT_16_BIT

0U

Filter output is in 16 bits 2’s complement format.

DL_SDFM_DATA_FORMAT_32_BIT

1U

Filter output is in 32 bits 2’s complement format.

SDFM Output Data Format.

enum DL_SDFM_CLOCK_SOURCE

Enumerator

Value

Description

DL_SDFM_CHANNEL_CLK

0U

Source is respective channel clock.

DL_SDFM_SD1_CLK

1U

Source is SD1 channel clock.

SDFM Clock Source.

enum DL_SDFM_FIFO_CLEAR_SYNC_MODE

Enumerator

Value

Description

DL_SDFM_FIFO_NOT_CLEARED_ON_SYNC

0U

SDFM FIFO buffer is not cleared on Sync signal.

DL_SDFM_FIFO_CLEARED_ON_SYNC

1U

SDFM FIFO buffer is cleared on Sync signal.

SDFM FIFO Clear Sync Mode.

enum DL_SDFM_OUTPUT_THRESHOLD_STATUS

Enumerator

Value

Description

DL_SDFM_OUTPUT_THRESHOLD_STATUS_WITHIN_THRESHOLD

0U

SDFM output is within threshold.

DL_SDFM_OUTPUT_THRESHOLD_STATUS_ABOVE_THRESHOLD

1U

SDFM output is above threshold.

DL_SDFM_OUTPUT_THRESHOLD_STATUS_BELOW_THRESHOLD

2U

SDFM output is below threshold.

SDFM Output Threshold Status.

enum DL_SDFM_COMP_EVENT_NUMBER

Enumerator

Value

Description

DL_SDFM_COMP_EVENT_1

0U

Selects CEVT1.

DL_SDFM_COMP_EVENT_2

2U

Selects CEVT2.

SDFM Comparator Event Number.

enum DL_SDFM_COMP_EVENT_SOURCE

Enumerator

Value

Description

DL_SDFM_COMP_EVENT_SRC_COMPH1

0U

COMPH1 event is the source.

DL_SDFM_COMP_EVENT_SRC_COMPH1_L1

1U

Either of COMPH1 or COMPL1 event can be the source.

DL_SDFM_COMP_EVENT_SRC_COMPH2

2U

COMPH2 event is the source.

DL_SDFM_COMP_EVENT_SRC_COMPH2_L2

3U

Either of COMPH2 or COMPL2 event can be the source.

DL_SDFM_COMP_EVENT_SRC_COMPL1

0U

COMPL1 event is the source.

DL_SDFM_COMP_EVENT_SRC_COMPL2

2U

COMPL2 event is the source.

SDFM Comparator Event Source.

enum DL_SDFM_COMP_EVENT_HIGH_SOURCE

Enumerator

Value

Description

DL_SDFM_COMPHOUT_SOURCE_COMPHIN

0x0U

Comparator event high source is unfiltered event.

DL_SDFM_COMPHOUT_SOURCE_FILTER

0x8U

Comparator event high source is filtered event.

SDFM Comparator Event High Source.

enum DL_SDFM_COMP_EVENT_LOW_SOURCE

Enumerator

Value

Description

DL_SDFM_COMPLOUT_SOURCE_COMPLIN

0x000U

Comparator event low source is unfiltered event.

DL_SDFM_COMPLOUT_SOURCE_FILTER

0x800U

Comparator event low source is filtered event.

SDFM Comparator Event Low Source.

enum DL_SDFM_PWM_SYNC_SOURCE

Enumerator

Value

Description

DL_SDFM_SYNC_MCPWM0_SOCA

0U

SDFM sync source is MCPWM0 SOCA.

DL_SDFM_SYNC_MCPWM0_SOCB

1U

SDFM sync source is MCPWM0 SOCB.

DL_SDFM_SYNC_MCPWM0_SOCC

2U

SDFM sync source is MCPWM0 SOCC.

DL_SDFM_SYNC_MCPWM0_SOCD

3U

SDFM sync source is MCPWM0 SOCD.

DL_SDFM_SYNC_MCPWM1_SOCA

4U

SDFM sync source is MCPWM1 SOCA.

DL_SDFM_SYNC_MCPWM1_SOCB

5U

SDFM sync source is MCPWM1 SOCB.

DL_SDFM_SYNC_MCPWM1_SOCC

6U

SDFM sync source is MCPWM1 SOCC.

DL_SDFM_SYNC_MCPWM1_SOCD

7U

SDFM sync source is MCPWM1 SOCD.

DL_SDFM_SYNC_MCPWM2_SOCA

8U

SDFM sync source is MCPWM2 SOCA.

DL_SDFM_SYNC_MCPWM2_SOCB

9U

SDFM sync source is MCPWM2 SOCB.

DL_SDFM_SYNC_MCPWM2_SOCC

10U

SDFM sync source is MCPWM2 SOCC.

DL_SDFM_SYNC_MCPWM2_SOCD

11U

SDFM sync source is MCPWM2 SOCD.

DL_SDFM_SYNC_EPWM0_SOCA

20U

SDFM sync source is EPWM0 SOCA.

DL_SDFM_SYNC_EPWM0_SOCB

21U

SDFM sync source is EPWM0 SOCB.

DL_SDFM_SYNC_EPWM1_SOCA

24U

SDFM sync source is EPWM1 SOCA.

DL_SDFM_SYNC_EPWM1_SOCB

25U

SDFM sync source is EPWM1 SOCB.

DL_SDFM_SYNC_EPWM2_SOCA

28U

SDFM sync source is EPWM2 SOCA.

DL_SDFM_SYNC_EPWM2_SOCB

29U

SDFM sync source is EPWM2 SOCB.

DL_SDFM_SYNC_EPWM3_SOCA

32U

SDFM sync source is EPWM3 SOCA.

DL_SDFM_SYNC_EPWM3_SOCB

33U

SDFM sync source is EPWM3 SOCB.

DL_SDFM_SYNC_EPWM4_SOCA

36U

SDFM sync source is EPWM4 SOCA.

DL_SDFM_SYNC_EPWM4_SOCB

37U

SDFM sync source is EPWM4 SOCB.

DL_SDFM_SYNC_EPWM5_SOCA

40U

SDFM sync source is EPWM5 SOCA.

DL_SDFM_SYNC_EPWM5_SOCB

41U

SDFM sync source is EPWM5 SOCB.

DL_SDFM_SYNC_EPWM5_CTR_CMP

63U

SDFM sync source is EPWM5 CTR=CMP (SDSYNC1/SDSYNC2 use CMPC, SDSYNC3/SDSYNC4 use CMPD)

SDFM PWM Sync Source.

enum DL_SDFM_WAIT_FOR_SYNC_CLEAR_MODE

Enumerator

Value

Description

DL_SDFM_MANUAL_CLEAR_WAIT_FOR_SYNC

0U

Wait for sync cleared using software.

DL_SDFM_AUTO_CLEAR_WAIT_FOR_SYNC

1U

Wait for sync cleared automatically.

SDFM Wait For Sync Clear Mode.

enum DL_SDFM_DATA_READY_INTERRUPT_SOURCE

Enumerator

Value

Description

DL_SDFM_DATA_READY_SOURCE_DIRECT

0U

Data ready interrupt source is direct (non-FIFO)

DL_SDFM_DATA_READY_SOURCE_FIFO

1U

Data ready interrupt source is FIFO.

SDFM Data Ready Interrupt Source.

Functions Documentation

function DL_SDFM_enableFilter

__STATIC_INLINE void DL_SDFM_enableFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables the filter specified by the filterNumber variable.

function DL_SDFM_disableFilter

__STATIC_INLINE void DL_SDFM_disableFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables the filter specified by the filterNumber variable.

function DL_SDFM_enableExternalReset

__STATIC_INLINE void DL_SDFM_enableExternalReset(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable external reset.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables data filter to be reset by an external source (PWM compare output).

function DL_SDFM_disableExternalReset

__STATIC_INLINE void DL_SDFM_disableExternalReset(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable external reset.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables data filter from being reset by an external source (PWM compare output).

function DL_SDFM_setFilterType

__STATIC_INLINE void DL_SDFM_setFilterType(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_FILTER_TYPE filterType
)

Set filter type.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • filterType is the filter type or structure.

This function sets the filter type or structure for the data filter.

function DL_SDFM_setFilterOverSamplingRatio

__STATIC_INLINE void DL_SDFM_setFilterOverSamplingRatio(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t overSamplingRatio
)

Set data filter over sampling ratio.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • overSamplingRatio is the data filter over sampling ratio. Valid values are 0 to DL_SDFM_MAX_DATA_FILTER_OSR inclusive.

This function sets the filter oversampling ratio for the filter specified by the filterNumber variable. Valid values for overSamplingRatio are 0 to DL_SDFM_MAX_DATA_FILTER_OSR inclusive. The actual oversampling ratio will be this value plus one.

function DL_SDFM_setupModulatorClock

__STATIC_INLINE void DL_SDFM_setupModulatorClock(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_MODULATOR_CLOCK_MODE clockMode
)

Set modulator clock mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • clockMode is the modulator clock mode.

This function sets the modulator clock mode and enables data and clock synchronizers for the specified filter.

function DL_SDFM_setOutputDataFormat

__STATIC_INLINE void DL_SDFM_setOutputDataFormat(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_OUTPUT_DATA_FORMAT dataFormat
)

Set the output data format.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • dataFormat is the output data format.

This function sets the output data format for the filter specified by filterNumber.

function DL_SDFM_setDataShiftValue

__STATIC_INLINE void DL_SDFM_setDataShiftValue(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t shiftValue
)

Set data shift value.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • shiftValue is the data shift value. Valid values are 0 to DL_SDFM_MAX_DATA_SHIFT_VALUE.

This function sets the shift value for the 16 bit 2’s complement data format. The valid maximum value for shiftValue is DL_SDFM_MAX_DATA_SHIFT_VALUE. Use this function with 16 bit 2’s complement data format only.

function DL_SDFM_selectClockSource

__STATIC_INLINE void DL_SDFM_selectClockSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_CLOCK_SOURCE clkSource
)

Selects clock source for SDFM channels.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • clkSource is the clock source.

This function selects the clock for SDFM module filter channels.

function DL_SDFM_enableSynchronizer

__STATIC_INLINE void DL_SDFM_enableSynchronizer(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t syncConfig
)

Enables Input Synchronizer.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • syncConfig defines which synchronizer to be enabled.

This function enables either data or clock or both synchronizer.

function DL_SDFM_disableSynchronizer

__STATIC_INLINE void DL_SDFM_disableSynchronizer(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t syncConfig
)

Disables Input Synchronizer.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • syncConfig defines which synchronizer to be disabled.

This function disables either data or clock or both synchronizer.

function DL_SDFM_enableFIFOBuffer

__STATIC_INLINE void DL_SDFM_enableFIFOBuffer(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable FIFO buffer.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables the filter FIFO buffer specified by the filterNumber variable.

function DL_SDFM_disableFIFOBuffer

__STATIC_INLINE void DL_SDFM_disableFIFOBuffer(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable FIFO buffer.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables the filter FIFO buffer specified by the filterNumber variable.

function DL_SDFM_setFIFOInterruptLevel

__STATIC_INLINE void DL_SDFM_setFIFOInterruptLevel(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t fifoLevel
)

Set the FIFO interrupt level.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • fifoLevel is the FIFO interrupt level. Valid values are 0 to DL_SDFM_MAX_FIFO_LEVEL.

This function sets the FIFO interrupt level. Interrupt is generated when the FIFO buffer word count gets to or exceeds the value of fifoLevel. Maximum value for fifoLevel is DL_SDFM_MAX_FIFO_LEVEL.

function DL_SDFM_getFIFODataCount

__STATIC_INLINE uint16_t DL_SDFM_getFIFODataCount(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Return the FIFO data count.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns the number of data words available in FIFO buffer.

This function returns the FIFO data count.

function DL_SDFM_getFIFOData

__STATIC_INLINE uint32_t DL_SDFM_getFIFOData(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Return the FIFO data.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns the latest FIFO data.

This function returns the latest FIFO data. Discard the upper 16 bits if the output data format is 16bits.

function DL_SDFM_getFIFOOverflowStatus

__STATIC_INLINE bool DL_SDFM_getFIFOOverflowStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Check if FIFO buffer is overflowed.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns true if FIFO buffer is overflowed, false if FIFO buffer is not overflowed.

This function returns the status of the FIFO buffer overflow for the given filter value.

function DL_SDFM_getFIFOISRStatus

__STATIC_INLINE bool DL_SDFM_getFIFOISRStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Check FIFO buffer interrupt status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns true if FIFO buffer interrupt has occurred, false if FIFO buffer interrupt has not occurred.

This function returns the status of the FIFO buffer interrupt for the given filter.

function DL_SDFM_setFIFOClearOnSyncMode

__STATIC_INLINE void DL_SDFM_setFIFOClearOnSyncMode(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_FIFO_CLEAR_SYNC_MODE fifoClearSyncMode
)

Set FIFO clear on sync mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • fifoClearSyncMode is the FIFO clear on sync mode.

This function sets the FIFO clear mode for the specified filter when a sync happens depending on the value of fifoClearSyncMode.

function DL_SDFM_enableComparator

__STATIC_INLINE void DL_SDFM_enableComparator(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable Comparator.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables the Comparator for the selected filter.

function DL_SDFM_disableComparator

__STATIC_INLINE void DL_SDFM_disableComparator(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable Comparator.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables the Comparator for the selected filter.

function DL_SDFM_setComparatorFilterType

__STATIC_INLINE void DL_SDFM_setComparatorFilterType(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_FILTER_TYPE filterType
)

Set the comparator filter type.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • filterType is the comparator filter type or structure.

This function sets the Comparator filter type or structure for the selected filter number.

function DL_SDFM_setCompFilterOverSamplingRatio

__STATIC_INLINE void DL_SDFM_setCompFilterOverSamplingRatio(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t overSamplingRatio
)

Set Comparator filter over sampling ratio.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • overSamplingRatio is the comparator filter over sampling ratio. Valid values are 0 to DL_SDFM_MAX_COMP_FILTER_OSR inclusive.

This function sets the comparator filter oversampling ratio for the filter specified by the filterNumber. Valid values for overSamplingRatio are 0 to DL_SDFM_MAX_COMP_FILTER_OSR inclusive. The actual oversampling ratio will be this value plus one.

function DL_SDFM_setCompFilterHighThreshold

__STATIC_INLINE void DL_SDFM_setCompFilterHighThreshold(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint32_t highThreshold
)

Set Filter output high-level threshold.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • highThreshold is the high-level threshold 1 & 2.

This function sets the unsigned high-level threshold value for the Comparator filter output. The param highThreshold takes both high threshold 1 & 2 values. The upper 16-bits represent the high threshold 2 value while lower 16-bits represent the threshold 1 values.

function DL_SDFM_setCompFilterLowThreshold

__STATIC_INLINE void DL_SDFM_setCompFilterLowThreshold(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint32_t lowThreshold
)

Set Filter output low-level threshold.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • lowThreshold is the low-level threshold.

This function sets the unsigned low-level threshold value for the Comparator filter output. The param lowThreshold takes both low threshold 1 & 2 values. The upper 16-bits represent the low threshold 2 value while lower 16-bits represent the threshold 1 values.

function DL_SDFM_setCompFilterZeroCrossThreshold

__STATIC_INLINE void DL_SDFM_setCompFilterZeroCrossThreshold(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t zeroCrossThreshold
)

Set Filter output zero-cross threshold.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • zeroCrossThreshold is the zero-cross threshold.

This function sets the unsigned zero-cross threshold value for the Comparator filter output.

function DL_SDFM_selectCompEventSource

__STATIC_INLINE void DL_SDFM_selectCompEventSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_COMP_EVENT_NUMBER compEventNum,
    DL_SDFM_COMP_EVENT_SOURCE compEventSource
)

Selects Comparator Event Source.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • compEventNum is the event number.

  • compEventSource is the event source.

This function selects the comparator event source for a given filter and event number.

function DL_SDFM_selectCompEventHighSource

__STATIC_INLINE void DL_SDFM_selectCompEventHighSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_COMP_EVENT_HIGH_SOURCE source
)

Selects comparator event high source.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • source is the comparator event high source.

This function selects the source for comparator event high.

function DL_SDFM_selectCompEventLowSource

__STATIC_INLINE void DL_SDFM_selectCompEventLowSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_COMP_EVENT_LOW_SOURCE source
)

Selects comparator event low source.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • source is the comparator event low source.

This function selects the source for comparator event low.

function DL_SDFM_initCompEventLowFilter

__STATIC_INLINE void DL_SDFM_initCompEventLowFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Initializes Comparator Event Low Filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function initializes Comparator Event Low Filter.

function DL_SDFM_initCompEventHighFilter

__STATIC_INLINE void DL_SDFM_initCompEventHighFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Initializes Comparator Event High Filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function initializes Comparator Event High Filter.

function DL_SDFM_lockCompEventFilterConfig

__STATIC_INLINE void DL_SDFM_lockCompEventFilterConfig(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t lockConfig
)

Lock Comparator Event Filter Configurations.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • lockConfig defines the configurations to be locked.

This function locks the comparator event filter configurations.

function DL_SDFM_enableZeroCrossEdgeDetect

__STATIC_INLINE void DL_SDFM_enableZeroCrossEdgeDetect(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable zero crossing detection.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables zero crossing detection.

function DL_SDFM_disableZeroCrossEdgeDetect

__STATIC_INLINE void DL_SDFM_disableZeroCrossEdgeDetect(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable zero crossing detection.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables zero crossing detection.

function DL_SDFM_getZeroCrossTripStatus

__STATIC_INLINE bool DL_SDFM_getZeroCrossTripStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Return the Zero Cross Trip status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: true if Comparator filter output >= High-level threshold (Z) false if Comparator filter output < High-level threshold (Z).

This function returns the Zero Cross Trip status for the filter specified by filterNumber variable.

function DL_SDFM_clearZeroCrossTripStatus

__STATIC_INLINE void DL_SDFM_clearZeroCrossTripStatus(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Clear the Zero Cross Trip status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function clears the Zero Cross Trip status for the filter specified by filterNumber variable.

function DL_SDFM_enableInterrupt

__STATIC_INLINE void DL_SDFM_enableInterrupt(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t intFlags
)

Enable SDFM interrupts.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • intFlags is the interrupt source. Valid values are SDFM_MODULATOR_FAILURE_INTERRUPT, SDFM_LOW_LEVEL_THRESHOLD_INTERRUPT, SDFM_HIGH_LEVEL_THRESHOLD_INTERRUPT, SDFM_FIFO_INTERRUPT, SDFM_FIFO_OVERFLOW_INTERRUPT, SDFM_DATA_FILTER_ACKNOWLEDGE_INTERRUPT.

This function enables the low threshold, high threshold or modulator failure interrupt as determined by intFlags for the filter specified by filterNumber.

function DL_SDFM_disableInterrupt

__STATIC_INLINE void DL_SDFM_disableInterrupt(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    uint16_t intFlags
)

Disable SDFM interrupts.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • intFlags is the interrupt source. Valid values are SDFM_MODULATOR_FAILURE_INTERRUPT, SDFM_LOW_LEVEL_THRESHOLD_INTERRUPT, SDFM_HIGH_LEVEL_THRESHOLD_INTERRUPT, SDFM_FIFO_INTERRUPT, SDFM_FIFO_OVERFLOW_INTERRUPT, SDFM_DATA_FILTER_ACKNOWLEDGE_INTERRUPT.

This function disables the low threshold, high threshold or modulator failure interrupt as determined by intFlags for the filter specified by filterNumber.

function DL_SDFM_enableMainInterrupt

__STATIC_INLINE void DL_SDFM_enableMainInterrupt(
    SDFM_Regs * sdfmHwRegsPtr
)

Enable main interrupt.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

This function enables the main SDFM interrupt.

function DL_SDFM_disableMainInterrupt

__STATIC_INLINE void DL_SDFM_disableMainInterrupt(
    SDFM_Regs * sdfmHwRegsPtr
)

Disable main interrupt.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

This function disables the main SDFM interrupt.

function DL_SDFM_clearInterruptFlag

__STATIC_INLINE void DL_SDFM_clearInterruptFlag(
    SDFM_Regs * sdfmHwRegsPtr,
    uint32_t flag
)

Clear pending flags.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • flag is the SDFM status flag.

This function clears the specified pending interrupt flag.

function DL_SDFM_getIsrStatus

__STATIC_INLINE bool DL_SDFM_getIsrStatus(
    const SDFM_Regs * sdfmHwRegsPtr
)

Get pending interrupt.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

Return: Returns true if there is a pending interrupt, false if no interrupt is pending.

This function returns any pending interrupt status.

function DL_SDFM_getFilterData

__STATIC_INLINE uint32_t DL_SDFM_getFilterData(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Get the filter data output.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns the latest data filter output.

This function returns the latest data filter output. Depending on the filter data output format selected, the valid value will be the lower 16 bits or the whole 32 bits of the returned value.

function DL_SDFM_getComparatorSincData

__STATIC_INLINE uint16_t DL_SDFM_getComparatorSincData(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Return the Comparator sinc filter data.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns the Comparator sinc filter data output.

This function returns the Comparator sinc filter data output.

function DL_SDFM_getThresholdStatus

__STATIC_INLINE DL_SDFM_OUTPUT_THRESHOLD_STATUS DL_SDFM_getThresholdStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Get the Comparator threshold status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns SDFM_OUTPUT_WITHIN_THRESHOLD, SDFM_OUTPUT_ABOVE_THRESHOLD, or SDFM_OUTPUT_BELOW_THRESHOLD.

This function returns the Comparator output threshold status for the given filterNumber.

function DL_SDFM_getModulatorStatus

__STATIC_INLINE bool DL_SDFM_getModulatorStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Get the Modulator status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns true if the Modulator is operating normally, false if the Modulator has failed.

This function returns the Modulator status.

function DL_SDFM_getNewFilterDataStatus

__STATIC_INLINE bool DL_SDFM_getNewFilterDataStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Check if new Filter data is available.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns true if new filter data is available, false if no new filter data is available.

This function returns new filter data status.

function DL_SDFM_enableWaitForSync

__STATIC_INLINE void DL_SDFM_enableWaitForSync(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Enable wait for sync mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function enables the wait for sync mode. Data to FIFO will be written only after PWM sync event.

function DL_SDFM_disableWaitForSync

__STATIC_INLINE void DL_SDFM_disableWaitForSync(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Disable wait for sync mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function disables the wait for sync mode. Data to FIFO will be written every Data ready event.

function DL_SDFM_getWaitForSyncStatus

__STATIC_INLINE bool DL_SDFM_getWaitForSyncStatus(
    const SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Get the wait-for-sync event status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

Return: Returns true if sync event has occurred, false if sync event has not occurred.

This function returns the Wait-for-Sync event status.

function DL_SDFM_clearWaitForSyncFlag

__STATIC_INLINE void DL_SDFM_clearWaitForSyncFlag(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber
)

Clear the Wait-for-sync event status.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

This function clears the Wait-for-sync event status.

function DL_SDFM_setWaitForSyncClearMode

__STATIC_INLINE void DL_SDFM_setWaitForSyncClearMode(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_WAIT_FOR_SYNC_CLEAR_MODE syncClearMode
)

Set Wait-for-sync clear mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • syncClearMode is the wait-for-sync clear mode.

This function sets the Wait-For-sync clear mode depending on the value of syncClearMode.

function DL_SDFM_setPWMSyncSource

__STATIC_INLINE void DL_SDFM_setPWMSyncSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_PWM_SYNC_SOURCE syncSource
)

Set the PWM sync mode.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • syncSource is the PWM sync source.

This function sets the PWM sync source for the specific SDFM filter. Valid values for syncSource are defined in the DL_SDFM_PWM_SYNC_SOURCE enumeration.

function DL_SDFM_enableMainFilter

__STATIC_INLINE void DL_SDFM_enableMainFilter(
    SDFM_Regs * sdfmHwRegsPtr
)

Enable main filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

This function enables main filter.

function DL_SDFM_disableMainFilter

__STATIC_INLINE void DL_SDFM_disableMainFilter(
    SDFM_Regs * sdfmHwRegsPtr
)

Disable main filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

This function disables main filter.

function DL_SDFM_setDataReadyInterruptSource

__STATIC_INLINE void DL_SDFM_setDataReadyInterruptSource(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    DL_SDFM_DATA_READY_INTERRUPT_SOURCE dataReadySource
)

Set data ready interrupt source.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber is the filter number.

  • dataReadySource is the data ready interrupt source.

This function sets the data ready interrupt source.

function DL_SDFM_configComparator

void DL_SDFM_configComparator(
    SDFM_Regs * sdfmHwRegsPtr,
    uint16_t config1,
    uint32_t config2,
    uint16_t config3
)

Configures SDFM comparator for filter config & threshold values.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • config1 filter number, filter type and over sampling ratio.

  • config2 high-level and low-level threshold 1 values.

  • config3 zero-cross threshold enable flag and zero-cross threshold value.

This function configures the comparator filter for filter config and threshold values based on provided inputs. The config1 parameter is the logical OR of the filter number, filter type and over sampling ratio. The bit definitions for config1 are as follow: - config1.[3:0] filter number - config1.[7:4] filter type - config1.[15:8] Over sampling Ratio Valid values for filter number and filter type are defined in SDFM_FilterNumber and SDFM_FilterType enumerations respectively. SDFM_SET_OSR(X) macro can be used to set the value of the oversampling ratio ,which ranges [1,32] inclusive, in the appropriate bit location. For example the value (SDFM_FILTER_1 | SDFM_FILTER_SINC_2 | SDFM_SET_OSR(16)) will select Filter 1, SINC 2 type with an oversampling ratio of 16. The config2 parameter is the logical OR of the filter high and low threshold 1 values. The bit definitions for config2 are as follow: - config2.[15:0] low threshold 1 - config2.[31:16] high threshold 1 The upper 16 bits define the high threshold 1 and the lower 16 bits define the low threshold 1. SDFM_THRESHOLD(H,L) can be used to combine the high and low thresholds. The config3 parameter is the logical OR of the zero cross threshold enable flag and the zero-cross threshold value. The bit definitions for config3 are as follow: - config3.[15] - Enable or disable zero cross threshold. Valid values are 1 or 0 to enable or disable the zero cross threshold respectively. -config3.[14:0] - Zero Cross Threshold value. The SDFM_SET_ZERO_CROSS_THRESH_VALUE(X) macro can be used to specify the zero-cross threshold value and OR the 1 to enable it.

function DL_SDFM_configEnhancedComparator

void DL_SDFM_configEnhancedComparator(
    SDFM_Regs * sdfmHwRegsPtr,
    uint16_t filterConfig,
    uint32_t highLowThreshold1,
    uint32_t highLowThreshold2,
    uint16_t zeroCrossThreshold
)

Configure SDFM enhanced comparator for filter config & threshold values.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterConfig filter number, filter type & over sampling ratio.

  • highLowThreshold1 high-level and low-level threshold 1 values.

  • highLowThreshold2 high-level and low-level threshold 2 values.

  • zeroCrossThreshold zero-cross threshold value.

This function configures the comparator filter for filter config and threshold values based on input parameters. The filterConfig parameter is the logical OR of the filter number, filter type and over sampling ratio. The bit definitions for filterConfig are as follow: - filterConfig.[3:0] filter number - filterConfig.[7:4] filter type - filterConfig.[15:8] Over sampling Ratio Valid values for filter number and filter type are defined in SDFM_FilterNumber and SDFM_FilterType enumerations respectively. SDFM_SET_OSR(X) macro can be used to set the value of the oversampling ratio ,which ranges [1,32] inclusive, in the appropriate bit location. For example the value (SDFM_FILTER_1 | SDFM_FILTER_SINC_2 | SDFM_SET_OSR(16)) will select Filter 1, SINC 2 type with an oversampling ratio of 16. The highLowThreshold1 parameter is the logical OR of the filter high & low threshold 1 values. The bit definitions for highLowThreshold1 are as follow: - highLowThreshold1.[15:0] low threshold 1 - highLowThreshold1.[31:16] high threshold 1 The upper 16 bits define the high threshold and the lower 16 bits define the low threshold. SDFM_THRESHOLD(H,L) can be used to combine the high and low thresholds. The highLowThreshold2 parameter is the logical OR of the filter high & low threshold 2 values. The bit definitions for highLowThreshold2 are as follow: - highLowThreshold2.[15:0] low threshold 2 - highLowThreshold2.[31:16] high threshold 2 The upper 16 bits define the high threshold and the lower 16 bits define the low threshold. SDFM_THRESHOLD(H,L) can be used to combine the high & low thresholds. The zeroCrossThreshold parameter is the logical OR of the zero cross threshold enable flag and the zero-cross threshold value. The bit definitions for zeroCrossThreshold are as follows: - zeroCrossThreshold.[15] - Enable or disable zero cross threshold. Valid values are 1 or 0 to enable or disable the zero cross threshold respectively. - zeroCrossThreshold.[14:0] - Zero Cross Threshold value. The SDFM_SET_ZERO_CROSS_THRESH_VALUE(X) macro can be used as parameter zeroCrossThreshold to enable & specify the zero-cross threshold value.

function DL_SDFM_configDataFilter

void DL_SDFM_configDataFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    uint16_t config1,
    uint16_t config2
)

Configure SDFM data filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • config1 filter number, filter type and over sampling ratio configuration.

  • config2 data representation, filter switch, and data shift values configuration.

This function configures the data filter based on configurations config1 and config2. The config1 parameter is the logical OR of the filter number, filter type and over sampling ratio. The bit definitions for config1 are as follow:

  • config1.[3:0] Filter number - config1.[7:4] Filter type - config1.[15:8] Over sampling Ratio Valid values for filter number and filter type are defined in SDFM_FilterNumber and SDFM_FilterType enumerations respectively. SDFM_SET_OSR(X) macro can be used to set the value of the oversampling ratio , which ranges [1,256] inclusive , in the appropriate bit location for config1. For example the value (SDFM_FILTER_2 | SDFM_FILTER_SINC_3 | SDFM_SET_OSR(64)) will select Filter 2 , SINC 3 type with an oversampling ratio of 64. The config2 parameter is the logical OR of data representation, filter switch, and data shift values. The bit definitions for config2 are as follow: - config2.[0] Data representation - config2.[1] Filter switch - config2.[15:2] Shift values Valid values for data representation are given in SDFM_OutputDataFormat enumeration. SDFM_FILTER_DISABLE or SDFM_FILTER_ENABLE will define the filter switch values.SDFM_SHIFT_VALUE(X) macro can be used to set the value of the data shift value,which ranges [0,31] inclusive, in the appropriate bit location for config2. The shift value is valid only in SDFM_DATA_FORMAT_16_BIT data representation format.

function DL_SDFM_configZeroCrossComparator

void DL_SDFM_configZeroCrossComparator(
    SDFM_Regs * sdfmHwRegsPtr,
    uint16_t config1,
    uint16_t config2
)

Configure SDFM data filter Zero Cross threshold.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • config1 filter number, filter type and over sampling ratio.

  • config2 zero cross threshold value.

This function configures the comparator filter zero cross threshold values based on configurations config1 and config2. The config1 parameter is the logical OR of the filter number, filter type and over sampling ratio. The bit definitions for config1 are as follow: - config1.[3:0] filter number - config1.[7:4] filter type - config1.[15:8] Over sampling Ratio Valid values for filter number and filter type are defined in SDFM_FilterNumber and SDFM_FilterType enumerations respectively. SDFM_SET_OSR(X) macro can be used to set the value of the oversampling ratio ,which ranges [1,32] inclusive, in the appropriate bit location. For example the value (SDFM_FILTER_1 | SDFM_FILTER_SINC_2 | SDFM_SET_OSR(16)) will select Filter 1 , SINC 2 type with an oversampling ratio of 16. The config2 parameter is the value of the zero cross threshold. The maximum acceptable value is SDFM_SDFLT1CMPHZ_HLTZ_MASK.

function DL_SDFM_configDataFilterFIFO

void DL_SDFM_configDataFilterFIFO(
    SDFM_Regs * sdfmHwRegsPtr,
    uint16_t config1,
    uint16_t config2
)

Configure SDFM data filter FIFO.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • config1 filter number, filter type and over sampling ratio configuration.

  • config2 data representation, filter switch, data shift value, and FIFO level configuration.

This function enables and configures the data filter FIFO based on configurations config1 and config2. The config1 parameter is the logical OR of the filter number, filter type and over sampling ratio configuration. The bit definitions for config1 are as follow: - config1.[3:0] filter number - config1.[7:4] filter type - config1.[15:8] Over sampling Ratio Valid values for filter number and filter type are defined in SDFM_FilterNumber and SDFM_FilterType enumerations respectively. SDFM_SET_OSR(X) macro can be used to set the value of the oversampling ratio , which ranges [1,256] inclusive , in the appropriate bit location for config1. For example the value (SDFM_FILTER_2 | SDFM_FILTER_SINC_3 | SDFM_SET_OSR(64)) will select Filter 2 , SINC 3 type with an oversampling ratio of 64. The config2 parameter is the logical OR of data representation, filter switch, data shift value, and FIFO level configuration. The bit definitions for config2 are as follow: - config2.[0] Data representation - config2.[1] filter switch. - config2.[6:2] shift values. - config2.[15:7] FIFO level Valid values for data representation are given in SDFM_OutputDataFormat enumeration. SDFM_FILTER_DISABLE or SDFM_FILTER_ENABLE will define the filter switch values.SDFM_SHIFT_VALUE(X) macro can be used to set the value of the data shift value,which ranges [0,31] inclusive, in the appropriate bit location for config2. The value of FIFO level ranges [1,16] inclusive. The macro SDFM_SET_FIFO_LEVEL(X) can be used to set the value of the FIFO level.

function DL_SDFM_configCompEventLowFilter

void DL_SDFM_configCompEventLowFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    const DL_SDFM_CompEventFilterConfig * config
)

Configure Comparator Event Low Filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber filter number.

  • *config comparator event low filter configuration.

This function configures the sample window, threshold and clock prescale configurations for the comparator event low filter.

function DL_SDFM_configCompEventHighFilter

void DL_SDFM_configCompEventHighFilter(
    SDFM_Regs * sdfmHwRegsPtr,
    DL_SDFM_FILTER_NUMBER filterNumber,
    const DL_SDFM_CompEventFilterConfig * config
)

Configure Comparator Event High Filter.

Parameters:

  • *sdfmHwRegsPtr is the pointer to the base address of the SDFM module.

  • filterNumber filter number.

  • *config comparator event high filter configuration.

This function configures the sample window, threshold and clock prescale configurations for the comparator event high filter.

Macros Documentation

define DL_SDFM_CLOCK_SYNCHRONIZER

#define DL_SDFM_CLOCK_SYNCHRONIZER (SDFM_SDCTLPARM1_SDCLKSYNC_MASK)

Define for Clock synchronizer Configuration.

define DL_SDFM_DATA_SYNCHRONIZER

#define DL_SDFM_DATA_SYNCHRONIZER (SDFM_SDCTLPARM1_SDDATASYNC_MASK)

Define for Data Synchronizer Configuration.

define DL_SDFM_COMPEVT_FILTER_CONFIG_M

#define DL_SDFM_COMPEVT_FILTER_CONFIG_M (SDFM_SDCOMP1EVT1FLTCTL_SAMPWIN_MASK | SDFM_SDCOMP1EVT1FLTCTL_THRESH_MASK)

Define to mask out the bits in the SDCOMPHFILCTL register that aren’t associated with comparator event filter configurations.

define DL_SDFM_COMPEVT_FILTER_LOCK_M

#define DL_SDFM_COMPEVT_FILTER_LOCK_M (SDFM_SDCOMP1LOCK_SDCOMP1CTL_MASK | SDFM_SDCOMP1LOCK_COMP_MASK)

Define to mask out the bits in the SDCOMPLOCK register that aren’t associated with lock configuration.

define DL_SDFM_MODULATOR_FAILURE_INTERRUPT

#define DL_SDFM_MODULATOR_FAILURE_INTERRUPT (0x200U)

Interrupt is generated if Modulator fails.

define DL_SDFM_LOW_LEVEL_THRESHOLD_INTERRUPT

#define DL_SDFM_LOW_LEVEL_THRESHOLD_INTERRUPT (0x40U)

Interrupt on Comparator low-level threshold.

define DL_SDFM_HIGH_LEVEL_THRESHOLD_INTERRUPT

#define DL_SDFM_HIGH_LEVEL_THRESHOLD_INTERRUPT (0x20U)

Interrupt on Comparator high-level threshold.

define DL_SDFM_DATA_FILTER_ACKNOWLEDGE_INTERRUPT

#define DL_SDFM_DATA_FILTER_ACKNOWLEDGE_INTERRUPT (0x1U)

Interrupt on Acknowledge flag.

define DL_SDFM_FIFO_INTERRUPT

#define DL_SDFM_FIFO_INTERRUPT (0x1000U)

Interrupt on FIFO level.

define DL_SDFM_FIFO_OVERFLOW_INTERRUPT

#define DL_SDFM_FIFO_OVERFLOW_INTERRUPT (0x8000U)

Interrupt on FIFO overflow.

define DL_SDFM_MAIN_INTERRUPT_FLAG

#define DL_SDFM_MAIN_INTERRUPT_FLAG (0x80000000U)

Main interrupt flag.

define DL_SDFM_FILTER_1_HIGH_THRESHOLD_FLAG

#define DL_SDFM_FILTER_1_HIGH_THRESHOLD_FLAG (0x1U)

Filter 1 high-level threshold flag.

define DL_SDFM_FILTER_1_LOW_THRESHOLD_FLAG

#define DL_SDFM_FILTER_1_LOW_THRESHOLD_FLAG (0x2U)

Filter 1 low -level threshold flag.

define DL_SDFM_FILTER_2_HIGH_THRESHOLD_FLAG

#define DL_SDFM_FILTER_2_HIGH_THRESHOLD_FLAG (0x4U)

Filter 2 high-level threshold flag.

define DL_SDFM_FILTER_2_LOW_THRESHOLD_FLAG

#define DL_SDFM_FILTER_2_LOW_THRESHOLD_FLAG (0x8U)

Filter 2 low -level threshold flag.

define DL_SDFM_FILTER_3_HIGH_THRESHOLD_FLAG

#define DL_SDFM_FILTER_3_HIGH_THRESHOLD_FLAG (0x10U)

Filter 3 high-level threshold flag.

define DL_SDFM_FILTER_3_LOW_THRESHOLD_FLAG

#define DL_SDFM_FILTER_3_LOW_THRESHOLD_FLAG (0x20U)

Filter 3 low -level threshold flag.

define DL_SDFM_FILTER_4_HIGH_THRESHOLD_FLAG

#define DL_SDFM_FILTER_4_HIGH_THRESHOLD_FLAG (0x40U)

Filter 4 high-level threshold flag.

define DL_SDFM_FILTER_4_LOW_THRESHOLD_FLAG

#define DL_SDFM_FILTER_4_LOW_THRESHOLD_FLAG (0x80U)

Filter 4 low -level threshold flag.

define DL_SDFM_FILTER_1_MOD_FAILED_FLAG

#define DL_SDFM_FILTER_1_MOD_FAILED_FLAG (0x100U)

Filter 1 modulator failed flag.

define DL_SDFM_FILTER_2_MOD_FAILED_FLAG

#define DL_SDFM_FILTER_2_MOD_FAILED_FLAG (0x200U)

Filter 2 modulator failed flag.

define DL_SDFM_FILTER_3_MOD_FAILED_FLAG

#define DL_SDFM_FILTER_3_MOD_FAILED_FLAG (0x400U)

Filter 3 modulator failed flag.

define DL_SDFM_FILTER_4_MOD_FAILED_FLAG

#define DL_SDFM_FILTER_4_MOD_FAILED_FLAG (0x800U)

Filter 4 modulator failed flag.

define DL_SDFM_FILTER_1_NEW_DATA_FLAG

#define DL_SDFM_FILTER_1_NEW_DATA_FLAG (0x1000U)

Filter 1 new data flag.

define DL_SDFM_FILTER_2_NEW_DATA_FLAG

#define DL_SDFM_FILTER_2_NEW_DATA_FLAG (0x2000U)

Filter 2 new data flag.

define DL_SDFM_FILTER_3_NEW_DATA_FLAG

#define DL_SDFM_FILTER_3_NEW_DATA_FLAG (0x4000U)

Filter 3 new data flag.

define DL_SDFM_FILTER_4_NEW_DATA_FLAG

#define DL_SDFM_FILTER_4_NEW_DATA_FLAG (0x8000U)

Filter 4 new data flag.

define DL_SDFM_FILTER_1_FIFO_OVERFLOW_FLAG

#define DL_SDFM_FILTER_1_FIFO_OVERFLOW_FLAG (0x10000U)

Filter 1 FIFO overflow flag.

define DL_SDFM_FILTER_2_FIFO_OVERFLOW_FLAG

#define DL_SDFM_FILTER_2_FIFO_OVERFLOW_FLAG (0x20000U)

Filter 2 FIFO overflow flag.

define DL_SDFM_FILTER_3_FIFO_OVERFLOW_FLAG

#define DL_SDFM_FILTER_3_FIFO_OVERFLOW_FLAG (0x40000U)

Filter 3 FIFO overflow flag.

define DL_SDFM_FILTER_4_FIFO_OVERFLOW_FLAG

#define DL_SDFM_FILTER_4_FIFO_OVERFLOW_FLAG (0x80000U)

Filter 4 FIFO overflow flag.

define DL_SDFM_FILTER_1_FIFO_INTERRUPT_FLAG

#define DL_SDFM_FILTER_1_FIFO_INTERRUPT_FLAG (0x100000U)

Filter 1 FIFO interrupt flag.

define DL_SDFM_FILTER_2_FIFO_INTERRUPT_FLAG

#define DL_SDFM_FILTER_2_FIFO_INTERRUPT_FLAG (0x200000U)

Filter 2 FIFO interrupt flag.

define DL_SDFM_FILTER_3_FIFO_INTERRUPT_FLAG

#define DL_SDFM_FILTER_3_FIFO_INTERRUPT_FLAG (0x400000U)

Filter 3 FIFO interrupt flag.

define DL_SDFM_FILTER_4_FIFO_INTERRUPT_FLAG

#define DL_SDFM_FILTER_4_FIFO_INTERRUPT_FLAG (0x800000U)

Filter 4 FIFO interrupt flag.

define DL_SDFM_GET_LOW_THRESHOLD

#define DL_SDFM_GET_LOW_THRESHOLD(
    C
)
((uint16_t)(C))

Macro to get the low threshold.

define DL_SDFM_GET_HIGH_THRESHOLD

#define DL_SDFM_GET_HIGH_THRESHOLD(
    C
)
((uint16_t)((uint32_t)(C) >> 16U))

Macro to get the high threshold.

define DL_SDFM_GET_LOW_THRESHOLD_BOTH

#define DL_SDFM_GET_LOW_THRESHOLD_BOTH(
    C1,
    C2
)
    ((((uint32_t)(DL_SDFM_GET_LOW_THRESHOLD(C2))) << 16U) | ((uint32_t)(DL_SDFM_GET_LOW_THRESHOLD(C1))))

Macro to get the low threshold 1 & 2 to be passed as lowThreshold parameter.

define DL_SDFM_GET_HIGH_THRESHOLD_BOTH

#define DL_SDFM_GET_HIGH_THRESHOLD_BOTH(
    C1,
    C2
)
    ((((uint32_t)(DL_SDFM_GET_HIGH_THRESHOLD(C2))) << 16U) | ((uint32_t)(DL_SDFM_GET_HIGH_THRESHOLD(C1))))

Macro to get the high threshold 1 & 2 to be passed as highThreshold parameter.

define DL_SDFM_THRESHOLD

#define DL_SDFM_THRESHOLD(
    H,
    L
)
((((uint32_t)(H)) << 16U) | (L))

Macro to combine high threshold and low threshold values.

define DL_SDFM_SET_OSR

#define DL_SDFM_SET_OSR(
    X
)
(((X) - 1U) << 8U)

Macro to convert comparator over sampling ratio to acceptable bit location.

define DL_SDFM_SHIFT_VALUE

#define DL_SDFM_SHIFT_VALUE(
    X
)
((X) << 2U)

Macro to convert the data shift bit values to acceptable bit location.

define DL_SDFM_SET_FIFO_LEVEL

#define DL_SDFM_SET_FIFO_LEVEL(
    X
)
((X) << 7U)

Macro to set the FIFO level to acceptable bit location.

define DL_SDFM_SET_ZERO_CROSS_THRESH_VALUE

#define DL_SDFM_SET_ZERO_CROSS_THRESH_VALUE(
    X
)
(0x8000U | (X))

Macro to set and enable the zero cross threshold value.

define DL_SDFM_FILTER_DISABLE

#define DL_SDFM_FILTER_DISABLE (0x0U)

Macro to disable filter.

define DL_SDFM_FILTER_ENABLE

#define DL_SDFM_FILTER_ENABLE (0x2U)

Macro to enable filter.

define DL_SDFM_GET_OSR

#define DL_SDFM_GET_OSR(
    C
)
((C) >> 8U)

Get filter oversampling ratio.

define DL_SDFM_GET_FILTER_TYPE

#define DL_SDFM_GET_FILTER_TYPE(
    C
)
((C) & 0x30U)

Get the filter type.

define DL_SDFM_GET_FILTER_NUMBER

#define DL_SDFM_GET_FILTER_NUMBER(
    C
)
((C) & 0x3U)

Get the filter number.

define DL_SDFM_GET_ZHIGH_THRESHOLD

#define DL_SDFM_GET_ZHIGH_THRESHOLD(
    C
)
((C) & 0x7FFFU)

Get the zero-crossing high threshold.

define DL_SDFM_ZHIGH_ENABLE_MASK

#define DL_SDFM_ZHIGH_ENABLE_MASK (0x8000U)

Zero-crossing high threshold mask.

define DL_SDFM_GET_SHIFT_VALUE

#define DL_SDFM_GET_SHIFT_VALUE(
    C
)
(((C) >> 2U) & 0x1FU)

Get data shift value.

define DL_SDFM_SDFIL_OFFSET

#define DL_SDFM_SDFIL_OFFSET (SDFM_SDCTLPARM2 - SDFM_SDCTLPARM1)

SD filter offset.

define DL_SDFM_DIGFIL_OFFSET

#define DL_SDFM_DIGFIL_OFFSET (SDFM_SDCOMP2CTL - SDFM_SDCOMP1CTL)

Event Digital filter offset.

define DL_SDFM_SDFLT1CMPHx_OFFSET

#define DL_SDFM_SDFLT1CMPHx_OFFSET (SDFM_SDFLT1CMPH2 - SDFM_SDFLT1CMPH1)

Offset between high threshold 1 & 2 registers.

define DL_SDFM_SDFLT1CMPLx_OFFSET

#define DL_SDFM_SDFLT1CMPLx_OFFSET (SDFM_SDFLT1CMPL2 - SDFM_SDFLT1CMPL1)

Offset between low threshold 1 & 2 registers.

define DL_SDFM_MAX_COMP_FILTER_OSR

#define DL_SDFM_MAX_COMP_FILTER_OSR (31U)

Maximum acceptable comparator filter oversampling ratio.

define DL_SDFM_MAX_DATA_FILTER_OSR

#define DL_SDFM_MAX_DATA_FILTER_OSR (255U)

Maximum acceptable data filter oversampling ratio.

define DL_SDFM_MAX_DATA_SHIFT_VALUE

#define DL_SDFM_MAX_DATA_SHIFT_VALUE (31U)

Maximum acceptable data shift value.

define DL_SDFM_MAX_FIFO_LEVEL

#define DL_SDFM_MAX_FIFO_LEVEL (16U)

Maximum acceptable FIFO interrupt level.

define DL_SDFM_ALL_INTERRUPT_FLAGS_MASK

#define DL_SDFM_ALL_INTERRUPT_FLAGS_MASK     (DL_SDFM_FILTER_1_HIGH_THRESHOLD_FLAG | DL_SDFM_FILTER_1_LOW_THRESHOLD_FLAG |                                    \
     DL_SDFM_FILTER_2_HIGH_THRESHOLD_FLAG | DL_SDFM_FILTER_2_LOW_THRESHOLD_FLAG |                                    \
     DL_SDFM_FILTER_3_HIGH_THRESHOLD_FLAG | DL_SDFM_FILTER_3_LOW_THRESHOLD_FLAG |                                    \
     DL_SDFM_FILTER_4_HIGH_THRESHOLD_FLAG | DL_SDFM_FILTER_4_LOW_THRESHOLD_FLAG | DL_SDFM_FILTER_1_MOD_FAILED_FLAG | \
     DL_SDFM_FILTER_2_MOD_FAILED_FLAG | DL_SDFM_FILTER_3_MOD_FAILED_FLAG | DL_SDFM_FILTER_4_MOD_FAILED_FLAG |        \
     DL_SDFM_FILTER_1_NEW_DATA_FLAG | DL_SDFM_FILTER_2_NEW_DATA_FLAG | DL_SDFM_FILTER_3_NEW_DATA_FLAG |              \
     DL_SDFM_FILTER_4_NEW_DATA_FLAG | DL_SDFM_FILTER_1_FIFO_OVERFLOW_FLAG | DL_SDFM_FILTER_2_FIFO_OVERFLOW_FLAG |    \
     DL_SDFM_FILTER_3_FIFO_OVERFLOW_FLAG | DL_SDFM_FILTER_4_FIFO_OVERFLOW_FLAG |                                     \
     DL_SDFM_FILTER_1_FIFO_INTERRUPT_FLAG | DL_SDFM_FILTER_2_FIFO_INTERRUPT_FLAG |                                   \
     DL_SDFM_FILTER_3_FIFO_INTERRUPT_FLAG | DL_SDFM_FILTER_4_FIFO_INTERRUPT_FLAG | DL_SDFM_MAIN_INTERRUPT_FLAG)

Mask of all valid SDIFLG/SDIFLGCLR interrupt flag bits.