1 //*****************************************************************************
\r
3 // adc.h - ADC headers for using the ADC driver functions.
\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 816 of the Stellaris Driver Library.
\r
26 //*****************************************************************************
\r
36 //*****************************************************************************
\r
38 // Values that can be passed to ADCSequenceConfigure as the ulTrigger
\r
41 //*****************************************************************************
\r
42 #define ADC_TRIGGER_PROCESSOR 0x00000000 // Processor event
\r
43 #define ADC_TRIGGER_COMP0 0x00000001 // Analog comparator 0 event
\r
44 #define ADC_TRIGGER_COMP1 0x00000002 // Analog comparator 1 event
\r
45 #define ADC_TRIGGER_COMP2 0x00000003 // Analog comparator 2 event
\r
46 #define ADC_TRIGGER_EXTERNAL 0x00000004 // External event
\r
47 #define ADC_TRIGGER_TIMER 0x00000005 // Timer event
\r
48 #define ADC_TRIGGER_PWM0 0x00000006 // PWM0 event
\r
49 #define ADC_TRIGGER_PWM1 0x00000007 // PWM1 event
\r
50 #define ADC_TRIGGER_PWM2 0x00000008 // PWM2 event
\r
51 #define ADC_TRIGGER_ALWAYS 0x0000000F // Always event
\r
53 //*****************************************************************************
\r
55 // Values that can be passed to ADCSequenceStepConfigure as the ulConfig
\r
58 //*****************************************************************************
\r
59 #define ADC_CTL_TS 0x00000080 // Temperature sensor select
\r
60 #define ADC_CTL_IE 0x00000040 // Interrupt enable
\r
61 #define ADC_CTL_END 0x00000020 // Sequence end select
\r
62 #define ADC_CTL_D 0x00000010 // Differential select
\r
63 #define ADC_CTL_CH0 0x00000000 // Input channel 0
\r
64 #define ADC_CTL_CH1 0x00000001 // Input channel 1
\r
65 #define ADC_CTL_CH2 0x00000002 // Input channel 2
\r
66 #define ADC_CTL_CH3 0x00000003 // Input channel 3
\r
67 #define ADC_CTL_CH4 0x00000004 // Input channel 4
\r
68 #define ADC_CTL_CH5 0x00000005 // Input channel 5
\r
69 #define ADC_CTL_CH6 0x00000006 // Input channel 6
\r
70 #define ADC_CTL_CH7 0x00000007 // Input channel 7
\r
72 //*****************************************************************************
\r
74 // Prototypes for the APIs.
\r
76 //*****************************************************************************
\r
77 extern void ADCIntRegister(unsigned long ulBase, unsigned long ulSequenceNum,
\r
78 void (*pfnHandler)(void));
\r
79 extern void ADCIntUnregister(unsigned long ulBase,
\r
80 unsigned long ulSequenceNum);
\r
81 extern void ADCIntDisable(unsigned long ulBase, unsigned long ulSequenceNum);
\r
82 extern void ADCIntEnable(unsigned long ulBase, unsigned long ulSequenceNum);
\r
83 extern unsigned long ADCIntStatus(unsigned long ulBase,
\r
84 unsigned long ulSequenceNum,
\r
86 extern void ADCIntClear(unsigned long ulBase, unsigned long ulSequenceNum);
\r
87 extern void ADCSequenceEnable(unsigned long ulBase,
\r
88 unsigned long ulSequenceNum);
\r
89 extern void ADCSequenceDisable(unsigned long ulBase,
\r
90 unsigned long ulSequenceNum);
\r
91 extern void ADCSequenceConfigure(unsigned long ulBase,
\r
92 unsigned long ulSequenceNum,
\r
93 unsigned long ulTrigger,
\r
94 unsigned long ulPriority);
\r
95 extern void ADCSequenceStepConfigure(unsigned long ulBase,
\r
96 unsigned long ulSequenceNum,
\r
97 unsigned long ulStep,
\r
98 unsigned long ulConfig);
\r
99 extern long ADCSequenceOverflow(unsigned long ulBase,
\r
100 unsigned long ulSequenceNum);
\r
101 extern long ADCSequenceUnderflow(unsigned long ulBase,
\r
102 unsigned long ulSequenceNum);
\r
103 extern long ADCSequenceDataGet(unsigned long ulBase,
\r
104 unsigned long ulSequenceNum,
\r
105 unsigned long *pulBuffer);
\r
106 extern void ADCProcessorTrigger(unsigned long ulBase,
\r
107 unsigned long ulSequenceNum);
\r
108 extern void ADCSoftwareOversampleConfigure(unsigned long ulBase,
\r
109 unsigned long ulSequenceNum,
\r
110 unsigned long ulFactor);
\r
111 extern void ADCSoftwareOversampleStepConfigure(unsigned long ulBase,
\r
112 unsigned long ulSequenceNum,
\r
113 unsigned long ulStep,
\r
114 unsigned long ulConfig);
\r
115 extern void ADCSoftwareOversampleDataGet(unsigned long ulBase,
\r
116 unsigned long ulSequenceNum,
\r
117 unsigned long *pulBuffer,
\r
118 unsigned long ulCount);
\r
124 #endif // __ADC_H__
\r