MSPM0C1105_C1106 Driver Library  2.05.01.00
Modules | Data Structures | Enumerations | Functions
Comparator (COMP)
Collaboration diagram for Comparator (COMP):

Modules

 DL_COMP_INTERRUPT
 
 DL_COMP_EVENT
 

Data Structures

struct  DL_COMP_Config
 Configuration struct for DL_COMP_init. More...
 
struct  DL_COMP_RefVoltageConfig
 Configuration struct for DL_COMP_refVoltageInit. More...
 

Enumerations

enum  DL_COMP_IIDX {
  DL_COMP_IIDX_NO_INTERRUPT = COMP_CPU_INT_IIDX_STAT_NO_INTR,
  DL_COMP_IIDX_OUTPUT_READY = COMP_CPU_INT_IIDX_STAT_OUTRDYIFG,
  DL_COMP_IIDX_OUTPUT_EDGE = COMP_CPU_INT_IIDX_STAT_COMPIFG,
  DL_COMP_IIDX_OUTPUT_EDGE_INV = COMP_CPU_INT_IIDX_STAT_COMPINVIFG
}
 
enum  DL_COMP_MODE {
  DL_COMP_MODE_FAST = COMP_CTL1_MODE_FAST,
  DL_COMP_MODE_ULP = COMP_CTL1_MODE_ULP
}
 
enum  DL_COMP_OUTPUT_INT_EDGE {
  DL_COMP_OUTPUT_INT_EDGE_RISING = COMP_CTL1_IES_RISING,
  DL_COMP_OUTPUT_INT_EDGE_FALLING = COMP_CTL1_IES_FALLING
}
 
enum  DL_COMP_HYSTERESIS {
  DL_COMP_HYSTERESIS_NONE = COMP_CTL1_HYST_NO_HYS,
  DL_COMP_HYSTERESIS_10 = COMP_CTL1_HYST_LOW_HYS,
  DL_COMP_HYSTERESIS_20 = COMP_CTL1_HYST_MED_HYS,
  DL_COMP_HYSTERESIS_30 = COMP_CTL1_HYST_HIGH_HYS
}
 
enum  DL_COMP_POLARITY {
  DL_COMP_POLARITY_NON_INV = COMP_CTL1_OUTPOL_NON_INV,
  DL_COMP_POLARITY_INV = COMP_CTL1_OUTPOL_INV
}
 
enum  DL_COMP_FILTER_DELAY {
  DL_COMP_FILTER_DELAY_70 = COMP_CTL1_FLTDLY_DLY_0,
  DL_COMP_FILTER_DELAY_500 = COMP_CTL1_FLTDLY_DLY_1,
  DL_COMP_FILTER_DELAY_1200 = COMP_CTL1_FLTDLY_DLY_2,
  DL_COMP_FILTER_DELAY_2700 = COMP_CTL1_FLTDLY_DLY_3
}
 
enum  DL_COMP_IPSEL_CHANNEL {
  DL_COMP_IPSEL_CHANNEL_0 = COMP_CTL0_IPSEL_CH_0,
  DL_COMP_IPSEL_CHANNEL_1 = COMP_CTL0_IPSEL_CH_1,
  DL_COMP_IPSEL_CHANNEL_2 = COMP_CTL0_IPSEL_CH_2,
  DL_COMP_IPSEL_CHANNEL_3 = COMP_CTL0_IPSEL_CH_3,
  DL_COMP_IPSEL_CHANNEL_4 = COMP_CTL0_IPSEL_CH_4,
  DL_COMP_IPSEL_CHANNEL_5 = COMP_CTL0_IPSEL_CH_5,
  DL_COMP_IPSEL_CHANNEL_6 = COMP_CTL0_IPSEL_CH_6,
  DL_COMP_IPSEL_CHANNEL_7 = COMP_CTL0_IPSEL_CH_7
}
 
enum  DL_COMP_IMSEL_CHANNEL {
  DL_COMP_IMSEL_CHANNEL_0 = COMP_CTL0_IMSEL_CH_0,
  DL_COMP_IMSEL_CHANNEL_1 = COMP_CTL0_IMSEL_CH_1,
  DL_COMP_IMSEL_CHANNEL_2 = COMP_CTL0_IMSEL_CH_2,
  DL_COMP_IMSEL_CHANNEL_3 = COMP_CTL0_IMSEL_CH_3,
  DL_COMP_IMSEL_CHANNEL_4 = COMP_CTL0_IMSEL_CH_4,
  DL_COMP_IMSEL_CHANNEL_5 = COMP_CTL0_IMSEL_CH_5,
  DL_COMP_IMSEL_CHANNEL_6 = COMP_CTL0_IMSEL_CH_6,
  DL_COMP_IMSEL_CHANNEL_7 = COMP_CTL0_IMSEL_CH_7
}
 
enum  DL_COMP_ENABLE_CHANNEL {
  DL_COMP_ENABLE_CHANNEL_NONE,
  DL_COMP_ENABLE_CHANNEL_POS = COMP_CTL0_IPEN_ENABLE,
  DL_COMP_ENABLE_CHANNEL_NEG = COMP_CTL0_IMEN_ENABLE,
  DL_COMP_ENABLE_CHANNEL_POS_NEG
}
 
enum  DL_COMP_REF_MODE {
  DL_COMP_REF_MODE_STATIC = COMP_CTL2_REFMODE_STATIC,
  DL_COMP_REF_MODE_SAMPLED = COMP_CTL2_REFMODE_SAMPLED
}
 
enum  DL_COMP_REF_SOURCE {
  DL_COMP_REF_SOURCE_NONE = COMP_CTL2_REFSRC_OFF,
  DL_COMP_REF_SOURCE_VDDA_DAC = COMP_CTL2_REFSRC_VDDA_DAC,
  DL_COMP_REF_SOURCE_VREF_DAC = COMP_CTL2_REFSRC_VREF_DAC,
  DL_COMP_REF_SOURCE_VREF = COMP_CTL2_REFSRC_VREF,
  DL_COMP_REF_SOURCE_VDDA = COMP_CTL2_REFSRC_VDDA,
  DL_COMP_REF_SOURCE_INT_VREF_DAC = COMP_CTL2_REFSRC_INTVREF_DAC,
  DL_COMP_REF_SOURCE_INT_VREF = COMP_CTL2_REFSRC_INTVREF
}
 
