MSP430 DriverLib for MSP430FR57xx Devices  2.91.13.01
comp_d.h
1 //*****************************************************************************
2 //
3 // comp_d.h - Driver for the COMP_D Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_COMP_D_H__
8 #define __MSP430WARE_COMP_D_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_COMPD__
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_D_init() function as the param parameter.
29 //
30 //*****************************************************************************
31 typedef struct Comp_D_initParam {
32  //! Selects the input to the positive terminal.
33  //! \n Valid values are:
34  //! - \b COMP_D_INPUT0 [Default]
35  //! - \b COMP_D_INPUT1
36  //! - \b COMP_D_INPUT2
37  //! - \b COMP_D_INPUT3
38  //! - \b COMP_D_INPUT4
39  //! - \b COMP_D_INPUT5
40  //! - \b COMP_D_INPUT6
41  //! - \b COMP_D_INPUT7
42  //! - \b COMP_D_INPUT8
43  //! - \b COMP_D_INPUT9
44  //! - \b COMP_D_INPUT10
45  //! - \b COMP_D_INPUT11
46  //! - \b COMP_D_INPUT12
47  //! - \b COMP_D_INPUT13
48  //! - \b COMP_D_INPUT14
49  //! - \b COMP_D_INPUT15
50  //! - \b COMP_D_VREF
52  //! Selects the input to the negative terminal.
53  //! \n Valid values are:
54  //! - \b COMP_D_INPUT0 [Default]
55  //! - \b COMP_D_INPUT1
56  //! - \b COMP_D_INPUT2
57  //! - \b COMP_D_INPUT3
58  //! - \b COMP_D_INPUT4
59  //! - \b COMP_D_INPUT5
60  //! - \b COMP_D_INPUT6
61  //! - \b COMP_D_INPUT7
62  //! - \b COMP_D_INPUT8
63  //! - \b COMP_D_INPUT9
64  //! - \b COMP_D_INPUT10
65  //! - \b COMP_D_INPUT11
66  //! - \b COMP_D_INPUT12
67  //! - \b COMP_D_INPUT13
68  //! - \b COMP_D_INPUT14
69  //! - \b COMP_D_INPUT15
70  //! - \b COMP_D_VREF
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_D_FILTEROUTPUT_OFF [Default]
77  //! - \b COMP_D_FILTEROUTPUT_DLYLVL1
78  //! - \b COMP_D_FILTEROUTPUT_DLYLVL2
79  //! - \b COMP_D_FILTEROUTPUT_DLYLVL3
80  //! - \b COMP_D_FILTEROUTPUT_DLYLVL4
82  //! Controls if the output will be inverted or not
83  //! \n Valid values are:
84  //! - \b COMP_D_NORMALOUTPUTPOLARITY [Default]
85  //! - \b COMP_D_INVERTEDOUTPUTPOLARITY
88 
89 
90 //*****************************************************************************
91 //
92 // The following are values that can be passed to the
93 // outputFilterEnableAndDelayLevel parameter for functions: Comp_D_init(); the
94 // param parameter for functions: Comp_D_init().
95 //
96 //*****************************************************************************
97 #define COMP_D_FILTEROUTPUT_OFF 0x00
98 #define COMP_D_FILTEROUTPUT_DLYLVL1 (CDF + CDFDLY_0)
99 #define COMP_D_FILTEROUTPUT_DLYLVL2 (CDF + CDFDLY_1)
100 #define COMP_D_FILTEROUTPUT_DLYLVL3 (CDF + CDFDLY_2)
101 #define COMP_D_FILTEROUTPUT_DLYLVL4 (CDF + CDFDLY_3)
102 
103 //*****************************************************************************
104 //
105 // The following are values that can be passed to the positiveTerminalInput
106 // parameter for functions: Comp_D_init(); the inputPort parameter for
107 // functions: Comp_D_enableInputBuffer(), and Comp_D_disableInputBuffer(); the
108 // negativeTerminalInput parameter for functions: Comp_D_init(); the param
109 // parameter for functions: Comp_D_init(), and Comp_D_init().
110 //
111 //*****************************************************************************
112 #define COMP_D_INPUT0 (CDIPSEL_0)
113 #define COMP_D_INPUT1 (CDIPSEL_1)
114 #define COMP_D_INPUT2 (CDIPSEL_2)
115 #define COMP_D_INPUT3 (CDIPSEL_3)
116 #define COMP_D_INPUT4 (CDIPSEL_4)
117 #define COMP_D_INPUT5 (CDIPSEL_5)
118 #define COMP_D_INPUT6 (CDIPSEL_6)
119 #define COMP_D_INPUT7 (CDIPSEL_7)
120 #define COMP_D_INPUT8 (CDIPSEL_8)
121 #define COMP_D_INPUT9 (CDIPSEL_9)
122 #define COMP_D_INPUT10 (CDIPSEL_10)
123 #define COMP_D_INPUT11 (CDIPSEL_11)
124 #define COMP_D_INPUT12 (CDIPSEL_12)
125 #define COMP_D_INPUT13 (CDIPSEL_13)
126 #define COMP_D_INPUT14 (CDIPSEL_14)
127 #define COMP_D_INPUT15 (CDIPSEL_15)
128 #define COMP_D_VREF (0x10)
129 
130 //*****************************************************************************
131 //
132 // The following are values that can be passed to the invertedOutputPolarity
133 // parameter for functions: Comp_D_init(); the param parameter for functions:
134 // Comp_D_init().
135 //
136 //*****************************************************************************
137 #define COMP_D_NORMALOUTPUTPOLARITY (!(CDOUTPOL))
138 #define COMP_D_INVERTEDOUTPUTPOLARITY (CDOUTPOL)
139 
140 //*****************************************************************************
141 //
142 // The following are values that can be passed to the
143 // supplyVoltageReferenceBase parameter for functions:
144 // Comp_D_setReferenceVoltage().
145 //
146 //*****************************************************************************
147 #define COMP_D_REFERENCE_AMPLIFIER_DISABLED (CDREFL_0)
148 #define COMP_D_VREFBASE1_5V (CDREFL_1)
149 #define COMP_D_VREFBASE2_0V (CDREFL_2)
150 #define COMP_D_VREFBASE2_5V (CDREFL_3)
151 
152 //*****************************************************************************
153 //
154 // The following are values that can be passed to the referenceAccuracy
155 // parameter for functions: Comp_D_setReferenceAccuracy().
156 //
157 //*****************************************************************************
158 #define COMP_D_ACCURACY_STATIC (!CDREFACC)
159 #define COMP_D_ACCURACY_CLOCKED (CDREFACC)
160 
161 //*****************************************************************************
162 //
163 // The following are values that can be passed to the interruptMask parameter
164 // for functions: Comp_D_enableInterrupt(), and Comp_D_disableInterrupt().
165 //
166 //*****************************************************************************
167 #define COMP_D_INTERRUPT (CDIE)
168 #define COMP_D_INTERRUPT_INVERTED_POLARITY (CDIIE)
169 
170 //*****************************************************************************
171 //
172 // The following are values that can be passed to the interruptFlagMask
173 // parameter for functions: Comp_D_clearInterrupt(), and
174 // Comp_D_getInterruptStatus().
175 //
176 //*****************************************************************************
177 #define COMP_D_INTERRUPT_FLAG (CDIFG)
178 #define COMP_D_INTERRUPT_FLAG_INVERTED_POLARITY (CDIIFG)
179 
180 //*****************************************************************************
181 //
182 // The following are values that can be passed to the edgeDirection parameter
183 // for functions: Comp_D_setInterruptEdgeDirection().
184 //
185 //*****************************************************************************
186 #define COMP_D_FALLINGEDGE (!(CDIES))
187 #define COMP_D_RISINGEDGE (CDIES)
188 
189 //*****************************************************************************
190 //
191 // The following are values that can be passed toThe following are values that
192 // can be returned by the Comp_D_outputValue() function.
193 //
194 //*****************************************************************************
195 #define COMP_D_HIGH (CDOUT)
196 #define COMP_D_LOW (!CDOUT)
197 
198 //*****************************************************************************
199 //
200 // Prototypes for the APIs.
201 //
202 //*****************************************************************************
203 
204 //*****************************************************************************
205 //
206 //! \brief Initializes the Comp_D Module.
207 //!
208 //! Upon successful initialization of the Comp_D module, this function will
209 //! have reset all necessary register bits and set the given options in the
210 //! registers. To actually use the Comp_D module, the Comp_D_enable() function
211 //! must be explicitly called before use. If a Reference Voltage is set to a
212 //! terminal, the Voltage should be set using the setReferenceVoltage()
213 //! function.
214 //!
215 //! \param baseAddress is the base address of the COMP_D module.
216 //! \param param is the pointer to struct for initialization.
217 //!
218 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process
219 //
220 //*****************************************************************************
221 extern bool Comp_D_init(uint16_t baseAddress,
222  Comp_D_initParam *param);
223 
224 //*****************************************************************************
225 //
226 //! \brief Generates a Reference Voltage to the terminal selected during
227 //! initialization.
228 //!
229 //! Use this function to generate a voltage to serve as a reference to the
230 //! terminal selected at initialization. The voltage is determined by the
231 //! equation: Vbase * (Numerator / 32). If the upper and lower limit voltage
232 //! numerators are equal, then a static reference is defined, whereas they are
233 //! different then a hysteresis effect is generated. Note that the "limit"
234 //! voltage is the voltage triggers a change in COMP_D value.
235 //!
236 //! \param baseAddress is the base address of the COMP_D module.
237 //! \param supplyVoltageReferenceBase decides the source and max amount of
238 //! Voltage that can be used as a reference.
239 //! Valid values are:
240 //! - \b COMP_D_REFERENCE_AMPLIFIER_DISABLED
241 //! - \b COMP_D_VREFBASE1_5V
242 //! - \b COMP_D_VREFBASE2_0V
243 //! - \b COMP_D_VREFBASE2_5V
244 //! \n Modified bits are \b CDREFL of \b CDCTL2 register.
245 //! \param lowerLimitSupplyVoltageFractionOf32 is the numerator of the equation
246 //! to generate the reference voltage for the lower limit reference
247 //! voltage.
248 //! \n Modified bits are \b CDREF0 of \b CDCTL2 register.
249 //! \param upperLimitSupplyVoltageFractionOf32 is the numerator of the equation
250 //! to generate the reference voltage for the upper limit reference
251 //! voltage.
252 //! \n Modified bits are \b CDREF1 of \b CDCTL2 register.
253 //!
254 //! \return None
255 //
256 //*****************************************************************************
257 extern void Comp_D_setReferenceVoltage(uint16_t baseAddress,
258  uint16_t supplyVoltageReferenceBase,
259  uint16_t lowerLimitSupplyVoltageFractionOf32,
260  uint16_t upperLimitSupplyVoltageFractionOf32);
261 
262 //*****************************************************************************
263 //
264 //! \brief Sets the reference accuracy
265 //!
266 //! The reference accuracy is set to the desired setting. Clocked is better for
267 //! low power operations but has a lower accuracy.
268 //!
269 //! \param baseAddress is the base address of the COMP_D module.
270 //! \param referenceAccuracy is the reference accuracy setting of the
271 //! comparator. Clocked is for low power/low accuracy.
272 //! Valid values are:
273 //! - \b COMP_D_ACCURACY_STATIC
274 //! - \b COMP_D_ACCURACY_CLOCKED
275 //! \n Modified bits are \b CDREFACC of \b CDCTL2 register.
276 //!
277 //! \return None
278 //
279 //*****************************************************************************
280 extern void Comp_D_setReferenceAccuracy(uint16_t baseAddress,
281  uint16_t referenceAccuracy);
282 
283 //*****************************************************************************
284 //
285 //! \brief Enables selected Comparator interrupt sources.
286 //!
287 //! Enables the indicated Comparator interrupt sources. Only the sources that
288 //! are enabled can be reflected to the processor interrupt; disabled sources
289 //! have no effect on the processor. <b>Does not clear interrupt flags.</b>
290 //!
291 //! \param baseAddress is the base address of the COMP_D module.
292 //! \param interruptMask
293 //! Mask value is the logical OR of any of the following:
294 //! - \b COMP_D_INTERRUPT - Output interrupt
295 //! - \b COMP_D_INTERRUPT_INVERTED_POLARITY - Output interrupt inverted
296 //! polarity
297 //!
298 //
299 //*****************************************************************************
300 extern void Comp_D_enableInterrupt(uint16_t baseAddress,
301  uint16_t interruptMask);
302 
303 //*****************************************************************************
304 //
305 //! \brief Disables selected Comparator interrupt sources.
306 //!
307 //! Disables the indicated Comparator interrupt sources. Only the sources that
308 //! are enabled can be reflected to the processor interrupt; disabled sources
309 //! have no effect on the processor.
310 //!
311 //! \param baseAddress is the base address of the COMP_D module.
312 //! \param interruptMask
313 //! Mask value is the logical OR of any of the following:
314 //! - \b COMP_D_INTERRUPT - Output interrupt
315 //! - \b COMP_D_INTERRUPT_INVERTED_POLARITY - Output interrupt inverted
316 //! polarity
317 //!
318 //
319 //*****************************************************************************
320 extern void Comp_D_disableInterrupt(uint16_t baseAddress,
321  uint16_t interruptMask);
322 
323 //*****************************************************************************
324 //
325 //! \brief Clears Comparator interrupt flags.
326 //!
327 //! The Comparator interrupt source is cleared, so that it no longer
328 //! asserts.The highest interrupt flag is automatically cleared when an
329 //! interrupt vector generator is used.
330 //!
331 //! \param baseAddress is the base address of the COMP_D module.
332 //! \param interruptFlagMask
333 //! Mask value is the logical OR of any of the following:
334 //! - \b COMP_D_INTERRUPT_FLAG - Output interrupt flag
335 //! - \b COMP_D_INTERRUPT_FLAG_INVERTED_POLARITY - Output interrupt flag
336 //! inverted polarity
337 //!
338 //
339 //*****************************************************************************
340 extern void Comp_D_clearInterrupt(uint16_t baseAddress,
341  uint16_t interruptFlagMask);
342 
343 //*****************************************************************************
344 //
345 //! \brief Gets the current Comparator interrupt status.
346 //!
347 //! This returns the interrupt status for the Comparator module based on which
348 //! flag is passed.
349 //!
350 //! \param baseAddress is the base address of the COMP_D module.
351 //! \param interruptFlagMask
352 //! Mask value is the logical OR of any of the following:
353 //! - \b COMP_D_INTERRUPT_FLAG - Output interrupt flag
354 //! - \b COMP_D_INTERRUPT_FLAG_INVERTED_POLARITY - Output interrupt flag
355 //! inverted polarity
356 //!
357 //
358 //*****************************************************************************
359 extern uint8_t Comp_D_getInterruptStatus(uint16_t baseAddress,
360  uint16_t interruptFlagMask);
361 
362 //*****************************************************************************
363 //
364 //! \brief Explicitly sets the edge direction that would trigger an interrupt.
365 //!
366 //! This function will set which direction the output will have to go, whether
367 //! rising or falling, to generate an interrupt based on a non-inverted
368 //! interrupt.
369 //!
370 //! \param baseAddress is the base address of the COMP_D module.
371 //! \param edgeDirection determines which direction the edge would have to go
372 //! to generate an interrupt based on the non-inverted interrupt flag.
373 //! Valid values are:
374 //! - \b COMP_D_FALLINGEDGE [Default] - sets the bit to generate an
375 //! interrupt when the output of the comparator falls from HIGH to
376 //! LOW if the normal interrupt bit is set(and LOW to HIGH if the
377 //! inverted interrupt enable bit is set).
378 //! - \b COMP_D_RISINGEDGE - sets the bit to generate an interrupt when
379 //! the output of the comparator rises from LOW to HIGH if the normal
380 //! interrupt bit is set(and HIGH to LOW if the inverted interrupt
381 //! enable bit is set).
382 //! \n Modified bits are \b CDIES of \b CDCTL1 register.
383 //!
384 //! \return None
385 //
386 //*****************************************************************************
387 extern void Comp_D_setInterruptEdgeDirection(uint16_t baseAddress,
388  uint16_t edgeDirection);
389 
390 //*****************************************************************************
391 //
392 //! \brief Toggles the edge direction that would trigger an interrupt.
393 //!
394 //! This function will toggle which direction the output will have to go,
395 //! whether rising or falling, to generate an interrupt based on a non-inverted
396 //! interrupt. If the direction was rising, it is now falling, if it was
397 //! falling, it is now rising.
398 //!
399 //! \param baseAddress is the base address of the COMP_D module.
400 //!
401 //! \return None
402 //
403 //*****************************************************************************
404 extern void Comp_D_toggleInterruptEdgeDirection(uint16_t baseAddress);
405 
406 //*****************************************************************************
407 //
408 //! \brief Turns on the Comparator module.
409 //!
410 //! This function sets the bit that enables the operation of the Comparator
411 //! module.
412 //!
413 //! \param baseAddress is the base address of the COMP_D module.
414 //!
415 //! \return None
416 //
417 //*****************************************************************************
418 extern void Comp_D_enable(uint16_t baseAddress);
419 
420 //*****************************************************************************
421 //
422 //! \brief Turns off the Comparator module.
423 //!
424 //! This function clears the CDON bit disabling the operation of the Comparator
425 //! module, saving from excess power consumption.
426 //!
427 //! \param baseAddress is the base address of the COMP_D module.
428 //!
429 //! \return None
430 //
431 //*****************************************************************************
432 extern void Comp_D_disable(uint16_t baseAddress);
433 
434 //*****************************************************************************
435 //
436 //! \brief Shorts the two input pins chosen during initialization.
437 //!
438 //! This function sets the bit that shorts the devices attached to the input
439 //! pins chosen from the initialization of the comparator.
440 //!
441 //! \param baseAddress is the base address of the COMP_D module.
442 //!
443 //! \return None
444 //
445 //*****************************************************************************
446 extern void Comp_D_shortInputs(uint16_t baseAddress);
447 
448 //*****************************************************************************
449 //
450 //! \brief Disables the short of the two input pins chosen during
451 //! initialization.
452 //!
453 //! This function clears the bit that shorts the devices attached to the input
454 //! pins chosen from the initialization of the comparator.
455 //!
456 //! \param baseAddress is the base address of the COMP_D module.
457 //!
458 //! \return None
459 //
460 //*****************************************************************************
461 extern void Comp_D_unshortInputs(uint16_t baseAddress);
462 
463 //*****************************************************************************
464 //
465 //! \brief Disables the input buffer of the selected input port to effectively
466 //! allow for analog signals.
467 //!
468 //! This function sets the bit to disable the buffer for the specified input
469 //! port to allow for analog signals from any of the comparator input pins.
470 //! This bit is automatically set when the input is initialized to be used with
471 //! the comparator module. This function should be used whenever an analog
472 //! input is connected to one of these pins to prevent parasitic voltage from
473 //! causing unexpected results.
474 //!
475 //! \param baseAddress is the base address of the COMP_D module.
476 //! \param inputPort is the port in which the input buffer will be disabled.
477 //! Valid values are:
478 //! - \b COMP_D_INPUT0 [Default]
479 //! - \b COMP_D_INPUT1
480 //! - \b COMP_D_INPUT2
481 //! - \b COMP_D_INPUT3
482 //! - \b COMP_D_INPUT4
483 //! - \b COMP_D_INPUT5
484 //! - \b COMP_D_INPUT6
485 //! - \b COMP_D_INPUT7
486 //! - \b COMP_D_INPUT8
487 //! - \b COMP_D_INPUT9
488 //! - \b COMP_D_INPUT10
489 //! - \b COMP_D_INPUT11
490 //! - \b COMP_D_INPUT12
491 //! - \b COMP_D_INPUT13
492 //! - \b COMP_D_INPUT14
493 //! - \b COMP_D_INPUT15
494 //! - \b COMP_D_VREF
495 //! \n Modified bits are \b CDPDx of \b CDCTL3 register.
496 //!
497 //! \return None
498 //
499 //*****************************************************************************
500 extern void Comp_D_disableInputBuffer(uint16_t baseAddress,
501  uint8_t inputPort);
502 
503 //*****************************************************************************
504 //
505 //! \brief Enables the input buffer of the selected input port to allow for
506 //! digital signals.
507 //!
508 //! This function clears the bit to enable the buffer for the specified input
509 //! port to allow for digital signals from any of the comparator input pins.
510 //! This should not be reset if there is an analog signal connected to the
511 //! specified input pin to prevent from unexpected results.
512 //!
513 //! \param baseAddress is the base address of the COMP_D module.
514 //! \param inputPort is the port in which the input buffer will be enabled.
515 //! Valid values are:
516 //! - \b COMP_D_INPUT0 [Default]
517 //! - \b COMP_D_INPUT1
518 //! - \b COMP_D_INPUT2
519 //! - \b COMP_D_INPUT3
520 //! - \b COMP_D_INPUT4
521 //! - \b COMP_D_INPUT5
522 //! - \b COMP_D_INPUT6
523 //! - \b COMP_D_INPUT7
524 //! - \b COMP_D_INPUT8
525 //! - \b COMP_D_INPUT9
526 //! - \b COMP_D_INPUT10
527 //! - \b COMP_D_INPUT11
528 //! - \b COMP_D_INPUT12
529 //! - \b COMP_D_INPUT13
530 //! - \b COMP_D_INPUT14
531 //! - \b COMP_D_INPUT15
532 //! - \b COMP_D_VREF
533 //! \n Modified bits are \b CDPDx of \b CDCTL3 register.
534 //!
535 //! \return None
536 //
537 //*****************************************************************************
538 extern void Comp_D_enableInputBuffer(uint16_t baseAddress,
539  uint8_t inputPort);
540 
541 //*****************************************************************************
542 //
543 //! \brief Toggles the bit that swaps which terminals the inputs go to, while
544 //! also inverting the output of the comparator.
545 //!
546 //! This function toggles the bit that controls which input goes to which
547 //! terminal. After initialization, this bit is set to 0, after toggling it
548 //! once the inputs are routed to the opposite terminal and the output is
549 //! inverted.
550 //!
551 //! \param baseAddress is the base address of the COMP_D module.
552 //!
553 //! \return None
554 //
555 //*****************************************************************************
556 extern void Comp_D_swapIO(uint16_t baseAddress);
557 
558 //*****************************************************************************
559 //
560 //! \brief Returns the output value of the Comp_D module.
561 //!
562 //! Returns the output value of the Comp_D module.
563 //!
564 //! \param baseAddress is the base address of the COMP_D module.
565 //!
566 //! \return Comp_D_HIGH or Comp_D_LOW as the output value of the Comparator
567 //! module.
568 //! Return one of the following:
569 //! - \b COMP_D_HIGH
570 //! - \b COMP_D_LOW
571 //! \n indicates the output should be normal
572 //
573 //*****************************************************************************
574 extern uint16_t Comp_D_outputValue(uint16_t baseAddress);
575 
576 //*****************************************************************************
577 //
578 // Mark the end of the C bindings section for C++ compilers.
579 //
580 //*****************************************************************************
581 #ifdef __cplusplus
582 }
583 #endif
584 
585 #endif
586 #endif // __MSP430WARE_COMP_D_H__
bool Comp_D_init(uint16_t baseAddress, Comp_D_initParam *param)
Initializes the Comp_D Module.
Definition: comp_d.c:21
uint16_t invertedOutputPolarity
Definition: comp_d.h:86
void Comp_D_shortInputs(uint16_t baseAddress)
Shorts the two input pins chosen during initialization.
Definition: comp_d.c:154
uint8_t negativeTerminalInput
Definition: comp_d.h:71
uint8_t outputFilterEnableAndDelayLevel
Definition: comp_d.h:81
void Comp_D_setInterruptEdgeDirection(uint16_t baseAddress, uint16_t edgeDirection)
Explicitly sets the edge direction that would trigger an interrupt.
Definition: comp_d.c:128
void Comp_D_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_d.c:66
Used in the Comp_D_init() function as the param parameter.
Definition: comp_d.h:31
void Comp_D_unshortInputs(uint16_t baseAddress)
Disables the short of the two input pins chosen during initialization.
Definition: comp_d.c:159
void Comp_D_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_d.c:176
uint16_t Comp_D_outputValue(uint16_t baseAddress)
Returns the output value of the Comp_D module.
Definition: comp_d.c:181
void Comp_D_toggleInterruptEdgeDirection(uint16_t baseAddress)
Toggles the edge direction that would trigger an interrupt.
Definition: comp_d.c:139
void Comp_D_clearInterrupt(uint16_t baseAddress, uint16_t interruptFlagMask)
Clears Comparator interrupt flags.
Definition: comp_d.c:116
uint8_t Comp_D_getInterruptStatus(uint16_t baseAddress, uint16_t interruptFlagMask)
Gets the current Comparator interrupt status.
Definition: comp_d.c:122
void Comp_D_setReferenceAccuracy(uint16_t baseAddress, uint16_t referenceAccuracy)
Sets the reference accuracy.
Definition: comp_d.c:96
void Comp_D_disable(uint16_t baseAddress)
Turns off the Comparator module.
Definition: comp_d.c:149
void Comp_D_disableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Disables selected Comparator interrupt sources.
Definition: comp_d.c:110
void Comp_D_enableInterrupt(uint16_t baseAddress, uint16_t interruptMask)
Enables selected Comparator interrupt sources.
Definition: comp_d.c:103
void Comp_D_enable(uint16_t baseAddress)
Turns on the Comparator module.
Definition: comp_d.c:144
void Comp_D_enableInputBuffer(uint16_t baseAddress, uint8_t inputPort)
Enables the input buffer of the selected input port to allow for digital signals. ...
Definition: comp_d.c:170
uint8_t positiveTerminalInput
Definition: comp_d.h:51
void Comp_D_disableInputBuffer(uint16_t baseAddress, uint8_t inputPort)
Disables the input buffer of the selected input port to effectively allow for analog signals...
Definition: comp_d.c:164

Copyright 2020, Texas Instruments Incorporated