27 #define COMP_E_CMSIS(x) ((COMP_E_Type *) x)
29 #define COMP_E_FILTEROUTPUT_OFF 0x00
30 #define COMP_E_FILTEROUTPUT_DLYLVL1 (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_0)
31 #define COMP_E_FILTEROUTPUT_DLYLVL2 (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_1)
32 #define COMP_E_FILTEROUTPUT_DLYLVL3 (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_2)
33 #define COMP_E_FILTEROUTPUT_DLYLVL4 (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_3)
35 #define COMP_E_INPUT0 (0x01)
36 #define COMP_E_INPUT1 (0x02)
37 #define COMP_E_INPUT2 (0x04)
38 #define COMP_E_INPUT3 (0x08)
39 #define COMP_E_INPUT4 (0x10)
40 #define COMP_E_INPUT5 (0x20)
41 #define COMP_E_INPUT6 (0x40)
42 #define COMP_E_INPUT7 (0x80)
43 #define COMP_E_INPUT8 (0x100)
44 #define COMP_E_INPUT9 (0x200)
45 #define COMP_E_INPUT10 (0x400)
46 #define COMP_E_INPUT11 (0x800)
47 #define COMP_E_INPUT12 (0x1000)
48 #define COMP_E_INPUT13 (0x2000)
49 #define COMP_E_INPUT14 (0x4000)
50 #define COMP_E_INPUT15 (0x8000)
51 #define COMP_E_VREF (0x9F)
53 #define COMP_E_NORMALOUTPUTPOLARITY (!(COMP_E_CTL1_OUTPOL))
54 #define COMP_E_INVERTEDOUTPUTPOLARITY (COMP_E_CTL1_OUTPOL)
56 #define COMP_E_REFERENCE_AMPLIFIER_DISABLED (COMP_E_CTL2_CEREFL_0)
57 #define COMP_E_VREFBASE1_2V (COMP_E_CTL2_CEREFL_1)
58 #define COMP_E_VREFBASE2_0V (COMP_E_CTL2_CEREFL_2)
59 #define COMP_E_VREFBASE2_5V (COMP_E_CTL2_CEREFL_3)
61 #define COMP_E_ACCURACY_STATIC (!COMP_E_CTL2_REFACC)
62 #define COMP_E_ACCURACY_CLOCKED (COMP_E_CTL2_REFACC)
64 #define COMP_E_HIGH_SPEED_MODE (COMP_E_CTL1_PWRMD_0)
65 #define COMP_E_NORMAL_MODE (COMP_E_CTL1_PWRMD_1)
66 #define COMP_E_ULTRA_LOW_POWER_MODE (COMP_E_CTL1_PWRMD_2)
68 #define COMP_E_OUTPUT_INTERRUPT (COMP_E_INT_IE)
69 #define COMP_E_INVERTED_POLARITY_INTERRUPT (COMP_E_INT_IIE)
70 #define COMP_E_READY_INTERRUPT (COMP_E_INT_RDYIE)
72 #define COMP_E_OUTPUT_INTERRUPT_FLAG (COMP_E_INT_IFG)
73 #define COMP_E_INTERRUPT_FLAG_INVERTED_POLARITY (COMP_E_INT_IIFG)
74 #define COMP_E_INTERRUPT_FLAG_READY (COMP_E_INT_RDYIFG)
76 #define COMP_E_FALLINGEDGE (!(COMP_E_CTL1_IES))
77 #define COMP_E_RISINGEDGE (COMP_E_CTL1_IES)
79 #define COMP_E_LOW (0x0)
80 #define COMP_E_HIGH (COMP_E_CTL1_OUT)
224 uint_fast16_t supplyVoltageReferenceBase,
225 uint_fast16_t lowerLimitSupplyVoltageFractionOf32,
226 uint_fast16_t upperLimitSupplyVoltageFractionOf32);
250 uint_fast16_t referenceAccuracy);
383 uint_fast16_t inputPort);
423 uint_fast16_t inputPort);
605 uint_fast8_t edgeDirection);
650 void (*intHandler)(
void));
674 #define COMP_E_enable(a) COMP_E_enableModule(a)
675 #define COMP_E_disable(a) COMP_E_disableModule(a)
676 #define COMP_E_IOSwap(a) COMP_E_swapIO(a)
677 #define COMP_E_interruptToggleEdgeDirection(a) COMP_E_toggleInterruptEdgeDirection(a)
678 #define COMP_E_clearInterrupt(a,b) COMP_E_clearInterruptFlag(a,b)
void COMP_E_clearInterruptFlag(uint32_t comparator, uint_fast16_t mask)
Definition: comp_e.c:219
uint_fast8_t outputFilterEnableAndDelayLevel
Definition: comp_e.h:96
void COMP_E_setReferenceAccuracy(uint32_t comparator, uint_fast16_t referenceAccuracy)
Definition: comp_e.c:138
void COMP_E_swapIO(uint32_t comparator)
Definition: comp_e.c:192
void COMP_E_enableInterrupt(uint32_t comparator, uint_fast16_t mask)
Definition: comp_e.c:202
void COMP_E_setInterruptEdgeDirection(uint32_t comparator, uint_fast8_t edgeDirection)
Definition: comp_e.c:231
void COMP_E_enableInputBuffer(uint32_t comparator, uint_fast16_t inputPort)
Definition: comp_e.c:185
void COMP_E_unshortInputs(uint32_t comparator)
Definition: comp_e.c:173
void COMP_E_disableModule(uint32_t comparator)
Definition: comp_e.c:163
void COMP_E_unregisterInterrupt(uint32_t comparator)
Definition: comp_e.c:265
struct _COMP_E_Config COMP_E_Config
Type definition for _COMP_E_Config structure.
Definition: comp_e.h:92
uint8_t COMP_E_outputValue(uint32_t comparator)
Definition: comp_e.c:197
uint_fast16_t COMP_E_getInterruptStatus(uint32_t comparator)
Definition: comp_e.c:224
uint_fast16_t positiveTerminalInput
Definition: comp_e.h:94
uint_fast16_t powerMode
Definition: comp_e.h:98
void COMP_E_toggleInterruptEdgeDirection(uint32_t comparator)
Definition: comp_e.c:243
void COMP_E_setReferenceVoltage(uint32_t comparator, uint_fast16_t supplyVoltageReferenceBase, uint_fast16_t lowerLimitSupplyVoltageFractionOf32, uint_fast16_t upperLimitSupplyVoltageFractionOf32)
Definition: comp_e.c:106
uint_fast16_t COMP_E_getEnabledInterruptStatus(uint32_t comparator)
Definition: comp_e.c:208
bool COMP_E_initModule(uint32_t comparator, const COMP_E_Config *config)
Definition: comp_e.c:50
void COMP_E_enableModule(uint32_t comparator)
Definition: comp_e.c:158
void COMP_E_disableInputBuffer(uint32_t comparator, uint_fast16_t inputPort)
Definition: comp_e.c:178
void COMP_E_registerInterrupt(uint32_t comparator, void(*intHandler)(void))
Definition: comp_e.c:248
uint_fast8_t invertedOutputPolarity
Definition: comp_e.h:97
void COMP_E_disableInterrupt(uint32_t comparator, uint_fast16_t mask)
Definition: comp_e.c:214
void COMP_E_shortInputs(uint32_t comparator)
Definition: comp_e.c:168
void COMP_E_setPowerMode(uint32_t comparator, uint_fast16_t powerMode)
Definition: comp_e.c:152
uint_fast16_t negativeTerminalInput
Definition: comp_e.h:95