enum  DL_COMP_REF_TERMINAL_SELECT {
  DL_COMP_REF_TERMINAL_SELECT_POS = COMP_CTL2_REFSEL_POSITIVE,
  DL_COMP_REF_TERMINAL_SELECT_NEG = COMP_CTL2_REFSEL_NEGATIVE
}
 
enum  DL_COMP_BLANKING_SOURCE {
  DL_COMP_BLANKING_SOURCE_DISABLE = COMP_CTL2_BLANKSRC_DISABLE,
  DL_COMP_BLANKING_SOURCE_1 = COMP_CTL2_BLANKSRC_BLANKSRC1,
  DL_COMP_BLANKING_SOURCE_2 = COMP_CTL2_BLANKSRC_BLANKSRC2,
  DL_COMP_BLANKING_SOURCE_3 = COMP_CTL2_BLANKSRC_BLANKSRC3,
  DL_COMP_BLANKING_SOURCE_4 = COMP_CTL2_BLANKSRC_BLANKSRC4,
  DL_COMP_BLANKING_SOURCE_5 = COMP_CTL2_BLANKSRC_BLANKSRC5,
  DL_COMP_BLANKING_SOURCE_6 = COMP_CTL2_BLANKSRC_BLANKSRC6
}
 
enum  DL_COMP_DAC_CONTROL {
  DL_COMP_DAC_CONTROL_COMP_OUT = COMP_CTL2_DACCTL_COMPOUT_SEL,
  DL_COMP_DAC_CONTROL_SW = COMP_CTL2_DACCTL_DACSW_SEL
}
 
enum  DL_COMP_DAC_INPUT {
  DL_COMP_DAC_INPUT_DACCODE0 = COMP_CTL2_DACSW_DACCODE0_SEL,
  DL_COMP_DAC_INPUT_DACCODE1 = COMP_CTL2_DACSW_DACCODE1_SEL
}
 
enum  DL_COMP_OUTPUT {
  DL_COMP_OUTPUT_LOW = COMP_STAT_OUT_LOW,
  DL_COMP_OUTPUT_HIGH = COMP_STAT_OUT_HIGH
}
 
enum  DL_COMP_SUBSCRIBER_INDEX {
  DL_COMP_SUBSCRIBER_INDEX_0 = 0,
  DL_COMP_SUBSCRIBER_INDEX_1 = 1
}
 

Functions

__STATIC_INLINE void DL_COMP_enablePower (COMP_Regs *comp)
 Enables the Peripheral Write Enable (PWREN) register for the COMP. More...
 
__STATIC_INLINE void DL_COMP_disablePower (COMP_Regs *comp)
 Disables the Peripheral Write Enable (PWREN) register for the COMP. More...
 
__STATIC_INLINE bool DL_COMP_isPowerEnabled (COMP_Regs *comp)
 Returns if the Peripheral Write Enable (PWREN) register for the COMP is enabled. More...
 
__STATIC_INLINE void DL_COMP_reset (COMP_Regs *comp)
 Resets comparator peripheral. More...
 
__STATIC_INLINE bool DL_COMP_isReset (COMP_Regs *comp)
 Returns if comparator was reset. More...
 
__STATIC_INLINE void DL_COMP_init (COMP_Regs *comp, DL_COMP_Config *config)
 Initialize the COMP peripheral. More...
 
__STATIC_INLINE void DL_COMP_refVoltageInit (COMP_Regs *comp, DL_COMP_RefVoltageConfig *config)
 Initialize the comparator reference voltage generator. More...
 
__STATIC_INLINE void DL_COMP_enable (COMP_Regs *comp)
 Enable the comparator peripheral. More...
 
__STATIC_INLINE bool DL_COMP_isEnabled (COMP_Regs *comp)
 Checks if the comparator peripheral is enabled. More...
 
__STATIC_INLINE void DL_COMP_disable (COMP_Regs *comp)
 Disable the comparator peripheral. More...
 
__STATIC_INLINE void DL_COMP_setCompMode (COMP_Regs *comp, DL_COMP_MODE mode)
 Set the comparator operating mode. More...
 
__STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode (COMP_Regs *comp)
 Get the mode the comparator is set to. More...
 
__STATIC_INLINE void DL_COMP_enableExchangeInputs (COMP_Regs *comp)
 Enable exchange of the comparator inputs, and invert output. More...
 
__STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled (COMP_Regs *comp)
 Checks if the inputs are exchanged and if output is inverted. More...
 
__STATIC_INLINE void DL_COMP_disableExchangeInputs (COMP_Regs *comp)
 Disable input exchange and invert output. More...
 
__STATIC_INLINE void DL_COMP_enableShortInputTerminals (COMP_Regs *comp)
 Enable shorting of the comparator inputs. More...
 
__STATIC_INLINE bool DL_COMP_isInputTerminalsShorted (COMP_Regs *comp)
 Checks if the comparator inputs are shorted. More...
 
__STATIC_INLINE void DL_COMP_disableShortInputTerminals (COMP_Regs *comp)
 Disable shorting the comparator inputs. More...
 
__STATIC_INLINE void DL_COMP_setOutputInterruptEdge (COMP_Regs *comp, DL_COMP_OUTPUT_INT_EDGE edge)
 Set the interrupt edge for the comparator output. More...
 
__STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge (COMP_Regs *comp)
 Get the interrupt edge for the comparator output. More...
 
__STATIC_INLINE void DL_COMP_setHysteresis (COMP_Regs *comp, DL_COMP_HYSTERESIS voltage)
 Set the hysteresis voltage. More...
 
__STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis (COMP_Regs *comp)
 Get the hysteresis voltage. More...
 
__STATIC_INLINE void DL_COMP_setOutputPolarity (COMP_Regs *comp, DL_COMP_POLARITY polarity)
 Set the output polarity. More...
 
__STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity (COMP_Regs *comp)
 Get the output polarity. More...
 
__STATIC_INLINE void DL_COMP_enableOutputFilter (COMP_Regs *comp, DL_COMP_FILTER_DELAY delay)
 Enable output filter. More...
 
__STATIC_INLINE bool DL_COMP_isOutputFilterEnabled (COMP_Regs *comp)
 Checks if output filter is enabled. More...
 
__STATIC_INLINE void DL_COMP_disableOutputFilter (COMP_Regs *comp)
 Disable output filter using on-chip analog filter. More...
 
__STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay (COMP_Regs *comp)
 Get the output filter delay. More...
 
__STATIC_INLINE void DL_COMP_enableWindowComparator (COMP_Regs *comp)
 Enable the window comparator. More...
 
__STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled (COMP_Regs *comp)
 Checks if the window comparator is enabled. More...
 
__STATIC_INLINE void DL_COMP_disableWindowComparator (COMP_Regs *comp)
 Disable the window comparator. More...
 
__STATIC_INLINE void DL_COMP_setEnabledInputChannels (COMP_Regs *comp, DL_COMP_ENABLE_CHANNEL channels)
 Set the enabled channels for the comparator terminals. More...
 
__STATIC_INLINE DL_COMP_ENABLE_CHANNEL DL_COMP_getEnabledInputChannels (COMP_Regs *comp)
 Get the enabled input channels. More...
 
__STATIC_INLINE void DL_COMP_setPositiveChannelInput (COMP_Regs *comp, DL_COMP_IPSEL_CHANNEL input)
 Set the channel input for the positive terminal. More...
 
__STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput (COMP_Regs *comp)
 Get the channel input for the positive terminal. More...
 
__STATIC_INLINE void DL_COMP_setNegativeChannelInput (COMP_Regs *comp, DL_COMP_IMSEL_CHANNEL input)
 Set the channel input for the negative terminal. More...
 
__STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput (COMP_Regs *comp)
 Get the channel input for the negative terminal. More...
 
__STATIC_INLINE void DL_COMP_setReferenceMode (COMP_Regs *comp, DL_COMP_REF_MODE mode)
 Set the mode for the reference voltage. More...
 
__STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode (COMP_Regs *comp)
 Get the mode for the reference voltage. More...
 
__STATIC_INLINE void DL_COMP_setReferenceSource (COMP_Regs *comp, DL_COMP_REF_SOURCE source)
 Set the reference source for the comparator. More...
 
__STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource (COMP_Regs *comp)
 Get the reference source for the comparator. More...
 
__STATIC_INLINE void DL_COMP_setReferenceCompTerminal (COMP_Regs *comp, DL_COMP_REF_TERMINAL_SELECT terminal)
 Set the comparator terminal the reference voltage is applied to. More...
 
__STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal (COMP_Regs *comp)
 Get the comparator terminal the reference voltage is applied to. More...
 
__STATIC_INLINE void DL_COMP_setBlankingSource (COMP_Regs *comp, DL_COMP_BLANKING_SOURCE source)
 Set the blanking source for the comparator. More...
 
__STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource (COMP_Regs *comp)
 Get the blanking source for the comparator. More...
 
__STATIC_INLINE void DL_COMP_setDACControl (COMP_Regs *comp, DL_COMP_DAC_CONTROL control)
 Select the source for DAC control. More...
 
__STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl (COMP_Regs *comp)
 Get what controls the input to the DAC. More...
 
__STATIC_INLINE void DL_COMP_setDACInput (COMP_Regs *comp, DL_COMP_DAC_INPUT input)
 Set whether DACCODE0 or DACCODE1 is the input to the DAC. More...
 
__STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput (COMP_Regs *comp)
 Get whether DACCODE0 or DACCODE1 is the input to the DAC. More...
 
__STATIC_INLINE void DL_COMP_setDACCode0 (COMP_Regs *comp, uint32_t value)
 Set the 8-bit DAC input code through DACCODE0. More...
 
__STATIC_INLINE uint32_t DL_COMP_getDACCode0 (COMP_Regs *comp)
 Get the code value of DACCODE0. More...
 
__STATIC_INLINE void DL_COMP_setDACCode1 (COMP_Regs *comp, uint32_t value)
 Set the 8-bit DAC input code through DACCODE1. More...
 
__STATIC_INLINE uint32_t DL_COMP_getDACCode1 (COMP_Regs *comp)
 Get the code value of DACCODE1. More...
 
__STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput (COMP_Regs *comp)
 Gets the comparator output. More...
 
__STATIC_INLINE void DL_COMP_enableSampledMode (COMP_Regs *comp)
 Enable sampled mode of the comparator. More...
 
__STATIC_INLINE bool DL_COMP_isSampledModeEnabled (COMP_Regs *comp)
 Checks if sampled mode is enabled. More...
 
__STATIC_INLINE void DL_COMP_disableSampledMode (COMP_Regs *comp)
 Disable sampled mode. More...
 
__STATIC_INLINE void DL_COMP_setSubscriberChanID (COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index, uint8_t chanID)
 Sets the event subscriber channel id. More...
 
__STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID (COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index)
 Gets the event subscriber channel id. More...
 
__STATIC_INLINE void DL_COMP_enableInterrupt (COMP_Regs *comp, uint32_t interruptMask)
 Enable COMP interrupts. More...
 
__STATIC_INLINE void DL_COMP_disableInterrupt (COMP_Regs *comp, uint32_t interruptMask)
 Disable COMP interrupts. More...
 
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts (COMP_Regs *comp, uint32_t interruptMask)
 Check which COMP interrupts are enabled. More...
 
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus (COMP_Regs *comp, uint32_t interruptMask)
 Check interrupt flag of enabled COMP interrupts. More...
 
__STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus (COMP_Regs *comp, uint32_t interruptMask)
 Check interrupt flag of any COMP interrupt. More...
 
__STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt (COMP_Regs *comp)
 Get highest priority pending COMP interrupt. More...
 
__STATIC_INLINE void DL_COMP_clearInterruptStatus (COMP_Regs *comp, uint32_t interruptMask)
 Clear pending COMP interrupts. More...
 
__STATIC_INLINE void DL_COMP_setPublisherChanID (COMP_Regs *comp, uint8_t chanID)
 Sets the COMP event publisher channel ID. More...
 
__STATIC_INLINE uint8_t DL_COMP_getPublisherChanID (COMP_Regs *comp)
 Gets the event publisher channel ID. More...
 
__STATIC_INLINE void DL_COMP_enableEvent (COMP_Regs *comp, uint32_t eventMask)
 Enable COMP event. More...
 
__STATIC_INLINE void DL_COMP_disableEvent (COMP_Regs *comp, uint32_t eventMask)
 Disable COMP event. More...
 
__STATIC_INLINE uint32_t DL_COMP_getEnabledEvents (COMP_Regs *comp, uint32_t eventMask)
 Check which COMP events are enabled. More...
 
__STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus (COMP_Regs *comp, uint32_t eventMask)
 Check event flag of enabled COMP event. More...
 
__STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus (COMP_Regs *comp, uint32_t eventMask)
 Check interrupt flag of any COMP event. More...
 
__STATIC_INLINE void DL_COMP_clearEventsStatus (COMP_Regs *comp, uint32_t eventMask)
 Clear pending COMP events. More...
 

Detailed Description

Overview

The COMP DriverLib allows full configuration of the MSPM0 comparator module. The comparator module (COMP) is an analog voltage comparator with general comparator functionality.


Enumeration Type Documentation

§ DL_COMP_IIDX

Enumerator
DL_COMP_IIDX_NO_INTERRUPT 

COMP interrupt index for no interrupt

DL_COMP_IIDX_OUTPUT_READY 

COMP interrupt index for comparator output ready interrupt

DL_COMP_IIDX_OUTPUT_EDGE 

COMP interrupt index for rising or falling edge of comparator output (selected by IES bit) interrupt

DL_COMP_IIDX_OUTPUT_EDGE_INV 

COMP interrupt index for rising or falling edge of comparator inverted output (selected by IES bit) interrupt

§ DL_COMP_MODE

Enumerator
DL_COMP_MODE_FAST 

Comparator is in fast mode

DL_COMP_MODE_ULP 

Comparator is in ultra-low power (ULP) mode

§ DL_COMP_OUTPUT_INT_EDGE

Enumerator
DL_COMP_OUTPUT_INT_EDGE_RISING 

Rising edge sets COMPIFG and falling edge sets COMPINVIFG

DL_COMP_OUTPUT_INT_EDGE_FALLING 

Falling edge sets COMPIFG and rising edge sets COMPINVIFG

§ DL_COMP_HYSTERESIS

Enumerator
DL_COMP_HYSTERESIS_NONE 

No hysteresis

DL_COMP_HYSTERESIS_10 

Typical hysteresis voltage generated is 10mV

DL_COMP_HYSTERESIS_20 

Typical hysteresis voltage generated is 20mV

DL_COMP_HYSTERESIS_30 

Typical hysteresis voltage generated is 30mV

§ DL_COMP_POLARITY

Enumerator
DL_COMP_POLARITY_NON_INV 

Comparator output is non-inverted. When comparator is off, OUT is low

DL_COMP_POLARITY_INV 

Comparator output is inverted. When comparator is off, OUT is high

§ DL_COMP_FILTER_DELAY

Enumerator
DL_COMP_FILTER_DELAY_70 

Typical filter delay of 70ns

DL_COMP_FILTER_DELAY_500 

Typical filter delay of 500ns

DL_COMP_FILTER_DELAY_1200 

Typical filter delay of 1200ns

DL_COMP_FILTER_DELAY_2700 

Typical filter delay of 2700ns

§ DL_COMP_IPSEL_CHANNEL

Enumerator
DL_COMP_IPSEL_CHANNEL_0 

IPSEL is channel 0. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_1 

IPSEL is channel 1. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_2 

IPSEL is channel 2. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_3 

IPSEL is channel 3. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_4 

IPSEL is channel 4. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_5 

IPSEL is channel 5. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_6 

IPSEL is channel 6. See the device datasheet for more details.

DL_COMP_IPSEL_CHANNEL_7 

IPSEL is channel 7. See the device datasheet for more details.

§ DL_COMP_IMSEL_CHANNEL

Enumerator
DL_COMP_IMSEL_CHANNEL_0 

IMSEL is channel 0. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_1 

IMSEL is channel 1. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_2 

IMSEL is channel 2. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_3 

IMSEL is channel 3. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_4 

IMSEL is channel 4. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_5 

IMSEL is channel 5. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_6 

IMSEL is channel 6. See the device datasheet for more details.

DL_COMP_IMSEL_CHANNEL_7 

IMSEL is channel 7. See the device datasheet for more details.

§ DL_COMP_ENABLE_CHANNEL

Enumerator
DL_COMP_ENABLE_CHANNEL_NONE 

Channel input disabled for both the positive and negative terminals

DL_COMP_ENABLE_CHANNEL_POS 

Channel input enabled for the positive terminal

DL_COMP_ENABLE_CHANNEL_NEG 

Channel input enabled for the positive terminal

DL_COMP_ENABLE_CHANNEL_POS_NEG 

Channel input enabled for both the positive and negative terminals

§ DL_COMP_REF_MODE

Enumerator
DL_COMP_REF_MODE_STATIC 

ULP_REF bandgap, local reference buffer, and 8-bit DAC inside comparator operate in static mode

DL_COMP_REF_MODE_SAMPLED 

ULP_REF bandgap, local reference buffer, and 8-bit DAC inside comparator operate in sampled mode

§ DL_COMP_REF_SOURCE

Enumerator
DL_COMP_REF_SOURCE_NONE 

Reference voltage generator is disabled (local reference buffer as well as DAC)

DL_COMP_REF_SOURCE_VDDA_DAC 

VDDA selected as the reference source to DAC and DAC output applied as reference to comparator

DL_COMP_REF_SOURCE_VREF_DAC 

VREF selected as the reference source to DAC and DAC output applied as reference to comparator

DL_COMP_REF_SOURCE_VREF 

VREF applied as reference to comparator. For some devices, DAC is switched off. Refer to the device datasheet for more information.

DL_COMP_REF_SOURCE_VDDA 

VDDA is used as comparator reference. For some devices, DAC is switched off. Refer to the device datasheet for more information.

DL_COMP_REF_SOURCE_INT_VREF_DAC 

Internal reference selected as the reference source to the DAC and DAC output applied as reference to comparator

DL_COMP_REF_SOURCE_INT_VREF 

Internal VREF used as reference source of comparator

§ DL_COMP_REF_TERMINAL_SELECT

Enumerator
DL_COMP_REF_TERMINAL_SELECT_POS 

Reference applied to positive terminal. If EXCH bit is 1, reference applied to negative terminal.

DL_COMP_REF_TERMINAL_SELECT_NEG 

Reference applied to negative terminal. If EXCH bit is 0, reference applied to positive terminal.

§ DL_COMP_BLANKING_SOURCE

Enumerator
DL_COMP_BLANKING_SOURCE_DISABLE 

Disable use of blanking source

DL_COMP_BLANKING_SOURCE_1 

