MSPM0GX51X Driver Library  2.05.01.00
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 #ifdef COMP_SYS_DACOUT_EN
65 
68 #define DEVICE_HAS_DAC_OUT_TO_PIN
69 #endif /* COMP_SYS_DACOUT_EN */
70 
71 /* clang-format off */
72 
79 #define DL_COMP_INTERRUPT_OUTPUT_READY (COMP_CPU_INT_IMASK_OUTRDYIFG_SET)
80 
85 #define DL_COMP_INTERRUPT_OUTPUT_EDGE (COMP_CPU_INT_IMASK_COMPIFG_SET)
86 
91 #define DL_COMP_INTERRUPT_OUTPUT_EDGE_INV (COMP_CPU_INT_IMASK_COMPINVIFG_SET)
92 
101 #define DL_COMP_EVENT_OUTPUT_READY (COMP_GEN_EVENT_IMASK_OUTRDYIFG_SET)
102 
107 #define DL_COMP_EVENT_OUTPUT_EDGE (COMP_GEN_EVENT_IMASK_COMPIFG_SET)
108 
113 #define DL_COMP_EVENT_OUTPUT_EDGE_INV (COMP_GEN_EVENT_IMASK_COMPINVIFG_SET)
114 
117 /* clang-format on */
118 
120 typedef enum {
122  DL_COMP_IIDX_NO_INTERRUPT = COMP_CPU_INT_IIDX_STAT_NO_INTR,
124  DL_COMP_IIDX_OUTPUT_READY = COMP_CPU_INT_IIDX_STAT_OUTRDYIFG,
127  DL_COMP_IIDX_OUTPUT_EDGE = COMP_CPU_INT_IIDX_STAT_COMPIFG,
130  DL_COMP_IIDX_OUTPUT_EDGE_INV = COMP_CPU_INT_IIDX_STAT_COMPINVIFG,
131 } DL_COMP_IIDX;
132 
134 typedef enum {
136  DL_COMP_MODE_FAST = COMP_CTL1_MODE_FAST,
138  DL_COMP_MODE_ULP = COMP_CTL1_MODE_ULP,
139 } DL_COMP_MODE;
140 
142 typedef enum {
144  DL_COMP_OUTPUT_INT_EDGE_RISING = COMP_CTL1_IES_RISING,
146  DL_COMP_OUTPUT_INT_EDGE_FALLING = COMP_CTL1_IES_FALLING,
148 
150 typedef enum {
152  DL_COMP_HYSTERESIS_NONE = COMP_CTL1_HYST_NO_HYS,
154  DL_COMP_HYSTERESIS_10 = COMP_CTL1_HYST_LOW_HYS,
156  DL_COMP_HYSTERESIS_20 = COMP_CTL1_HYST_MED_HYS,
158  DL_COMP_HYSTERESIS_30 = COMP_CTL1_HYST_HIGH_HYS,
160 
162 typedef enum {
164  DL_COMP_POLARITY_NON_INV = COMP_CTL1_OUTPOL_NON_INV,
166  DL_COMP_POLARITY_INV = COMP_CTL1_OUTPOL_INV,
168 
170 typedef enum {
172  DL_COMP_FILTER_DELAY_70 = COMP_CTL1_FLTDLY_DLY_0,
174  DL_COMP_FILTER_DELAY_500 = COMP_CTL1_FLTDLY_DLY_1,
176  DL_COMP_FILTER_DELAY_1200 = COMP_CTL1_FLTDLY_DLY_2,
178  DL_COMP_FILTER_DELAY_2700 = COMP_CTL1_FLTDLY_DLY_3,
180 
182 typedef enum {
184  DL_COMP_IPSEL_CHANNEL_0 = COMP_CTL0_IPSEL_CH_0,
186  DL_COMP_IPSEL_CHANNEL_1 = COMP_CTL0_IPSEL_CH_1,
188  DL_COMP_IPSEL_CHANNEL_2 = COMP_CTL0_IPSEL_CH_2,
190  DL_COMP_IPSEL_CHANNEL_3 = COMP_CTL0_IPSEL_CH_3,
192  DL_COMP_IPSEL_CHANNEL_4 = COMP_CTL0_IPSEL_CH_4,
194  DL_COMP_IPSEL_CHANNEL_5 = COMP_CTL0_IPSEL_CH_5,
196  DL_COMP_IPSEL_CHANNEL_6 = COMP_CTL0_IPSEL_CH_6,
198  DL_COMP_IPSEL_CHANNEL_7 = COMP_CTL0_IPSEL_CH_7,
200 
202 typedef enum {
204  DL_COMP_IMSEL_CHANNEL_0 = COMP_CTL0_IMSEL_CH_0,
206  DL_COMP_IMSEL_CHANNEL_1 = COMP_CTL0_IMSEL_CH_1,
208  DL_COMP_IMSEL_CHANNEL_2 = COMP_CTL0_IMSEL_CH_2,
210  DL_COMP_IMSEL_CHANNEL_3 = COMP_CTL0_IMSEL_CH_3,
212  DL_COMP_IMSEL_CHANNEL_4 = COMP_CTL0_IMSEL_CH_4,
214  DL_COMP_IMSEL_CHANNEL_5 = COMP_CTL0_IMSEL_CH_5,
216  DL_COMP_IMSEL_CHANNEL_6 = COMP_CTL0_IMSEL_CH_6,
218  DL_COMP_IMSEL_CHANNEL_7 = COMP_CTL0_IMSEL_CH_7,
220 
222 typedef enum {
225  (COMP_CTL0_IPEN_DISABLE | COMP_CTL0_IMEN_DISABLE),
227  DL_COMP_ENABLE_CHANNEL_POS = COMP_CTL0_IPEN_ENABLE,
229  DL_COMP_ENABLE_CHANNEL_NEG = COMP_CTL0_IMEN_ENABLE,
232  (COMP_CTL0_IPEN_ENABLE | COMP_CTL0_IMEN_ENABLE),
234 
236 typedef enum {
239  DL_COMP_REF_MODE_STATIC = COMP_CTL2_REFMODE_STATIC,
242  DL_COMP_REF_MODE_SAMPLED = COMP_CTL2_REFMODE_SAMPLED,
244 
246 typedef enum {
249  DL_COMP_REF_SOURCE_NONE = COMP_CTL2_REFSRC_OFF,
252  DL_COMP_REF_SOURCE_VDDA_DAC = COMP_CTL2_REFSRC_VDDA_DAC,
255  DL_COMP_REF_SOURCE_VREF_DAC = COMP_CTL2_REFSRC_VREF_DAC,
258  DL_COMP_REF_SOURCE_VREF = COMP_CTL2_REFSRC_VREF,
261  DL_COMP_REF_SOURCE_VDDA = COMP_CTL2_REFSRC_VDDA,
264  DL_COMP_REF_SOURCE_INT_VREF_DAC = COMP_CTL2_REFSRC_INTVREF_DAC,
265 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_MSPM0L122X_L222X)
266 
267  DL_COMP_REF_SOURCE_INT_VREF = COMP_CTL2_REFSRC_INTVREF,
268 #endif
270 
272 typedef enum {
275  DL_COMP_REF_TERMINAL_SELECT_POS = COMP_CTL2_REFSEL_POSITIVE,
278  DL_COMP_REF_TERMINAL_SELECT_NEG = COMP_CTL2_REFSEL_NEGATIVE,
280 
282 typedef enum {
284  DL_COMP_BLANKING_SOURCE_DISABLE = COMP_CTL2_BLANKSRC_DISABLE,
286  DL_COMP_BLANKING_SOURCE_1 = COMP_CTL2_BLANKSRC_BLANKSRC1,
288  DL_COMP_BLANKING_SOURCE_2 = COMP_CTL2_BLANKSRC_BLANKSRC2,
290  DL_COMP_BLANKING_SOURCE_3 = COMP_CTL2_BLANKSRC_BLANKSRC3,
292  DL_COMP_BLANKING_SOURCE_4 = COMP_CTL2_BLANKSRC_BLANKSRC4,
294  DL_COMP_BLANKING_SOURCE_5 = COMP_CTL2_BLANKSRC_BLANKSRC5,
296  DL_COMP_BLANKING_SOURCE_6 = COMP_CTL2_BLANKSRC_BLANKSRC6,
298 
300 typedef enum {
302  DL_COMP_DAC_CONTROL_COMP_OUT = COMP_CTL2_DACCTL_COMPOUT_SEL,
304  DL_COMP_DAC_CONTROL_SW = COMP_CTL2_DACCTL_DACSW_SEL,
306 
308 typedef enum {
310  DL_COMP_DAC_INPUT_DACCODE0 = COMP_CTL2_DACSW_DACCODE0_SEL,
312  DL_COMP_DAC_INPUT_DACCODE1 = COMP_CTL2_DACSW_DACCODE1_SEL,
314 
316 typedef enum {
318  DL_COMP_OUTPUT_LOW = COMP_STAT_OUT_LOW,
320  DL_COMP_OUTPUT_HIGH = COMP_STAT_OUT_HIGH,
322 
324 typedef enum {
330 
334 typedef struct {
336  DL_COMP_MODE mode;
340  DL_COMP_IPSEL_CHANNEL posChannel;
342  DL_COMP_IMSEL_CHANNEL negChannel;
344  DL_COMP_POLARITY polarity;
346  DL_COMP_HYSTERESIS hysteresis;
348 
352 typedef struct {
354  DL_COMP_REF_MODE mode;
356  DL_COMP_REF_SOURCE source;
358  DL_COMP_REF_TERMINAL_SELECT terminalSelect;
360  DL_COMP_DAC_CONTROL controlSelect;
363  DL_COMP_DAC_INPUT inputSelect;
365 
377 __STATIC_INLINE void DL_COMP_enablePower(COMP_Regs *comp)
378 {
379  comp->GPRCM.PWREN = (COMP_PWREN_KEY_UNLOCK_W | COMP_PWREN_ENABLE_ENABLE);
380 }
381 
393 __STATIC_INLINE void DL_COMP_disablePower(COMP_Regs *comp)
394 {
395  comp->GPRCM.PWREN = (COMP_PWREN_KEY_UNLOCK_W | COMP_PWREN_ENABLE_DISABLE);
396 }
397 
416 __STATIC_INLINE bool DL_COMP_isPowerEnabled(COMP_Regs *comp)
417 {
418  return ((comp->GPRCM.PWREN & COMP_PWREN_ENABLE_MASK) ==
419  COMP_PWREN_ENABLE_ENABLE);
420 }
421 
427 __STATIC_INLINE void DL_COMP_reset(COMP_Regs *comp)
428 {
429  comp->GPRCM.RSTCTL =
430  (COMP_RSTCTL_KEY_UNLOCK_W | COMP_RSTCTL_RESETSTKYCLR_CLR |
431  COMP_RSTCTL_RESETASSERT_ASSERT);
432 }
433 
443 __STATIC_INLINE bool DL_COMP_isReset(COMP_Regs *comp)
444 {
445  return ((comp->GPRCM.STAT & COMP_GPRCM_STAT_RESETSTKY_MASK) ==
446  COMP_GPRCM_STAT_RESETSTKY_RESET);
447 }
448 
459 __STATIC_INLINE void DL_COMP_init(COMP_Regs *comp, DL_COMP_Config *config)
460 {
461  DL_Common_updateReg(&comp->CTL0,
462  (uint32_t) config->posChannel | (uint32_t) config->negChannel |
463  (uint32_t) config->channelEnable,
464  COMP_CTL0_IMSEL_MASK | COMP_CTL0_IPSEL_MASK | COMP_CTL0_IPEN_MASK |
465  COMP_CTL0_IMEN_MASK);
466 
467  DL_Common_updateReg(&comp->CTL1,
468  (uint32_t) config->mode | (uint32_t) config->polarity |
469  (uint32_t) config->hysteresis,
470  COMP_CTL1_MODE_MASK | COMP_CTL1_HYST_MASK | COMP_CTL1_OUTPOL_MASK);
471 }
472 
483 __STATIC_INLINE void DL_COMP_refVoltageInit(
484  COMP_Regs *comp, DL_COMP_RefVoltageConfig *config)
485 {
486  DL_Common_updateReg(&comp->CTL2,
487  (uint32_t) config->mode | (uint32_t) config->source |
488  (uint32_t) config->terminalSelect |
489  (uint32_t) config->controlSelect | (uint32_t) config->inputSelect,
490  COMP_CTL2_REFMODE_MASK | COMP_CTL2_REFSRC_MASK |
491  COMP_CTL2_REFSEL_MASK | COMP_CTL2_DACCTL_MASK |
492  COMP_CTL2_DACSW_MASK);
493 }
494 
500 __STATIC_INLINE void DL_COMP_enable(COMP_Regs *comp)
501 {
502  comp->CTL1 |= COMP_CTL1_ENABLE_ON;
503 }
504 
516 __STATIC_INLINE bool DL_COMP_isEnabled(COMP_Regs *comp)
517 {
518  return ((comp->CTL1 & COMP_CTL1_ENABLE_MASK) == COMP_CTL1_ENABLE_ON);
519 }
520 
526 __STATIC_INLINE void DL_COMP_disable(COMP_Regs *comp)
527 {
528  comp->CTL1 &= ~(COMP_CTL1_ENABLE_MASK);
529 }
530 
546 __STATIC_INLINE void DL_COMP_setCompMode(COMP_Regs *comp, DL_COMP_MODE mode)
547 {
548  DL_Common_updateReg(&comp->CTL1, (uint32_t) mode, COMP_CTL1_MODE_MASK);
549 }
550 
560 __STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode(COMP_Regs *comp)
561 {
562  uint32_t mode = (comp->CTL1 & COMP_CTL1_MODE_MASK);
563 
564  return (DL_COMP_MODE)(mode);
565 }
566 
577 __STATIC_INLINE void DL_COMP_enableExchangeInputs(COMP_Regs *comp)
578 {
579  comp->CTL1 |= COMP_CTL1_EXCH_EXC;
580 }
581 
593 __STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled(COMP_Regs *comp)
594 {
595  return ((comp->CTL1 & COMP_CTL1_EXCH_MASK) == COMP_CTL1_EXCH_EXC);
596 }
597 
606 __STATIC_INLINE void DL_COMP_disableExchangeInputs(COMP_Regs *comp)
607 {
608  comp->CTL1 &= ~(COMP_CTL1_EXCH_MASK);
609 }
610 
619 __STATIC_INLINE void DL_COMP_enableShortInputTerminals(COMP_Regs *comp)
620 {
621  comp->CTL1 |= COMP_CTL1_SHORT_SHT;
622 }
623 
635 __STATIC_INLINE bool DL_COMP_isInputTerminalsShorted(COMP_Regs *comp)
636 {
637  return ((comp->CTL1 & COMP_CTL1_SHORT_MASK) == COMP_CTL1_SHORT_SHT);
638 }
639 
645 __STATIC_INLINE void DL_COMP_disableShortInputTerminals(COMP_Regs *comp)
646 {
647  comp->CTL1 &= ~(COMP_CTL1_SHORT_MASK);
648 }
649 
664 __STATIC_INLINE void DL_COMP_setOutputInterruptEdge(
665  COMP_Regs *comp, DL_COMP_OUTPUT_INT_EDGE edge)
666 {
667  DL_Common_updateReg(&comp->CTL1, (uint32_t) edge, COMP_CTL1_IES_MASK);
668 }
669 
679 __STATIC_INLINE DL_COMP_OUTPUT_INT_EDGE DL_COMP_getOutputInterruptEdge(
680  COMP_Regs *comp)
681 {
682  uint32_t interruptEdge = (comp->CTL1 & COMP_CTL1_IES_MASK);
683 
684  return (DL_COMP_OUTPUT_INT_EDGE)(interruptEdge);
685 }
686 
693 __STATIC_INLINE void DL_COMP_setHysteresis(
694  COMP_Regs *comp, DL_COMP_HYSTERESIS voltage)
695 {
696  DL_Common_updateReg(&comp->CTL1, (uint32_t) voltage, COMP_CTL1_HYST_MASK);
697 }
698 
708 __STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis(COMP_Regs *comp)
709 {
710  uint32_t hysteresis = (comp->CTL1 & COMP_CTL1_HYST_MASK);
711 
712  return (DL_COMP_HYSTERESIS)(hysteresis);
713 }
714 
721 __STATIC_INLINE void DL_COMP_setOutputPolarity(
722  COMP_Regs *comp, DL_COMP_POLARITY polarity)
723 {
725  &comp->CTL1, (uint32_t) polarity, COMP_CTL1_OUTPOL_MASK);
726 }
727 
737 __STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity(COMP_Regs *comp)
738 {
739  uint32_t polarity = (comp->CTL1 & COMP_CTL1_OUTPOL_MASK);
740 
741  return (DL_COMP_POLARITY)(polarity);
742 }
743 
755 __STATIC_INLINE void DL_COMP_enableOutputFilter(
756  COMP_Regs *comp, DL_COMP_FILTER_DELAY delay)
757 {
758  comp->CTL1 |= (COMP_CTL1_FLTEN_ENABLE | (uint32_t) delay);
759 }
760 
771 __STATIC_INLINE bool DL_COMP_isOutputFilterEnabled(COMP_Regs *comp)
772 {
773  return ((comp->CTL1 & COMP_CTL1_FLTEN_MASK) == COMP_CTL1_FLTEN_ENABLE);
774 }
775 
781 __STATIC_INLINE void DL_COMP_disableOutputFilter(COMP_Regs *comp)
782 {
783  comp->CTL1 &= ~(COMP_CTL1_FLTEN_MASK);
784 }
785 
795 __STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay(
796  COMP_Regs *comp)
797 {
798  uint32_t delay = (comp->CTL1 & COMP_CTL1_FLTDLY_MASK);
799 
800  return (DL_COMP_FILTER_DELAY)(delay);
801 }
802 
808 __STATIC_INLINE void DL_COMP_enableWindowComparator(COMP_Regs *comp)
809 {
810  comp->CTL1 |= COMP_CTL1_WINCOMPEN_ON;
811 }
812 
823 __STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled(COMP_Regs *comp)
824 {
825  return ((comp->CTL1 & COMP_CTL1_WINCOMPEN_MASK) == COMP_CTL1_WINCOMPEN_ON);
826 }
827 
833 __STATIC_INLINE void DL_COMP_disableWindowComparator(COMP_Regs *comp)
834 {
835  comp->CTL1 &= ~(COMP_CTL1_WINCOMPEN_MASK);
836 }
837 
838 #ifdef DEVICE_HAS_DAC_OUT_TO_PIN
839 
847 __STATIC_INLINE void DL_COMP_enableDACOutputToPin(COMP_Regs *comp)
848 {
849  comp->CTL1 |= COMP_CTL1_DACOUTEN_ENABLE;
850 }
851 
862 __STATIC_INLINE bool DL_COMP_isDACOutputToPinEnabled(COMP_Regs *comp)
863 {
864  return (
865  (comp->CTL1 & COMP_CTL1_DACOUTEN_MASK) == COMP_CTL1_DACOUTEN_ENABLE);
866 }
867 
873 __STATIC_INLINE void DL_COMP_disableDACOutputToPin(COMP_Regs *comp)
874 {
875  comp->CTL1 &= ~(COMP_CTL1_DACOUTEN_MASK);
876 }
877 
878 #endif /* DEVICE_HAS_DAC_OUT_TO_PIN */
879 
889 __STATIC_INLINE void DL_COMP_setEnabledInputChannels(
890  COMP_Regs *comp, DL_COMP_ENABLE_CHANNEL channels)
891 {
892  DL_Common_updateReg(&comp->CTL0, (uint32_t) channels,
893  (COMP_CTL0_IMEN_MASK | COMP_CTL0_IPEN_MASK));
894 }
895 
906  COMP_Regs *comp)
907 {
908  uint32_t channel =
909  (comp->CTL0 & (COMP_CTL0_IMEN_MASK | COMP_CTL0_IPEN_MASK));
910 
911  return (DL_COMP_ENABLE_CHANNEL)(channel);
912 }
913 
927 __STATIC_INLINE void DL_COMP_setPositiveChannelInput(
928  COMP_Regs *comp, DL_COMP_IPSEL_CHANNEL input)
929 {
930  DL_Common_updateReg(&comp->CTL0, (uint32_t) input, COMP_CTL0_IPSEL_MASK);
931 }
932 
942 __STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput(
943  COMP_Regs *comp)
944 {
945  uint32_t channel = (comp->CTL0 & COMP_CTL0_IPSEL_MASK);
946 
947  return (DL_COMP_IPSEL_CHANNEL)(channel);
948 }
949 
963 __STATIC_INLINE void DL_COMP_setNegativeChannelInput(
964  COMP_Regs *comp, DL_COMP_IMSEL_CHANNEL input)
965 {
966  DL_Common_updateReg(&comp->CTL0, (uint32_t) input, COMP_CTL0_IMSEL_MASK);
967 }
968 
978 __STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput(
979  COMP_Regs *comp)
980 {
981  uint32_t channel = (comp->CTL0 & COMP_CTL0_IMSEL_MASK);
982 
983  return (DL_COMP_IMSEL_CHANNEL)(channel);
984 }
985 
1001 __STATIC_INLINE void DL_COMP_setReferenceMode(
1002  COMP_Regs *comp, DL_COMP_REF_MODE mode)
1003 {
1004  DL_Common_updateReg(&comp->CTL2, (uint32_t) mode, COMP_CTL2_REFMODE_MASK);
1005 }
1006 
1016 __STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode(COMP_Regs *comp)
1017 {
1018  uint32_t mode = (comp->CTL2 & COMP_CTL2_REFMODE_MASK);
1019 
1020  return (DL_COMP_REF_MODE)(mode);
1021 }
1022 
1029 __STATIC_INLINE void DL_COMP_setReferenceSource(
1030  COMP_Regs *comp, DL_COMP_REF_SOURCE source)
1031 {
1032  DL_Common_updateReg(&comp->CTL2, (uint32_t) source, COMP_CTL2_REFSRC_MASK);
1033 }
1034 
1044 __STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource(COMP_Regs *comp)
1045 {
1046  uint32_t source = (comp->CTL2 & COMP_CTL2_REFSRC_MASK);
1047 
1048  return (DL_COMP_REF_SOURCE)(source);
1049 }
1050 
1065  COMP_Regs *comp, DL_COMP_REF_TERMINAL_SELECT terminal)
1066 {
1068  &comp->CTL2, (uint32_t) terminal, COMP_CTL2_REFSEL_MASK);
1069 }
1070 
1080 __STATIC_INLINE DL_COMP_REF_TERMINAL_SELECT DL_COMP_getReferenceCompTerminal(
1081  COMP_Regs *comp)
1082 {
1083  uint32_t terminal = (comp->CTL2 & COMP_CTL2_REFSEL_MASK);
1084 
1085  return (DL_COMP_REF_TERMINAL_SELECT)(terminal);
1086 }
1087 
1094 __STATIC_INLINE void DL_COMP_setBlankingSource(
1095  COMP_Regs *comp, DL_COMP_BLANKING_SOURCE source)
1096 {
1098  &comp->CTL2, (uint32_t) source, COMP_CTL2_BLANKSRC_MASK);
1099 }
1100 
1110 __STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource(
1111  COMP_Regs *comp)
1112 {
1113  uint32_t source = (comp->CTL2 & COMP_CTL2_BLANKSRC_MASK);
1114 
1115  return (DL_COMP_BLANKING_SOURCE)(source);
1116 }
1117 
1129 __STATIC_INLINE void DL_COMP_setDACControl(
1130  COMP_Regs *comp, DL_COMP_DAC_CONTROL control)
1131 {
1133  &comp->CTL2, (uint32_t) control, COMP_CTL2_DACCTL_MASK);
1134 }
1135 
1145 __STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl(COMP_Regs *comp)
1146 {
1147  uint32_t control = (comp->CTL2 & COMP_CTL2_DACCTL_MASK);
1148 
1149  return (DL_COMP_DAC_CONTROL)(control);
1150 }
1151 
1163 __STATIC_INLINE void DL_COMP_setDACInput(
1164  COMP_Regs *comp, DL_COMP_DAC_INPUT input)
1165 {
1166  DL_Common_updateReg(&comp->CTL2, (uint32_t) input, COMP_CTL2_DACSW_MASK);
1167 }
1168 
1181 __STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput(COMP_Regs *comp)
1182 {
1183  uint32_t input = (comp->CTL2 & COMP_CTL2_DACSW_MASK);
1184 
1185  return (DL_COMP_DAC_INPUT)(input);
1186 }
1187 
1207 __STATIC_INLINE void DL_COMP_setDACCode0(COMP_Regs *comp, uint32_t value)
1208 {
1209  DL_Common_updateReg(&comp->CTL3, value, COMP_CTL3_DACCODE0_MASK);
1210 }
1211 
1221 __STATIC_INLINE uint32_t DL_COMP_getDACCode0(COMP_Regs *comp)
1222 {
1223  return (comp->CTL3 & COMP_CTL3_DACCODE0_MASK);
1224 }
1225 
1245 __STATIC_INLINE void DL_COMP_setDACCode1(COMP_Regs *comp, uint32_t value)
1246 {
1247  DL_Common_updateReg(&comp->CTL3, (value << COMP_CTL3_DACCODE1_OFS),
1248  COMP_CTL3_DACCODE1_MASK);
1249 }
1250 
1260 __STATIC_INLINE uint32_t DL_COMP_getDACCode1(COMP_Regs *comp)
1261 {
1262  return ((comp->CTL3 & COMP_CTL3_DACCODE1_MASK) >> COMP_CTL3_DACCODE1_OFS);
1263 }
1264 
1272 __STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput(COMP_Regs *comp)
1273 {
1274  uint32_t output = (comp->STAT & COMP_STAT_OUT_MASK);
1275 
1276  return (DL_COMP_OUTPUT)(output);
1277 }
1278 
1284 __STATIC_INLINE void DL_COMP_enableSampledMode(COMP_Regs *comp)
1285 {
1286  comp->CTL2 |= COMP_CTL2_SAMPMODE_ENABLE;
1287 }
1288 
1300 __STATIC_INLINE bool DL_COMP_isSampledModeEnabled(COMP_Regs *comp)
1301 {
1302  return (
1303  (comp->CTL2 & COMP_CTL2_SAMPMODE_MASK) == COMP_CTL2_SAMPMODE_ENABLE);
1304 }
1305 
1311 __STATIC_INLINE void DL_COMP_disableSampledMode(COMP_Regs *comp)
1312 {
1313  comp->CTL2 &= ~(COMP_CTL2_SAMPMODE_MASK);
1314 }
1315 
1325 __STATIC_INLINE void DL_COMP_setSubscriberChanID(
1326  COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index, uint8_t chanID)
1327 {
1328  volatile uint32_t *pReg = &comp->FSUB_0;
1329 
1330  *(pReg + (uint32_t) index) = (chanID & COMP_FSUB_0_CHANID_MAXIMUM);
1331 }
1332 
1342 __STATIC_INLINE uint8_t DL_COMP_getSubscriberChanID(
1343  COMP_Regs *comp, DL_COMP_SUBSCRIBER_INDEX index)
1344 {
1345  volatile uint32_t *pReg = &comp->FSUB_0;
1346 
1347  return ((uint8_t)(*(pReg + (uint32_t) index) & COMP_FSUB_0_CHANID_MASK));
1348 }
1349 
1358 __STATIC_INLINE void DL_COMP_enableInterrupt(
1359  COMP_Regs *comp, uint32_t interruptMask)
1360 {
1361  comp->CPU_INT.IMASK |= interruptMask;
1362 }
1363 
1372 __STATIC_INLINE void DL_COMP_disableInterrupt(
1373  COMP_Regs *comp, uint32_t interruptMask)
1374 {
1375  comp->CPU_INT.IMASK &= ~(interruptMask);
1376 }
1377 
1390 __STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts(
1391  COMP_Regs *comp, uint32_t interruptMask)
1392 {
1393  return (comp->CPU_INT.IMASK & interruptMask);
1394 }
1395 
1413 __STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus(
1414  COMP_Regs *comp, uint32_t interruptMask)
1415 {
1416  return (comp->CPU_INT.MIS & interruptMask);
1417 }
1418 
1434 __STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus(
1435  COMP_Regs *comp, uint32_t interruptMask)
1436 {
1437  return (comp->CPU_INT.RIS & interruptMask);
1438 }
1439 
1451 __STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt(COMP_Regs *comp)
1452 {
1453  return (DL_COMP_IIDX)(comp->CPU_INT.IIDX);
1454 }
1455 
1464 __STATIC_INLINE void DL_COMP_clearInterruptStatus(
1465  COMP_Regs *comp, uint32_t interruptMask)
1466 {
1467  comp->CPU_INT.ICLR = interruptMask;
1468 }
1469 
1478 __STATIC_INLINE void DL_COMP_setPublisherChanID(
1479  COMP_Regs *comp, uint8_t chanID)
1480 {
1481  comp->FPUB_1 = (chanID & COMP_FPUB_1_CHANID_MAXIMUM);
1482 }
1483 
1492 __STATIC_INLINE uint8_t DL_COMP_getPublisherChanID(COMP_Regs *comp)
1493 {
1494  return ((uint8_t)((comp->FPUB_1) & COMP_FPUB_1_CHANID_MAXIMUM));
1495 }
1496 
1505 __STATIC_INLINE void DL_COMP_enableEvent(COMP_Regs *comp, uint32_t eventMask)
1506 {
1507  comp->GEN_EVENT.IMASK |= (eventMask);
1508 }
1509 
1518 __STATIC_INLINE void DL_COMP_disableEvent(COMP_Regs *comp, uint32_t eventMask)
1519 {
1520  comp->GEN_EVENT.IMASK &= ~(eventMask);
1521 }
1522 
1535 __STATIC_INLINE uint32_t DL_COMP_getEnabledEvents(
1536  COMP_Regs *comp, uint32_t eventMask)
1537 {
1538  return ((comp->GEN_EVENT.IMASK) & (eventMask));
1539 }
1540 
1558 __STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus(
1559  COMP_Regs *comp, uint32_t eventMask)
1560 {
1561  return ((comp->GEN_EVENT.MIS) & eventMask);
1562 }
1563 
1579 __STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus(
1580  COMP_Regs *comp, uint32_t eventMask)
1581 {
1582  return ((comp->GEN_EVENT.RIS) & eventMask);
1583 }
1584 
1593 __STATIC_INLINE void DL_COMP_clearEventsStatus(
1594  COMP_Regs *comp, uint32_t eventMask)
1595 {
1596  comp->GEN_EVENT.ICLR |= (eventMask);
1597 }
1598 
1599 /* clang-format on */
1600 
1601 #ifdef __cplusplus
1602 }
1603 #endif
1604 
1605 #endif /* __MSPM0_HAS_COMP__ */
1606 
1607 #endif /* ti_dl_m0p_dl_comp__include */
1608 
__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:889
Definition: dl_comp.h:304
__STATIC_INLINE bool DL_COMP_isInputTerminalsShorted(COMP_Regs *comp)
Checks if the comparator inputs are shorted.
Definition: dl_comp.h:635
__STATIC_INLINE void DL_COMP_enableExchangeInputs(COMP_Regs *comp)
Enable exchange of the comparator inputs, and invert output.
Definition: dl_comp.h:577
Definition: dl_comp.h:275
__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 the Peripheral Write Enable (PWREN) register for the COMP.
Definition: dl_comp.h:393
Definition: dl_comp.h:178
Definition: dl_comp.h:231
Definition: dl_comp.h:216
DL_COMP_OUTPUT
Definition: dl_comp.h:316
__STATIC_INLINE DL_COMP_IIDX DL_COMP_getPendingInterrupt(COMP_Regs *comp)
Get highest priority pending COMP interrupt.
Definition: dl_comp.h:1451
Definition: dl_comp.h:296
DL_COMP_POLARITY
Definition: dl_comp.h:162
__STATIC_INLINE void DL_COMP_clearEventsStatus(COMP_Regs *comp, uint32_t eventMask)
Clear pending COMP events.
Definition: dl_comp.h:1593
DL_COMP_BLANKING_SOURCE
Definition: dl_comp.h:282
DL_COMP_HYSTERESIS hysteresis
Definition: dl_comp.h:346
Definition: dl_comp.h:154
DL_COMP_ENABLE_CHANNEL
Definition: dl_comp.h:222
Definition: dl_comp.h:229
Configuration struct for DL_COMP_init.
Definition: dl_comp.h:334
Definition: dl_comp.h:158
__STATIC_INLINE DL_COMP_IPSEL_CHANNEL DL_COMP_getPositiveChannelInput(COMP_Regs *comp)
Get the channel input for the positive terminal.
Definition: dl_comp.h:942
Definition: dl_comp.h:156
DL_COMP_IPSEL_CHANNEL
Definition: dl_comp.h:182
Definition: dl_comp.h:186
Definition: dl_comp.h:302
DL_COMP_REF_TERMINAL_SELECT terminalSelect
Definition: dl_comp.h:358
Definition: dl_comp.h:328
Definition: dl_comp.h:138
__STATIC_INLINE DL_COMP_REF_MODE DL_COMP_getReferenceMode(COMP_Regs *comp)
Get the mode for the reference voltage.
Definition: dl_comp.h:1016
Definition: dl_comp.h:218
__STATIC_INLINE void DL_COMP_setCompMode(COMP_Regs *comp, DL_COMP_MODE mode)
Set the comparator operating mode.
Definition: dl_comp.h:546
Definition: dl_comp.h:278
Definition: dl_comp.h:267
Definition: dl_comp.h:130
Definition: dl_comp.h:194
DL_COMP_ENABLE_CHANNEL channelEnable
Definition: dl_comp.h:338
Definition: dl_comp.h:290
__STATIC_INLINE void DL_COMP_disableExchangeInputs(COMP_Regs *comp)
Disable input exchange and invert output.
Definition: dl_comp.h:606
Definition: dl_comp.h:122
__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:1325
__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:1080
Definition: dl_comp.h:166
__STATIC_INLINE bool DL_COMP_isWindowComparatorEnabled(COMP_Regs *comp)
Checks if the window comparator is enabled.
Definition: dl_comp.h:823
Definition: dl_comp.h:127
__STATIC_INLINE void DL_COMP_disableSampledMode(COMP_Regs *comp)
Disable sampled mode.
Definition: dl_comp.h:1311
Definition: dl_comp.h:242
__STATIC_INLINE void DL_COMP_enableEvent(COMP_Regs *comp, uint32_t eventMask)
Enable COMP event.
Definition: dl_comp.h:1505
Definition: dl_comp.h:288
Definition: dl_comp.h:258
Definition: dl_comp.h:146
__STATIC_INLINE void DL_COMP_setOutputPolarity(COMP_Regs *comp, DL_COMP_POLARITY polarity)
Set the output polarity.
Definition: dl_comp.h:721
__STATIC_INLINE bool DL_COMP_isSampledModeEnabled(COMP_Regs *comp)
Checks if sampled mode is enabled.
Definition: dl_comp.h:1300
Configuration struct for DL_COMP_refVoltageInit.
Definition: dl_comp.h:352
Definition: dl_comp.h:294
__STATIC_INLINE void DL_COMP_disableEvent(COMP_Regs *comp, uint32_t eventMask)
Disable COMP event.
Definition: dl_comp.h:1518
DL_COMP_REF_TERMINAL_SELECT
Definition: dl_comp.h:272
Definition: dl_comp.h:312
Definition: dl_comp.h:320
__STATIC_INLINE uint32_t DL_COMP_getRawEventsStatus(COMP_Regs *comp, uint32_t eventMask)
Check interrupt flag of any COMP event.
Definition: dl_comp.h:1579
Definition: dl_comp.h:204
__STATIC_INLINE uint8_t DL_COMP_getPublisherChanID(COMP_Regs *comp)
Gets the event publisher channel ID.
Definition: dl_comp.h:1492
DL_COMP_DAC_INPUT inputSelect
Definition: dl_comp.h:363
DriverLib Common APIs.
Definition: dl_comp.h:249
DL_COMP_MODE mode
Definition: dl_comp.h:336
__STATIC_INLINE bool DL_COMP_isPowerEnabled(COMP_Regs *comp)
Returns if the Peripheral Write Enable (PWREN) register for the COMP is enabled.
Definition: dl_comp.h:416
__STATIC_INLINE uint32_t DL_COMP_getDACCode1(COMP_Regs *comp)
Get the code value of DACCODE1.
Definition: dl_comp.h:1260
__STATIC_INLINE void DL_COMP_setDACControl(COMP_Regs *comp, DL_COMP_DAC_CONTROL control)
Select the source for DAC control.
Definition: dl_comp.h:1129
__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:1094
__STATIC_INLINE DL_COMP_MODE DL_COMP_getCompMode(COMP_Regs *comp)
Get the mode the comparator is set to.
Definition: dl_comp.h:560
Definition: dl_comp.h:136
__STATIC_INLINE DL_COMP_HYSTERESIS DL_COMP_getHysteresis(COMP_Regs *comp)
Get the hysteresis voltage.
Definition: dl_comp.h:708
__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:1064
__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:1001
__STATIC_INLINE DL_COMP_REF_SOURCE DL_COMP_getReferenceSource(COMP_Regs *comp)
Get the reference source for the comparator.
Definition: dl_comp.h:1044
Definition: dl_comp.h:261
__STATIC_INLINE void DL_COMP_enableShortInputTerminals(COMP_Regs *comp)
Enable shorting of the comparator inputs.
Definition: dl_comp.h:619
Definition: dl_comp.h:144
DL_COMP_MODE
Definition: dl_comp.h:134
DL_COMP_REF_SOURCE source
Definition: dl_comp.h:356
__STATIC_INLINE void DL_COMP_enable(COMP_Regs *comp)
Enable the comparator peripheral.
Definition: dl_comp.h:500
DL_COMP_HYSTERESIS
Definition: dl_comp.h:150
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterrupts(COMP_Regs *comp, uint32_t interruptMask)
Check which COMP interrupts are enabled.
Definition: dl_comp.h:1390
Definition: dl_comp.h:210
Definition: dl_comp.h:152
__STATIC_INLINE void DL_COMP_refVoltageInit(COMP_Regs *comp, DL_COMP_RefVoltageConfig *config)
Initialize the comparator reference voltage generator.
Definition: dl_comp.h:483
DL_COMP_REF_SOURCE
Definition: dl_comp.h:246
__STATIC_INLINE void DL_COMP_setDACCode1(COMP_Regs *comp, uint32_t value)
Set the 8-bit DAC input code through DACCODE1.
Definition: dl_comp.h:1245
DL_COMP_OUTPUT_INT_EDGE
Definition: dl_comp.h:142
Definition: dl_comp.h:124
Definition: dl_comp.h:192
__STATIC_INLINE bool DL_COMP_isEnabled(COMP_Regs *comp)
Checks if the comparator peripheral is enabled.
Definition: dl_comp.h:516
__STATIC_INLINE uint32_t DL_COMP_getDACCode0(COMP_Regs *comp)
Get the code value of DACCODE0.
Definition: dl_comp.h:1221
__STATIC_INLINE void DL_COMP_disableInterrupt(COMP_Regs *comp, uint32_t interruptMask)
Disable COMP interrupts.
Definition: dl_comp.h:1372
__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:679
__STATIC_INLINE void DL_COMP_disableShortInputTerminals(COMP_Regs *comp)
Disable shorting the comparator inputs.
Definition: dl_comp.h:645
__STATIC_INLINE DL_COMP_OUTPUT DL_COMP_getComparatorOutput(COMP_Regs *comp)
Gets the comparator output.
Definition: dl_comp.h:1272
__STATIC_INLINE DL_COMP_POLARITY DL_COMP_getOutputPolarity(COMP_Regs *comp)
Get the output polarity.
Definition: dl_comp.h:737
__STATIC_INLINE void DL_COMP_setDACCode0(COMP_Regs *comp, uint32_t value)
Set the 8-bit DAC input code through DACCODE0.
Definition: dl_comp.h:1207
__STATIC_INLINE void DL_COMP_init(COMP_Regs *comp, DL_COMP_Config *config)
Initialize the COMP peripheral.
Definition: dl_comp.h:459
__STATIC_INLINE DL_COMP_DAC_CONTROL DL_COMP_getDACControl(COMP_Regs *comp)
Get what controls the input to the DAC.
Definition: dl_comp.h:1145
Definition: dl_comp.h:310
Definition: dl_comp.h:198
Definition: dl_comp.h:206
__STATIC_INLINE void DL_COMP_enableInterrupt(COMP_Regs *comp, uint32_t interruptMask)
Enable COMP interrupts.
Definition: dl_comp.h:1358
__STATIC_INLINE bool DL_COMP_isReset(COMP_Regs *comp)
Returns if comparator was reset.
Definition: dl_comp.h:443
Definition: dl_comp.h:172
Definition: dl_comp.h:252
Definition: dl_comp.h:184
__STATIC_INLINE bool DL_COMP_isExchangeInputsEnabled(COMP_Regs *comp)
Checks if the inputs are exchanged and if output is inverted.
Definition: dl_comp.h:593
__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:963
Definition: dl_comp.h:212
__STATIC_INLINE DL_COMP_IMSEL_CHANNEL DL_COMP_getNegativeChannelInput(COMP_Regs *comp)
Get the channel input for the negative terminal.
Definition: dl_comp.h:978
Definition: dl_comp.h:318
DL_COMP_SUBSCRIBER_INDEX
Definition: dl_comp.h:324
DL_COMP_IMSEL_CHANNEL negChannel
Definition: dl_comp.h:342
__STATIC_INLINE DL_COMP_DAC_INPUT DL_COMP_getDACInput(COMP_Regs *comp)
Get whether DACCODE0 or DACCODE1 is the input to the DAC.
Definition: dl_comp.h:1181
__STATIC_INLINE void DL_COMP_setPublisherChanID(COMP_Regs *comp, uint8_t chanID)
Sets the COMP event publisher channel ID.
Definition: dl_comp.h:1478
__STATIC_INLINE void DL_COMP_reset(COMP_Regs *comp)
Resets comparator peripheral.
Definition: dl_comp.h:427
__STATIC_INLINE void DL_COMP_enableWindowComparator(COMP_Regs *comp)
Enable the window comparator.
Definition: dl_comp.h:808
__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.
Definition: dl_comp.h:1163
__STATIC_INLINE void DL_COMP_enablePower(COMP_Regs *comp)
Enables the Peripheral Write Enable (PWREN) register for the COMP.
Definition: dl_comp.h:377
__STATIC_INLINE uint32_t DL_COMP_getEnabledInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Check interrupt flag of enabled COMP interrupts.
Definition: dl_comp.h:1413
__STATIC_INLINE void DL_COMP_disable(COMP_Regs *comp)
Disable the comparator peripheral.
Definition: dl_comp.h:526
Definition: dl_comp.h:214
__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:1342
Definition: dl_comp.h:196
Definition: dl_comp.h:292
Definition: dl_comp.h:190
Definition: dl_comp.h:176
DL_COMP_POLARITY polarity
Definition: dl_comp.h:344
Definition: dl_comp.h:286
DL_COMP_FILTER_DELAY
Definition: dl_comp.h:170
__STATIC_INLINE void DL_COMP_enableSampledMode(COMP_Regs *comp)
Enable sampled mode of the comparator.
Definition: dl_comp.h:1284
DL_COMP_DAC_CONTROL
Definition: dl_comp.h:300
Definition: dl_comp.h:224
Definition: dl_comp.h:174
__STATIC_INLINE void DL_COMP_disableWindowComparator(COMP_Regs *comp)
Disable the window comparator.
Definition: dl_comp.h:833
__STATIC_INLINE void DL_COMP_disableOutputFilter(COMP_Regs *comp)
Disable output filter using on-chip analog filter.
Definition: dl_comp.h:781
DL_COMP_REF_MODE mode
Definition: dl_comp.h:354
Definition: dl_comp.h:208
__STATIC_INLINE void DL_COMP_clearInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Clear pending COMP interrupts.
Definition: dl_comp.h:1464
Definition: dl_comp.h:227
__STATIC_INLINE void DL_COMP_setHysteresis(COMP_Regs *comp, DL_COMP_HYSTERESIS voltage)
Set the hysteresis voltage.
Definition: dl_comp.h:693
__STATIC_INLINE DL_COMP_FILTER_DELAY DL_COMP_getOutputFilterDelay(COMP_Regs *comp)
Get the output filter delay.
Definition: dl_comp.h:795
__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:664
Definition: dl_comp.h:264
DL_COMP_IIDX
Definition: dl_comp.h:120
Definition: dl_comp.h:188
__STATIC_INLINE uint32_t DL_COMP_getEnabledEvents(COMP_Regs *comp, uint32_t eventMask)
Check which COMP events are enabled.
Definition: dl_comp.h:1535
__STATIC_INLINE DL_COMP_ENABLE_CHANNEL DL_COMP_getEnabledInputChannels(COMP_Regs *comp)
Get the enabled input channels.
Definition: dl_comp.h:905
Definition: dl_comp.h:326
Definition: dl_comp.h:284
Definition: dl_comp.h:164
__STATIC_INLINE uint32_t DL_COMP_getEnabledEventStatus(COMP_Regs *comp, uint32_t eventMask)
Check event flag of enabled COMP event.
Definition: dl_comp.h:1558
DL_COMP_DAC_INPUT
Definition: dl_comp.h:308
__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:1029
DL_COMP_IPSEL_CHANNEL posChannel
Definition: dl_comp.h:340
__STATIC_INLINE void DL_COMP_enableOutputFilter(COMP_Regs *comp, DL_COMP_FILTER_DELAY delay)
Enable output filter.
Definition: dl_comp.h:755
DL_COMP_IMSEL_CHANNEL
Definition: dl_comp.h:202
__STATIC_INLINE DL_COMP_BLANKING_SOURCE DL_COMP_getBlankingSource(COMP_Regs *comp)
Get the blanking source for the comparator.
Definition: dl_comp.h:1110
__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:927
DL_COMP_DAC_CONTROL controlSelect
Definition: dl_comp.h:360
Definition: dl_comp.h:255
__STATIC_INLINE uint32_t DL_COMP_getRawInterruptStatus(COMP_Regs *comp, uint32_t interruptMask)
Check interrupt flag of any COMP interrupt.
Definition: dl_comp.h:1434
__STATIC_INLINE bool DL_COMP_isOutputFilterEnabled(COMP_Regs *comp)
Checks if output filter is enabled.
Definition: dl_comp.h:771
DL_COMP_REF_MODE
Definition: dl_comp.h:236
Definition: dl_comp.h:239
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale