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