7 #ifndef __MSP430WARE_ECOMP_H__ 8 #define __MSP430WARE_ECOMP_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_ECOMPx__ 25 #include "inc/hw_memmap.h" 103 #define ECOMP_INPUT_0 0x0 104 #define ECOMP_INPUT_1 0x1 105 #define ECOMP_INPUT_2 0x2 106 #define ECOMP_INPUT_3 0x3 107 #define ECOMP_INPUT_DEVICE_SPECIFIC_0 0x4 108 #define ECOMP_INPUT_DEVICE_SPECIFIC_1 0x5 109 #define ECOMP_INPUT_DAC 0x6 110 #define ECOMP_INPUT_DISABLED 0x7 118 #define ECOMP_FILTER_DELAY_OFF 0x0 119 #define ECOMP_FILTER_DELAY_450NS (CPFLT|CPFLTDLY_0) 120 #define ECOMP_FILTER_DELAY_900NS (CPFLT|CPFLTDLY_1) 121 #define ECOMP_FILTER_DELAY_1800NS (CPFLT|CPFLTDLY_2) 122 #define ECOMP_FILTER_DELAY_3600NS (CPFLT|CPFLTDLY_3) 130 #define ECOMP_NORMAL_OUTPUT_POLARITY 0x0 131 #define ECOMP_INVERTED_OUTPUT_POLARITY CPINV 139 #define ECOMP_HYSTERESIS_MODE_DISABLE CPHSEL_0 140 #define ECOMP_HYSTERESIS_MODE_10MV CPHSEL_1 141 #define ECOMP_HYSTERESIS_MODE_20MV CPHSEL_2 142 #define ECOMP_HYSTERESIS_MODE_30MV CPHSEL_3 150 #define ECOMP_POWER_MODE_HIGH_POWER_HIGH_SPEED 0x0 151 #define ECOMP_POWER_MODE_LOW_POWER_LOW_SPEED CPMSEL 159 #define ECOMP_OUTPUT_INTERRUPT CPIE 160 #define ECOMP_INVERTED_POLARITY_INTERRUPT CPIIE 170 #define ECOMP_OUTPUT_INTERRUPT_FLAG CPIFG 171 #define ECOMP_INVERTED_POLARITY_INTERRUPT_FLAG CPIIFG 179 #define ECOMP_OUTPUT_INTERRUPT_RISING_EDGE 0x0 180 #define ECOMP_OUTPUT_INTERRUPT_FALLING_EDGE CPIES 188 #define ECOMP_LOW 0x0 189 #define ECOMP_HIGH CPOUT 197 #define ECOMP_DAC_REFERENCE_VOLTAGE_VDD 0x0 198 #define ECOMP_DAC_REFERENCE_VOLTAGE_VREF CPDACREFS 206 #define ECOMP_DAC_BUFFER_SOURCE_COMP_OUTPUT 0x0 207 #define ECOMP_DAC_BUFFER_SOURCE_DUAL_BUFFER_1 (CPDACBUFS) 208 #define ECOMP_DAC_BUFFER_SOURCE_DUAL_BUFFER_2 (CPDACBUFS|CPDACSW) 255 uint16_t hysteresisMode);
325 uint16_t interruptMask);
346 uint16_t interruptMask);
367 uint16_t interruptFlagMask);
391 uint16_t interruptFlagMask);
419 uint16_t edgeDirection);
508 #endif // __MSP430WARE_ECOMP_H__ uint8_t EComp_outputValue(uint16_t baseAddress)
Returns the output value of the EComp module.
Definition: ecomp.c:94
void EComp_setInterruptEdgeDirection(uint16_t baseAddress, uint16_t edgeDirection)
Explicitly sets the edge direction that would trigger an interrupt.
Definition: ecomp.c:82
void EComp_enableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Enables selected EComp interrupt sources.
Definition: ecomp.c:61
void EComp_selectPowerMode(uint16_t baseAddress, uint16_t powerMode)
Sets the power mode.
Definition: ecomp.c:45
Used in the EComp_init() function as the param parameter.
Definition: ecomp.h:31
void EComp_enableDAC(uint16_t baseAddress)
Enables DAC output.
Definition: ecomp.c:111
void EComp_configureDAC(uint16_t baseAddress, EComp_configureDACParam *param)
Configures the built-in DAC for internal reference.
Definition: ecomp.c:99
void EComp_selectHysteresisMode(uint16_t baseAddress, uint16_t hysteresisMode)
Sets the hysteresis mode.
Definition: ecomp.c:38
void EComp_disableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Disables selected EComp interrupt sources.
Definition: ecomp.c:66
void EComp_disable(uint16_t baseAddress)
Turns off the EComp module.
Definition: ecomp.c:56
void EComp_enable(uint16_t baseAddress)
Turns on the EComp module.
Definition: ecomp.c:51
void EComp_disableDAC(uint16_t baseAddress)
Disables DAC output.
Definition: ecomp.c:116
void EComp_clearInterrupt(uint16_t baseAddress, uint16_t interruptFlagMask)
Clears EComp interrupt flags.
Definition: ecomp.c:71
uint8_t positiveTerminalInput
Definition: ecomp.h:42
uint16_t invertedOutputPolarity
Definition: ecomp.h:68
void EComp_toggleInterruptEdgeDirection(uint16_t baseAddress)
Toggles the edge direction that would trigger an interrupt.
Definition: ecomp.c:89
void EComp_init(uint16_t baseAddress, EComp_initParam *param)
Initializes the EComp.
Definition: ecomp.c:21
uint8_t negativeTerminalInput
Definition: ecomp.h:53
uint16_t outputFilterEnableAndDelayLevel
Definition: ecomp.h:63
uint8_t EComp_getInterruptStatus(uint16_t baseAddress, uint16_t interruptFlagMask)
Gets the current EComp interrupt status.
Definition: ecomp.c:76