Blanking source 1

DL_COMP_BLANKING_SOURCE_2 

Blanking source 2

DL_COMP_BLANKING_SOURCE_3 

Blanking source 3

DL_COMP_BLANKING_SOURCE_4 

Blanking source 4

DL_COMP_BLANKING_SOURCE_5 

Blanking source 5

DL_COMP_BLANKING_SOURCE_6 

Blanking source 6

§ DL_COMP_DAC_CONTROL

Enumerator
DL_COMP_DAC_CONTROL_COMP_OUT 

Comparator output controls selection betwen DACCODE0 and DACCODE1

DL_COMP_DAC_CONTROL_SW 

DACSW bit controls selection betwen DACCODE0 and DACCODE1

§ DL_COMP_DAC_INPUT

Enumerator
DL_COMP_DAC_INPUT_DACCODE0 

DACCODE0 selected as input for 8-bit DAC when DACCTL bit is 1

DL_COMP_DAC_INPUT_DACCODE1 

DACCODE1 selected as input for 8-bit DAC when DACCTL bit is 1

§ DL_COMP_OUTPUT

Enumerator
DL_COMP_OUTPUT_LOW 

Comparator output is low

DL_COMP_OUTPUT_HIGH 

Comparator output is high

§ DL_COMP_SUBSCRIBER_INDEX

Enumerator
DL_COMP_SUBSCRIBER_INDEX_0 

COMP Subscriber index 0

DL_COMP_SUBSCRIBER_INDEX_1 

COMP Subscriber index 1

Function Documentation

§ DL_COMP_enablePower()

__STATIC_INLINE void DL_COMP_enablePower ( COMP_Regs *  comp)

Enables the Peripheral Write Enable (PWREN) register for the COMP.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

Note
For power savings, please refer to DL_COMP_enable
Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_disablePower()

__STATIC_INLINE void DL_COMP_disablePower ( COMP_Regs *  comp)

Disables the Peripheral Write Enable (PWREN) register for the COMP.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Note
This API does not provide large power savings. For power savings, please refer to DL_COMP_enable
Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isPowerEnabled()

__STATIC_INLINE bool DL_COMP_isPowerEnabled ( COMP_Regs *  comp)

Returns if the Peripheral Write Enable (PWREN) register for the COMP is enabled.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The status of the peripheral power
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_COMP_reset()

__STATIC_INLINE void DL_COMP_reset ( COMP_Regs *  comp)

Resets comparator peripheral.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isReset()

__STATIC_INLINE bool DL_COMP_isReset ( COMP_Regs *  comp)

Returns if comparator was reset.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
true If peripheral was reset
false If peripheral wasn't reset

§ DL_COMP_init()

__STATIC_INLINE void DL_COMP_init ( COMP_Regs *  comp,
DL_COMP_Config config 
)

Initialize the COMP peripheral.

Initializes all the common configurable options for the COMP peripheral. Any other custom configuration can be done after calling this API. The COMP is not enabled in this API.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]configConfiguration for COMP peripheral

References DL_COMP_Config::channelEnable, DL_Common_updateReg(), DL_COMP_Config::hysteresis, DL_COMP_Config::mode, DL_COMP_Config::negChannel, DL_COMP_Config::polarity, and DL_COMP_Config::posChannel.

§ DL_COMP_refVoltageInit()

__STATIC_INLINE void DL_COMP_refVoltageInit ( COMP_Regs *  comp,
DL_COMP_RefVoltageConfig config 
)

Initialize the comparator reference voltage generator.

Initializes all the common configurable options for the comparator reference voltage generator. Any other custom configuration can be done after calling this API.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]configConfiguration for the reference voltage generator

References DL_COMP_RefVoltageConfig::controlSelect, DL_Common_updateReg(), DL_COMP_RefVoltageConfig::inputSelect, DL_COMP_RefVoltageConfig::mode, DL_COMP_RefVoltageConfig::source, and DL_COMP_RefVoltageConfig::terminalSelect.

§ DL_COMP_enable()

__STATIC_INLINE void DL_COMP_enable ( COMP_Regs *  comp)

Enable the comparator peripheral.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isEnabled()

__STATIC_INLINE bool DL_COMP_isEnabled ( COMP_Regs *  comp)

Checks if the comparator peripheral is enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns the enabled status of the comparator
Return values
trueThe comparator peripheral is enabled
falseThe comparator peripheral is disabled

§ DL_COMP_disable()

__STATIC_INLINE void DL_COMP_disable ( COMP_Regs *  comp)

Disable the comparator peripheral.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_setCompMode()

__STATIC_INLINE void DL_COMP_setCompMode ( COMP_Regs *  comp,
DL_COMP_MODE  mode 
)

Set the comparator operating mode.

The clock control for comparator is managed by SYSCTL, SYSCTL knows if comparator module is enabled and at also knows if it is in ultra-low power mode or fast mode. User needs to ensure the proper bus clock is selected for different comparator operation mode.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]modeMode to set the comparator to. One of DL_COMP_MODE.

References DL_Common_updateReg().

§ DL_COMP_getCompMode()

__STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode ( COMP_Regs *  comp)

Get the mode the comparator is set to.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The mode the comparator is set to
Return values
Oneof DL_COMP_MODE

§ DL_COMP_enableExchangeInputs()

__STATIC_INLINE void DL_COMP_enableExchangeInputs ( COMP_Regs *  comp)

Enable exchange of the comparator inputs, and invert output.

When enabled, the input signals of comparator positive and negative terminals are exchanged. Additionally, the output signal from the comparator is inverted too. This allows the user to determine or compensate for the comparator input offset voltage.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isExchangeInputsEnabled()

__STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled ( COMP_Regs *  comp)

Checks if the inputs are exchanged and if output is inverted.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns if the inputs are exchanged and if output is inverted
Return values
trueThe inputs are exchanged and output is inverted
falseThe inputs are not exchanged and output is not inverted

§ DL_COMP_disableExchangeInputs()

__STATIC_INLINE void DL_COMP_disableExchangeInputs ( COMP_Regs *  comp)

Disable input exchange and invert output.

The input signals of the comparator positive and negative terminals are not exchanged, and the output signal from the comparator is not inverted.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_enableShortInputTerminals()

__STATIC_INLINE void DL_COMP_enableShortInputTerminals ( COMP_Regs *  comp)

Enable shorting of the comparator inputs.

