eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4dlcdhw_flexbus_16b.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 __D4DLCDHW_FLEXBUS_16B_H
47 #define __D4DLCDHW_FLEXBUS_16B_H
48 
49  #if (D4D_MK_STR(D4D_LLD_LCD_HW) == d4dlcdhw_flexbus_16b_ID)
50 
51  /******************************************************************************
52  * Includes
53  ******************************************************************************/
54  #include "d4dlcdhw_flexbus_16b_cfg.h"
55 
56 
57  /******************************************************************************
58  * Types
59  ******************************************************************************/
60 
61  /******************************************************************************
62  * Macros
63  ******************************************************************************/
64 
65  #define SET(x) (x##_PORT) |= (1 << (x))
66  #define RESET(x) (x##_PORT) &= ~(1 << (x))
67 
68  #define OUTPUT(x) (x##_DDR) |= (1 << (x))
69  #define INPUT(x) (x##_DDR) &= ~(1 << (x))
70 
71 
72  /******************************************************************************
73  * Constants
74  ******************************************************************************/
75 
76 
77  #ifndef D4DLCD_FLEX_BASE_ADDRESS
78  #define D4DLCD_FLEX_BASE_ADDRESS 0x00410000
79  #endif
80 
81  #ifndef D4DLCD_FLEX_DC_ADDRESS
82  #define D4DLCD_FLEX_DC_ADDRESS 0x00400000
83  #endif
84 
85  #ifndef D4DLCD_FLEX_ADRESS_MASK
86  #define D4DLCD_FLEX_ADRESS_MASK 0x00010000
87  #endif
88 
89 
90  #ifndef D4DLCD_FLEX_CS
91  #define D4DLCD_FLEX_CS 0
92  #else
93  #if (D4DLCD_FLEX_CS < 0) || (D4DLCD_FLEX_CS > 1)
94  #error The D4DLCD_FLEX_CS value must be set to 0 or 1
95  #endif
96  #endif
97 
98 
99  #ifndef D4DLCD_FLEX_CSAR
100  #if D4DLCD_FLEX_CS == 0
101  #define D4DLCD_FLEX_CSAR CSAR0
102  #else
103  #define D4DLCD_FLEX_CSAR CSAR1
104  #endif
105  #endif
106 
107  #ifndef D4DLCD_FLEX_CSMR
108  #if D4DLCD_FLEX_CS == 0
109  #define D4DLCD_FLEX_CSMR CSMR0
110  #else
111  #define D4DLCD_FLEX_CSMR CSMR1
112  #endif
113  #endif
114 
115  #ifndef D4DLCD_FLEX_CSCR
116  #if D4DLCD_FLEX_CS == 0
117  #define D4DLCD_FLEX_CSCR CSCR0
118  #else
119  #define D4DLCD_FLEX_CSCR CSCR1
120  #endif
121  #endif
122 
123 
124  #ifndef D4DLCD_FLEX_CSMR_V_MASK
125  #define D4DLCD_FLEX_CSMR_V_MASK CSMR0_V_MASK
126  #endif
127 
128  #ifndef D4DLCD_FLEX_CSCR_MUX_MASK
129  #define D4DLCD_FLEX_CSCR_MUX_MASK CSCR0_MUX_MASK
130  #endif
131 
132  #ifndef D4DLCD_FLEX_CSCR_AA_MASK
133  #define D4DLCD_FLEX_CSCR_AA_MASK CSCR0_AA_MASK
134  #endif
135 
136  #ifndef D4DLCD_FLEX_CSCR_PS1_MASK
137  #define D4DLCD_FLEX_CSCR_PS1_MASK CSCR0_PS1_MASK
138  #endif
139 
140 
141  #ifdef D4DLCD_BACKLIGHT
142 
143  #ifndef D4DLCD_INIT_BACKLIGHT
144  #define D4DLCD_INIT_BACKLIGHT OUTPUT(D4DLCD_BACKLIGHT);
145  #endif
146 
147  #ifndef D4DLCD_ASSERT_BACKLIGHT
148  #define D4DLCD_ASSERT_BACKLIGHT RESET(D4DLCD_BACKLIGHT);
149  #endif
150 
151  #ifndef D4DLCD_DEASSERT_BACKLIGHT
152  #define D4DLCD_DEASSERT_BACKLIGHT SET(D4DLCD_BACKLIGHT);
153  #endif
154 
155  #endif
156 
157  #ifndef D4DLCD_INIT_RESET
158  #ifndef D4DLCD_RESET
159  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
160  #else
161  #define D4DLCD_INIT_RESET OUTPUT(D4DLCD_RESET);
162  #endif
163  #endif
164 
165  #ifndef D4DLCD_ASSERT_RESET
166  #ifndef D4DLCD_RESET
167  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
168  #else
169  #define D4DLCD_ASSERT_RESET RESET(D4DLCD_RESET);
170  #endif
171  #endif
172 
173  #ifndef D4DLCD_DEASSERT_RESET
174  #ifndef D4DLCD_RESET
175  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
176  #else
177  #define D4DLCD_DEASSERT_RESET SET(D4DLCD_RESET);
178  #endif
179  #endif
180 
181  /******************************************************************************
182  * Global variables
183  ******************************************************************************/
184 
185  /******************************************************************************
186  * Global functions
187  ******************************************************************************/
188 
189  #endif
190 #endif /* __D4DLCDHW_FLEXBUS_16B_H */
191 
192 
193 
194 
195 
196 
197 
198 
199 
200