55 #include <ti/devices/msp432p4xx/inc/msp.h> 
   58 #define COMP_E_CMSIS(x) ((COMP_E_Type *) x) 
   60 #define COMP_E_FILTEROUTPUT_OFF                                            0x00 
   61 #define COMP_E_FILTEROUTPUT_DLYLVL1         (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_0) 
   62 #define COMP_E_FILTEROUTPUT_DLYLVL2         (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_1) 
   63 #define COMP_E_FILTEROUTPUT_DLYLVL3         (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_2) 
   64 #define COMP_E_FILTEROUTPUT_DLYLVL4         (COMP_E_CTL1_F + COMP_E_CTL1_FDLY_3) 
   66 #define COMP_E_INPUT0                                                    (0x01) 
   67 #define COMP_E_INPUT1                                                    (0x02) 
   68 #define COMP_E_INPUT2                                                    (0x04) 
   69 #define COMP_E_INPUT3                                                    (0x08) 
   70 #define COMP_E_INPUT4                                                    (0x10) 
   71 #define COMP_E_INPUT5                                                    (0x20) 
   72 #define COMP_E_INPUT6                                                    (0x40) 
   73 #define COMP_E_INPUT7                                                    (0x80) 
   74 #define COMP_E_INPUT8                                                   (0x100) 
   75 #define COMP_E_INPUT9                                                   (0x200) 
   76 #define COMP_E_INPUT10                                                  (0x400) 
   77 #define COMP_E_INPUT11                                                  (0x800) 
   78 #define COMP_E_INPUT12                                                 (0x1000) 
   79 #define COMP_E_INPUT13                                                 (0x2000) 
   80 #define COMP_E_INPUT14                                                 (0x4000) 
   81 #define COMP_E_INPUT15                                                 (0x8000) 
   82 #define COMP_E_VREF                                                      (0x9F) 
   84 #define COMP_E_NORMALOUTPUTPOLARITY                      (!(COMP_E_CTL1_OUTPOL)) 
   85 #define COMP_E_INVERTEDOUTPUTPOLARITY                       (COMP_E_CTL1_OUTPOL) 
   87 #define COMP_E_REFERENCE_AMPLIFIER_DISABLED               (COMP_E_CTL2_CEREFL_0) 
   88 #define COMP_E_VREFBASE1_2V                               (COMP_E_CTL2_CEREFL_1) 
   89 #define COMP_E_VREFBASE2_0V                               (COMP_E_CTL2_CEREFL_2) 
   90 #define COMP_E_VREFBASE2_5V                               (COMP_E_CTL2_CEREFL_3) 
   92 #define COMP_E_ACCURACY_STATIC                             (!COMP_E_CTL2_REFACC) 
   93 #define COMP_E_ACCURACY_CLOCKED                             (COMP_E_CTL2_REFACC) 
   95 #define COMP_E_HIGH_SPEED_MODE                             (COMP_E_CTL1_PWRMD_0) 
   96 #define COMP_E_NORMAL_MODE                                 (COMP_E_CTL1_PWRMD_1) 
   97 #define COMP_E_ULTRA_LOW_POWER_MODE                        (COMP_E_CTL1_PWRMD_2) 
   99 #define COMP_E_OUTPUT_INTERRUPT                                  (COMP_E_INT_IE) 
  100 #define COMP_E_INVERTED_POLARITY_INTERRUPT                      (COMP_E_INT_IIE) 
  101 #define COMP_E_READY_INTERRUPT                                (COMP_E_INT_RDYIE) 
  103 #define COMP_E_OUTPUT_INTERRUPT_FLAG                            (COMP_E_INT_IFG) 
  104 #define COMP_E_INTERRUPT_FLAG_INVERTED_POLARITY                (COMP_E_INT_IIFG) 
  105 #define COMP_E_INTERRUPT_FLAG_READY                          (COMP_E_INT_RDYIFG) 
  107 #define COMP_E_FALLINGEDGE                                     (COMP_E_CTL1_IES) 
  108 #define COMP_E_RISINGEDGE                                   (!(COMP_E_CTL1_IES)) 
  110 #define COMP_E_LOW                                                         (0x0) 
  111 #define COMP_E_HIGH                                            (COMP_E_CTL1_OUT) 
  255         uint_fast16_t supplyVoltageReferenceBase,
 
  256         uint_fast16_t lowerLimitSupplyVoltageFractionOf32,
 
  257         uint_fast16_t upperLimitSupplyVoltageFractionOf32);
 
  281         uint_fast16_t referenceAccuracy);
 
  414         uint_fast16_t inputPort);
 
  454         uint_fast16_t inputPort);
 
  636         uint_fast8_t edgeDirection);
 
  681         void (*intHandler)(
void));
 
  705 #define COMP_E_enable(a) COMP_E_enableModule(a) 
  706 #define COMP_E_disable(a) COMP_E_disableModule(a) 
  707 #define COMP_E_IOSwap(a) COMP_E_swapIO(a) 
  708 #define COMP_E_interruptToggleEdgeDirection(a) COMP_E_toggleInterruptEdgeDirection(a) 
  709 #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:250
uint_fast8_t outputFilterEnableAndDelayLevel
Definition: comp_e.h:127
void COMP_E_setReferenceAccuracy(uint32_t comparator, uint_fast16_t referenceAccuracy)
Definition: comp_e.c:169
void COMP_E_swapIO(uint32_t comparator)
Definition: comp_e.c:223
void COMP_E_enableInterrupt(uint32_t comparator, uint_fast16_t mask)
Definition: comp_e.c:233
void COMP_E_setInterruptEdgeDirection(uint32_t comparator, uint_fast8_t edgeDirection)
Definition: comp_e.c:262
void COMP_E_enableInputBuffer(uint32_t comparator, uint_fast16_t inputPort)
Definition: comp_e.c:216
void COMP_E_unshortInputs(uint32_t comparator)
Definition: comp_e.c:204
void COMP_E_disableModule(uint32_t comparator)
Definition: comp_e.c:194
void COMP_E_unregisterInterrupt(uint32_t comparator)
Definition: comp_e.c:296
struct _COMP_E_Config COMP_E_Config
Type definition for _COMP_E_Config structure. 
Definition: comp_e.h:123
uint8_t COMP_E_outputValue(uint32_t comparator)
Definition: comp_e.c:228
uint_fast16_t COMP_E_getInterruptStatus(uint32_t comparator)
Definition: comp_e.c:255
uint_fast16_t positiveTerminalInput
Definition: comp_e.h:125
uint_fast16_t powerMode
Definition: comp_e.h:129
void COMP_E_toggleInterruptEdgeDirection(uint32_t comparator)
Definition: comp_e.c:274
void COMP_E_setReferenceVoltage(uint32_t comparator, uint_fast16_t supplyVoltageReferenceBase, uint_fast16_t lowerLimitSupplyVoltageFractionOf32, uint_fast16_t upperLimitSupplyVoltageFractionOf32)
Definition: comp_e.c:137
uint_fast16_t COMP_E_getEnabledInterruptStatus(uint32_t comparator)
Definition: comp_e.c:239
bool COMP_E_initModule(uint32_t comparator, const COMP_E_Config *config)
Definition: comp_e.c:81
void COMP_E_enableModule(uint32_t comparator)
Definition: comp_e.c:189
void COMP_E_disableInputBuffer(uint32_t comparator, uint_fast16_t inputPort)
Definition: comp_e.c:209
void COMP_E_registerInterrupt(uint32_t comparator, void(*intHandler)(void))
Definition: comp_e.c:279
uint_fast8_t invertedOutputPolarity
Definition: comp_e.h:128
void COMP_E_disableInterrupt(uint32_t comparator, uint_fast16_t mask)
Definition: comp_e.c:245
void COMP_E_shortInputs(uint32_t comparator)
Definition: comp_e.c:199
void COMP_E_setPowerMode(uint32_t comparator, uint_fast16_t powerMode)
Definition: comp_e.c:183
uint_fast16_t negativeTerminalInput
Definition: comp_e.h:126