eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4dlcdhw_spi_swc_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_SPI_SWC_8B_H
47 #define __D4DRVHW_SPI_SWC_8B_H
48 
49 #if (D4D_MK_STR(D4D_LLD_LCD_HW) == d4dlcdhw_spi_swc_8b_ID)
50 
51 
52  /******************************************************************************
53  * Includes
54  ******************************************************************************/
55  #include "d4dlcdhw_spi_swc_8b_cfg.h"
56 
57  /******************************************************************************
58  * Macros
59  ******************************************************************************/
60 
61  #define SET(x) (x##_PORT) |= (1 << (x))
62  #define RESET(x) (x##_PORT) &= ~(1 << (x))
63 
64  #define OUTPUT(x) (x##_DDR) |= (1 << (x))
65  #define INPUT(x) (x##_DDR) &= ~(1 << (x))
66 
67 
68  /******************************************************************************
69  * Constants
70  ******************************************************************************/
71 
72  #ifndef D4DLCDHW_SWC_DATAWR
73  #error "The Macro D4DLCDHW_SWC_DATAWR must be set in LCD low level driver configuration file."
74  #endif
75 
76  #ifndef D4DLCDHW_SWC_CMDWR
77  #error "The Macro D4DLCDHW_SWC_DATAWR must be set in LCD low level driver configuration file."
78  #endif
79 
80 
81  #ifndef D4DLCD_INIT_CS
82  #ifndef D4DLCD_CS
83  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
84  #else
85  #define D4DLCD_INIT_CS OUTPUT(D4DLCD_CS);
86  #endif
87  #endif
88 
89  #ifndef D4DLCD_ASSERT_CS
90  #ifndef D4DLCD_CS
91  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
92  #else
93  #define D4DLCD_ASSERT_CS RESET(D4DLCD_CS);
94  #endif
95  #endif
96 
97  #ifndef D4DLCD_DEASSERT_CS
98  #ifndef D4DLCD_CS
99  #error "The Macro D4DLCD_CS must be set in LCD low level driver configuration file."
100  #else
101  #define D4DLCD_DEASSERT_CS SET(D4DLCD_CS);
102  #endif
103  #endif
104 
105  #ifndef D4DLCD_INIT_DC
106  #ifndef D4DLCD_DC
107  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
108  #else
109  #define D4DLCD_INIT_DC OUTPUT(D4DLCD_DC);
110  #endif
111  #endif
112 
113  #ifndef D4DLCD_ASSERT_DC
114  #ifndef D4DLCD_DC
115  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
116  #else
117  #define D4DLCD_ASSERT_DC RESET(D4DLCD_DC);
118  #endif
119  #endif
120 
121  #ifndef D4DLCD_DEASSERT_DC
122  #ifndef D4DLCD_DC
123  #error "The Macro D4DLCD_DC must be set in LCD low level driver configuration file."
124  #else
125  #define D4DLCD_DEASSERT_DC SET(D4DLCD_DC);
126  #endif
127  #endif
128 
129 
130  #ifndef D4DLCD_READ_CMD_SUPPORT
131  #define D4DLCD_READ_CMD_SUPPORT D4D_FALSE
132  #endif
133 
134  #if D4DLCD_COMM_HW_ID == 0
135  #define D4DLCD_SPIBR SPIBR
136  #define D4DLCD_SPIC1 SPIC1
137  #define D4DLCD_SPIC2 SPIC2
138  #define D4DLCD_SPID SPID
139  #define D4DLCD_SPIS_SPTEF SPIS_SPTEF
140  #elif D4DLCD_COMM_HW_ID == 1
141  #define D4DLCD_SPIBR SPI1BR
142  #define D4DLCD_SPIC1 SPI1C1
143  #define D4DLCD_SPIC2 SPI1C2
144  #define D4DLCD_SPID SPI1D
145  #define D4DLCD_SPIS_SPTEF SPI1S_SPTEF
146  #elif D4DLCD_COMM_HW_ID == 2
147  #define D4DLCD_SPIBR SPI2BR
148  #define D4DLCD_SPIC1 SPI2C1
149  #define D4DLCD_SPIC2 SPI2C2
150  #define D4DLCD_SPID SPI2D
151  #define D4DLCD_SPIS_SPTEF SPI2S_SPTEF
152  #elif D4DLCD_COMM_HW_ID == 3
153  #define D4DLCD_SPIBR SPI3BR
154  #define D4DLCD_SPIC1 SPI3C1
155  #define D4DLCD_SPIC2 SPI3C2
156  #define D4DLCD_SPID SPI3D
157  #define D4DLCD_SPIS_SPTEF SPI3S_SPTEF
158  #endif
159 
160 
161  #ifdef D4DLCD_BACKLIGHT
162 
163  #ifndef D4DLCD_INIT_BACKLIGHT
164  #define D4DLCD_INIT_BACKLIGHT OUTPUT(D4DLCD_BACKLIGHT);
165  #endif
166 
167  #ifndef D4DLCD_ASSERT_BACKLIGHT
168  #define D4DLCD_ASSERT_BACKLIGHT RESET(D4DLCD_BACKLIGHT);
169  #endif
170 
171  #ifndef D4DLCD_DEASSERT_BACKLIGHT
172  #define D4DLCD_DEASSERT_BACKLIGHT SET(D4DLCD_BACKLIGHT);
173  #endif
174 
175  #endif
176 
177  #ifndef D4DLCD_INIT_RESET
178  #ifndef D4DLCD_RESET
179  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
180  #else
181  #define D4DLCD_INIT_RESET OUTPUT(D4DLCD_RESET);
182  #endif
183  #endif
184 
185  #ifndef D4DLCD_ASSERT_RESET
186  #ifndef D4DLCD_RESET
187  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
188  #else
189  #define D4DLCD_ASSERT_RESET RESET(D4DLCD_RESET);
190  #endif
191  #endif
192 
193  #ifndef D4DLCD_DEASSERT_RESET
194  #ifndef D4DLCD_RESET
195  #error "The Macro D4DLCD_RESET must be set in LCD low level driver configuration file."
196  #else
197  #define D4DLCD_DEASSERT_RESET SET(D4DLCD_RESET);
198  #endif
199  #endif
200 
201  /******************************************************************************
202  * Types
203  ******************************************************************************/
204 
205  /******************************************************************************
206  * Macros
207  ******************************************************************************/
208 
209  /******************************************************************************
210  * Global variables
211  ******************************************************************************/
212 
213  /******************************************************************************
214  * Global functions
215  ******************************************************************************/
216 
217 #endif
218 #endif /* __D4DRVHW_SPI_8B_H */
219 
220 
221 
222 
223 
224 
225 
226 
227 
228