mikroSDK Reference Manual
tft7.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2024 MikroElektronika d.o.o.
4** Contact: https://www.mikroe.com/contact
5**
6** This file is part of the mikroSDK package
7**
8** Commercial License Usage
9**
10** Licensees holding valid commercial NECTO compilers AI licenses may use this
11** file in accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The MikroElektronika Company.
14** For licensing terms and conditions see
15** https://www.mikroe.com/legal/software-license-agreement.
16** For further information use the contact form at
17** https://www.mikroe.com/contact.
18**
19**
20** GNU Lesser General Public License Usage
21**
22** Alternatively, this file may be used for
23** non-commercial projects under the terms of the GNU Lesser
24** General Public License version 3 as published by the Free Software
25** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** The above copyright notice and this permission notice shall be
28** included in all copies or substantial portions of the Software.
29**
30** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
32** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
35** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37**
38****************************************************************************/
44#ifndef _TFT7_H_
45#define _TFT7_H_
46
47#include "drv_port.h"
48#include "gl_types.h"
49#include "board.h"
50#include "gl.h"
51
67#define TFT7_MIN_BACKLIGHT (0)
68#define TFT7_BACKLIGHT_10 (0.1)
69#define TFT7_BACKLIGHT_20 (0.2)
70#define TFT7_BACKLIGHT_30 (0.3)
71#define TFT7_BACKLIGHT_40 (0.4)
72#define TFT7_BACKLIGHT_50 (0.5)
73#define TFT7_BACKLIGHT_60 (0.6)
74#define TFT7_BACKLIGHT_70 (0.7)
75#define TFT7_BACKLIGHT_80 (0.8)
76#define TFT7_BACKLIGHT_90 (0.9)
77#define TFT7_MAX_BACKLIGHT (1)
78
79#define TFT_MIN_BACKLIGHT TFT7_MIN_BACKLIGHT
80#define TFT_MAX_BACKLIGHT TFT7_MAX_BACKLIGHT
81
85#define TFT7_MAP_CTRL_BITS( tft_cfg ) \
86 tft_cfg.tft_rst = TFT_RST;\
87 tft_cfg.tft_cs = TFT_CS; \
88 tft_cfg.tft_rs = TFT_RS; \
89 tft_cfg.tft_wr = TFT_WR; \
90 tft_cfg.tft_rd = TFT_RD; \
91
92#define TFT_MAP_CTRL_BITS TFT7_MAP_CTRL_BITS
93
98#define TFT7_MAP_CTRL_8BIT( tft_cfg ) \
99 TFT7_MAP_CTRL_BITS( tft_cfg ); \
100 tft_cfg.data_channel_0 = TFT_8BIT_DATA_PORT_CH0; \
101 tft_cfg.data_channel_0_mask = TFT_8BIT_DATA_PORT_CH0_MASK; \
102 tft_cfg.host_interface = TFT7_HOST_INTERFACE_8BIT;
103
104#define TFT_MAP_CTRL_8BIT TFT7_MAP_CTRL_8BIT
105
110#define TFT7_MAP_CTRL_16BIT( tft_cfg ) \
111 TFT7_MAP_CTRL_BITS( tft_cfg ); \
112 tft_cfg.data_channel_0 = TFT_16BIT_DATA_PORT_CH0; \
113 tft_cfg.data_channel_0_mask = TFT_16BIT_DATA_PORT_CH0_MASK; \
114 tft_cfg.data_channel_1 = TFT_16BIT_DATA_PORT_CH1; \
115 tft_cfg.data_channel_1_mask = TFT_16BIT_DATA_PORT_CH1_MASK; \
116 tft_cfg.host_interface = TFT7_HOST_INTERFACE_16BIT;
117
118#define TFT_MAP_CTRL_16BIT TFT7_MAP_CTRL_16BIT
119
123typedef enum
124{
125 TFT7_HOST_INTERFACE_8BIT = 0,
126 TFT7_HOST_INTERFACE_16BIT
128
132 typedef enum
133{
134 TFT_MODE_LANDSCAPE_UP = 0,
135 TFT_MODE_PORTRAIT_LEFT,
136 TFT_MODE_LANDSCAPE_DOWN,
137 TFT_MODE_PORTRAIT_RIGHT
139
143typedef struct tft7_board_s
144{
145 uint16_t display_width;
146 uint16_t display_height;
148 void ( *reset_procedure )( tft7_orientation_t orientation );
150
151// Definition constant for EasyTFT board.
152extern const tft7_board_t TFT_BOARD_EASY;
153
178
179#ifdef __cplusplus
180extern "C"{
181#endif
182
190void tft7_init( tft7_cfg_t *cfg, gl_driver_t *driver );
191
196
201
210
216void tft7_set_backlight( float intensity );
217
218// TODO Implement set gamma.
219// TODO Implement display on/off.
220
221 // tft7group
222 // compgroup
223
224#ifdef __cplusplus
225}
226#endif
227#endif // _TFT7_H_
API for GPIO port driver.
mikroSDK Graphic Library API.
Declaration of types for Graphic Library.
void tft7_init(tft7_cfg_t *cfg, gl_driver_t *driver)
Initializes TFT extension board module driver with given configuration.
void tft7_set_display_orientation(tft7_cfg_t *cfg, gl_driver_t *driver, tft7_orientation_t orientation)
Sets the active display orientation to orientation.
uint16_t tft7_display_width()
Returns displays width in pixels.
tft7_orientation_t
Mapping structure for display orientation.
Definition tft7.h:133
void tft7_set_backlight(float intensity)
Sets the active display backlight to intensity.
struct tft7_board_s tft7_board_t
EasyTFT Board definition structure.
uint16_t tft7_display_height()
Returns displays height in pixels.
tft7_host_interface_t
Host interface configuration enumeration.
Definition tft7.h:124
hal_ll_port_name_t hal_port_name_t
Definition hal_target.h:61
hal_ll_pin_name_t hal_pin_name_t
Definition hal_target.h:60
The context structure for storing driver configuration.
Definition gl_types.h:148
EasyTFT Board definition structure.
Definition tft7.h:144
uint16_t display_width
Definition tft7.h:145
uint16_t display_height
Definition tft7.h:146
EasyTFT Board library configuration structure.
Definition tft7.h:158
hal_pin_name_t tft_cs
Definition tft7.h:162
uint32_t data_channel_0_mask
Definition tft7.h:169
hal_port_name_t data_channel_1
Definition tft7.h:171
hal_pin_name_t tft_rst
Definition tft7.h:161
hal_pin_name_t tft_rs
Definition tft7.h:163
hal_pin_name_t tft_wr
Definition tft7.h:165
hal_port_name_t data_channel_0
Definition tft7.h:168
uint32_t data_channel_1_mask
Definition tft7.h:172
hal_pin_name_t tft_rd
Definition tft7.h:164
const tft7_board_t * board
Definition tft7.h:159
hal_pin_name_t tft_pwm
Definition tft7.h:166
tft7_host_interface_t host_interface
Definition tft7.h:174