When enabled, shorts the positive and negative input terminals of the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isInputTerminalsShorted()

__STATIC_INLINE bool DL_COMP_isInputTerminalsShorted ( COMP_Regs *  comp)

Checks if the comparator inputs are shorted.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns if the comparator inputs are shorted
Return values
trueThe comparator inputs are shorted
falseThe comparator inputs are not shorted

§ DL_COMP_disableShortInputTerminals()

__STATIC_INLINE void DL_COMP_disableShortInputTerminals ( COMP_Regs *  comp)

Disable shorting the comparator inputs.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_setOutputInterruptEdge()

__STATIC_INLINE void DL_COMP_setOutputInterruptEdge ( COMP_Regs *  comp,
DL_COMP_OUTPUT_INT_EDGE  edge 
)

Set the interrupt edge for the comparator output.

The interrupt flags COMPIFG and COMPINVIFG are set either on the rising or falling edge of the comparator output.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]edgeInterrupt edge for the comparator output. One of DL_COMP_OUTPUT_INT_EDGE.

References DL_Common_updateReg().

§ DL_COMP_getOutputInterruptEdge()

__STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge ( COMP_Regs *  comp)

Get the interrupt edge for the comparator output.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The interrupt edge for the comparator output
Return values
Oneof DL_COMP_OUTPUT_INT_EDGE

§ DL_COMP_setHysteresis()

__STATIC_INLINE void DL_COMP_setHysteresis ( COMP_Regs *  comp,
DL_COMP_HYSTERESIS  voltage 
)

Set the hysteresis voltage.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]voltageVoltage value to set the hysteresis to

References DL_Common_updateReg().

§ DL_COMP_getHysteresis()

__STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis ( COMP_Regs *  comp)

Get the hysteresis voltage.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The hysteresis voltage
Return values
Oneof DL_COMP_HYSTERESIS

§ DL_COMP_setOutputPolarity()

__STATIC_INLINE void DL_COMP_setOutputPolarity ( COMP_Regs *  comp,
DL_COMP_POLARITY  polarity 
)

Set the output polarity.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]polarityThe polarity of the comparator output

References DL_Common_updateReg().

§ DL_COMP_getOutputPolarity()

__STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity ( COMP_Regs *  comp)

Get the output polarity.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The output polarity
Return values
Oneof DL_COMP_POLARITY

§ DL_COMP_enableOutputFilter()

__STATIC_INLINE void DL_COMP_enableOutputFilter ( COMP_Regs *  comp,
DL_COMP_FILTER_DELAY  delay 
)

Enable output filter.

The output is filtered with an on-chip analog filter. The delay of the filter can be adjusted in four different steps. Refer to the device specific datasheet for the comparator propagation delay with different filter delay settings.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]delayDelay of the filter. One of DL_COMP_FILTER_DELAY.

§ DL_COMP_isOutputFilterEnabled()

__STATIC_INLINE bool DL_COMP_isOutputFilterEnabled ( COMP_Regs *  comp)

Checks if output filter is enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns if the output is filtered
Return values
trueThe output is filtered
falseThe output is not filtered

§ DL_COMP_disableOutputFilter()

__STATIC_INLINE void DL_COMP_disableOutputFilter ( COMP_Regs *  comp)

Disable output filter using on-chip analog filter.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_getOutputFilterDelay()

__STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay ( COMP_Regs *  comp)

Get the output filter delay.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The output filter delay
Return values
Oneof DL_COMP_FILTER_DELAY

§ DL_COMP_enableWindowComparator()

__STATIC_INLINE void DL_COMP_enableWindowComparator ( COMP_Regs *  comp)

Enable the window comparator.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isWindowComparatorEnabled()

__STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled ( COMP_Regs *  comp)

Checks if the window comparator is enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns if the window comparator is enabled
Return values
trueThe window comparator is enabled
falseThe window comparator is not enabled

§ DL_COMP_disableWindowComparator()

__STATIC_INLINE void DL_COMP_disableWindowComparator ( COMP_Regs *  comp)

Disable the window comparator.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_setEnabledInputChannels()

__STATIC_INLINE void DL_COMP_setEnabledInputChannels ( COMP_Regs *  comp,
DL_COMP_ENABLE_CHANNEL  channels 
)

Set the enabled channels for the comparator terminals.

Enables the selected analog input channels for the positive and negative comparator terminals.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]channelsInput channels to enable

References DL_Common_updateReg().

§ DL_COMP_getEnabledInputChannels()

__STATIC_INLINE DL_COMP_ENABLE_CHANNEL DL_COMP_getEnabledInputChannels ( COMP_Regs *  comp)

Get the enabled input channels.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The enabled input channels
Return values
Oneof DL_COMP_ENABLE_CHANNEL

§ DL_COMP_setPositiveChannelInput()

__STATIC_INLINE void DL_COMP_setPositiveChannelInput ( COMP_Regs *  comp,
DL_COMP_IPSEL_CHANNEL  input 
)

Set the channel input for the positive terminal.

This API sets the IPSEL control bit to select the channel input for the positive terminal. Please see the device datasheet for more details on each channel input for each comparator instance.

Note this API does not enable the positive terminal. Call DL_COMP_setEnabledInputChannels to enable the terminals.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]inputChannel input for the positive terminal

References DL_Common_updateReg().

§ DL_COMP_getPositiveChannelInput()

__STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput ( COMP_Regs *  comp)

Get the channel input for the positive terminal.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The channel input for the positive terminal
Return values
Oneof DL_COMP_IPSEL_CHANNEL

§ DL_COMP_setNegativeChannelInput()

__STATIC_INLINE void DL_COMP_setNegativeChannelInput ( COMP_Regs *  comp,
DL_COMP_IMSEL_CHANNEL  input 
)

Set the channel input for the negative terminal.

This API sets the IMSEL control bit to select the channel input for the negative terminal. Please see the device TRM for more details on each channel input for each comparator instance.

Note this API does not enable the negative terminal. Call DL_COMP_setEnabledInputChannels to enable the terminals.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]inputChannel input for the negative terminal

References DL_Common_updateReg().

§ DL_COMP_getNegativeChannelInput()

__STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput ( COMP_Regs *  comp)

Get the channel input for the negative terminal.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The channel input for the negative terminal
Return values
Oneof DL_COMP_IMSEL_CHANNEL

