1 //*****************************************************************************
\r
3 // comp.h - Prototypes for the analog comparator driver.
\r
5 // Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
\r
7 // Software License Agreement
\r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
\r
10 // exclusively on LMI's Stellaris Family of microcontroller products.
\r
12 // The software is owned by LMI and/or its suppliers, and is protected under
\r
13 // applicable copyright laws. All rights are reserved. Any use in violation
\r
14 // of the foregoing restrictions may subject the user to criminal sanctions
\r
15 // under applicable laws, as well as to civil liability for the breach of the
\r
16 // terms and conditions of this license.
\r
18 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
\r
19 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
\r
20 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
21 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
\r
22 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
\r
24 // This is part of revision 523 of the Stellaris Driver Library.
\r
26 //*****************************************************************************
\r
36 //*****************************************************************************
\r
38 // Values that can be passed to ComparatorConfigure() as the ulConfig
\r
39 // parameter. For each group (i.e. COMP_INT_xxx, COMP_ASRCP_xxx, etc.), one of
\r
40 // the values may be selected and ORed together will values from the other
\r
43 //*****************************************************************************
\r
44 #define COMP_INT_HIGH 0x00000010 // Interrupt when high
\r
45 #define COMP_INT_LOW 0x00000000 // Interrupt when low
\r
46 #define COMP_INT_FALL 0x00000004 // Interrupt on falling edge
\r
47 #define COMP_INT_RISE 0x00000008 // Interrupt on rising edge
\r
48 #define COMP_INT_BOTH 0x0000000C // Interrupt on both edges
\r
49 #define COMP_ASRCP_PIN 0x00000000 // Dedicated Comp+ pin
\r
50 #define COMP_ASRCP_PIN0 0x00000200 // Comp0+ pin
\r
51 #define COMP_ASRCP_REF 0x00000400 // Internal voltage reference
\r
52 #define COMP_OUTPUT_NONE 0x00000000 // No comparator output
\r
53 #define COMP_OUTPUT_NORMAL 0x00000100 // Comparator output normal
\r
54 #define COMP_OUTPUT_INVERT 0x00000102 // Comparator output inverted
\r
56 //*****************************************************************************
\r
58 // Values that can be passed to ComparatorSetRef() as the ulRef parameter.
\r
60 //*****************************************************************************
\r
61 #define COMP_REF_OFF 0x00000000 // Turn off the internal reference
\r
62 #define COMP_REF_0V 0x00000300 // Internal reference of 0V
\r
63 #define COMP_REF_0_1375V 0x00000301 // Internal reference of 0.1375V
\r
64 #define COMP_REF_0_275V 0x00000302 // Internal reference of 0.275V
\r
65 #define COMP_REF_0_4125V 0x00000303 // Internal reference of 0.4125V
\r
66 #define COMP_REF_0_55V 0x00000304 // Internal reference of 0.55V
\r
67 #define COMP_REF_0_6875V 0x00000305 // Internal reference of 0.6875V
\r
68 #define COMP_REF_0_825V 0x00000306 // Internal reference of 0.825V
\r
69 #define COMP_REF_0_928125V 0x00000201 // Internal reference of 0.928125V
\r
70 #define COMP_REF_0_9625V 0x00000307 // Internal reference of 0.9625V
\r
71 #define COMP_REF_1_03125V 0x00000202 // Internal reference of 1.03125V
\r
72 #define COMP_REF_1_134375V 0x00000203 // Internal reference of 1.134375V
\r
73 #define COMP_REF_1_1V 0x00000308 // Internal reference of 1.1V
\r
74 #define COMP_REF_1_2375V 0x00000309 // Internal reference of 1.2375V
\r
75 #define COMP_REF_1_340625V 0x00000205 // Internal reference of 1.340625V
\r
76 #define COMP_REF_1_375V 0x0000030A // Internal reference of 1.375V
\r
77 #define COMP_REF_1_44375V 0x00000206 // Internal reference of 1.44375V
\r
78 #define COMP_REF_1_5125V 0x0000030B // Internal reference of 1.5125V
\r
79 #define COMP_REF_1_546875V 0x00000207 // Internal reference of 1.546875V
\r
80 #define COMP_REF_1_65V 0x0000030C // Internal reference of 1.65V
\r
81 #define COMP_REF_1_753125V 0x00000209 // Internal reference of 1.753125V
\r
82 #define COMP_REF_1_7875V 0x0000030D // Internal reference of 1.7875V
\r
83 #define COMP_REF_1_85625V 0x0000020A // Internal reference of 1.85625V
\r
84 #define COMP_REF_1_925V 0x0000030E // Internal reference of 1.925V
\r
85 #define COMP_REF_1_959375V 0x0000020B // Internal reference of 1.959375V
\r
86 #define COMP_REF_2_0625V 0x0000030F // Internal reference of 2.0625V
\r
87 #define COMP_REF_2_165625V 0x0000020D // Internal reference of 2.165625V
\r
88 #define COMP_REF_2_26875V 0x0000020E // Internal reference of 2.26875V
\r
89 #define COMP_REF_2_371875V 0x0000020F // Internal reference of 2.371875V
\r
91 //*****************************************************************************
\r
93 // Prototypes for the APIs.
\r
95 //*****************************************************************************
\r
96 extern void ComparatorConfigure(unsigned long ulBase, unsigned long ulComp,
\r
97 unsigned long ulConfig);
\r
98 extern void ComparatorRefSet(unsigned long ulBase, unsigned long ulRef);
\r
99 extern tBoolean ComparatorValueGet(unsigned long ulBase, unsigned long ulComp);
\r
100 extern void ComparatorIntRegister(unsigned long ulBase, unsigned long ulComp,
\r
101 void (*pfnHandler)(void));
\r
102 extern void ComparatorIntUnregister(unsigned long ulBase,
\r
103 unsigned long ulComp);
\r
104 extern tBoolean ComparatorIntStatus(unsigned long ulBase, unsigned long ulComp,
\r
106 extern void ComparatorIntClear(unsigned long ulBase, unsigned long ulComp);
\r
112 #endif // __COMP_H__
\r