]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_LM3S2965_IAR/LuminaryDrivers/adc.h
Update to V4.3.0 as described in http://www.FreeRTOS.org/History.txt
[freertos] / Demo / CORTEX_LM3S2965_IAR / LuminaryDrivers / adc.h
1 //*****************************************************************************\r
2 //\r
3 // adc.h - ADC headers for using the ADC driver functions.\r
4 //\r
5 // Copyright (c) 2005-2007 Luminary Micro, Inc.  All rights reserved.\r
6 // \r
7 // Software License Agreement\r
8 // \r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and\r
10 // exclusively on LMI's microcontroller products.\r
11 // \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
17 // \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
23 // \r
24 // This is part of revision 1408 of the Stellaris Peripheral Driver Library.\r
25 //\r
26 //*****************************************************************************\r
27 \r
28 #ifndef __ADC_H__\r
29 #define __ADC_H__\r
30 \r
31 #ifdef __cplusplus\r
32 extern "C"\r
33 {\r
34 #endif\r
35 \r
36 //*****************************************************************************\r
37 //\r
38 // Values that can be passed to ADCSequenceConfigure as the ulTrigger\r
39 // parameter.\r
40 //\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
52 \r
53 //*****************************************************************************\r
54 //\r
55 // Values that can be passed to ADCSequenceStepConfigure as the ulConfig\r
56 // parameter.\r
57 //\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
71 \r
72 //*****************************************************************************\r
73 //\r
74 // Prototypes for the APIs.\r
75 //\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
85                                   tBoolean bMasked);\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 void ADCSequenceOverflowClear(unsigned long ulBase,\r
102                                      unsigned long ulSequenceNum);\r
103 extern long ADCSequenceUnderflow(unsigned long ulBase,\r
104                                  unsigned long ulSequenceNum);\r
105 extern void ADCSequenceUnderflowClear(unsigned long ulBase,\r
106                                       unsigned long ulSequenceNum);\r
107 extern long ADCSequenceDataGet(unsigned long ulBase,\r
108                                unsigned long ulSequenceNum,\r
109                                unsigned long *pulBuffer);\r
110 extern void ADCProcessorTrigger(unsigned long ulBase,\r
111                                 unsigned long ulSequenceNum);\r
112 extern void ADCSoftwareOversampleConfigure(unsigned long ulBase,\r
113                                            unsigned long ulSequenceNum,\r
114                                            unsigned long ulFactor);\r
115 extern void ADCSoftwareOversampleStepConfigure(unsigned long ulBase,\r
116                                                unsigned long ulSequenceNum,\r
117                                                unsigned long ulStep,\r
118                                                unsigned long ulConfig);\r
119 extern void ADCSoftwareOversampleDataGet(unsigned long ulBase,\r
120                                          unsigned long ulSequenceNum,\r
121                                          unsigned long *pulBuffer,\r
122                                          unsigned long ulCount);\r
123 extern void ADCHardwareOversampleConfigure(unsigned long ulBase,\r
124                                            unsigned long ulFactor);\r
125 \r
126 #ifdef __cplusplus\r
127 }\r
128 #endif\r
129 \r
130 #endif // __ADC_H__\r