§ DL_COMP_setReferenceMode()

__STATIC_INLINE void DL_COMP_setReferenceMode ( COMP_Regs *  comp,
DL_COMP_REF_MODE  mode 
)

Set the mode for the reference voltage.

This bit requests ULP_REF bandgap operation in static mode or sampled mode. The local reference buffer and 8-bit DAC inside comparator module are also configured accordingly.

  • In DL_COMP_REF_MODE_STATIC, operation offers higher accuracy but consumes higher current.
  • In DL_COMP_REF_MODE_SAMPLED, operation consumes lower current but with relaxed reference voltage accuracy. Comparator requests for reference voltage from ULP_REF only when REFLVL > 0.
Parameters
[in]compPointer to the register overlay for the peripheral
[in]modeMode to set the reference voltage to

References DL_Common_updateReg().

§ DL_COMP_getReferenceMode()

__STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode ( COMP_Regs *  comp)

Get the mode for the reference voltage.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The mode of the reference voltage
Return values
Oneof DL_COMP_REF_MODE

§ DL_COMP_setReferenceSource()

__STATIC_INLINE void DL_COMP_setReferenceSource ( COMP_Regs *  comp,
DL_COMP_REF_SOURCE  source 
)

Set the reference source for the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]sourceReference source for the comparator

References DL_Common_updateReg().

§ DL_COMP_getReferenceSource()

__STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource ( COMP_Regs *  comp)

Get the reference source for the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The reference source
Return values
Oneof DL_COMP_REF_SOURCE

§ DL_COMP_setReferenceCompTerminal()

__STATIC_INLINE void DL_COMP_setReferenceCompTerminal ( COMP_Regs *  comp,
DL_COMP_REF_TERMINAL_SELECT  terminal 
)

Set the comparator terminal the reference voltage is applied to.

The reference voltage generator output can be applied to either the positive terminal or negative terminal of the comparator. When the reference voltage generator output is applied on a comparator terminal using REFSEL bit and the comparator channel (from device pins or from internal analog modules) is also selected on the same terminal using IPSEL/IPEN or IMSEL/IMEN bits, then the comparator channel selection takes precedence.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]terminalTerminal the reference voltage is applied to

References DL_Common_updateReg().

§ DL_COMP_getReferenceCompTerminal()

__STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal ( COMP_Regs *  comp)

Get the comparator terminal the reference voltage is applied to.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The terminal the reference voltage is applied to
Return values
Oneof DL_COMP_REF_TERMINAL_SELECT

§ DL_COMP_setBlankingSource()

__STATIC_INLINE void DL_COMP_setBlankingSource ( COMP_Regs *  comp,
DL_COMP_BLANKING_SOURCE  source 
)

Set the blanking source for the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]sourceBlanking source for the comparator

References DL_Common_updateReg().

§ DL_COMP_getBlankingSource()

__STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource ( COMP_Regs *  comp)

Get the blanking source for the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The blanking source
Return values
Oneof DL_COMP_BLANKING_SOURCE

§ DL_COMP_setDACControl()

__STATIC_INLINE void DL_COMP_setDACControl ( COMP_Regs *  comp,
DL_COMP_DAC_CONTROL  control 
)

Select the source for DAC control.

The DACCTL bit determines if the comparator output or a software control bit, DACSW, selects between DACCODE0 and DACCODE1 bits as the input to the DAC.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]controlWhat controls the inputs to the DAC. One of DL_COMP_DAC_CONTROL

References DL_Common_updateReg().

§ DL_COMP_getDACControl()

__STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl ( COMP_Regs *  comp)

Get what controls the input to the DAC.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The control input
Return values
Oneof DL_COMP_DAC_CONTROL

§ DL_COMP_setDACInput()

__STATIC_INLINE void DL_COMP_setDACInput ( COMP_Regs *  comp,
DL_COMP_DAC_INPUT  input 
)

Set whether DACCODE0 or DACCODE1 is the input to the DAC.

Precondition
The DACCTL bit must be set to 1 in order to program the DACSW bit to select between DACCODE0 or DACCODE1.
See also
DL_COMP_setDACControl
Parameters
[in]compPointer to the register overlay for the peripheral
[in]inputThe input to the DAC. One of DL_COMP_DAC_INPUT

References DL_Common_updateReg().

§ DL_COMP_getDACInput()

__STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput ( COMP_Regs *  comp)

Get whether DACCODE0 or DACCODE1 is the input to the DAC.

Precondition
The DACCTL bit must be set to 1 in order to program the DACSW bit to select between DACCODE0 or DACCODE1.
Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The input to the DAC
Return values
Oneof DL_COMP_DAC_INPUT

§ DL_COMP_setDACCode0()

__STATIC_INLINE void DL_COMP_setDACCode0 ( COMP_Regs *  comp,
uint32_t  value 
)

Set the 8-bit DAC input code through DACCODE0.

Sets the first 8-bit DAC code through DACCODE0. When the DAC code is 0x0 the DAC output will be selected reference voltage x 1/256 V. When the DAC code is 0xFF the DAC output will be selected reference voltage x 255/256.

Precondition
The DACCTL bit determines what controls the selection between DACCODE0 and DACCODE1.
If DACCTL is 1, then the DACSW bit is used to select between DACCODE0 or DACCODE1.
See also
DL_COMP_setDACControl
DL_COMP_setDACInput
Parameters
[in]compPointer to the register overlay for the peripheral
[in]valueCode to set for codeDACCODE0. Value between 0x0 - 0xFF.

References DL_Common_updateReg().

§ DL_COMP_getDACCode0()

__STATIC_INLINE uint32_t DL_COMP_getDACCode0 ( COMP_Regs *  comp)

Get the code value of DACCODE0.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The code value that DACCODE0 is set to
Return values
Valuebetween 0x0 - 0xFF

§ DL_COMP_setDACCode1()

__STATIC_INLINE void DL_COMP_setDACCode1 ( COMP_Regs *  comp,
uint32_t  value 
)

Set the 8-bit DAC input code through DACCODE1.

Sets the second 8-bit DAC code through DACCODE1. When the DAC code is 0x0 the DAC output will be selected reference voltage x 1/256 V. When the DAC code is 0xFF the DAC output will be selected reference voltage x 255/256.

