MSPM0G1X0X_G3X0X Driver Library  1.10.01.05
dl_comp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!****************************************************************************
33  * @file dl_comp.h
34  * @brief Comparator (COMP)
35  * @defgroup COMP Comparator (COMP)
36  *
37  * @anchor ti_dl_dl_comp_Overview
38  * # Overview
39  *
40  * The COMP DriverLib allows full configuration of the MSPM0 comparator module.
41  * The comparator module (COMP) is an analog voltage comparator with general
42  * comparator functionality.
43  *
44  * <hr>
45  ******************************************************************************/
49 #ifndef ti_dl_m0p_dl_comp__include
50 #define ti_dl_m0p_dl_comp__include
51 
52 #include <stdbool.h>
53 #include <stdint.h>
54 
55 #include <ti/devices/msp/msp.h>
56 #include <ti/driverlib/dl_common.h>
57 
58 #ifdef __MSPM0_HAS_COMP__
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /* clang-format off */
65 
72 #define DL_COMP_INTERRUPT_OUTPUT_READY (COMP_CPU_INT_IMASK_OUTRDYIFG_SET)
73 
78 #define DL_COMP_INTERRUPT_OUTPUT_EDGE (COMP_CPU_INT_IMASK_COMPIFG_SET)
79 
84 #define DL_COMP_INTERRUPT_OUTPUT_EDGE_INV (COMP_CPU_INT_IMASK_COMPINVIFG_SET)
85 
94 #define DL_COMP_EVENT_OUTPUT_READY (COMP_GEN_EVENT_IMASK_OUTRDYIFG_SET)
95 
100 #define DL_COMP_EVENT_OUTPUT_EDGE (COMP_GEN_EVENT_IMASK_COMPIFG_SET)
101 
106 #define DL_COMP_EVENT_OUTPUT_EDGE_INV (COMP_GEN_EVENT_IMASK_COMPINVIFG_SET)
107 
110 /* clang-format on */
111 
113 typedef enum {
115  DL_COMP_IIDX_NO_INTERRUPT = COMP_CPU_INT_IIDX_STAT_NO_INTR,
117  DL_COMP_IIDX_OUTPUT_READY = COMP_CPU_INT_IIDX_STAT_OUTRDYIFG,
120  DL_COMP_IIDX_OUTPUT_EDGE = COMP_CPU_INT_IIDX_STAT_COMPIFG,
123  DL_COMP_IIDX_OUTPUT_EDGE_INV = COMP_CPU_INT_IIDX_STAT_COMPINVIFG,
124 } DL_COMP_IIDX;
125 
127 typedef enum {
129  DL_COMP_MODE_FAST = COMP_CTL1_MODE_FAST,
131  DL_COMP_MODE_ULP = COMP_CTL1_MODE_ULP,
132 } DL_COMP_MODE;
133 
135 typedef enum {
137  DL_COMP_OUTPUT_INT_EDGE_RISING = COMP_CTL1_IES_RISING,
139  DL_COMP_OUTPUT_INT_EDGE_FALLING = COMP_CTL1_IES_FALLING,
141 
143 typedef enum {
145  DL_COMP_HYSTERESIS_NONE = COMP_CTL1_HYST_NO_HYS,
147  DL_COMP_HYSTERESIS_10 = COMP_CTL1_HYST_LOW_HYS,
149  DL_COMP_HYSTERESIS_20 = COMP_CTL1_HYST_MED_HYS,
151  DL_COMP_HYSTERESIS_30 = COMP_CTL1_HYST_HIGH_HYS,
153 
155 typedef enum {
157  DL_COMP_POLARITY_NON_INV = COMP_CTL1_OUTPOL_NON_INV,
159  DL_COMP_POLARITY_INV = COMP_CTL1_OUTPOL_INV,
161 
163 typedef enum {
165  DL_COMP_FILTER_DELAY_70 = COMP_CTL1_FLTDLY_DLY_0,
167  DL_COMP_FILTER_DELAY_500 = COMP_CTL1_FLTDLY_DLY_1,
169  DL_COMP_FILTER_DELAY_1200 = COMP_CTL1_FLTDLY_DLY_2,
171  DL_COMP_FILTER_DELAY_2700 = COMP_CTL1_FLTDLY_DLY_3,
173 
175 typedef enum {
177  DL_COMP_IPSEL_CHANNEL_0 = COMP_CTL0_IPSEL_CH_0,
179  DL_COMP_IPSEL_CHANNEL_1 = COMP_CTL0_IPSEL_CH_1,
181  DL_COMP_IPSEL_CHANNEL_2 = COMP_CTL0_IPSEL_CH_2,
183  DL_COMP_IPSEL_CHANNEL_3 = COMP_CTL0_IPSEL_CH_3,
185  DL_COMP_IPSEL_CHANNEL_4 = COMP_CTL0_IPSEL_CH_4,
187  DL_COMP_IPSEL_CHANNEL_5 = COMP_CTL0_IPSEL_CH_5,
189  DL_COMP_IPSEL_CHANNEL_6 = COMP_CTL0_IPSEL_CH_6,
191  DL_COMP_IPSEL_CHANNEL_7 = COMP_CTL0_IPSEL_CH_7,
193 
195 typedef enum {
197  DL_COMP_IMSEL_CHANNEL_0 = COMP_CTL0_IMSEL_CH_0,
199  DL_COMP_IMSEL_CHANNEL_1 = COMP_CTL0_IMSEL_CH_1,
201  DL_COMP_IMSEL_CHANNEL_2 = COMP_CTL0_IMSEL_CH_2,
203  DL_COMP_IMSEL_CHANNEL_3 = COMP_CTL0_IMSEL_CH_3,
205  DL_COMP_IMSEL_CHANNEL_4 = COMP_CTL0_IMSEL_CH_4,
207  DL_COMP_IMSEL_CHANNEL_5 = COMP_CTL0_IMSEL_CH_5,
209  DL_COMP_IMSEL_CHANNEL_6 = COMP_CTL0_IMSEL_CH_6,
211  DL_COMP_IMSEL_CHANNEL_7 = COMP_CTL0_IMSEL_CH_7,
213 
215 typedef enum {
218  (COMP_CTL0_IPEN_DISABLE | COMP_CTL0_IMEN_DISABLE),
220  DL_COMP_ENABLE_CHANNEL_POS = COMP_CTL0_IPEN_ENABLE,
222  DL_COMP_ENABLE_CHANNEL_NEG = COMP_CTL0_IMEN_ENABLE,
225  (COMP_CTL0_IPEN_ENABLE | COMP_CTL0_IMEN_ENABLE),
227 
229 typedef enum {
232  DL_COMP_REF_MODE_STATIC = COMP_CTL2_REFMODE_STATIC,
235  DL_COMP_REF_MODE_SAMPLED = COMP_CTL2_REFMODE_SAMPLED,
237 
239 typedef enum {
242  DL_COMP_REF_SOURCE_NONE = COMP_CTL2_REFSRC_OFF,
245  DL_COMP_REF_SOURCE_VDDA_DAC = COMP_CTL2_REFSRC_VDDA_DAC,
248  DL_COMP_REF_SOURCE_VREF_DAC = COMP_CTL2_REFSRC_VREF_DAC,
250  DL_COMP_REF_SOURCE_VREF = COMP_CTL2_REFSRC_VREF,
251 
253 
255 typedef enum {
258  DL_COMP_REF_TERMINAL_SELECT_POS = COMP_CTL2_REFSEL_POSITIVE,
261  DL_COMP_REF_TERMINAL_SELECT_NEG = COMP_CTL2_REFSEL_NEGATIVE,
263 
265 typedef enum {
267  DL_COMP_BLANKING_SOURCE_DISABLE = COMP_CTL2_BLANKSRC_DISABLE,
269  DL_COMP_BLANKING_SOURCE_1 = COMP_CTL2_BLANKSRC_BLANKSRC1,
271  DL_COMP_BLANKING_SOURCE_2 = COMP_CTL2_BLANKSRC_BLANKSRC2,
273  DL_COMP_BLANKING_SOURCE_3 = COMP_CTL2_BLANKSRC_BLANKSRC3,
275  DL_COMP_BLANKING_SOURCE_4 = COMP_CTL2_BLANKSRC_BLANKSRC4,
277  DL_COMP_BLANKING_SOURCE_5 = COMP_CTL2_BLANKSRC_BLANKSRC5,
279  DL_COMP_BLANKING_SOURCE_6 = COMP_CTL2_BLANKSRC_BLANKSRC6,
281 
283 typedef enum {
285  DL_COMP_DAC_CONTROL_COMP_OUT = COMP_CTL2_DACCTL_COMPOUT_SEL,
287  DL_COMP_DAC_CONTROL_SW = COMP_CTL2_DACCTL_DACSW_SEL,
289 
291 typedef enum {
293  DL_COMP_DAC_INPUT_DACCODE0 = COMP_CTL2_DACSW_DACCODE0_SEL,
295  DL_COMP_DAC_INPUT_DACCODE1 = COMP_CTL2_DACSW_DACCODE1_SEL,
297 
299 typedef enum {
301  DL_COMP_OUTPUT_HIGH = COMP_STAT_OUT_LOW,
303  DL_COMP_OUTPUT_LOW = COMP_STAT_OUT_HIGH,
305 
307 typedef enum {
313 
317 typedef struct {
319  DL_COMP_MODE mode;
323  DL_COMP_IPSEL_CHANNEL posChannel;
325  DL_COMP_IMSEL_CHANNEL negChannel;
327  DL_COMP_POLARITY polarity;
329  DL_COMP_HYSTERESIS hysteresis;
331 
335 typedef struct {
337  DL_COMP_REF_MODE mode;
339  DL_COMP_REF_SOURCE source;
341  DL_COMP_REF_TERMINAL_SELECT terminalSelect;
343  DL_COMP_DAC_CONTROL controlSelect;
346  DL_COMP_DAC_INPUT inputSelect;
348 
354 __STATIC_INLINE void DL_COMP_enablePower(COMP_Regs *comp)
355 {
356  comp->GPRCM.PWREN = (COMP_PWREN_KEY_UNLOCK_W | COMP_PWREN_ENABLE_ENABLE);
357 }
358 
364 __STATIC_INLINE void DL_COMP_disablePower(COMP_Regs *comp)
365 {
366  comp->GPRCM.PWREN = (COMP_PWREN_KEY_UNLOCK_W | COMP_PWREN_ENABLE_DISABLE);
367 }
368 
379 __STATIC_INLINE bool DL_COMP_isPowerEnabled(COMP_Regs *comp)
380 {
381  return ((comp->GPRCM.PWREN & COMP_PWREN_ENABLE_MASK) ==
382  COMP_PWREN_ENABLE_ENABLE);
383 }
384 
390 __STATIC_INLINE void DL_COMP_reset(COMP_Regs *comp)
391 {
392  comp->GPRCM.RSTCTL =
393  (COMP_RSTCTL_KEY_UNLOCK_W | COMP_RSTCTL_RESETSTKYCLR_CLR |
394  COMP_RSTCTL_RESETASSERT_ASSERT);
395 }
396 
406 __STATIC_INLINE bool DL_COMP_isReset(COMP_Regs *comp)
407 {
408  return ((comp->GPRCM.STAT & COMP_GPRCM_STAT_RESETSTKY_MASK) ==
409  COMP_GPRCM_STAT_RESETSTKY_RESET);
410 }
411 
422 __STATIC_INLINE void DL_COMP_init(COMP_Regs *comp, DL_COMP_Config *config)
423 {
424  DL_Common_updateReg(&comp->CTL0,
425  (uint32_t) config->posChannel | (uint32_t) config->negChannel |
426  (uint32_t) config->channelEnable,
427  COMP_CTL0_IMSEL_MASK | COMP_CTL0_IPSEL_MASK | COMP_CTL0_IPEN_MASK |
428  COMP_CTL0_IMEN_MASK);
429 
430  DL_Common_updateReg(&comp->CTL1,
431  (uint32_t) config->mode | (uint32_t) config->polarity |
432  (uint32_t) config->hysteresis,
433  COMP_CTL1_MODE_MASK | COMP_CTL1_HYST_MASK | COMP_CTL1_OUTPOL_MASK);
434 }
435 
446 __STATIC_INLINE void DL_COMP_refVoltageInit(
447  COMP_Regs *comp, DL_COMP_RefVoltageConfig *config)
448 {
449  DL_Common_updateReg(&comp->CTL2,
450  (uint32_t) config->mode | (uint32_t) config->source |
451  (uint32_t) config->terminalSelect |
452  (uint32_t) config->controlSelect | (uint32_t) config->inputSelect,
453  COMP_CTL2_REFMODE_MASK | COMP_CTL2_REFSRC_MASK |
454  COMP_CTL2_REFSEL_MASK | COMP_CTL2_DACCTL_MASK |
455  COMP_CTL2_DACSW_MASK);
456 }
457 
463 __STATIC_INLINE void DL_COMP_enable(COMP_Regs *comp)
464 {
465  comp->CTL1 |= COMP_CTL1_ENABLE_ON;
466 }
467 
479 __STATIC_INLINE bool DL_COMP_isEnabled(COMP_Regs *comp)
480 {
481  return ((comp->CTL1 & COMP_CTL1_ENABLE_MASK) == COMP_CTL1_ENABLE_ON);
482 }
483 
489 __STATIC_INLINE void DL_COMP_disable(COMP_Regs *comp)
490 {
491  comp->CTL1 &= ~(COMP_CTL1_ENABLE_MASK);
492 }
493 
509 __STATIC_INLINE void DL_COMP_setCompMode(COMP_Regs *comp, DL_COMP_MODE mode)
510 {
511  DL_Common_updateReg(&comp->CTL1, (uint32_t) mode, COMP_CTL1_MODE_MASK);
512 }
513 
523 __STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode(COMP_Regs *comp)
524 {
525  uint32_t mode = (comp->CTL1 & COMP_CTL1_MODE_MASK);
526 
527  return (DL_COMP_MODE)(mode);
528 }
529 
540 __STATIC_INLINE void DL_COMP_enableExchangeInputs(COMP_Regs *comp)
541 {
542  comp->CTL1 |= COMP_CTL1_EXCH_EXC;
543 }
544 
556 __STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled(COMP_Regs *comp)
557 {
558  return ((comp->CTL1 & COMP_CTL1_EXCH_MASK) == COMP_CTL1_EXCH_EXC);
559 }
560 
569 __STATIC_INLINE void DL_COMP_disableExchangeInputs(COMP_Regs *comp)
570 {
571  comp->CTL1 &= ~(COMP_CTL1_EXCH_MASK);
572 }
573 
582 __STATIC_INLINE void DL_COMP_enableShortInputTerminals(COMP_Regs *comp)
583 {
584  comp->CTL1 |= COMP_CTL1_SHORT_SHT;
585 }
586 
598 __STATIC_INLINE bool DL_COMP_isInputTerminalsShorted(COMP_Regs *comp)
599 {
600  return ((comp->CTL1 & COMP_CTL1_SHORT_MASK) == COMP_CTL1_SHORT_SHT);
601 }
602 
608 __STATIC_INLINE void DL_COMP_disableShortInputTerminals(COMP_Regs *comp)
609 {
610  comp->CTL1 &= ~(COMP_CTL1_SHORT_MASK);
611 }
612 
627 __STATIC_INLINE void DL_COMP_setOutputInterruptEdge(
628  COMP_Regs *comp, DL_COMP_OUTPUT_INT_EDGE edge)
629 {
630  DL_Common_updateReg(&comp->CTL1, (uint32_t) edge, COMP_CTL1_IES_MASK);
631 }
632 
642 __STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge(
643  COMP_Regs *comp)
644 {
645  uint32_t interruptEdge = (comp->CTL1 & COMP_CTL1_IES_MASK);
646 
647  return (DL_COMP_OUTPUT_INT_EDGE)(interruptEdge);
648 }
649 
656 __STATIC_INLINE void DL_COMP_setHysteresis(
657  COMP_Regs *comp, DL_COMP_HYSTERESIS voltage)
658 {
659  DL_Common_updateReg(&comp->CTL1, (uint32_t) voltage, COMP_CTL1_HYST_MASK);
660 }
661 
671 __STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis(COMP_Regs *comp)
672 {
673  uint32_t hysteresis = (comp->CTL1 & COMP_CTL1_HYST_MASK);
674 
675  return (DL_COMP_HYSTERESIS)(hysteresis);
676 }
677 
684 __STATIC_INLINE void DL_COMP_setOutputPolarity(
685  COMP_Regs *comp, DL_COMP_POLARITY polarity)
686 {
688  &comp->CTL1, (uint32_t) polarity, COMP_CTL1_OUTPOL_MASK);
689 }
690 
700 __STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity(COMP_Regs *comp)
701 {
702  uint32_t polarity = (comp->CTL1 & COMP_CTL1_OUTPOL_MASK);
703 
704  return (DL_COMP_POLARITY)(polarity);
705 }
706 
718 __STATIC_INLINE void DL_COMP_enableOutputFilter(
719  COMP_Regs *comp, DL_COMP_FILTER_DELAY delay)
720 {
721  comp->CTL1 |= (COMP_CTL1_FLTEN_ENABLE | (uint32_t) delay);
722 }
723 
734 __STATIC_INLINE bool DL_COMP_isOutputFilterEnabled(COMP_Regs *comp)
735 {
736  return ((comp->CTL1 & COMP_CTL1_FLTEN_MASK) == COMP_CTL1_FLTEN_ENABLE);
737 }
738 
744 __STATIC_INLINE void DL_COMP_disableOutputFilter(COMP_Regs *comp)
745 {
746  comp->CTL1 &= ~(COMP_CTL1_FLTEN_MASK);
747 }
748 
758 __STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay(
759  COMP_Regs *comp)
760 {
761  uint32_t delay = (comp->CTL1 & COMP_CTL1_FLTDLY_MASK);
762 
763  return (DL_COMP_FILTER_DELAY)(delay);
764 }
765 
771 __STATIC_INLINE void DL_COMP_enableWindowComparator(COMP_Regs *comp)
772 {
773  comp->CTL1 |= COMP_CTL1_WINCOMPEN_ON;
774 }
775 
786 __STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled(COMP_Regs *comp)
787 {
788  return ((comp->CTL1 & COMP_CTL1_WINCOMPEN_MASK) == COMP_CTL1_WINCOMPEN_ON);
789 }
790 
796 __STATIC_INLINE void DL_COMP_disableWindowComparator(COMP_Regs *comp)
797 {
798  comp->CTL1 &= ~(COMP_CTL1_WINCOMPEN_MASK);
799 }
800 
810 __STATIC_INLINE void DL_COMP_setEnabledInputChannels(
811  COMP_Regs *comp, DL_COMP_ENABLE_CHANNEL channels)
812 {
813  DL_Common_updateReg(&comp->CTL0, (uint32_t) channels,
814  (COMP_CTL0_IMEN_MASK | COMP_CTL0_IPEN_MASK));
815 }
816 
827  COMP_Regs *comp)
828 {
829  uint32_t channel =
830  (comp->CTL0 & (COMP_CTL0_IMEN_MASK | COMP_CTL0_IPEN_MASK));
831 
832  return (DL_COMP_ENABLE_CHANNEL)(channel);
833 }
834 
848 __STATIC_INLINE void DL_COMP_setPositiveChannelInput(
849  COMP_Regs *comp, DL_COMP_IPSEL_CHANNEL input)
850 {
851  DL_Common_updateReg(&comp->CTL0, (uint32_t) input, COMP_CTL0_IPSEL_MASK);
852 }
853 
863 __STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput(
864  COMP_Regs *comp)
865 {
866  uint32_t channel = (comp->CTL0 & COMP_CTL0_IPSEL_MASK);
867 
868  return (DL_COMP_IPSEL_CHANNEL)(channel);
869 }
870 
884 __STATIC_INLINE void DL_COMP_setNegativeChannelInput(
885  COMP_Regs *comp, DL_COMP_IMSEL_CHANNEL input)
886 {
887  DL_Common_updateReg(&comp->CTL0, (uint32_t) input, COMP_CTL0_IMSEL_MASK);
888 }
889 
899 __STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput(
900  COMP_Regs *comp)
901 {
902  uint32_t channel = (comp->CTL0 & COMP_CTL0_IMSEL_MASK);
903 
904  return (DL_COMP_IMSEL_CHANNEL)(channel);
905 }
906 
922 __STATIC_INLINE void DL_COMP_setReferenceMode(
923  COMP_Regs *comp, DL_COMP_REF_MODE mode)
924 {
925  DL_Common_updateReg(&comp->CTL2, (uint32_t) mode, COMP_CTL2_REFMODE_MASK);
926 }
927 
937 __STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode(COMP_Regs *comp)
938 {
939  uint32_t mode = (comp->CTL2 & COMP_CTL2_REFMODE_MASK);
940 
941  return (DL_COMP_REF_MODE)(mode);
942 }
943 
950 __STATIC_INLINE void DL_COMP_setReferenceSource(
951  COMP_Regs *comp, DL_COMP_REF_SOURCE source)
952 {
953  DL_Common_updateReg(&comp->CTL2, (uint32_t) source, COMP_CTL2_REFSRC_MASK);
954 }
955 
965 __STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource(COMP_Regs *comp)
966 {
967  uint32_t source = (comp->CTL2 & COMP_CTL2_REFSRC_MASK);
968 
969  return (DL_COMP_REF_SOURCE)(source);
970 }
971 
985 __STATIC_INLINE void DL_COMP_setReferenceCompTerminal(
986  COMP_Regs *comp, DL_COMP_REF_TERMINAL_SELECT terminal)
987 {
989  &comp->CTL2, (uint32_t) terminal, COMP_CTL2_REFSEL_MASK);
990 }
991 
1001 __STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal(
1002  COMP_Regs *comp)
1003 {
1004  uint32_t terminal = (comp->CTL2 & COMP_CTL2_REFSEL_MASK);
1005 
1006  return (DL_COMP_REF_TERMINAL_SELECT)(terminal);
1007 }
1008 
1015 __STATIC_INLINE void DL_COMP_setBlankingSource(
1016  COMP_Regs *comp, DL_COMP_BLANKING_SOURCE source)
1017 {
1019  &comp->CTL2, (uint32_t) source, COMP_CTL2_BLANKSRC_MASK);
1020 }
1021 
1031 __STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource(
1032  COMP_Regs *comp)
1033 {
1034  uint32_t source = (comp->CTL2 & COMP_CTL2_BLANKSRC_MASK);
1035 
1036  return (DL_COMP_BLANKING_SOURCE)(source);
1037 }
1038 
1050 __STATIC_INLINE void DL_COMP_setDACControl(
1051  COMP_Regs *comp, DL_COMP_DAC_CONTROL control)
1052 {
1054  &comp->CTL2, (uint32_t) control, COMP_CTL2_DACCTL_MASK);
1055 }
1056 
1066 __STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl(COMP_Regs *comp)
1067 {
1068  uint32_t control = (comp->CTL2 & COMP_CTL2_DACCTL_MASK);
1069 
1070  return (DL_COMP_DAC_CONTROL)(control);
1071 }
1072 
1084 __STATIC_INLINE void DL_COMP_setDACInput(
1085  COMP_Regs *comp, DL_COMP_DAC_INPUT input)
1086 {
1087  DL_Common_updateReg(&comp->CTL2, (uint32_t) input, COMP_CTL2_DACSW_MASK);
1088 }
1089 
1102 __STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput(COMP_Regs *comp)
1103 {
1104  uint32_t input = (comp->CTL2 & COMP_CTL2_DACSW_MASK);
1105 
1106  return (DL_COMP_DAC_INPUT)(input);
1107 }
1108 
1128 __STATIC_INLINE void DL_COMP_setDACCode0(COMP_Regs *comp, uint32_t value)
1129 {
1130  DL_Common_updateReg(&comp->CTL3, value, COMP_CTL3_DACCODE0_MASK);
1131 }
1132 
1142 __STATIC_INLINE uint32_t DL_COMP_getDACCode0(COMP_Regs *comp)
1143 {
1144  return (comp->CTL3 & COMP_CTL3_DACCODE0_MASK);
1145 }
1146 
1166 __STATIC_INLINE void DL_COMP_setDACCode1(COMP_Regs *comp, uint32_t value)
1167 {
1168  DL_Common_updateReg(&comp->CTL3, (value << COMP_CTL3_DACCODE1_OFS),
1169  COMP_CTL3_DACCODE1_MASK);
1170 }
1171 
1181 __STATIC_INLINE uint32_t DL_COMP_getDACCode1(COMP_Regs *comp)
1182 {
1183  return ((comp->CTL3 & COMP_CTL3_DACCODE1_MASK) >> COMP_CTL3_DACCODE1_OFS);
1184 }
1185 
1193 __STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput(COMP_Regs *comp)
1194 {
1195  uint32_t output = (comp->STAT & COMP_STAT_OUT_MASK);
1196 
1197  return (DL_COMP_OUTPUT)(output);
1198 }
1199 
1205 __STATIC_INLINE void DL_COMP_enableSampledMode(COMP_Regs *comp)
1206 {
1207  comp->CTL2 |= COMP_CTL2_SAMPMODE_ENABLE;
1208 }
1209 
1221 __STATIC_INLINE bool DL_COMP_isSampledModeEnabled(COMP_Regs *comp)
1222 {
1223  return (
1224  (comp->CTL2 & COMP_CTL2_SAMPMODE_MASK) == COMP_CTL2_SAMPMODE_ENABLE);
1225 }
1226 
1232 __STATIC_INLINE void DL_COMP_disableSampledMode(COMP_Regs *comp)
1233 {
1234  comp->CTL2 &= ~(COMP_CTL2_SAMPMODE_MASK);
1235 }
1236 
1246 __STATIC_INLINE void DL_COMP_setSubscriberChanID(
1247  COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index, uint8_t chanID)
1248 {
1249  volatile uint32_t *pReg = &comp->FSUB_0;
1250 
1251  *(pReg + (uint32_t) index) = (chanID & COMP_FSUB_0_CHANID_MAXIMUM);
1252 }
1253 
1263 __STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID(
1264  COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index)
1265 {
1266  volatile uint32_t *pReg = &comp->FSUB_0;
1267 
1268  return ((uint8_t)(*(pReg + (uint32_t) index) & COMP_FSUB_0_CHANID_MASK));
1269 }
1270 
1279 __STATIC_INLINE void DL_COMP_enableInterrupt(
1280  COMP_Regs *comp, uint32_t interruptMask)
1281 {
1282  comp->CPU_INT.IMASK |= interruptMask;
1283 }
1284 
1293 __STATIC_INLINE void DL_COMP_disableInterrupt(
1294  COMP_Regs *comp, uint32_t interruptMask)
1295 {
1296  comp->CPU_INT.IMASK &= ~(interruptMask);
1297 }
1298 
1311 __STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts(
1312  COMP_Regs *comp, uint32_t interruptMask)
1313 {
1314  return (comp->CPU_INT.IMASK & interruptMask);
1315 }
1316 
1334 __STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus(
1335  COMP_Regs *comp, uint32_t interruptMask)
1336 {
1337  return (comp->CPU_INT.MIS & interruptMask);
1338 }
1339 
1355 __STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus(
1356  COMP_Regs *comp, uint32_t interruptMask)
1357 {
1358  return (comp->CPU_INT.RIS & interruptMask);
1359 }
1360 
1372 __STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt(COMP_Regs *comp)
1373 {
1374  return (DL_COMP_IIDX)(comp->CPU_INT.IIDX);
1375 }
1376 
1385 __STATIC_INLINE void DL_COMP_clearInterruptStatus(
1386  COMP_Regs *comp, uint32_t interruptMask)
1387 {
1388  comp->CPU_INT.ICLR = interruptMask;
1389 }
1390 
1399 __STATIC_INLINE void DL_COMP_setPublisherChanID(
1400  COMP_Regs *comp, uint8_t chanID)
1401 {
1402  comp->FPUB_1 = (chanID & COMP_FPUB_1_CHANID_MAXIMUM);
1403 }
1404 
1413 __STATIC_INLINE uint8_t DL_COMP_getPublisherChanID(COMP_Regs *comp)
1414 {
1415  return ((uint8_t)((comp->FPUB_1) & COMP_FPUB_1_CHANID_MAXIMUM));
1416 }
1417 
1426 __STATIC_INLINE void DL_COMP_enableEvent(COMP_Regs *comp, uint32_t eventMask)
1427 {
1428  comp->GEN_EVENT.IMASK |= (eventMask);
1429 }
1430 
1439 __STATIC_INLINE void DL_COMP_disableEvent(COMP_Regs *comp, uint32_t eventMask)
1440 {
1441  comp->GEN_EVENT.IMASK &= ~(eventMask);
1442 }
1443 
1456 __STATIC_INLINE uint32_t DL_COMP_getEnabledEvents(
1457  COMP_Regs *comp, uint32_t eventMask)
1458 {
1459  return ((comp->GEN_EVENT.IMASK) & (eventMask));
1460 }
1461 
1479 __STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus(
1480  COMP_Regs *comp, uint32_t eventMask)
1481 {
1482  return ((comp->GEN_EVENT.MIS) & eventMask);
1483 }
1484 
1500 __STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus(
1501  COMP_Regs *comp, uint32_t eventMask)
1502 {
1503  return ((comp->GEN_EVENT.RIS) & eventMask);
1504 }
1505 
1514 __STATIC_INLINE void DL_COMP_clearEventsStatus(
1515  COMP_Regs *comp, uint32_t eventMask)
1516 {
1517  comp->GEN_EVENT.ICLR |= (eventMask);
1518 }
1519 
1520 /* clang-format on */
1521 
1522 #ifdef __cplusplus
1523 }
1524 #endif
1525 
1526 #endif /* __MSPM0_HAS_COMP__ */
1527 
1528 #endif /* ti_dl_m0p_dl_comp__include */
1529 
__STATIC_INLINE void DL_COMP_setEnabledInputChannels(COMP_Regs *comp, DL_COMP_ENABLE_CHANNEL channels)
Set the enabled channels for the comparator terminals.
Definition: dl_comp.h:810
Definition: dl_comp.h:287
__STATIC_INLINE bool DL_COMP_isInputTerminalsShorted(COMP_Regs *comp)
Checks if the comparator inputs are shorted.
Definition: dl_comp.h:598
__STATIC_INLINE void DL_COMP_enableExchangeInputs(COMP_Regs *comp)
Enable exchange of the comparator inputs, and invert output.
Definition: dl_comp.h:540
Definition: dl_comp.h:258
__STATIC_INLINE void DL_Common_updateReg(volatile uint32_t *reg, uint32_t val, uint32_t mask)
Writes value to specified register - retaining bits unaffected by mask.
Definition: dl_common.h:63
__STATIC_INLINE void DL_COMP_disablePower(COMP_Regs *comp)
Disables power on the comparator module.
Definition: dl_comp.h:364
Definition: dl_comp.h:171
Definition: dl_comp.h:224
Definition: dl_comp.h:209
DL_COMP_OUTPUT
Definition: dl_comp.h:299
__STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt(COMP_Regs *comp)
Get highest priority pending COMP interrupt.
Definition: dl_comp.h:1372
Definition: dl_comp.h:279
DL_COMP_POLARITY
Definition: dl_comp.h:155
__STATIC_INLINE void DL_COMP_clearEventsStatus(COMP_Regs *comp, uint32_t eventMask)
Clear pending COMP events.
Definition: dl_comp.h:1514
DL_COMP_BLANKING_SOURCE
Definition: dl_comp.h:265
DL_COMP_HYSTERESIS hysteresis
Definition: dl_comp.h:329
Definition: dl_comp.h:147
DL_COMP_ENABLE_CHANNEL
Definition: dl_comp.h:215
Definition: dl_comp.h:222
Configuration struct for DL_COMP_init.
Definition: dl_comp.h:317
Definition: dl_comp.h:151
__STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput(COMP_Regs *comp)
Get the channel input for the positive terminal.
Definition: dl_comp.h:863
Definition: dl_comp.h:149
DL_COMP_IPSEL_CHANNEL
Definition: dl_comp.h:175
Definition: dl_comp.h:179
Definition: dl_comp.h:285
DL_COMP_REF_TERMINAL_SELECT terminalSelect
Definition: dl_comp.h:341
Definition: dl_comp.h:311
Definition: dl_comp.h:131
__STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode(COMP_Regs *comp)
Get the mode for the reference voltage.
Definition: dl_comp.h:937
Definition: dl_comp.h:211
__STATIC_INLINE void DL_COMP_setCompMode(COMP_Regs *comp, DL_COMP_MODE mode)
Set the comparator operating mode.
Definition: dl_comp.h:509
Definition: dl_comp.h:261
Definition: dl_comp.h:123
Definition: dl_comp.h:187
DL_COMP_ENABLE_CHANNEL channelEnable
Definition: dl_comp.h:321
Definition: dl_comp.h:273
__STATIC_INLINE void DL_COMP_disableExchangeInputs(COMP_Regs *comp)
Disable input exchange and invert output.
Definition: dl_comp.h:569
Definition: dl_comp.h:115
__STATIC_INLINE void DL_COMP_setSubscriberChanID(COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index, uint8_t chanID)
Sets the event subscriber channel id.
Definition: dl_comp.h:1246
__STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal(COMP_Regs *comp)
Get the comparator terminal the reference voltage is applied to.
Definition: dl_comp.h:1001
Definition: dl_comp.h:159
__STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled(COMP_Regs *comp)
Checks if the window comparator is enabled.
Definition: dl_comp.h:786
Definition: dl_comp.h:120
__STATIC_INLINE void DL_COMP_disableSampledMode(COMP_Regs *comp)
Disable sampled mode.
Definition: dl_comp.h:1232
Definition: dl_comp.h:235
__STATIC_INLINE void DL_COMP_enableEvent(COMP_Regs *comp, uint32_t eventMask)
Enable COMP event.
Definition: dl_comp.h:1426
Definition: dl_comp.h:271
Definition: dl_comp.h:250
Definition: dl_comp.h:139
__STATIC_INLINE void DL_COMP_setOutputPolarity(COMP_Regs *comp, DL_COMP_POLARITY polarity)
Set the output polarity.
Definition: dl_comp.h:684
__STATIC_INLINE bool DL_COMP_isSampledModeEnabled(COMP_Regs *comp)
Checks if sampled mode is enabled.
Definition: dl_comp.h:1221
Configuration struct for DL_COMP_refVoltageInit.
Definition: dl_comp.h:335
Definition: dl_comp.h:277
__STATIC_INLINE void DL_COMP_disableEvent(COMP_Regs *comp, uint32_t eventMask)
Disable COMP event.
Definition: dl_comp.h:1439
DL_COMP_REF_TERMINAL_SELECT
Definition: dl_comp.h:255
Definition: dl_comp.h:295
Definition: dl_comp.h:301
__STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus(COMP_Regs *comp, uint32_t eventMask)
Check interrupt flag of any COMP event.
Definition: dl_comp.h:1500
Definition: dl_comp.h:197
__STATIC_INLINE uint8_t DL_COMP_getPublisherChanID(COMP_Regs *comp)
Gets the event publisher channel ID.
Definition: dl_comp.h:1413
DL_COMP_DAC_INPUT inputSelect
Definition: dl_comp.h:346
DriverLib Common APIs.
Definition: dl_comp.h:242
DL_COMP_MODE mode
Definition: dl_comp.h:319
__STATIC_INLINE bool DL_COMP_isPowerEnabled(COMP_Regs *comp)
Returns if power is on for the comparator module.
Definition: dl_comp.h:379
__STATIC_INLINE uint32_t DL_COMP_getDACCode1(COMP_Regs *comp)
Get the code value of DACCODE1.
Definition: dl_comp.h:1181
__STATIC_INLINE void DL_COMP_setDACControl(COMP_Regs *comp, DL_COMP_DAC_CONTROL control)
Select the source for COMP control.
Definition: dl_comp.h:1050
__STATIC_INLINE void DL_COMP_setBlankingSource(COMP_Regs *comp, DL_COMP_BLANKING_SOURCE source)
Set the blanking source for the comparator.
Definition: dl_comp.h:1015
__STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode(COMP_Regs *comp)
Get the mode the comparator is set to.
Definition: dl_comp.h:523
Definition: dl_comp.h:129
__STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis(COMP_Regs *comp)
Get the hysteresis voltage.
Definition: dl_comp.h:671
__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.
Definition: dl_comp.h:985
__STATIC_INLINE void DL_COMP_setReferenceMode(COMP_Regs *comp, DL_COMP_REF_MODE mode)
Set the mode for the reference voltage.
Definition: dl_comp.h:922
__STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource(COMP_Regs *comp)
Get the reference source for the comparator.
Definition: dl_comp.h:965
__STATIC_INLINE void DL_COMP_enableShortInputTerminals(COMP_Regs *comp)
Enable shorting of the comparator inputs.
Definition: dl_comp.h:582
Definition: dl_comp.h:137
DL_COMP_MODE
Definition: dl_comp.h:127
DL_COMP_REF_SOURCE source
Definition: dl_comp.h:339
__STATIC_INLINE void DL_COMP_enable(COMP_Regs *comp)
Enable the comparator peripheral.
Definition: dl_comp.h:463
DL_COMP_HYSTERESIS
Definition: dl_comp.h:143
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts(COMP_Regs *comp, uint32_t interruptMask)
Check which COMP interrupts are enabled.
Definition: dl_comp.h:1311
Definition: dl_comp.h:203
Definition: dl_comp.h:145
__STATIC_INLINE void DL_COMP_refVoltageInit(COMP_Regs *comp, DL_COMP_RefVoltageConfig *config)
Initialize the comparator reference voltage generator.
Definition: dl_comp.h:446
DL_COMP_REF_SOURCE
Definition: dl_comp.h:239
__STATIC_INLINE void DL_COMP_setDACCode1(COMP_Regs *comp, uint32_t value)
Set the 8-bit COMP input code through DACCODE1.
Definition: dl_comp.h:1166
DL_COMP_OUTPUT_INT_EDGE
Definition: dl_comp.h:135
Definition: dl_comp.h:117
Definition: dl_comp.h:185
__STATIC_INLINE bool DL_COMP_isEnabled(COMP_Regs *comp)
Checks if the comparator peripheral is enabled.
Definition: dl_comp.h:479
__STATIC_INLINE uint32_t DL_COMP_getDACCode0(COMP_Regs *comp)
Get the code value of DACCODE0.
Definition: dl_comp.h:1142
__STATIC_INLINE void DL_COMP_disableInterrupt(COMP_Regs *comp, uint32_t interruptMask)
Disable COMP interrupts.
Definition: dl_comp.h:1293
__STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge(COMP_Regs *comp)
Get the interrupt edge for the comparator output.
Definition: dl_comp.h:642
__STATIC_INLINE void DL_COMP_disableShortInputTerminals(COMP_Regs *comp)
Disable shorting the comparator inputs.
Definition: dl_comp.h:608
__STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput(COMP_Regs *comp)
Gets the comparator output.
Definition: dl_comp.h:1193
__STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity(COMP_Regs *comp)
Get the output polarity.
Definition: dl_comp.h:700
__STATIC_INLINE void DL_COMP_setDACCode0(COMP_Regs *comp, uint32_t value)
Set the 8-bit COMP input code through DACCODE0.
Definition: dl_comp.h:1128
__STATIC_INLINE void DL_COMP_init(COMP_Regs *comp, DL_COMP_Config *config)
Initialize the COMP peripheral.
Definition: dl_comp.h:422
__STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl(COMP_Regs *comp)
Get what controls the input to the COMP.
Definition: dl_comp.h:1066
Definition: dl_comp.h:293
Definition: dl_comp.h:191
Definition: dl_comp.h:199
__STATIC_INLINE void DL_COMP_enableInterrupt(COMP_Regs *comp, uint32_t interruptMask)
Enable COMP interrupts.
Definition: dl_comp.h:1279
__STATIC_INLINE bool DL_COMP_isReset(COMP_Regs *comp)
Returns if comparator was reset.
Definition: dl_comp.h:406
Definition: dl_comp.h:165
Definition: dl_comp.h:245
Definition: dl_comp.h:177
__STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled(COMP_Regs *comp)
Checks if the inputs are exchanged and if output is inverted.
Definition: dl_comp.h:556
__STATIC_INLINE void DL_COMP_setNegativeChannelInput(COMP_Regs *comp, DL_COMP_IMSEL_CHANNEL input)
Set the channel input for the negative terminal.
Definition: dl_comp.h:884
Definition: dl_comp.h:205
__STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput(COMP_Regs *comp)
Get the channel input for the negative terminal.
Definition: dl_comp.h:899
Definition: dl_comp.h:303
DL_COMP_SUBSCRIBER_INDEX
Definition: dl_comp.h:307
DL_COMP_IMSEL_CHANNEL negChannel
Definition: dl_comp.h:325
__STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput(COMP_Regs *comp)
Get whether DACCODE0 or DACCODE1 is the input to the COMP.
Definition: dl_comp.h:1102
__STATIC_INLINE void DL_COMP_setPublisherChanID(COMP_Regs *comp, uint8_t chanID)
Sets the COMP event publisher channel ID.
Definition: dl_comp.h:1399
__STATIC_INLINE void DL_COMP_reset(COMP_Regs *comp)
Resets comparator peripheral.
Definition: dl_comp.h:390
__STATIC_INLINE void DL_COMP_enableWindowComparator(COMP_Regs *comp)
Enable the window comparator.
Definition: dl_comp.h:771
__STATIC_INLINE void DL_COMP_setDACInput(COMP_Regs *comp, DL_COMP_DAC_INPUT input)
Set whether DACCODE0 or DACCODE1 is the input to the COMP.
Definition: dl_comp.h:1084
__STATIC_INLINE void DL_COMP_enablePower(COMP_Regs *comp)
Enables power on the comparator module.
Definition: dl_comp.h:354
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Check interrupt flag of enabled COMP interrupts.
Definition: dl_comp.h:1334
__STATIC_INLINE void DL_COMP_disable(COMP_Regs *comp)
Disable the comparator peripheral.
Definition: dl_comp.h:489
Definition: dl_comp.h:207
__STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID(COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index)
Gets the event subscriber channel id.
Definition: dl_comp.h:1263
Definition: dl_comp.h:189
Definition: dl_comp.h:275
Definition: dl_comp.h:183
Definition: dl_comp.h:169
DL_COMP_POLARITY polarity
Definition: dl_comp.h:327
Definition: dl_comp.h:269
DL_COMP_FILTER_DELAY
Definition: dl_comp.h:163
__STATIC_INLINE void DL_COMP_enableSampledMode(COMP_Regs *comp)
Enable sampled mode of the comparator.
Definition: dl_comp.h:1205
DL_COMP_DAC_CONTROL
Definition: dl_comp.h:283
Definition: dl_comp.h:217
Definition: dl_comp.h:167
__STATIC_INLINE void DL_COMP_disableWindowComparator(COMP_Regs *comp)
Disable the window comparator.
Definition: dl_comp.h:796
__STATIC_INLINE void DL_COMP_disableOutputFilter(COMP_Regs *comp)
Disable output filter using on-chip analog filter.
Definition: dl_comp.h:744
DL_COMP_REF_MODE mode
Definition: dl_comp.h:337
Definition: dl_comp.h:201
__STATIC_INLINE void DL_COMP_clearInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Clear pending COMP interrupts.
Definition: dl_comp.h:1385
Definition: dl_comp.h:220
__STATIC_INLINE void DL_COMP_setHysteresis(COMP_Regs *comp, DL_COMP_HYSTERESIS voltage)
Set the hysteresis voltage.
Definition: dl_comp.h:656
__STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay(COMP_Regs *comp)
Get the output filter delay.
Definition: dl_comp.h:758
__STATIC_INLINE void DL_COMP_setOutputInterruptEdge(COMP_Regs *comp, DL_COMP_OUTPUT_INT_EDGE edge)
Set the interrupt edge for the comparator output.
Definition: dl_comp.h:627
DL_COMP_IIDX
Definition: dl_comp.h:113
Definition: dl_comp.h:181
__STATIC_INLINE uint32_t DL_COMP_getEnabledEvents(COMP_Regs *comp, uint32_t eventMask)
Check which COMP events are enabled.
Definition: dl_comp.h:1456
__STATIC_INLINE DL_COMP_ENABLE_CHANNEL DL_COMP_getEnabledInputChannels(COMP_Regs *comp)
Get the enabled input channels.
Definition: dl_comp.h:826
Definition: dl_comp.h:309
Definition: dl_comp.h:267
Definition: dl_comp.h:157
__STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus(COMP_Regs *comp, uint32_t eventMask)
Check event flag of enabled COMP event.
Definition: dl_comp.h:1479
DL_COMP_DAC_INPUT
Definition: dl_comp.h:291
__STATIC_INLINE void DL_COMP_setReferenceSource(COMP_Regs *comp, DL_COMP_REF_SOURCE source)
Set the reference source for the comparator.
Definition: dl_comp.h:950
DL_COMP_IPSEL_CHANNEL posChannel
Definition: dl_comp.h:323
__STATIC_INLINE void DL_COMP_enableOutputFilter(COMP_Regs *comp, DL_COMP_FILTER_DELAY delay)
Enable output filter.
Definition: dl_comp.h:718
DL_COMP_IMSEL_CHANNEL
Definition: dl_comp.h:195
__STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource(COMP_Regs *comp)
Get the blanking source for the comparator.
Definition: dl_comp.h:1031
__STATIC_INLINE void DL_COMP_setPositiveChannelInput(COMP_Regs *comp, DL_COMP_IPSEL_CHANNEL input)
Set the channel input for the positive terminal.
Definition: dl_comp.h:848
DL_COMP_DAC_CONTROL controlSelect
Definition: dl_comp.h:343
Definition: dl_comp.h:248
__STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Check interrupt flag of any COMP interrupt.
Definition: dl_comp.h:1355
__STATIC_INLINE bool DL_COMP_isOutputFilterEnabled(COMP_Regs *comp)
Checks if output filter is enabled.
Definition: dl_comp.h:734
DL_COMP_REF_MODE
Definition: dl_comp.h:229
Definition: dl_comp.h:232
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale