7 #ifndef __MSP430WARE_COMP_E_H__ 8 #define __MSP430WARE_COMP_E_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_COMP_E__ 25 #include "inc/hw_memmap.h" 99 #define COMP_E_FILTEROUTPUT_OFF 0x00 100 #define COMP_E_FILTEROUTPUT_DLYLVL1 (CEF + CEFDLY_0) 101 #define COMP_E_FILTEROUTPUT_DLYLVL2 (CEF + CEFDLY_1) 102 #define COMP_E_FILTEROUTPUT_DLYLVL3 (CEF + CEFDLY_2) 103 #define COMP_E_FILTEROUTPUT_DLYLVL4 (CEF + CEFDLY_3) 114 #define COMP_E_INPUT0 (0x01) 115 #define COMP_E_INPUT1 (0x02) 116 #define COMP_E_INPUT2 (0x04) 117 #define COMP_E_INPUT3 (0x08) 118 #define COMP_E_INPUT4 (0x10) 119 #define COMP_E_INPUT5 (0x20) 120 #define COMP_E_INPUT6 (0x40) 121 #define COMP_E_INPUT7 (0x80) 122 #define COMP_E_INPUT8 (0x100) 123 #define COMP_E_INPUT9 (0x200) 124 #define COMP_E_INPUT10 (0x400) 125 #define COMP_E_INPUT11 (0x800) 126 #define COMP_E_INPUT12 (0x1000) 127 #define COMP_E_INPUT13 (0x2000) 128 #define COMP_E_INPUT14 (0x4000) 129 #define COMP_E_INPUT15 (0x8000) 130 #define COMP_E_VREF (0x9F) 139 #define COMP_E_NORMALOUTPUTPOLARITY (!(CEOUTPOL)) 140 #define COMP_E_INVERTEDOUTPUTPOLARITY (CEOUTPOL) 149 #define COMP_E_REFERENCE_AMPLIFIER_DISABLED (CEREFL_0) 150 #define COMP_E_VREFBASE1_2V (CEREFL_1) 151 #define COMP_E_VREFBASE2_0V (CEREFL_2) 152 #define COMP_E_VREFBASE2_5V (CEREFL_3) 160 #define COMP_E_ACCURACY_STATIC (!CEREFACC) 161 #define COMP_E_ACCURACY_CLOCKED (CEREFACC) 169 #define COMP_E_HIGH_SPEED_MODE (CEPWRMD_0) 170 #define COMP_E_NORMAL_MODE (CEPWRMD_1) 171 #define COMP_E_ULTRA_LOW_POWER_MODE (CEPWRMD_2) 179 #define COMP_E_OUTPUT_INTERRUPT (CEIE) 180 #define COMP_E_INVERTED_POLARITY_INTERRUPT (CEIIE) 181 #define COMP_E_READY_INTERRUPT (CERDYIE) 191 #define COMP_E_OUTPUT_INTERRUPT_FLAG (CEIFG) 192 #define COMP_E_INTERRUPT_FLAG_INVERTED_POLARITY (CEIIFG) 193 #define COMP_E_INTERRUPT_FLAG_READY (CERDYIFG) 201 #define COMP_E_RISINGEDGE (!(CEIES)) 202 #define COMP_E_FALLINGEDGE (CEIES) 210 #define COMP_E_LOW (0x0) 211 #define COMP_E_HIGH (CEOUT) 272 uint16_t supplyVoltageReferenceBase,
273 uint16_t lowerLimitSupplyVoltageFractionOf32,
274 uint16_t upperLimitSupplyVoltageFractionOf32);
294 uint16_t referenceAccuracy);
334 uint16_t interruptMask);
356 uint16_t interruptMask);
378 uint16_t interruptFlagMask);
404 uint16_t interruptFlagMask);
432 uint16_t edgeDirection);
635 #endif // __MSP430WARE_COMP_E_H__ Used in the Comp_E_init() function as the param parameter.
Definition: comp_e.h:31
void Comp_E_enableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Enables selected Comp_E interrupt sources.
Definition: comp_e.c:157
uint16_t negTerminalInput
Definition: comp_e.h:71
void Comp_E_disableInputBuffer(uint16_t baseAddress, uint16_t inputPort)
Disables the input buffer of the selected input port to effectively allow for analog signals...
Definition: comp_e.c:218
void Comp_E_disable(uint16_t baseAddress)
Turns off the Comp_E module.
Definition: comp_e.c:203
uint8_t outputFilterEnableAndDelayLevel
Definition: comp_e.h:81
void Comp_E_enable(uint16_t baseAddress)
Turns on the Comp_E module.
Definition: comp_e.c:198
void Comp_E_setReferenceVoltage(uint16_t baseAddress, uint16_t supplyVoltageReferenceBase, uint16_t lowerLimitSupplyVoltageFractionOf32, uint16_t upperLimitSupplyVoltageFractionOf32)
Generates a Reference Voltage to the terminal selected during initialization.
Definition: comp_e.c:113
void Comp_E_enableInputBuffer(uint16_t baseAddress, uint16_t inputPort)
Enables the input buffer of the selected input port to allow for digital signals. ...
Definition: comp_e.c:224
void Comp_E_shortInputs(uint16_t baseAddress)
Shorts the two input pins chosen during initialization.
Definition: comp_e.c:208
uint8_t Comp_E_getInterruptStatus(uint16_t baseAddress, uint16_t interruptFlagMask)
Gets the current Comp_E interrupt status.
Definition: comp_e.c:176
void Comp_E_disableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Disables selected Comp_E interrupt sources.
Definition: comp_e.c:164
uint16_t posTerminalInput
Definition: comp_e.h:51
void Comp_E_setPowerMode(uint16_t baseAddress, uint16_t powerMode)
Sets the power mode.
Definition: comp_e.c:150
void Comp_E_unshortInputs(uint16_t baseAddress)
Disables the short of the two input pins chosen during initialization.
Definition: comp_e.c:213
uint16_t invertedOutputPolarity
Definition: comp_e.h:87
void Comp_E_setInterruptEdgeDirection(uint16_t baseAddress, uint16_t edgeDirection)
Explicitly sets the edge direction that would trigger an interrupt.
Definition: comp_e.c:182
void Comp_E_toggleInterruptEdgeDirection(uint16_t baseAddress)
Toggles the edge direction that would trigger an interrupt.
Definition: comp_e.c:193
void Comp_E_swapIO(uint16_t baseAddress)
Toggles the bit that swaps which terminals the inputs go to, while also inverting the output of the C...
Definition: comp_e.c:229
bool Comp_E_init(uint16_t baseAddress, Comp_E_initParam *param)
Initializes the Comp_E Module.
Definition: comp_e.c:64
void Comp_E_setReferenceAccuracy(uint16_t baseAddress, uint16_t referenceAccuracy)
Sets the reference accuracy.
Definition: comp_e.c:143
uint16_t Comp_E_outputValue(uint16_t baseAddress)
Returns the output value of the Comp_E module.
Definition: comp_e.c:234
void Comp_E_clearInterrupt(uint16_t baseAddress, uint16_t interruptFlagMask)
Clears Comp_E interrupt flags.
Definition: comp_e.c:170