]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_LM3S316_IAR/hw_include/adc.h
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / CORTEX_LM3S316_IAR / hw_include / adc.h
1 //*****************************************************************************\r
2 //\r
3 // adc.h - ADC headers for using the ADC driver functions.\r
4 //\r
5 // Copyright (c) 2005,2006 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 Stellaris Family of 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 635 of the Stellaris 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 \r
68 //*****************************************************************************\r
69 //\r
70 // Prototypes for the APIs.\r
71 //\r
72 //*****************************************************************************\r
73 extern void ADCIntRegister(unsigned long ulBase, unsigned long ulSequenceNum,\r
74                            void (*pfnHandler)(void));\r
75 extern void ADCIntUnregister(unsigned long ulBase,\r
76                              unsigned long ulSequenceNum);\r
77 extern void ADCIntDisable(unsigned long ulBase, unsigned long ulSequenceNum);\r
78 extern void ADCIntEnable(unsigned long ulBase, unsigned long ulSequenceNum);\r
79 extern unsigned long ADCIntStatus(unsigned long ulBase,\r
80                                   unsigned long ulSequenceNum,\r
81                                   tBoolean bMasked);\r
82 extern void ADCIntClear(unsigned long ulBase, unsigned long ulSequenceNum);\r
83 extern void ADCSequenceEnable(unsigned long ulBase,\r
84                               unsigned long ulSequenceNum);\r
85 extern void ADCSequenceDisable(unsigned long ulBase,\r
86                                unsigned long ulSequenceNum);\r
87 extern void ADCSequenceConfigure(unsigned long ulBase,\r
88                                  unsigned long ulSequenceNum,\r
89                                  unsigned long ulTrigger,\r
90                                  unsigned long ulPriority);\r
91 extern void ADCSequenceStepConfigure(unsigned long ulBase,\r
92                                      unsigned long ulSequenceNum,\r
93                                      unsigned long ulStep,\r
94                                      unsigned long ulConfig);\r
95 extern long ADCSequenceOverflow(unsigned long ulBase,\r
96                                 unsigned long ulSequenceNum);\r
97 extern long ADCSequenceUnderflow(unsigned long ulBase,\r
98                                  unsigned long ulSequenceNum);\r
99 extern long ADCSequenceDataGet(unsigned long ulBase,\r
100                                unsigned long ulSequenceNum,\r
101                                unsigned long *pulBuffer);\r
102 extern void ADCProcessorTrigger(unsigned long ulBase,\r
103                                 unsigned long ulSequenceNum);\r
104 extern void ADCSoftwareOversampleConfigure(unsigned long ulBase,\r
105                                            unsigned long ulSequenceNum,\r
106                                            unsigned long ulFactor);\r
107 extern void ADCSoftwareOversampleStepConfigure(unsigned long ulBase,\r
108                                                unsigned long ulSequenceNum,\r
109                                                unsigned long ulStep,\r
110                                                unsigned long ulConfig);\r
111 extern void ADCSoftwareOversampleDataGet(unsigned long ulBase,\r
112                                          unsigned long ulSequenceNum,\r
113                                          unsigned long *pulBuffer,\r
114                                          unsigned long ulCount);\r
115 \r
116 #ifdef __cplusplus\r
117 }\r
118 #endif\r
119 \r
120 #endif // __ADC_H__\r