7 #ifndef __MSP430WARE_COMP_B_H__ 8 #define __MSP430WARE_COMP_B_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_COMPB__ 25 #include "inc/hw_memmap.h" 132 #define COMP_B_POWERMODE_HIGHSPEED (CBPWRMD_0) 133 #define COMP_B_POWERMODE_NORMALMODE (CBPWRMD_1) 134 #define COMP_B_POWERMODE_ULTRALOWPOWER (CBPWRMD_2) 145 #define COMP_B_INPUT0 (CBIPSEL_0) 146 #define COMP_B_INPUT1 (CBIPSEL_1) 147 #define COMP_B_INPUT2 (CBIPSEL_2) 148 #define COMP_B_INPUT3 (CBIPSEL_3) 149 #define COMP_B_INPUT4 (CBIPSEL_4) 150 #define COMP_B_INPUT5 (CBIPSEL_5) 151 #define COMP_B_INPUT6 (CBIPSEL_6) 152 #define COMP_B_INPUT7 (CBIPSEL_7) 153 #define COMP_B_INPUT8 (CBIPSEL_8) 154 #define COMP_B_INPUT9 (CBIPSEL_9) 155 #define COMP_B_INPUT10 (CBIPSEL_10) 156 #define COMP_B_INPUT11 (CBIPSEL_11) 157 #define COMP_B_INPUT12 (CBIPSEL_12) 158 #define COMP_B_INPUT13 (CBIPSEL_13) 159 #define COMP_B_INPUT14 (CBIPSEL_14) 160 #define COMP_B_INPUT15 (CBIPSEL_15) 161 #define COMP_B_VREF (0x10) 170 #define COMP_B_FILTEROUTPUT_OFF 0x00 171 #define COMP_B_FILTEROUTPUT_DLYLVL1 (CBF + CBFDLY_0) 172 #define COMP_B_FILTEROUTPUT_DLYLVL2 (CBF + CBFDLY_1) 173 #define COMP_B_FILTEROUTPUT_DLYLVL3 (CBF + CBFDLY_2) 174 #define COMP_B_FILTEROUTPUT_DLYLVL4 (CBF + CBFDLY_3) 183 #define COMP_B_NORMALOUTPUTPOLARITY (!(CBOUTPOL)) 184 #define COMP_B_INVERTEDOUTPUTPOLARITY (CBOUTPOL) 192 #define COMP_B_ACCURACY_STATIC (!CBREFACC) 193 #define COMP_B_ACCURACY_CLOCKED (CBREFACC) 201 #define COMP_B_VREFBASE_VCC (CBREFL_0) 202 #define COMP_B_VREFBASE1_5V (CBREFL_1) 203 #define COMP_B_VREFBASE2_0V (CBREFL_2) 204 #define COMP_B_VREFBASE2_5V (CBREFL_3) 212 #define COMP_B_OUTPUT_INT CBIE 213 #define COMP_B_OUTPUTINVERTED_INT CBIIE 223 #define COMP_B_OUTPUT_FLAG CBIFG 224 #define COMP_B_OUTPUTINVERTED_FLAG CBIIFG 232 #define COMP_B_RISINGEDGE (!(CBIES)) 233 #define COMP_B_FALLINGEDGE (CBIES) 241 #define COMP_B_LOW (0x0) 242 #define COMP_B_HIGH (CBOUT) 250 #define COMP_B_VREF_AUTO_SELECT 0x0000 251 #define COMP_B_VREF_MANUAL_SELECT CBMRVS 259 #define COMP_B_SELECT_VREF0 0x0000 260 #define COMP_B_SELECT_VREF1 CBMRVL 328 uint16_t interruptMask);
350 uint16_t interruptMask);
372 uint16_t interruptFlagMask);
395 uint16_t interruptFlagMask);
423 uint16_t edgeDirection);
637 uint16_t selectVRef);
649 #endif // __MSP430WARE_COMP_B_H__
uint16_t powerModeSelect
Definition: comp_b.h:77
void Comp_B_enableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Enables selected Comp_B interrupt sources.
Definition: comp_b.c:106
void Comp_B_enableInputBuffer(uint16_t baseAddress, uint8_t inputPort)
Enables the input buffer of the selected input port to allow for digital signals. ...
Definition: comp_b.c:174
uint16_t Comp_B_outputValue(uint16_t baseAddress)
Returns the output value of the Comp_B module.
Definition: comp_b.c:185
void Comp_B_setInterruptEdgeDirection(uint16_t baseAddress, uint16_t edgeDirection)
Explicitly sets the edge direction that would trigger an interrupt.
Definition: comp_b.c:131
void Comp_B_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_b.c:180
bool Comp_B_init(uint16_t baseAddress, Comp_B_initParam *param)
Initializes the Comp_B Module.
Definition: comp_b.c:21
uint16_t invertedOutputPolarity
Definition: comp_b.h:92
uint8_t negativeTerminalInput
Definition: comp_b.h:71
void Comp_B_toggleInterruptEdgeDirection(uint16_t baseAddress)
Toggles the edge direction that would trigger an interrupt.
Definition: comp_b.c:143
uint8_t positiveTerminalInput
Definition: comp_b.h:51
void Comp_B_selectReferenceVoltage(uint16_t baseAddress, uint16_t selectType, uint16_t selectVRef)
Modifies how comparator output selects between VREF0 or VREF1.
Definition: comp_b.c:191
void Comp_B_shortInputs(uint16_t baseAddress)
Shorts the two input pins chosen during initialization.
Definition: comp_b.c:158
uint8_t outputFilterEnableAndDelayLevel
Definition: comp_b.h:87
void Comp_B_configureReferenceVoltage(uint16_t baseAddress, Comp_B_configureReferenceVoltageParam *param)
Generates a Reference Voltage to the terminal selected during initialization.
Definition: comp_b.c:72
void Comp_B_disableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Disables selected Comp_B interrupt sources.
Definition: comp_b.c:113
uint8_t Comp_B_getInterruptStatus(uint16_t baseAddress, uint16_t interruptFlagMask)
Gets the current Comp_B interrupt status.
Definition: comp_b.c:125
void Comp_B_disable(uint16_t baseAddress)
Turns off the Comp_B module.
Definition: comp_b.c:153
void Comp_B_unshortInputs(uint16_t baseAddress)
Disables the short of the two input pins chosen during initialization.
Definition: comp_b.c:163
void Comp_B_disableInputBuffer(uint16_t baseAddress, uint8_t inputPort)
Disables the input buffer of the selected input port to effectively allow for analog signals...
Definition: comp_b.c:168
void Comp_B_enable(uint16_t baseAddress)
Turns on the Comp_B module.
Definition: comp_b.c:148
void Comp_B_clearInterrupt(uint16_t baseAddress, uint16_t interruptFlagMask)
Clears Comp_B interrupt flags.
Definition: comp_b.c:119
Used in the Comp_B_init() function as the param parameter.
Definition: comp_b.h:31