![]() |
![]() |
|
MSPM0C1105_C1106 Driver Library
2.05.01.00
|
|
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... | |
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... | |
The COMP DriverLib allows full configuration of the MSPM0 comparator module. The comparator module (COMP) is an analog voltage comparator with general comparator functionality.
| enum DL_COMP_IIDX |
| enum DL_COMP_MODE |
| enum DL_COMP_HYSTERESIS |
| enum DL_COMP_POLARITY |
| enum DL_COMP_FILTER_DELAY |
| enum DL_COMP_REF_MODE |
| enum DL_COMP_REF_SOURCE |
| enum DL_COMP_DAC_CONTROL |
| enum DL_COMP_DAC_INPUT |
| enum DL_COMP_OUTPUT |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_COMP_reset | ( | COMP_Regs * | comp | ) |
Resets comparator peripheral.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isReset | ( | COMP_Regs * | comp | ) |
Returns if comparator was reset.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | config | Configuration 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.
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | config | Configuration 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.
| __STATIC_INLINE void DL_COMP_enable | ( | COMP_Regs * | comp | ) |
Enable the comparator peripheral.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isEnabled | ( | COMP_Regs * | comp | ) |
Checks if the comparator peripheral is enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | The comparator peripheral is enabled |
| false | The comparator peripheral is disabled |
| __STATIC_INLINE void DL_COMP_disable | ( | COMP_Regs * | comp | ) |
Disable the comparator peripheral.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | mode | Mode to set the comparator to. One of DL_COMP_MODE. |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode | ( | COMP_Regs * | comp | ) |
Get the mode the comparator is set to.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_MODE |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled | ( | COMP_Regs * | comp | ) |
Checks if the inputs are exchanged and if output is inverted.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | The inputs are exchanged and output is inverted |
| false | The inputs are not exchanged and output is not inverted |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isInputTerminalsShorted | ( | COMP_Regs * | comp | ) |
Checks if the comparator inputs are shorted.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | The comparator inputs are shorted |
| false | The comparator inputs are not shorted |
| __STATIC_INLINE void DL_COMP_disableShortInputTerminals | ( | COMP_Regs * | comp | ) |
Disable shorting the comparator inputs.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | edge | Interrupt edge for the comparator output. One of DL_COMP_OUTPUT_INT_EDGE. |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge | ( | COMP_Regs * | comp | ) |
Get the interrupt edge for the comparator output.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_OUTPUT_INT_EDGE |
| __STATIC_INLINE void DL_COMP_setHysteresis | ( | COMP_Regs * | comp, |
| DL_COMP_HYSTERESIS | voltage | ||
| ) |
Set the hysteresis voltage.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | voltage | Voltage value to set the hysteresis to |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis | ( | COMP_Regs * | comp | ) |
Get the hysteresis voltage.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_HYSTERESIS |
| __STATIC_INLINE void DL_COMP_setOutputPolarity | ( | COMP_Regs * | comp, |
| DL_COMP_POLARITY | polarity | ||
| ) |
Set the output polarity.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | polarity | The polarity of the comparator output |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity | ( | COMP_Regs * | comp | ) |
Get the output polarity.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_POLARITY |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | delay | Delay of the filter. One of DL_COMP_FILTER_DELAY. |
| __STATIC_INLINE bool DL_COMP_isOutputFilterEnabled | ( | COMP_Regs * | comp | ) |
Checks if output filter is enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | The output is filtered |
| false | The output is not filtered |
| __STATIC_INLINE void DL_COMP_disableOutputFilter | ( | COMP_Regs * | comp | ) |
Disable output filter using on-chip analog filter.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay | ( | COMP_Regs * | comp | ) |
Get the output filter delay.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_FILTER_DELAY |
| __STATIC_INLINE void DL_COMP_enableWindowComparator | ( | COMP_Regs * | comp | ) |
Enable the window comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled | ( | COMP_Regs * | comp | ) |
Checks if the window comparator is enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | The window comparator is enabled |
| false | The window comparator is not enabled |
| __STATIC_INLINE void DL_COMP_disableWindowComparator | ( | COMP_Regs * | comp | ) |
Disable the window comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | channels | Input channels to enable |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_ENABLE_CHANNEL DL_COMP_getEnabledInputChannels | ( | COMP_Regs * | comp | ) |
Get the enabled input channels.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_ENABLE_CHANNEL |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | input | Channel input for the positive terminal |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput | ( | COMP_Regs * | comp | ) |
Get the channel input for the positive terminal.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_IPSEL_CHANNEL |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | input | Channel input for the negative terminal |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput | ( | COMP_Regs * | comp | ) |
Get the channel input for the negative terminal.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_IMSEL_CHANNEL |
| __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] | comp | Pointer to the register overlay for the peripheral |
| [in] | mode | Mode to set the reference voltage to |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode | ( | COMP_Regs * | comp | ) |
Get the mode for the reference voltage.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_REF_MODE |
| __STATIC_INLINE void DL_COMP_setReferenceSource | ( | COMP_Regs * | comp, |
| DL_COMP_REF_SOURCE | source | ||
| ) |
Set the reference source for the comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | source | Reference source for the comparator |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource | ( | COMP_Regs * | comp | ) |
Get the reference source for the comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_REF_SOURCE |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | terminal | Terminal the reference voltage is applied to |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal | ( | COMP_Regs * | comp | ) |
Get the comparator terminal the reference voltage is applied to.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_REF_TERMINAL_SELECT |
| __STATIC_INLINE void DL_COMP_setBlankingSource | ( | COMP_Regs * | comp, |
| DL_COMP_BLANKING_SOURCE | source | ||
| ) |
Set the blanking source for the comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | source | Blanking source for the comparator |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource | ( | COMP_Regs * | comp | ) |
Get the blanking source for the comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_BLANKING_SOURCE |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | control | What controls the inputs to the DAC. One of DL_COMP_DAC_CONTROL |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl | ( | COMP_Regs * | comp | ) |
Get what controls the input to the DAC.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_DAC_CONTROL |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | input | The input to the DAC. One of DL_COMP_DAC_INPUT |
References DL_Common_updateReg().
| __STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput | ( | COMP_Regs * | comp | ) |
Get whether DACCODE0 or DACCODE1 is the input to the DAC.
| [in] | comp | Pointer to the register overlay for the peripheral |
| One | of DL_COMP_DAC_INPUT |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | value | Code to set for codeDACCODE0. Value between 0x0 - 0xFF. |
References DL_Common_updateReg().
| __STATIC_INLINE uint32_t DL_COMP_getDACCode0 | ( | COMP_Regs * | comp | ) |
Get the code value of DACCODE0.
| [in] | comp | Pointer to the register overlay for the peripheral |
| Value | between 0x0 - 0xFF |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | value | Code to set for codeDACCODE1. Value between 0x0 - 0xFF. |
References DL_Common_updateReg().
| __STATIC_INLINE uint32_t DL_COMP_getDACCode1 | ( | COMP_Regs * | comp | ) |
Get the code value of DACCODE1.
| [in] | comp | Pointer to the register overlay for the peripheral |
| Value | between 0x0 - 0xFF |
| __STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput | ( | COMP_Regs * | comp | ) |
Gets the comparator output.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_COMP_enableSampledMode | ( | COMP_Regs * | comp | ) |
Enable sampled mode of the comparator.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE bool DL_COMP_isSampledModeEnabled | ( | COMP_Regs * | comp | ) |
Checks if sampled mode is enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| true | Sampled mode is enabled |
| false | Sampled mode is disabled |
| __STATIC_INLINE void DL_COMP_disableSampledMode | ( | COMP_Regs * | comp | ) |
Disable sampled mode.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_COMP_setSubscriberChanID | ( | COMP_Regs * | comp, |
| DL_COMP_SUBSCRIBER_INDEX | index, | ||
| uint8_t | chanID | ||
| ) |
Sets the event subscriber channel id.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | index | Specifies the register event index to be configured |
| [in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0 subscriber is disconnected. |
| __STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID | ( | COMP_Regs * | comp, |
| DL_COMP_SUBSCRIBER_INDEX | index | ||
| ) |
Gets the event subscriber channel id.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | index | Specifies the register event index to be configured |
| __STATIC_INLINE void DL_COMP_enableInterrupt | ( | COMP_Regs * | comp, |
| uint32_t | interruptMask | ||
| ) |
Enable COMP interrupts.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to enable. Bitwise OR of DL_COMP_INTERRUPT. |
| __STATIC_INLINE void DL_COMP_disableInterrupt | ( | COMP_Regs * | comp, |
| uint32_t | interruptMask | ||
| ) |
Disable COMP interrupts.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to disable. Bitwise OR of DL_COMP_INTERRUPT. |
| __STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts | ( | COMP_Regs * | comp, |
| uint32_t | interruptMask | ||
| ) |
Check which COMP interrupts are enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT. |
| Bitwise | OR of DL_COMP_INTERRUPT values |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT. |
| Bitwise | OR of DL_COMP_INTERRUPT values |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_INTERRUPT. |
| Bitwise | OR of DL_COMP_INTERRUPT values |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_COMP_clearInterruptStatus | ( | COMP_Regs * | comp, |
| uint32_t | interruptMask | ||
| ) |
Clear pending COMP interrupts.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | interruptMask | Bit mask of interrupts to clear. Bitwise OR of DL_COMP_INTERRUPT. |
| __STATIC_INLINE void DL_COMP_setPublisherChanID | ( | COMP_Regs * | comp, |
| uint8_t | chanID | ||
| ) |
Sets the COMP event publisher channel ID.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0, publisher is disconnected. |
| __STATIC_INLINE uint8_t DL_COMP_getPublisherChanID | ( | COMP_Regs * | comp | ) |
Gets the event publisher channel ID.
| [in] | comp | Pointer to the register overlay for the peripheral |
| __STATIC_INLINE void DL_COMP_enableEvent | ( | COMP_Regs * | comp, |
| uint32_t | eventMask | ||
| ) |
Enable COMP event.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to enable. Bitwise OR of DL_COMP_EVENT. |
| __STATIC_INLINE void DL_COMP_disableEvent | ( | COMP_Regs * | comp, |
| uint32_t | eventMask | ||
| ) |
Disable COMP event.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to enable. Bitwise OR of DL_COMP_EVENT. |
| __STATIC_INLINE uint32_t DL_COMP_getEnabledEvents | ( | COMP_Regs * | comp, |
| uint32_t | eventMask | ||
| ) |
Check which COMP events are enabled.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT. |
| Bitwise | OR of DL_COMP_EVENT values |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT. |
| Bitwise | OR of DL_COMP_EVENT values |
| __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.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to check. Bitwise OR of DL_COMP_EVENT. |
| Bitwise | OR of DL_COMP_EVENT values |
| __STATIC_INLINE void DL_COMP_clearEventsStatus | ( | COMP_Regs * | comp, |
| uint32_t | eventMask | ||
| ) |
Clear pending COMP events.
| [in] | comp | Pointer to the register overlay for the peripheral |
| [in] | eventMask | Bit mask of interrupts to clear. Bitwise OR of DL_COMP_EVENT. |