eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4dtch_TSC2046.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4DTCH_TSC2046_H
47 #define __D4DTCH_TSC2046_H
48 
49  #if (D4D_MK_STR(D4D_LLD_TCH) == d4dtch_tsc2046_ID)
50 
51  /******************************************************************************
52  * Includes
53  ******************************************************************************/
54  #include "d4dtch_tsc2046_cfg.h"
55 
56  /******************************************************************************
57  * Constants
58  ******************************************************************************/
59 
60  /******************************************************************************
61  * Types
62  ******************************************************************************/
63 
64  /******************************************************************************
65  * Macros
66  ******************************************************************************/
67 
68  /******************************************************************************
69  * Global variables
70  ******************************************************************************/
71 
72  /******************************************************************************
73  * Global functions
74  ******************************************************************************/
75 
76  #endif
77 #endif /* __D4DTCH_TSC2046_H */
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 #if 0 // will be implemented ASAP, Petr Gargulak
90 
91 /**************************************************************************
92 *
93 * Copyright 2014 by Petr Gargulak. eGUI Community.
94 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
95 *
96 ***************************************************************************
97 * This program is free software: you can redistribute it and/or modify
98 * it under the terms of the GNU Lesser General Public License Version 3
99 * or later (the "LGPL").
100 *
101 * As a special exception, the copyright holders of the eGUI project give you
102 * permission to link the eGUI sources with independent modules to produce an
103 * executable, regardless of the license terms of these independent modules,
104 * and to copy and distribute the resulting executable under terms of your
105 * choice, provided that you also meet, for each linked independent module,
106 * the terms and conditions of the license of that module.
107 * An independent module is a module which is not derived from or based
108 * on this library.
109 * If you modify the eGUI sources, you may extend this exception
110 * to your version of the eGUI sources, but you are not obligated
111 * to do so. If you do not wish to do so, delete this
112 * exception statement from your version.
113 *
114 * This program is distributed in the hope that it will be useful,
115 * but WITHOUT ANY WARRANTY; without even the implied warranty of
116 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
117 *
118 * You should have received a copy of the GNU General Public License
119 * and the GNU Lesser General Public License along with this program.
120 * If not, see <http://www.gnu.org/licenses/>.
121 *
122 ***************************************************************************/
136 /******************************************************************************
137 * Driver under development
138 ******************************************************************************/
139 
140 
141 #ifndef __D4DTCH_TSC2046_H
142 #define __D4DTCH_TSC2046_H
143 
144 #if (D4D_LLD_TCH == D4D_LLD_TCHSCR_TSC2046)
145 
146  /******************************************************************************
147  * Includes
148  ******************************************************************************/
149  #include "d4dtch_TSC2046_cfg.h"
150  /******************************************************************************
151  * Constants
152  ******************************************************************************/
153 
154  #define D4DTCH_AXIS_ORIENT_NORMAL 0
155  #define D4DTCH_AXIS_ORIENT_INVERTED 1
156 
157 
158  // define Channels
159  #define TSC2046_CHNL_DIF_Y 1
160  #define TSC2046_CHNL_DIF_X 5
161 
162 
163  #define TSC_2046_CTRL_BYTE_DIF12_DEFAULT 0x80
164 
165  #if D4DTCH_SERIAL_OUTPUT_SPI_IX == 1
166  #define D4DLCD_SPIBR SPI1BR
167  #define D4DLCD_SPIC1 SPI1C1
168  #define D4DLCD_SPIC2 SPI1C2
169  #define D4DLCD_SPID SPI1D
170  #define D4DLCD_SPIS SPI1S
171  #define D4DLCD_SPIS_SPTEF SPI1S_SPTEF
172  #define D4DLCD_SPIS_SPRF SPI1S_SPRF
173  #elif D4DTCH_SERIAL_OUTPUT_SPI_IX == 2
174  #define D4DLCD_SPIBR SPI2BR
175  #define D4DLCD_SPIC1 SPI2C1
176  #define D4DLCD_SPIC2 SPI2C2
177  #define D4DLCD_SPID SPI2D
178  #define D4DLCD_SPIS SPI2S
179  #define D4DLCD_SPIS_SPTEF SPI2S_SPTEF
180  #define D4DLCD_SPIS_SPRF SPI2S_SPRF
181  #endif
182 
183  /******************************************************************************
184  * Types
185  ******************************************************************************/
186  typedef union{
187  unsigned int all;
188  struct{
189  unsigned PD0 : 1;
190  unsigned PD1 : 1;
191  unsigned SER_DFR : 1;
192  unsigned MODE : 1;
193  unsigned A0 : 1;
194  unsigned A1 : 1;
195  unsigned A2 : 1;
196  unsigned S : 1;
197  }Bits;
198  struct{
199  unsigned PD : 2;
200  unsigned SER_DFR : 1;
201  unsigned MODE : 1;
202  unsigned A : 3;
203  unsigned S : 1;
204  }MergedBits;
205  }TSC2046_CTRL_BYTE;
206 
207 
208  /******************************************************************************
209  * Macros
210  ******************************************************************************/
211 
212 
213  /******************************************************************************
214  * Global variables
215  ******************************************************************************/
216 
217  /******************************************************************************
218  * Global functions
219  ******************************************************************************/
220 
221 
222 #endif
223 #endif /* __D4DTCH_TSC2046_H */
224 
225 #endif
226 
227 
228 
229 
230 
231 
232 
233