MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
comp_e.h
1 //*****************************************************************************
2 //
3 // comp_e.h - Driver for the COMP_E Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_COMP_E_H__
8 #define __MSP430WARE_COMP_E_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_COMP_E__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "inc/hw_memmap.h"
26 //*****************************************************************************
27 //
28 //! \brief Used in the Comp_E_init() function as the param parameter.
29 //
30 //*****************************************************************************
31 typedef struct Comp_E_initParam {
32  //! Selects the input to the positive terminal.
33  //! \n Valid values are:
34  //! - \b COMP_E_INPUT0 [Default]
35  //! - \b COMP_E_INPUT1
36  //! - \b COMP_E_INPUT2
37  //! - \b COMP_E_INPUT3
38  //! - \b COMP_E_INPUT4
39  //! - \b COMP_E_INPUT5
40  //! - \b COMP_E_INPUT6
41  //! - \b COMP_E_INPUT7
42  //! - \b COMP_E_INPUT8
43  //! - \b COMP_E_INPUT9
44  //! - \b COMP_E_INPUT10
45  //! - \b COMP_E_INPUT11
46  //! - \b COMP_E_INPUT12
47  //! - \b COMP_E_INPUT13
48  //! - \b COMP_E_INPUT14
49  //! - \b COMP_E_INPUT15
50  //! - \b COMP_E_VREF
51  uint16_t posTerminalInput;
52  //! Selects the input to the negative terminal.
53  //! \n Valid values are:
54  //! - \b COMP_E_INPUT0 [Default]
55  //! - \b COMP_E_INPUT1
56  //! - \b COMP_E_INPUT2
57  //! - \b COMP_E_INPUT3
58  //! - \b COMP_E_INPUT4
59  //! - \b COMP_E_INPUT5
60  //! - \b COMP_E_INPUT6
61  //! - \b COMP_E_INPUT7
62  //! - \b COMP_E_INPUT8
63  //! - \b COMP_E_INPUT9
64  //! - \b COMP_E_INPUT10
65  //! - \b COMP_E_INPUT11
66  //! - \b COMP_E_INPUT12
67  //! - \b COMP_E_INPUT13
68  //! - \b COMP_E_INPUT14
69  //! - \b COMP_E_INPUT15
70  //! - \b COMP_E_VREF
71  uint16_t negTerminalInput;
72  //! Controls the output filter delay state, which is either off or enabled
73  //! with a specified delay level. This parameter is device specific and
74  //! delay levels should be found in the device's datasheet.
75  //! \n Valid values are:
76  //! - \b COMP_E_FILTEROUTPUT_OFF [Default]
77  //! - \b COMP_E_FILTEROUTPUT_DLYLVL1
78  //! - \b COMP_E_FILTEROUTPUT_DLYLVL2
79  //! - \b COMP_E_FILTEROUTPUT_DLYLVL3
80  //! - \b COMP_E_FILTEROUTPUT_DLYLVL4
82  //! Controls if the output will be inverted or not
83  //! \n Valid values are:
84  //! - \b COMP_E_NORMALOUTPUTPOLARITY - indicates the output should be
85  //! normal
86  //! - \b COMP_E_INVERTEDOUTPUTPOLARITY - the output should be inverted
89 
90 
91 
92 //*****************************************************************************
93 //
94 // The following are values that can be passed to the
95 // outputFilterEnableAndDelayLevel parameter for functions: Comp_E_init(); the
96 // param parameter for functions: Comp_E_init().
97 //
98 //*****************************************************************************
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)
104 
105 //*****************************************************************************
106 //
107 // The following are values that can be passed to the posTerminalInput
108 // parameter for functions: Comp_E_init(); the inputPort parameter for
109 // functions: Comp_E_disableInputBuffer(), and Comp_E_enableInputBuffer(); the
110 // param parameter for functions: Comp_E_init(), and Comp_E_init(); the
111 // negTerminalInput parameter for functions: Comp_E_init().
112 //
113 //*****************************************************************************
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)
131 
132 //*****************************************************************************
133 //
134 // The following are values that can be passed to the invertedOutputPolarity
135 // parameter for functions: Comp_E_init(); the param parameter for functions:
136 // Comp_E_init().
137 //
138 //*****************************************************************************
139 #define COMP_E_NORMALOUTPUTPOLARITY (!(CEOUTPOL))
140 #define COMP_E_INVERTEDOUTPUTPOLARITY (CEOUTPOL)
141 
142 //*****************************************************************************
143 //
144 // The following are values that can be passed to the
145 // supplyVoltageReferenceBase parameter for functions:
146 // Comp_E_setReferenceVoltage().
147 //
148 //*****************************************************************************
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)
153 
154 //*****************************************************************************
155 //
156 // The following are values that can be passed to the referenceAccuracy
157 // parameter for functions: Comp_E_setReferenceAccuracy().
158 //
159 //*****************************************************************************
160 #define COMP_E_ACCURACY_STATIC (!CEREFACC)
161 #define COMP_E_ACCURACY_CLOCKED (CEREFACC)
162 
163 //*****************************************************************************
164 //
165 // The following are values that can be passed to the powerMode parameter for
166 // functions: Comp_E_setPowerMode().
167 //
168 //*****************************************************************************
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)
172 
173 //*****************************************************************************
174 //
175 // The following are values that can be passed to the interruptMask parameter
176 // for functions: Comp_E_enableInterrupt(), and Comp_E_disableInterrupt().
177 //
178 //*****************************************************************************
179 #define COMP_E_OUTPUT_INTERRUPT (CEIE)
180 #define COMP_E_INVERTED_POLARITY_INTERRUPT (CEIIE)
181 #define COMP_E_READY_INTERRUPT (CERDYIE)
182 
183 //*****************************************************************************
184 //
185 // The following are values that can be passed to the interruptFlagMask
186 // parameter for functions: Comp_E_clearInterrupt(), and
187 // Comp_E_getInterruptStatus() as well as returned by the
188 // Comp_E_getInterruptStatus() function.
189 //
190 //*****************************************************************************
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)
194 
195 //*****************************************************************************
196 //
197 // The following are values that can be passed to the edgeDirection parameter
198 // for functions: Comp_E_setInterruptEdgeDirection().
199 //
200 //*****************************************************************************
201 #define COMP_E_FALLINGEDGE (!(CEIES))
202 #define COMP_E_RISINGEDGE (CEIES)
203 
204 //*****************************************************************************
205 //
206 // The following are values that can be passed toThe following are values that
207 // can be returned by the Comp_E_outputValue() function.
208 //
209 //*****************************************************************************
210 #define COMP_E_LOW (0x0)
211 #define COMP_E_HIGH (CEOUT)
212 
213 //*****************************************************************************
214 //
215 // Prototypes for the APIs.
216 //
217 //*****************************************************************************
218 
219 //*****************************************************************************
220 //
221 //! \brief Initializes the Comp_E Module.
222 //!
223 //! Upon successful initialization of the Comp_E module, this function will
224 //! have reset all necessary register bits and set the given options in the
225 //! registers. To actually use the Comp_E module, the Comp_E_enable() function
226 //! must be explicitly called before use. If a Reference Voltage is set to a
227 //! terminal, the Voltage should be set using the setReferenceVoltage()
228 //! function.
229 //!
230 //! \param baseAddress is the base address of the COMP_E module.
231 //! \param param is the pointer to struct for initialization.
232 //!
233 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process
234 //
235 //*****************************************************************************
236 extern bool Comp_E_init(uint16_t baseAddress,
237  Comp_E_initParam *param);
238 
239 //*****************************************************************************
240 //
241 //! \brief Generates a Reference Voltage to the terminal selected during
242 //! initialization.
243 //!
244 //! Use this function to generate a voltage to serve as a reference to the
245 //! terminal selected at initialization. The voltage is determined by the
246 //! equation: Vbase * (Numerator / 32). If the upper and lower limit voltage
247 //! numerators are equal, then a static reference is defined, whereas they are
248 //! different then a hysteresis effect is generated.
249 //!
250 //! \param baseAddress is the base address of the COMP_E module.
251 //! \param supplyVoltageReferenceBase decides the source and max amount of
252 //! Voltage that can be used as a reference.
253 //! Valid values are:
254 //! - \b COMP_E_REFERENCE_AMPLIFIER_DISABLED
255 //! - \b COMP_E_VREFBASE1_2V
256 //! - \b COMP_E_VREFBASE2_0V
257 //! - \b COMP_E_VREFBASE2_5V
258 //! \n Modified bits are \b CEREFL of \b CECTL2 register.
259 //! \param lowerLimitSupplyVoltageFractionOf32 is the numerator of the equation
260 //! to generate the reference voltage for the lower limit reference
261 //! voltage.
262 //! \n Modified bits are \b CEREF0 of \b CECTL2 register.
263 //! \param upperLimitSupplyVoltageFractionOf32 is the numerator of the equation
264 //! to generate the reference voltage for the upper limit reference
265 //! voltage.
266 //! \n Modified bits are \b CEREF1 of \b CECTL2 register.
267 //!
268 //! \return None
269 //
270 //*****************************************************************************
271 extern void Comp_E_setReferenceVoltage(uint16_t baseAddress,
272  uint16_t supplyVoltageReferenceBase,
273  uint16_t lowerLimitSupplyVoltageFractionOf32,
274  uint16_t upperLimitSupplyVoltageFractionOf32);
275 
276 //*****************************************************************************
277 //
278 //! \brief Sets the reference accuracy
279 //!
280 //! The reference accuracy is set to the desired setting. Clocked is better for
281 //! low power operations but has a lower accuracy.
282 //!
283 //! \param baseAddress is the base address of the COMP_E module.
284 //! \param referenceAccuracy is the reference accuracy setting of the COMP_E.
285 //! Valid values are:
286 //! - \b COMP_E_ACCURACY_STATIC
287 //! - \b COMP_E_ACCURACY_CLOCKED - for low power / low accuracy
288 //! \n Modified bits are \b CEREFACC of \b CECTL2 register.
289 //!
290 //! \return None
291 //
292 //*****************************************************************************
293 extern void Comp_E_setReferenceAccuracy(uint16_t baseAddress,
294  uint16_t referenceAccuracy);
295 
296 //*****************************************************************************
297 //
298 //! \brief Sets the power mode
299 //!
300 //! \param baseAddress is the base address of the COMP_E module.
301 //! \param powerMode decides the power mode
302 //! Valid values are:
303 //! - \b COMP_E_HIGH_SPEED_MODE
304 //! - \b COMP_E_NORMAL_MODE
305 //! - \b COMP_E_ULTRA_LOW_POWER_MODE
306 //! \n Modified bits are \b CEPWRMD of \b CECTL1 register.
307 //!
308 //! \return None
309 //
310 //*****************************************************************************
311 extern void Comp_E_setPowerMode(uint16_t baseAddress,
312  uint16_t powerMode);
313 
314 //*****************************************************************************
315 //
316 //! \brief Enables selected Comp_E interrupt sources.
317 //!
318 //! Enables the indicated Comp_E interrupt sources. Only the sources that are
319 //! enabled can be reflected to the processor interrupt; disabled sources have
320 //! no effect on the processor. <b>Does not clear interrupt flags.</b>
321 //!
322 //! \param baseAddress is the base address of the COMP_E module.
323 //! \param interruptMask
324 //! Mask value is the logical OR of any of the following:
325 //! - \b COMP_E_OUTPUT_INTERRUPT - Output interrupt
326 //! - \b COMP_E_INVERTED_POLARITY_INTERRUPT - Output interrupt inverted
327 //! polarity
328 //! - \b COMP_E_READY_INTERRUPT - Ready interrupt
329 //!
330 //! \return None
331 //
332 //*****************************************************************************
333 extern void Comp_E_enableInterrupt(uint16_t baseAddress,
334  uint16_t interruptMask);
335 
336 //*****************************************************************************
337 //
338 //! \brief Disables selected Comp_E interrupt sources.
339 //!
340 //! Disables the indicated Comp_E interrupt sources. Only the sources that are
341 //! enabled can be reflected to the processor interrupt; disabled sources have
342 //! no effect on the processor.
343 //!
344 //! \param baseAddress is the base address of the COMP_E module.
345 //! \param interruptMask
346 //! Mask value is the logical OR of any of the following:
347 //! - \b COMP_E_OUTPUT_INTERRUPT - Output interrupt
348 //! - \b COMP_E_INVERTED_POLARITY_INTERRUPT - Output interrupt inverted
349 //! polarity
350 //! - \b COMP_E_READY_INTERRUPT - Ready interrupt
351 //!
352 //! \return None
353 //
354 //*****************************************************************************
355 extern void Comp_E_disableInterrupt(uint16_t baseAddress,
356  uint16_t interruptMask);
357 
358 //*****************************************************************************
359 //
360 //! \brief Clears Comp_E interrupt flags.
361 //!
362 //! The Comp_E interrupt source is cleared, so that it no longer asserts. The
363 //! highest interrupt flag is automatically cleared when an interrupt vector
364 //! generator is used.
365 //!
366 //! \param baseAddress is the base address of the COMP_E module.
367 //! \param interruptFlagMask
368 //! Mask value is the logical OR of any of the following:
369 //! - \b COMP_E_OUTPUT_INTERRUPT_FLAG - Output interrupt flag
370 //! - \b COMP_E_INTERRUPT_FLAG_INVERTED_POLARITY - Output interrupt flag
371 //! inverted polarity
372 //! - \b COMP_E_INTERRUPT_FLAG_READY - Ready interrupt flag
373 //!
374 //! \return None
375 //
376 //*****************************************************************************
377 extern void Comp_E_clearInterrupt(uint16_t baseAddress,
378  uint16_t interruptFlagMask);
379 
380 //*****************************************************************************
381 //
382 //! \brief Gets the current Comp_E interrupt status.
383 //!
384 //! This returns the interrupt status for the Comp_E module based on which flag
385 //! is passed.
386 //!
387 //! \param baseAddress is the base address of the COMP_E module.
388 //! \param interruptFlagMask
389 //! Mask value is the logical OR of any of the following:
390 //! - \b COMP_E_OUTPUT_INTERRUPT_FLAG - Output interrupt flag
391 //! - \b COMP_E_INTERRUPT_FLAG_INVERTED_POLARITY - Output interrupt flag
392 //! inverted polarity
393 //! - \b COMP_E_INTERRUPT_FLAG_READY - Ready interrupt flag
394 //!
395 //! \return Logical OR of any of the following:
396 //! - \b Comp_E_OUTPUT_INTERRUPT_FLAG Output interrupt flag
397 //! - \b Comp_E_INTERRUPT_FLAG_INVERTED_POLARITY Output interrupt flag
398 //! inverted polarity
399 //! - \b Comp_E_INTERRUPT_FLAG_READY Ready interrupt flag
400 //! \n indicating the status of the masked flags
401 //
402 //*****************************************************************************
403 extern uint8_t Comp_E_getInterruptStatus(uint16_t baseAddress,
404  uint16_t interruptFlagMask);
405 
406 //*****************************************************************************
407 //
408 //! \brief Explicitly sets the edge direction that would trigger an interrupt.
409 //!
410 //! This function will set which direction the output will have to go, whether
411 //! rising or falling, to generate an interrupt based on a non-inverted
412 //! interrupt.
413 //!
414 //! \param baseAddress is the base address of the COMP_E module.
415 //! \param edgeDirection determines which direction the edge would have to go
416 //! to generate an interrupt based on the non-inverted interrupt flag.
417 //! Valid values are:
418 //! - \b COMP_E_FALLINGEDGE [Default] - sets the bit to generate an
419 //! interrupt when the output of the Comp_E falls from HIGH to LOW if
420 //! the normal interrupt bit is set(and LOW to HIGH if the inverted
421 //! interrupt enable bit is set).
422 //! - \b COMP_E_RISINGEDGE - sets the bit to generate an interrupt when
423 //! the output of the Comp_E rises from LOW to HIGH if the normal
424 //! interrupt bit is set(and HIGH to LOW if the inverted interrupt
425 //! enable bit is set).
426 //! \n Modified bits are \b CEIES of \b CECTL1 register.
427 //!
428 //! \return None
429 //
430 //*****************************************************************************
431 extern void Comp_E_setInterruptEdgeDirection(uint16_t baseAddress,
432  uint16_t edgeDirection);
433 
434 //*****************************************************************************
435 //
436 //! \brief Toggles the edge direction that would trigger an interrupt.
437 //!
438 //! This function will toggle which direction the output will have to go,
439 //! whether rising or falling, to generate an interrupt based on a non-inverted
440 //! interrupt. If the direction was rising, it is now falling, if it was
441 //! falling, it is now rising.
442 //!
443 //! \param baseAddress is the base address of the COMP_E module.
444 //!
445 //! Modified bits are \b CEIES of \b CECTL1 register.
446 //!
447 //! \return None
448 //
449 //*****************************************************************************
450 extern void Comp_E_toggleInterruptEdgeDirection(uint16_t baseAddress);
451 
452 //*****************************************************************************
453 //
454 //! \brief Turns on the Comp_E module.
455 //!
456 //! This function sets the bit that enables the operation of the Comp_E module.
457 //!
458 //! \param baseAddress is the base address of the COMP_E module.
459 //!
460 //! \return None
461 //
462 //*****************************************************************************
463 extern void Comp_E_enable(uint16_t baseAddress);
464 
465 //*****************************************************************************
466 //
467 //! \brief Turns off the Comp_E module.
468 //!
469 //! This function clears the CEON bit disabling the operation of the Comp_E
470 //! module, saving from excess power consumption.
471 //!
472 //! \param baseAddress is the base address of the COMP_E module.
473 //!
474 //! Modified bits are \b CEON of \b CECTL1 register.
475 //!
476 //! \return None
477 //
478 //*****************************************************************************
479 extern void Comp_E_disable(uint16_t baseAddress);
480 
481 //*****************************************************************************
482 //
483 //! \brief Shorts the two input pins chosen during initialization.
484 //!
485 //! This function sets the bit that shorts the devices attached to the input
486 //! pins chosen from the initialization of the Comp_E.
487 //!
488 //! \param baseAddress is the base address of the COMP_E module.
489 //!
490 //! Modified bits are \b CESHORT of \b CECTL1 register.
491 //!
492 //! \return None
493 //
494 //*****************************************************************************
495 extern void Comp_E_shortInputs(uint16_t baseAddress);
496 
497 //*****************************************************************************
498 //
499 //! \brief Disables the short of the two input pins chosen during
500 //! initialization.
501 //!
502 //! This function clears the bit that shorts the devices attached to the input
503 //! pins chosen from the initialization of the Comp_E.
504 //!
505 //! \param baseAddress is the base address of the COMP_E module.
506 //!
507 //! Modified bits are \b CESHORT of \b CECTL1 register.
508 //!
509 //! \return None
510 //
511 //*****************************************************************************
512 extern void Comp_E_unshortInputs(uint16_t baseAddress);
513 
514 //*****************************************************************************
515 //
516 //! \brief Disables the input buffer of the selected input port to effectively
517 //! allow for analog signals.
518 //!
519 //! This function sets the bit to disable the buffer for the specified input
520 //! port to allow for analog signals from any of the Comp_E input pins. This
521 //! bit is automatically set when the input is initialized to be used with the
522 //! Comp_E module. This function should be used whenever an analog input is
523 //! connected to one of these pins to prevent parasitic voltage from causing
524 //! unexpected results.
525 //!
526 //! \param baseAddress is the base address of the COMP_E module.
527 //! \param inputPort is the port in which the input buffer will be disabled.
528 //! Mask value is the logical OR of any of the following:
529 //! - \b COMP_E_INPUT0 [Default]
530 //! - \b COMP_E_INPUT1
531 //! - \b COMP_E_INPUT2
532 //! - \b COMP_E_INPUT3
533 //! - \b COMP_E_INPUT4
534 //! - \b COMP_E_INPUT5
535 //! - \b COMP_E_INPUT6
536 //! - \b COMP_E_INPUT7
537 //! - \b COMP_E_INPUT8
538 //! - \b COMP_E_INPUT9
539 //! - \b COMP_E_INPUT10
540 //! - \b COMP_E_INPUT11
541 //! - \b COMP_E_INPUT12
542 //! - \b COMP_E_INPUT13
543 //! - \b COMP_E_INPUT14
544 //! - \b COMP_E_INPUT15
545 //! - \b COMP_E_VREF
546 //! \n Modified bits are \b CEPDx of \b CECTL3 register.
547 //!
548 //! \return None
549 //
550 //*****************************************************************************
551 extern void Comp_E_disableInputBuffer(uint16_t baseAddress,
552  uint16_t inputPort);
553 
554 //*****************************************************************************
555 //
556 //! \brief Enables the input buffer of the selected input port to allow for
557 //! digital signals.
558 //!
559 //! This function clears the bit to enable the buffer for the specified input
560 //! port to allow for digital signals from any of the Comp_E input pins. This
561 //! should not be reset if there is an analog signal connected to the specified
562 //! input pin to prevent from unexpected results.
563 //!
564 //! \param baseAddress is the base address of the COMP_E module.
565 //! \param inputPort is the port in which the input buffer will be enabled.
566 //! Mask value is the logical OR of any of the following:
567 //! - \b COMP_E_INPUT0 [Default]
568 //! - \b COMP_E_INPUT1
569 //! - \b COMP_E_INPUT2
570 //! - \b COMP_E_INPUT3
571 //! - \b COMP_E_INPUT4
572 //! - \b COMP_E_INPUT5
573 //! - \b COMP_E_INPUT6
574 //! - \b COMP_E_INPUT7
575 //! - \b COMP_E_INPUT8
576 //! - \b COMP_E_INPUT9
577 //! - \b COMP_E_INPUT10
578 //! - \b COMP_E_INPUT11
579 //! - \b COMP_E_INPUT12
580 //! - \b COMP_E_INPUT13
581 //! - \b COMP_E_INPUT14
582 //! - \b COMP_E_INPUT15
583 //! - \b COMP_E_VREF
584 //! \n Modified bits are \b CEPDx of \b CECTL3 register.
585 //!
586 //! \return None
587 //
588 //*****************************************************************************
589 extern void Comp_E_enableInputBuffer(uint16_t baseAddress,
590  uint16_t inputPort);
591 
592 //*****************************************************************************
593 //
594 //! \brief Toggles the bit that swaps which terminals the inputs go to, while
595 //! also inverting the output of the Comp_E.
596 //!
597 //! This function toggles the bit that controls which input goes to which
598 //! terminal. After initialization, this bit is set to 0, after toggling it
599 //! once the inputs are routed to the opposite terminal and the output is
600 //! inverted.
601 //!
602 //! \param baseAddress is the base address of the COMP_E module.
603 //!
604 //! \return None
605 //
606 //*****************************************************************************
607 extern void Comp_E_swapIO(uint16_t baseAddress);
608 
609 //*****************************************************************************
610 //
611 //! \brief Returns the output value of the Comp_E module.
612 //!
613 //! Returns the output value of the Comp_E module.
614 //!
615 //! \param baseAddress is the base address of the COMP_E module.
616 //!
617 //! \return One of the following:
618 //! - \b Comp_E_LOW
619 //! - \b Comp_E_HIGH
620 //! \n indicating the output value of the Comp_E module
621 //
622 //*****************************************************************************
623 extern uint16_t Comp_E_outputValue(uint16_t baseAddress);
624 
625 //*****************************************************************************
626 //
627 // Mark the end of the C bindings section for C++ compilers.
628 //
629 //*****************************************************************************
630 #ifdef __cplusplus
631 }
632 #endif
633 
634 #endif
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

Copyright 2015, Texas Instruments Incorporated