mikroSDK Reference Manual
ili9341.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2023 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 _ILI9341_H_
45 #define _ILI9341_H_
46 
47 #include "drv_pwm.h"
48 #include "tp_mikroe.h"
49 #include "ili9341_cmd.h"
50 #include "ili9341_defines.h"
51 #include "drv_port.h"
52 
56 #define ILI9341_PWM_CONFIG( ili9341_cfg ) \
57  ili9341_cfg.pwm_cfg.pin = TFT_BPWM;\
58  ili9341_cfg.pwm_cfg.freq_hz = (5000);
59 
64 typedef enum
65 {
69 
70  /*
71  * @brief Mapping structure for display orientation.
72  */
73 typedef enum
74 {
75  ILI9341_MODE_LANDSCAPE_UP = 0,
76  ILI9341_MODE_PORTRAIT_LEFT,
77  ILI9341_MODE_LANDSCAPE_DOWN,
78  ILI9341_MODE_PORTRAIT_RIGHT
79 } ili9341_orientation_t;
80 
85 typedef struct
86 {
99  ili9341_orientation_t orientation;
105  uint16_t width;
106  uint16_t height;
107 } ili9341_cfg_t;
108 
113 typedef struct
114 {
119  uint16_t width;
120  uint16_t height;
121 } ili9341_t;
122 
144 void ili9341_init( ili9341_cfg_t *cfg, gl_driver_t *__generic_ptr driver, ili9341_t *ctx );
145 
154 
161 void ili9341_write_command(uint8_t command);
162 
169 void ili9341_write_param(uint8_t param);
170 
176 uint16_t ili9341_get_display_width();
177 
183 uint16_t ili9341_get_display_height();
184 
191 
197 void ili9341_set_backlight_intensity( float intensity, ili9341_t *ctx );
198 
208 void ili9341_rotate( ili9341_t *ctx, tp_rotate_t *rotate );
209  // ili9341 // mwgroup
212 
213 #endif // _ILI9341_H_
214 // ------------------------------------------------------------------------- END
tp_mikroe.h
TP_MIKROE Touch Controller Driver.
ili9341_t
ILI9341 Context Object.
Definition: ili9341.h:113
drv_port.h
API for GPIO port driver.
gl_driver_t
The context structure for storing driver configuration.
Definition: gl_types.h:145
ili9341_cfg_t::cs
pin_name_t cs
Definition: ili9341.h:88
ili9341_cfg_t::host_interface
ili9341_host_interface_t host_interface
Definition: ili9341.h:101
drv_pwm.h
API for PWM driver.
ili9341_host_interface_t
ili9341_host_interface_t
ILI9341 Interface Mode.
Definition: ili9341.h:64
ili9341_cfg_t::width
uint16_t width
Definition: ili9341.h:105
ili9341_cfg_t::data_channel_1_mask
uint32_t data_channel_1_mask
Definition: ili9341.h:97
hal_port_name_t
hal_ll_port_name_t hal_port_name_t
Definition: hal_target.h:60
ili9341_t::width
uint16_t width
Definition: ili9341.h:119
pwm_config_t
PWM driver config structure, consisted of the following fields:
Definition: drv_pwm.h:82
ili9341_t::rotate
tp_rotate_t rotate
Definition: ili9341.h:115
ili9341_cfg_t::rd
pin_name_t rd
Definition: ili9341.h:90
ili9341_cfg_t::rst
pin_name_t rst
Definition: ili9341.h:87
ili9341_cfg_t::pwm_cfg
pwm_config_t pwm_cfg
Definition: ili9341.h:103
ili9341_cfg_t::data_channel_1
hal_port_name_t data_channel_1
Definition: ili9341.h:96
ili9341_t::pwm
pwm_t pwm
Definition: ili9341.h:117
ili9341_get_display_height
uint16_t ili9341_get_display_height()
Get display height.
ili9341_rotate
void ili9341_rotate(ili9341_t *ctx, tp_rotate_t *rotate)
Function used for changing display rotation.
ili9341_write_command
void ili9341_write_command(uint8_t command)
Send command to ILI9341 Display Controller.
tp_rotate_t
tp_rotate_t
Touch Panel Placement (Orientation) Definition.
Definition: tp.h:115
ili9341_defines.h
ILI9341 Display Controller Driver.
ili9341_init
void ili9341_init(ili9341_cfg_t *cfg, gl_driver_t *__generic_ptr driver, ili9341_t *ctx)
ILI9341 Display Controller initialization.
ili9341_set_backlight_intensity
void ili9341_set_backlight_intensity(float intensity, ili9341_t *ctx)
ILI9341 Display controller backlight intensity.
ILI9341_HOST_INTERFACE_16BIT
Definition: ili9341.h:67
ILI9341_HOST_INTERFACE_8BIT
Definition: ili9341.h:66
ili9341_write_param
void ili9341_write_param(uint8_t param)
Send data to ILI9341 Display Controller.
ili9341_cmd.h
ILI9341 Display Controller Commands.
pin_name_t
hal_pin_name_t pin_name_t
Definition: drv_name.h:73
ili9341_t::height
uint16_t height
Definition: ili9341.h:120
ili9341_cfg_t::wr
pin_name_t wr
Definition: ili9341.h:91
ili9341_cfg_t::rs
pin_name_t rs
Definition: ili9341.h:89
ili9341_cfg_t::data_channel_0_mask
uint32_t data_channel_0_mask
Definition: ili9341.h:94
ili9341_cfg_t::orientation
ili9341_orientation_t orientation
Definition: ili9341.h:99
ili9341_cfg_t::data_channel_0
hal_port_name_t data_channel_0
Definition: ili9341.h:93
ili9341_cfg_t::height
uint16_t height
Definition: ili9341.h:106
ili9341_default_cfg
void ili9341_default_cfg(ili9341_cfg_t *cfg)
ILI9341 Default Configuration Function.
ili9341_backlight_control_init
void ili9341_backlight_control_init(ili9341_cfg_t *cfg, ili9341_t *ctx)
ILI9341 Display Controller PWM initialization.
ili9341_get_display_width
uint16_t ili9341_get_display_width()
Get display width.
pwm_t
PWM driver context structure.
Definition: drv_pwm.h:95
ili9341_cfg_t
ILI9341 Configuration Object.
Definition: ili9341.h:85