Driverlib CMPSSLITE API
Module: Driverlib (AM13E232X) APIs
Structures
Name |
|
|---|---|
struct |
DL_CMPSSLITE_FilterConfig |
struct |
DL_CMPSSLITE_DacConfig |
struct |
DL_CMPSSLITE_CompConfig |
struct |
DL_CMPSSLITE_CompSSConfig |
struct |
DL_CMPSSLITE_Config |
Types
Name |
|
|---|---|
enum |
DL_CMPSSLITE_SYNCSOURCE { DL_CMPSSLITE_SYNCSOURCE_MCPWM0_SYNCPER = 0U, DL_CMPSSLITE_SYNCSOURCE_MCPWM1_SYNCPER = 1U, DL_CMPSSLITE_SYNCSOURCE_MCPWM2_SYNCPER = 2U, DL_CMPSSLITE_SYNCSOURCE_EPWM0_SYNCPER = 5U, DL_CMPSSLITE_SYNCSOURCE_EPWM1_SYNCPER = 6U, DL_CMPSSLITE_SYNCSOURCE_EPWM2_SYNCPER = 7U, DL_CMPSSLITE_SYNCSOURCE_EPWM3_SYNCPER = 8U, DL_CMPSSLITE_SYNCSOURCE_EPWM4_SYNCPER = 9U, DL_CMPSSLITE_SYNCSOURCE_EPWM5_SYNCPER = 10U} |
enum |
DL_CMPSSLITE_FILTER_INPUT { DL_CMPSSLITE_FILTIN_COMPOUT = 0x0000U, DL_CMPSSLITE_FILTIN_EXT_H1 = 0x0001U, DL_CMPSSLITE_FILTIN_EXT_H2 = 0x0002U, DL_CMPSSLITE_FILTIN_EXT_H3 = 0x0003U, DL_CMPSSLITE_FILTIN_EXT_H4 = 0x0004U, DL_CMPSSLITE_FILTIN_EXT_H5 = 0x0005U, DL_CMPSSLITE_FILTIN_EXT_H6 = 0x0006U, DL_CMPSSLITE_FILTIN_EXT_H7 = 0x0007U} |
enum |
DL_CMPSSLITE_HYSTERESIS { DL_CMPSSLITE_HYSTERESIS_NONE = 0U, DL_CMPSSLITE_HYSTERESIS_TYPICAL = 1U, DL_CMPSSLITE_HYSTERESIS_2X = 2U, DL_CMPSSLITE_HYSTERESIS_3X = 3U, DL_CMPSSLITE_HYSTERESIS_4X = 4U} |
Functions
Name |
|
|---|---|
__STATIC_INLINE void |
DL_CMPSSLITE_enableModule(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_disableModule(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_configHighComparator(CMPSS_LITE_Regs * cmpsslite, uint16_t config) |
__STATIC_INLINE void |
DL_CMPSSLITE_configLowComparator(CMPSS_LITE_Regs * cmpsslite, uint16_t config) |
__STATIC_INLINE void |
DL_CMPSSLITE_configOutputsHigh(CMPSS_LITE_Regs * cmpsslite, uint16_t config) |
__STATIC_INLINE void |
DL_CMPSSLITE_configOutputsLow(CMPSS_LITE_Regs * cmpsslite, uint16_t config) |
__STATIC_INLINE uint16_t |
DL_CMPSSLITE_getStatus(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_configDACHigh(CMPSS_LITE_Regs * cmpsslite, uint16_t config) |
__STATIC_INLINE void |
DL_CMPSSLITE_configureSyncSourceHigh(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_SYNCSOURCE syncSource) |
__STATIC_INLINE void |
DL_CMPSSLITE_configureSyncSourceLow(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_SYNCSOURCE syncSource) |
__STATIC_INLINE void |
DL_CMPSSLITE_setDACValueHigh(CMPSS_LITE_Regs * cmpsslite, uint16_t value) |
__STATIC_INLINE void |
DL_CMPSSLITE_setDACValueLow(CMPSS_LITE_Regs * cmpsslite, uint16_t value) |
__STATIC_INLINE uint16_t |
DL_CMPSSLITE_getDACValueHigh(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE uint16_t |
DL_CMPSSLITE_getDACValueLow(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_initFilterHigh(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_initFilterLow(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_configFilterInputHigh(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_FILTER_INPUT filtInput) |
__STATIC_INLINE void |
DL_CMPSSLITE_configFilterInputLow(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_FILTER_INPUT filtInput) |
__STATIC_INLINE void |
DL_CMPSSLITE_clearFilterLatchHigh(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_clearFilterLatchLow(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_setHysteresis(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_HYSTERESIS hysteresis) |
__STATIC_INLINE void |
DL_CMPSSLITE_enableLatchResetOnPWMSYNCHigh(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_disableLatchResetOnPWMSYNCHigh(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_enableLatchResetOnPWMSYNCLow(CMPSS_LITE_Regs * cmpsslite) |
__STATIC_INLINE void |
DL_CMPSSLITE_disableLatchResetOnPWMSYNCLow(CMPSS_LITE_Regs * cmpsslite) |
void |
DL_CMPSSLITE_configFilterHigh(CMPSS_LITE_Regs * cmpsslite, uint32_t samplePrescale, uint16_t sampleWindow, uint16_t threshold) |
void |
DL_CMPSSLITE_configFilterLow(CMPSS_LITE_Regs * cmpsslite, uint32_t samplePrescale, uint16_t sampleWindow, uint16_t threshold) |
void |
DL_CMPSSLITE_configLatchOnPWMSYNC(CMPSS_LITE_Regs * cmpsslite, bool highEnable, bool lowEnable) |
void |
DL_CMPSSLITE_initParamsSetDefault(DL_CMPSSLITE_Config * config) |
void |
DL_CMPSSLITE_init(CMPSS_LITE_Regs * cmpsslite, DL_CMPSSLITE_Config * config) |
Defines
Name |
|
|---|---|
DL_CMPSSLITE_INSRC_DAC |
|
DL_CMPSSLITE_INSRC_PIN |
|
DL_CMPSSLITE_CONFIG_INVERT |
|
DL_CMPSSLITE_CONFIG_ASYNCH_ENABLE |
|
DL_CMPSSLITE_TRIPOUT_ASYNC_COMP |
|
DL_CMPSSLITE_TRIPOUT_SYNC_COMP |
|
DL_CMPSSLITE_TRIPOUT_FILTER |
|
DL_CMPSSLITE_TRIPOUT_LATCH |
|
DL_CMPSSLITE_TRIP_ASYNC_COMP |
|
DL_CMPSSLITE_TRIP_SYNC_COMP |
|
DL_CMPSSLITE_TRIP_FILTER |
|
DL_CMPSSLITE_TRIP_LATCH |
|
DL_CMPSSLITE_STS_HI_FILOUT |
|
DL_CMPSSLITE_STS_HI_LATCHFILOUT |
|
DL_CMPSSLITE_STS_LO_FILOUT |
|
DL_CMPSSLITE_STS_LO_LATCHFILOUT |
|
DL_CMPSSLITE_DACVAL_MCLK |
|
DL_CMPSSLITE_DACVAL_PWMSYNC |
Types Documentation
enum DL_CMPSSLITE_SYNCSOURCE
Enumerator |
Value |
Description |
|---|---|---|
DL_CMPSSLITE_SYNCSOURCE_MCPWM0_SYNCPER |
0U |
Sync source is MCPWM0_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_MCPWM1_SYNCPER |
1U |
Sync source is MCPWM1_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_MCPWM2_SYNCPER |
2U |
Sync source is MCPWM2_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM0_SYNCPER |
5U |
Sync source is EPWM0_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM1_SYNCPER |
6U |
Sync source is EPWM1_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM2_SYNCPER |
7U |
Sync source is EPWM2_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM3_SYNCPER |
8U |
Sync source is EPWM3_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM4_SYNCPER |
9U |
Sync source is EPWM4_SYNCPER |
DL_CMPSSLITE_SYNCSOURCE_EPWM5_SYNCPER |
10U |
Sync source is EPWM5_SYNCPER |
DAC and digital filter Sync source.
enum DL_CMPSSLITE_FILTER_INPUT
Enumerator |
Value |
Description |
|---|---|---|
DL_CMPSSLITE_FILTIN_COMPOUT |
0x0000U |
Filter input driven by comparator output |
DL_CMPSSLITE_FILTIN_EXT_H1 |
0x0001U |
Filter input driven by EXT_FILTIN_H[1] |
DL_CMPSSLITE_FILTIN_EXT_H2 |
0x0002U |
Filter input driven by EXT_FILTIN_H[2] |
DL_CMPSSLITE_FILTIN_EXT_H3 |
0x0003U |
Filter input driven by EXT_FILTIN_H[3] |
DL_CMPSSLITE_FILTIN_EXT_H4 |
0x0004U |
Filter input driven by EXT_FILTIN_H[4] |
DL_CMPSSLITE_FILTIN_EXT_H5 |
0x0005U |
Filter input driven by EXT_FILTIN_H[5] |
DL_CMPSSLITE_FILTIN_EXT_H6 |
0x0006U |
Filter input driven by EXT_FILTIN_H[6] |
DL_CMPSSLITE_FILTIN_EXT_H7 |
0x0007U |
Filter input driven by EXT_FILTIN_H[7] |
Comparator digital filter input selection.
enum DL_CMPSSLITE_HYSTERESIS
Enumerator |
Value |
Description |
|---|---|---|
DL_CMPSSLITE_HYSTERESIS_NONE |
0U |
No hysteresis |
DL_CMPSSLITE_HYSTERESIS_TYPICAL |
1U |
Typical hysteresis level |
DL_CMPSSLITE_HYSTERESIS_2X |
2U |
2x typical hysteresis |
DL_CMPSSLITE_HYSTERESIS_3X |
3U |
3x typical hysteresis |
DL_CMPSSLITE_HYSTERESIS_4X |
4U |
4x typical hysteresis |
Hysteresis levels for the comparator.
Functions Documentation
function DL_CMPSSLITE_enableModule
__STATIC_INLINE void DL_CMPSSLITE_enableModule(
CMPSS_LITE_Regs * cmpsslite
)
Enables the CMPSSLITE module.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
function DL_CMPSSLITE_disableModule
__STATIC_INLINE void DL_CMPSSLITE_disableModule(
CMPSS_LITE_Regs * cmpsslite
)
Disables the CMPSSLITE module.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
function DL_CMPSSLITE_configHighComparator
__STATIC_INLINE void DL_CMPSSLITE_configHighComparator(
CMPSS_LITE_Regs * cmpsslite,
uint16_t config
)
Sets the configuration for the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
config Configuration for the high comparator [DL_CMPSSLITE_INSRC] and [DL_CMPSSLITE_CONFIG]
This API configures a high comparator. The config parameter is the result of a logical OR operation between following values:
Comparator negative input source:
DL_CMPSSLITE_INSRC_DAC - Input driven by internal DAC
DL_CMPSSLITE_INSRC_PIN - Input driven by external pin
DL_CMPSSLITE_CONFIG_INVERT - Invert comparator output
DL_CMPSSLITE_CONFIG_ASYNCH_ENABLE - The asynchronous comparator output will be fed into an OR gate with the latched digital filter output before it is made available for CTRIPH or CTRIPOUTH.
function DL_CMPSSLITE_configLowComparator
__STATIC_INLINE void DL_CMPSSLITE_configLowComparator(
CMPSS_LITE_Regs * cmpsslite,
uint16_t config
)
Sets the configuration for the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
config Configuration for the low comparator [DL_CMPSSLITE_INSRC] and [DL_CMPSSLITE_CONFIG]
This API configures a low comparator. The config parameter is the result of a logical OR operation between following values:
Comparator negative input source:
DL_CMPSSLITE_INSRC_DAC - Input driven by internal DAC
DL_CMPSSLITE_INSRC_PIN - Input driven by external pin
DL_CMPSSLITE_CONFIG_INVERT - Invert comparator output
DL_CMPSSLITE_CONFIG_ASYNCH_ENABLE - The asynchronous comparator output will be fed into an OR gate with the latched digital filter output before it is made available for CTRIPL or CTRIPOUTL.
function DL_CMPSSLITE_configOutputsHigh
__STATIC_INLINE void DL_CMPSSLITE_configOutputsHigh(
CMPSS_LITE_Regs * cmpsslite,
uint16_t config
)
Sets the output signal configuration for the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
config Configuration for the high comparator output signals [DL_CMPSSLITE_TRIPOUT] and [DL_CMPSSLITE_TRIP]
This API configures a comparator’s output signals CTRIP and CTRIPOUT for the high comparator. The config parameter is the result of a logical OR operation between the following values:
High Comparator Trip Output Source Select:
DL_CMPSSLITE_TRIPOUT_ASYNC_COMP - Asynchronous comparator output
DL_CMPSSLITE_TRIPOUT_SYNC_COMP - Synchronous comparator output
DL_CMPSSLITE_TRIPOUT_FILTER - Digital filter output
DL_CMPSSLITE_TRIPOUT_LATCH - Latched digital filter output
High Comparator Trip Source Select:
DL_CMPSSLITE_TRIP_ASYNC_COMP - Asynchronous comparator output
DL_CMPSSLITE_TRIP_SYNC_COMP - Synchronous comparator output
DL_CMPSSLITE_TRIP_FILTER - Digital filter output
DL_CMPSSLITE_TRIP_LATCH - Latched digital filter output
function DL_CMPSSLITE_configOutputsLow
__STATIC_INLINE void DL_CMPSSLITE_configOutputsLow(
CMPSS_LITE_Regs * cmpsslite,
uint16_t config
)
Sets the output signal configuration for the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
config Configuration for the low comparator output signals [DL_CMPSSLITE_TRIPOUT] and [DL_CMPSSLITE_TRIP]
This API configures a comparator’s output signals CTRIP and CTRIPOUT for the low comparator. The config parameter is the result of a logical OR operation between the following values:
Low Comparator Trip Output Source Select:
DL_CMPSSLITE_TRIPOUT_ASYNC_COMP - Asynchronous comparator output
DL_CMPSSLITE_TRIPOUT_SYNC_COMP - Synchronous comparator output
DL_CMPSSLITE_TRIPOUT_FILTER - Digital filter output
DL_CMPSSLITE_TRIPOUT_LATCH - Latched digital filter output
Low Comparator Trip Source Select:
DL_CMPSSLITE_TRIP_ASYNC_COMP - Asynchronous comparator output
DL_CMPSSLITE_TRIP_SYNC_COMP - Synchronous comparator output
DL_CMPSSLITE_TRIP_FILTER - Digital filter output
DL_CMPSSLITE_TRIP_LATCH - Latched digital filter output
function DL_CMPSSLITE_getStatus
__STATIC_INLINE uint16_t DL_CMPSSLITE_getStatus(
CMPSS_LITE_Regs * cmpsslite
)
Gets the current comparator status.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
Return: Current comparator status as a bitwise combination of status flags
This API returns the current status for the comparator, specifically the digital filter output and latched digital filter output.
Possible status values are bitwise combinations of the following:
DL_CMPSSLITE_STS_HI_FILOUT - High digital filter output
DL_CMPSSLITE_STS_HI_LATCHFILOUT - Latched value of high digital filter output
DL_CMPSSLITE_STS_LO_FILOUT - Low digital filter output
DL_CMPSSLITE_STS_LO_LATCHFILOUT - Latched value of low digital filter output
function DL_CMPSSLITE_configDACHigh
__STATIC_INLINE void DL_CMPSSLITE_configDACHigh(
CMPSS_LITE_Regs * cmpsslite,
uint16_t config
)
Sets the configuration for the internal DAC of high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
config configuration of the internal DAC
This API configures the comparator’s internal DAC. The config parameter configures whether DACxVALA is updated from DACxVALS on MCLK or MCPWMSYNCPER.
DL_CMPSSLITE_DACVAL_MCLK - Value register updated on system clock
DL_CMPSSLITE_DACVAL_PWMSYNC - Value register updated on PWM sync
function DL_CMPSSLITE_configureSyncSourceHigh
__STATIC_INLINE void DL_CMPSSLITE_configureSyncSourceHigh(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_SYNCSOURCE syncSource
)
Configures sync source for high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
syncSource Desired MCPWMxSYNCPER source
This API configures the desired MCPWMxSYNCPER source for high comparator blocks. The configured MCPWMxSYNCPER signal can be used to synchronize loading of DAC input value from shadow to active register. It can also be used to synchronize the Ramp generator, if applicable.
Valid values for syncSource parameter can be 0 to n, where n represents the maximum number of MCPWMSYNCPER signals available on the device. For instance, passing 2 into syncSource will select MCPWM2SYNCPER.
function DL_CMPSSLITE_configureSyncSourceLow
__STATIC_INLINE void DL_CMPSSLITE_configureSyncSourceLow(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_SYNCSOURCE syncSource
)
Configures sync source for low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
syncSource Desired MCPWMxSYNCPER source
This API configures the desired MCPWMxSYNCPER source for low comparator blocks. The configured MCPWMxSYNCPER signal can be used to synchronize loading of DAC input value from shadow to active register. It can also be used to synchronize the Ramp generator, if applicable.
Valid values for syncSource parameter can be 0 to n, where n represents the maximum number of MCPWMSYNCPER signals available on the device. For instance, passing 2 into syncSource will select MCPWM2SYNCPER.
function DL_CMPSSLITE_setDACValueHigh
__STATIC_INLINE void DL_CMPSSLITE_setDACValueHigh(
CMPSS_LITE_Regs * cmpsslite,
uint16_t value
)
Sets the value of the internal DAC of the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
value 12-bit DAC value to be set (0-4095)
This API sets the 12-bit value driven by the internal DAC of the high comparator. The value will be loaded into the shadow register, from which the actual DAC value register will be updated based on the configuration set by DL_CMPSSLITE_configDACHigh().
function DL_CMPSSLITE_setDACValueLow
__STATIC_INLINE void DL_CMPSSLITE_setDACValueLow(
CMPSS_LITE_Regs * cmpsslite,
uint16_t value
)
Sets the value of the internal DAC of the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
value 12-bit DAC value to be set (0-4095)
This API sets the 12-bit value driven by the internal DAC of the low comparator. The value will be loaded into the shadow register, from which the actual DAC value register will be updated based on the configuration set by DL_CMPSSLITE_configDACLow().
function DL_CMPSSLITE_getDACValueHigh
__STATIC_INLINE uint16_t DL_CMPSSLITE_getDACValueHigh(
CMPSS_LITE_Regs * cmpsslite
)
Gets the value of the internal DAC of the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
Return: Value driven by the internal DAC of the high comparator
This API returns the value of the internal DAC of the high comparator. The value is read from the active register, not the shadow register used by DL_CMPSSLITE_setDACValueHigh().
function DL_CMPSSLITE_getDACValueLow
__STATIC_INLINE uint16_t DL_CMPSSLITE_getDACValueLow(
CMPSS_LITE_Regs * cmpsslite
)
Gets the value of the internal DAC of the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
Return: Value driven by the internal DAC of the low comparator
This API returns the value of the internal DAC of the low comparator. The value is read from the active register, not the shadow register used by DL_CMPSSLITE_setDACValueLow().
function DL_CMPSSLITE_initFilterHigh
__STATIC_INLINE void DL_CMPSSLITE_initFilterHigh(
CMPSS_LITE_Regs * cmpsslite
)
Initializes the digital filter of the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
Note: See DL_CMPSSLITE_configFilterHigh() for the proper initialization sequence to avoid glitches.
This API initializes all the samples in the high comparator digital filter to the filter input value.
function DL_CMPSSLITE_initFilterLow
__STATIC_INLINE void DL_CMPSSLITE_initFilterLow(
CMPSS_LITE_Regs * cmpsslite
)
Initializes the digital filter of the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
Note: See DL_CMPSSLITE_configFilterLow() for the proper initialization sequence to avoid glitches.
This API initializes all the samples in the low comparator digital filter to the filter input value.
function DL_CMPSSLITE_configFilterInputHigh
__STATIC_INLINE void DL_CMPSSLITE_configFilterInputHigh(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_FILTER_INPUT filtInput
)
Configures input for the digital filter of the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
filtInput Desired filter input
This API configures the input for the digital filter of the high comparator. The filter input can be the high comparator output or an external signal configured through XBAR.
function DL_CMPSSLITE_configFilterInputLow
__STATIC_INLINE void DL_CMPSSLITE_configFilterInputLow(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_FILTER_INPUT filtInput
)
Configures input for the digital filter of the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
filtInput Desired filter input
This API configures the input for the digital filter of the low comparator. The filter input can be the low comparator output or an external signal configured through XBAR.
function DL_CMPSSLITE_clearFilterLatchHigh
__STATIC_INLINE void DL_CMPSSLITE_clearFilterLatchHigh(
CMPSS_LITE_Regs * cmpsslite
)
Causes a software reset of the high comparator digital filter output latch.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API causes a software reset of the high comparator digital filter output latch. It will generate a single pulse of the latch reset signal.
function DL_CMPSSLITE_clearFilterLatchLow
__STATIC_INLINE void DL_CMPSSLITE_clearFilterLatchLow(
CMPSS_LITE_Regs * cmpsslite
)
Causes a software reset of the low comparator digital filter output latch.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API causes a software reset of the low comparator digital filter output latch. It will generate a single pulse of the latch reset signal.
function DL_CMPSSLITE_setHysteresis
__STATIC_INLINE void DL_CMPSSLITE_setHysteresis(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_HYSTERESIS hysteresis
)
Sets the comparator hysteresis settings.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
hysteresis Amount of hysteresis DL_CMPSSLITE_HYSTERESIS
This API sets the amount of hysteresis on the comparator inputs.
function DL_CMPSSLITE_enableLatchResetOnPWMSYNCHigh
__STATIC_INLINE void DL_CMPSSLITE_enableLatchResetOnPWMSYNCHigh(
CMPSS_LITE_Regs * cmpsslite
)
Enables reset of HIGH comparator digital filter output latch on PWMSYNC.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API enables MCPWMSYNCPER reset of High comparator digital filter output latch
function DL_CMPSSLITE_disableLatchResetOnPWMSYNCHigh
__STATIC_INLINE void DL_CMPSSLITE_disableLatchResetOnPWMSYNCHigh(
CMPSS_LITE_Regs * cmpsslite
)
Disables reset of HIGH comparator digital filter output latch on PWMSYNC.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API disables MCPWMSYNCPER reset of High comparator digital filter output latch
function DL_CMPSSLITE_enableLatchResetOnPWMSYNCLow
__STATIC_INLINE void DL_CMPSSLITE_enableLatchResetOnPWMSYNCLow(
CMPSS_LITE_Regs * cmpsslite
)
Enables reset of LOW comparator digital filter output latch on PWMSYNC.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API enables MCPWMSYNCPER reset of Low comparator digital filter output latch
function DL_CMPSSLITE_disableLatchResetOnPWMSYNCLow
__STATIC_INLINE void DL_CMPSSLITE_disableLatchResetOnPWMSYNCLow(
CMPSS_LITE_Regs * cmpsslite
)
Disables reset of LOW comparator digital filter output latch on PWMSYNC.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
This API disables MCPWMSYNCPER reset of Low comparator digital filter output latch
function DL_CMPSSLITE_configFilterHigh
void DL_CMPSSLITE_configFilterHigh(
CMPSS_LITE_Regs * cmpsslite,
uint32_t samplePrescale,
uint16_t sampleWindow,
uint16_t threshold
)
Configures the digital filter of the high comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
samplePrescale Number of system clock cycles between samples
sampleWindow Size of the sample window
threshold Majority threshold of samples to change state
This API configures the operation of the digital filter of the high comparator.
The samplePrescale parameter specifies the number of system clock cycles between samples. It is a 24-bit value so a number higher than 16777215 should not be passed as this parameter. The prescaler used by digital filter is 1 more than samplePrescale value. So, the input provided should be 1 less than the expected prescaler.
The sampleWindow parameter configures the size of the window of FIFO samples taken from the input that will be monitored to determine when to change the filter output. This sample window may be no larger than 64 samples.
The threshold parameter configures the threshold value to be used by the digital filter.
The filter output resolves to the majority value of the sample window where majority is defined by the value passed into the threshold parameter. For proper operation, the value of threshold must be greater than sampleWindow / 2.
To ensure proper operation of the filter, the following is the recommended function call sequence for initialization:
Configure and enable the comparator using DL_CMPSSLITE_configHighComparator() and DL_CMPSSLITE_enableModule()
Configure the digital filter using DL_CMPSSLITE_configFilterHigh()
Initialize the sample values using DL_CMPSSLITE_initFilterHigh()
Configure the module output signals CTRIP and CTRIPOUT using DL_CMPSSLITE_configOutputsHigh()
function DL_CMPSSLITE_configFilterLow
void DL_CMPSSLITE_configFilterLow(
CMPSS_LITE_Regs * cmpsslite,
uint32_t samplePrescale,
uint16_t sampleWindow,
uint16_t threshold
)
Configures the digital filter of the low comparator.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
samplePrescale Number of system clock cycles between samples
sampleWindow Size of the sample window
threshold Majority threshold of samples to change state
This API configures the operation of the digital filter of the low comparator.
The samplePrescale parameter specifies the number of system clock cycles between samples. It is a 24-bit value so a number higher than 16777215 should not be passed as this parameter. The prescaler used by digital filter is 1 more than samplePrescale value. So, the input provided should be 1 less than the expected prescaler.
The sampleWindow parameter configures the size of the window of FIFO samples taken from the input that will be monitored to determine when to change the filter output. This sample window may be no larger than 64 samples.
The threshold parameter configures the threshold value to be used by the digital filter.
The filter output resolves to the majority value of the sample window where majority is defined by the value passed into the threshold parameter. For proper operation, the value of threshold must be greater than sampleWindow / 2.
To ensure proper operation of the filter, the following is the recommended function call sequence for initialization:
Configure and enable the comparator using DL_CMPSSLITE_configLowComparator() and DL_CMPSSLITE_enableModule()
Configure the digital filter using DL_CMPSSLITE_configFilterLow()
Initialize the sample values using DL_CMPSSLITE_initFilterLow()
Configure the module output signals CTRIP and CTRIPOUT using DL_CMPSSLITE_configOutputsLow()
function DL_CMPSSLITE_configLatchOnPWMSYNC
void DL_CMPSSLITE_configLatchOnPWMSYNC(
CMPSS_LITE_Regs * cmpsslite,
bool highEnable,
bool lowEnable
)
Configures whether or not the digital filter latches are reset by PWMSYNC.
Parameters:
cmpsslite Pointer to the register overlay for the peripheral
highEnable indicates filter latch settings in the high comparator
lowEnable indicates filter latch settings in the low comparator
This API configures whether or not the digital filter latches in both the high and low comparators should be reset by PWMSYNC.
If the highEnable parameter is true, the PWMSYNC will be allowed to reset the high comparator’s digital filter latch. If it is false, the ability of the PWMSYNC to reset the latch will be disabled. The lowEnable parameter has the same effect on the low comparator’s digital filter latch.
function DL_CMPSSLITE_initParamsSetDefault
void DL_CMPSSLITE_initParamsSetDefault(
DL_CMPSSLITE_Config * config
)
Initializes the CMPSSLITE configuration parameters.
Parameters:
config Pointer to the CMPSSLITE configuration structure.
This function initializes all the parameters of the CMPSSLITE configuration structure to their default values.
function DL_CMPSSLITE_init
void DL_CMPSSLITE_init(
CMPSS_LITE_Regs * cmpsslite,
DL_CMPSSLITE_Config * config
)
Initializes the CMPSSLITE module.
Parameters:
cmpsslite Pointer to the CMPSSLITE register overlay
config Pointer to the CMPSSLITE configuration structure
This function configures the CMPSSLITE module according to the provided configuration.
Macros Documentation
define DL_CMPSSLITE_INSRC_DAC
#define DL_CMPSSLITE_INSRC_DAC (0x0000U)
Input driven by internal DAC.
define DL_CMPSSLITE_INSRC_PIN
#define DL_CMPSSLITE_INSRC_PIN (0x0001U)
Input driven by external pin.
define DL_CMPSSLITE_CONFIG_INVERT
#define DL_CMPSSLITE_CONFIG_INVERT (0x0002U)
Comparator output is inverted.
define DL_CMPSSLITE_CONFIG_ASYNCH_ENABLE
#define DL_CMPSSLITE_CONFIG_ASYNCH_ENABLE (0x0040U)
Asynch comparator output feeds into OR gate with latched digital filter output.
define DL_CMPSSLITE_TRIPOUT_ASYNC_COMP
#define DL_CMPSSLITE_TRIPOUT_ASYNC_COMP (0x0000U)
Asynchronous comparator output drives CTRIPOUT.
define DL_CMPSSLITE_TRIPOUT_SYNC_COMP
#define DL_CMPSSLITE_TRIPOUT_SYNC_COMP (0x0010U)
Synchronous comparator output drives CTRIPOUT.
define DL_CMPSSLITE_TRIPOUT_FILTER
#define DL_CMPSSLITE_TRIPOUT_FILTER (0x0020U)
Filter output drives CTRIPOUT.
define DL_CMPSSLITE_TRIPOUT_LATCH
#define DL_CMPSSLITE_TRIPOUT_LATCH (0x0030U)
Latched filter output drives CTRIPOUT.
define DL_CMPSSLITE_TRIP_ASYNC_COMP
#define DL_CMPSSLITE_TRIP_ASYNC_COMP (0x0000U)
Asynchronous comparator output drives CTRIP.
define DL_CMPSSLITE_TRIP_SYNC_COMP
#define DL_CMPSSLITE_TRIP_SYNC_COMP (0x0004U)
Synchronous comparator output drives CTRIP.
define DL_CMPSSLITE_TRIP_FILTER
#define DL_CMPSSLITE_TRIP_FILTER (0x0008U)
Filter output drives CTRIP.
define DL_CMPSSLITE_TRIP_LATCH
#define DL_CMPSSLITE_TRIP_LATCH (0x000CU)
Latched filter output drives CTRIP.
define DL_CMPSSLITE_STS_HI_FILOUT
#define DL_CMPSSLITE_STS_HI_FILOUT (CMPSS_LITE_COMPSTS_COMPHSTS_MASK)
High digital filter output.
define DL_CMPSSLITE_STS_HI_LATCHFILOUT
#define DL_CMPSSLITE_STS_HI_LATCHFILOUT (CMPSS_LITE_COMPSTS_COMPHLATCH_MASK)
Latched value of high digital filter output.
define DL_CMPSSLITE_STS_LO_FILOUT
#define DL_CMPSSLITE_STS_LO_FILOUT (CMPSS_LITE_COMPSTS_COMPLSTS_MASK)
Low digital filter output.
define DL_CMPSSLITE_STS_LO_LATCHFILOUT
#define DL_CMPSSLITE_STS_LO_LATCHFILOUT (CMPSS_LITE_COMPSTS_COMPLLATCH_MASK)
Latched value of low digital filter output.
define DL_CMPSSLITE_DACVAL_MCLK
#define DL_CMPSSLITE_DACVAL_MCLK (0x0000U)
DAC value register updated on MCLK.
define DL_CMPSSLITE_DACVAL_PWMSYNC
#define DL_CMPSSLITE_DACVAL_PWMSYNC (0x0080U)
DAC value register updated on PWM sync.