eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4dlcdhw_gpio8080_8b.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 __D4DRVHW_GPIO8080_8B_H
47 #define __D4DRVHW_GPIO8080_8B_H
48 
49 #if (D4D_MK_STR(D4D_LLD_LCD_HW) == d4dlcdhw_gpio8080_8b_ID)
50 
51 
52  /******************************************************************************
53  * Includes
54  ******************************************************************************/
55 #include "d4dlcdhw_gpio8080_8b_cfg.h"
56  /******************************************************************************
57  * Macros
58  ******************************************************************************/
59 
60  #define SET(x) (x##_PORT) |= (1 << (x))
61  #define RESET(x) (x##_PORT) &= ~(1 << (x))
62  #define SET_ALL(x) (x##_PORT) = 0xFF
63  #define RESET_ALL(x) (x##_PORT) = 0
64 
65  #define OUTPUT(x) (x##_DDR) |= (1 << (x))
66  #define INPUT(x) (x##_DDR) &= ~(1 << (x))
67  #define OUTPUT_ALL(x) (x##_DDR) = 0xFF
68  #define INPUT_ALL(x) (x##_DDR) = 0
69 
70  /******************************************************************************
71  * Constants
72  ******************************************************************************/
73 
74  #ifndef D4DLCD_INIT_CS
75  #ifndef D4DLCD_CS
76  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
77  #else
78  #define D4DLCD_INIT_CS OUTPUT(D4DLCD_CS);
79  #endif
80  #endif
81 
82  #ifndef D4DLCD_ASSERT_CS
83  #ifndef D4DLCD_CS
84  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
85  #else
86  #define D4DLCD_ASSERT_CS RESET(D4DLCD_CS);
87  #endif
88  #endif
89 
90  #ifndef D4DLCD_DEASSERT_CS
91  #ifndef D4DLCD_CS
92  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
93  #else
94  #define D4DLCD_DEASSERT_CS SET(D4DLCD_CS);
95  #endif
96  #endif
97 
98  #ifndef D4DLCD_INIT_DC
99  #ifndef D4DLCD_DC
100  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
101  #else
102  #define D4DLCD_INIT_DC OUTPUT(D4DLCD_DC);
103  #endif
104  #endif
105 
106  #ifndef D4DLCD_ASSERT_DC
107  #ifndef D4DLCD_DC
108  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
109  #else
110  #define D4DLCD_ASSERT_DC RESET(D4DLCD_DC);
111  #endif
112  #endif
113 
114  #ifndef D4DLCD_DEASSERT_DC
115  #ifndef D4DLCD_DC
116  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
117  #else
118  #define D4DLCD_DEASSERT_DC SET(D4DLCD_DC);
119  #endif
120  #endif
121 
122 
123  #ifndef D4DLCD_READ_CMD_SUPPORT
124  #define D4DLCD_READ_CMD_SUPPORT D4D_TRUE
125  #endif
126 
127  #ifndef D4DLCD_INIT_RD
128  #ifndef D4DLCD_RD
129  #error "The Macro D4DLCD_RD must be set in LCD low level driver configuration file."
130  #else
131  #define D4DLCD_INIT_RD OUTPUT(D4DLCD_RD);
132  #endif
133  #endif
134 
135  #ifndef D4DLCD_ASSERT_RD
136  #ifndef D4DLCD_RD
137  #error "The Macro D4DLCD_RD must be set in LCD low level driver configuration file."
138  #else
139  #define D4DLCD_ASSERT_RD RESET(D4DLCD_RD);
140  #endif
141  #endif
142 
143  #ifndef D4DLCD_DEASSERT_RD
144  #ifndef D4DLCD_RD
145  #error "The Macro D4DLCD_RD must be set in LCD low level driver configuration file."
146  #else
147  #define D4DLCD_DEASSERT_RD SET(D4DLCD_RD);
148  #endif
149  #endif
150 
151 
152  #ifndef D4DLCD_INIT_WR
153  #ifndef D4DLCD_WR
154  #error "The Macro D4DLCD_WR must be set in LCD low level driver configuration file."
155  #else
156  #define D4DLCD_INIT_WR OUTPUT(D4DLCD_WR);
157  #endif
158  #endif
159 
160  #ifndef D4DLCD_ASSERT_WR
161  #ifndef D4DLCD_WR
162  #error "The Macro D4DLCD_WR must be set in LCD low level driver configuration file."
163  #else
164  #define D4DLCD_ASSERT_WR RESET(D4DLCD_WR);
165  #endif
166  #endif
167 
168  #ifndef D4DLCD_DEASSERT_WR
169  #ifndef D4DLCD_WR
170  #error "The Macro D4DLCD_WR must be set in LCD low level driver configuration file."
171  #else
172  #define D4DLCD_DEASSERT_WR SET(D4DLCD_WR);
173  #endif
174  #endif
175 
176 
177  #ifndef D4DLCD_INIT_DATA
178  #ifndef D4DLCD_DATA
179  #error "The Macro D4DLCD_DATA must be set in LCD low level driver configuration file."
180  #else
181  #define D4DLCD_INIT_DATA OUTPUT_ALL(D4DLCD_DATA);
182  #endif
183  #endif
184 
185  #ifndef D4DLCD_DATA_WRITE
186  #ifndef D4DLCD_DATA
187  #error "The Macro D4DLCD_DATA must be set in LCD low level driver configuration file."
188  #else
189  #define D4DLCD_DATA_WRITE(x) D4DLCD_DATA = x;
190  #endif
191  #endif
192 
193 
194  #ifdef D4DLCD_BACKLIGHT
195 
196  #ifndef D4DLCD_INIT_BACKLIGHT
197  #define D4DLCD_INIT_BACKLIGHT OUTPUT(D4DLCD_BACKLIGHT);
198  #endif
199 
200  #ifndef D4DLCD_ASSERT_BACKLIGHT
201  #define D4DLCD_ASSERT_BACKLIGHT RESET(D4DLCD_BACKLIGHT);
202  #endif
203 
204  #ifndef D4DLCD_DEASSERT_BACKLIGHT
205  #define D4DLCD_DEASSERT_BACKLIGHT SET(D4DLCD_BACKLIGHT);
206  #endif
207 
208  #endif
209 
210  #ifndef D4DLCD_INIT_RESET
211  #ifndef D4DLCD_RESET
212  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
213  #else
214  #define D4DLCD_INIT_RESET OUTPUT(D4DLCD_RESET);
215  #endif
216  #endif
217 
218  #ifndef D4DLCD_ASSERT_RESET
219  #ifndef D4DLCD_RESET
220  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
221  #else
222  #define D4DLCD_ASSERT_RESET RESET(D4DLCD_RESET);
223  #endif
224  #endif
225 
226  #ifndef D4DLCD_DEASSERT_RESET
227  #ifndef D4DLCD_RESET
228  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
229  #else
230  #define D4DLCD_DEASSERT_RESET SET(D4DLCD_RESET);
231  #endif
232  #endif
233 
234  /******************************************************************************
235  * Types
236  ******************************************************************************/
237 
238  /******************************************************************************
239  * Macros
240  ******************************************************************************/
241 
242  /******************************************************************************
243  * Global variables
244  ******************************************************************************/
245 
246  /******************************************************************************
247  * Global functions
248  ******************************************************************************/
249 
250 #endif
251 #endif /* __D4DRVHW_GPIO8080_8B_H */
252 
253 
254 
255 
256 
257 
258 
259 
260 
261