Precondition
The DACCTL bit determines what controls the selection between DACCODE0 and DACCODE1.
If DACCTL is 1, then the DACSW bit is used to select between DACCODE0 or DACCODE1.
See also
DL_COMP_setDACControl
DL_COMP_setDACInput
Parameters
[in]compPointer to the register overlay for the peripheral
[in]valueCode to set for codeDACCODE1. Value between 0x0 - 0xFF.

References DL_Common_updateReg().

§ DL_COMP_getDACCode1()

__STATIC_INLINE uint32_t DL_COMP_getDACCode1 ( COMP_Regs *  comp)

Get the code value of DACCODE1.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The code value that DACCODE1 is set to
Return values
Valuebetween 0x0 - 0xFF

§ DL_COMP_getComparatorOutput()

__STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput ( COMP_Regs *  comp)

Gets the comparator output.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns the output status of the comparator. One of DL_COMP_OUTPUT

§ DL_COMP_enableSampledMode()

__STATIC_INLINE void DL_COMP_enableSampledMode ( COMP_Regs *  comp)

Enable sampled mode of the comparator.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_isSampledModeEnabled()

__STATIC_INLINE bool DL_COMP_isSampledModeEnabled ( COMP_Regs *  comp)

Checks if sampled mode is enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Returns if sampled mode is enabled
Return values
trueSampled mode is enabled
falseSampled mode is disabled

§ DL_COMP_disableSampledMode()

__STATIC_INLINE void DL_COMP_disableSampledMode ( COMP_Regs *  comp)

Disable sampled mode.

Parameters
[in]compPointer to the register overlay for the peripheral

§ DL_COMP_setSubscriberChanID()

__STATIC_INLINE void DL_COMP_setSubscriberChanID ( COMP_Regs *  comp,
DL_COMP_SUBSCRIBER_INDEX  index,
uint8_t  chanID 
)

Sets the event subscriber channel id.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]indexSpecifies the register event index to be configured
[in]chanIDChannel ID number. Valid range 0-15. If ChanID == 0 subscriber is disconnected.

§ DL_COMP_getSubscriberChanID()

__STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID ( COMP_Regs *  comp,
DL_COMP_SUBSCRIBER_INDEX  index 
)

Gets the event subscriber channel id.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]indexSpecifies the register event index to be configured
Returns
Event subscriber channel ID

§ DL_COMP_enableInterrupt()

__STATIC_INLINE void DL_COMP_enableInterrupt ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Enable COMP interrupts.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to enable. Bitwise OR of DL_COMP_INTERRUPT.

§ DL_COMP_disableInterrupt()

__STATIC_INLINE void DL_COMP_disableInterrupt ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Disable COMP interrupts.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to disable. Bitwise OR of DL_COMP_INTERRUPT.

§ DL_COMP_getEnabledInterrupts()

__STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Check which COMP interrupts are enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT.
Returns
Which of the requested COMP interrupts are enabled
Return values
BitwiseOR of DL_COMP_INTERRUPT values

§ DL_COMP_getEnabledInterruptStatus()

__STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Check interrupt flag of enabled COMP interrupts.

Checks if any of the COMP interrupts that were previously enabled are pending.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT.
Returns
Which of the requested COMP interrupts are pending
Return values
BitwiseOR of DL_COMP_INTERRUPT values
See also
DL_COMP_enableInterrupt

§ DL_COMP_getRawInterruptStatus()

__STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Check interrupt flag of any COMP interrupt.

Checks if any of the COMP interrupts are pending. Interrupts do not have to be previously enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT.
Returns
Which of the requested COMP interrupts are pending
Return values
BitwiseOR of DL_COMP_INTERRUPT values

§ DL_COMP_getPendingInterrupt()

__STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt ( COMP_Regs *  comp)

Get highest priority pending COMP interrupt.

Checks if any of the COMP interrupts are pending. Interrupts do not have to be previously enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
The highest priority pending COMP interrupt. One of DL_COMP_IIDX

§ DL_COMP_clearInterruptStatus()

__STATIC_INLINE void DL_COMP_clearInterruptStatus ( COMP_Regs *  comp,
uint32_t  interruptMask 
)

Clear pending COMP interrupts.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to clear. Bitwise OR of DL_COMP_INTERRUPT.

§ DL_COMP_setPublisherChanID()

__STATIC_INLINE void DL_COMP_setPublisherChanID ( COMP_Regs *  comp,
uint8_t  chanID 
)

Sets the COMP event publisher channel ID.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]chanIDChannel ID number. Valid range 0-15. If ChanID == 0, publisher is disconnected.

§ DL_COMP_getPublisherChanID()

__STATIC_INLINE uint8_t DL_COMP_getPublisherChanID ( COMP_Regs *  comp)

Gets the event publisher channel ID.

Parameters
[in]compPointer to the register overlay for the peripheral
Returns
Event publisher channel ID

§ DL_COMP_enableEvent()

__STATIC_INLINE void DL_COMP_enableEvent ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Enable COMP event.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to enable. Bitwise OR of DL_COMP_EVENT.

§ DL_COMP_disableEvent()

__STATIC_INLINE void DL_COMP_disableEvent ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Disable COMP event.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to enable. Bitwise OR of DL_COMP_EVENT.

§ DL_COMP_getEnabledEvents()

__STATIC_INLINE uint32_t DL_COMP_getEnabledEvents ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Check which COMP events are enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT.
Returns
Which of the requested COMP interrupts are enabled
Return values
BitwiseOR of DL_COMP_EVENT values

§ DL_COMP_getEnabledEventStatus()

__STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Check event flag of enabled COMP event.

Checks if any of the COMP events that were previously enabled are pending.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT.
Returns
Which of the requested COMP interrupts are pending
Return values
BitwiseOR of DL_COMP_EVENT values
See also
DL_COMP_enableInterrupt

§ DL_COMP_getRawEventsStatus()

__STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Check interrupt flag of any COMP event.

Checks if any events are pending. Events do not have to be previously enabled.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT.
Returns
Which of the requested COMP interrupts are pending
Return values
BitwiseOR of DL_COMP_EVENT values

§ DL_COMP_clearEventsStatus()

__STATIC_INLINE void DL_COMP_clearEventsStatus ( COMP_Regs *  comp,
uint32_t  eventMask 
)

Clear pending COMP events.

Parameters
[in]compPointer to the register overlay for the peripheral
[in]eventMaskBit mask of interrupts to clear. Bitwise OR of DL_COMP_EVENT.
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale