48#ifndef _LVGL_COMMON_H_
49#define _LVGL_COMMON_H_
53#include "ili9341_cmd.h"
54#include "ili9341_defines.h"
59#include <me_built_in.h>
64#ifdef TFT_LCD_PORT_UNDEFINED_TEMP_FIX
65#ifndef LCD_TFT_8BIT_CH0
66#define LCD_TFT_8BIT_CH0 TFT_8BIT_DATA_PORT_CH0
69#ifndef LCD_TFT_CH0_8BIT_MASK
70#define LCD_TFT_CH0_8BIT_MASK TFT_8BIT_DATA_PORT_CH0_MASK
73#ifndef LCD_TFT_16BIT_CH0
74#define LCD_TFT_16BIT_CH0 TFT_16BIT_DATA_PORT_CH0
77#ifndef LCD_TFT_16BIT_CH0_MASK
78#define LCD_TFT_16BIT_CH0_MASK TFT_16BIT_DATA_PORT_CH0_MASK
81#ifndef LCD_TFT_16BIT_CH1
82#define LCD_TFT_16BIT_CH1 TFT_16BIT_DATA_PORT_CH1
85#ifndef LCD_TFT_16BIT_CH1_MASK
86#define LCD_TFT_16BIT_CH1_MASK TFT_16BIT_DATA_PORT_CH1_MASK
104#define set_column() uint16_t start_column = act_x1; \
105 uint16_t end_column = act_x2;
108#define set_page() uint16_t start_page = act_y1; \
109 uint16_t end_page = act_y2;
112#define CS_HIGH (digital_out_high( &pin_cs ))
114#define CS_LOW (digital_out_low( &pin_cs ))
116#define WR_HIGH (digital_out_high( &pin_wr ))
118#define WR_LOW (digital_out_low( &pin_wr ))
120#define DC_HIGH (digital_out_high( &pin_dc ))
122#define DC_LOW (digital_out_low( &pin_dc ))
124#define display_deselect() (CS_HIGH)
127#define check_touchpad() (void)tp_press_detect(&tp); \
128 return (tp.touch.event != TP_EVENT_PRESS_NOT_DET);
152static inline void write_command(uint8_t command)
167static inline void write_param(uint8_t param)
184static inline void data_8bit_write(uint16_t fill_data)
186 uint32_t red_value = RED_OF( fill_data );
187 uint32_t green_value = GREEN_OF( fill_data );
188 uint32_t blue_value = BLUE_OF( fill_data );
206static inline void write_array_data(uint16_t *array, uint16_t length)
210 for (i = 0; i < length; i++)
212 data_8bit_write(*array);
224static inline void display_configure(
void)
250static inline void frame_start(uint32_t start_column, uint32_t end_column,
251 uint32_t start_page, uint32_t end_page)
253 write_command( ILI9341_CMD_COLUMN_ADDRESS_SET );
254 write_param( Hi( start_column ) );
255 write_param( Lo( start_column ) );
256 write_param( Hi( end_column ) );
257 write_param( Lo( end_column ) );
259 write_command( ILI9341_CMD_PAGE_ADDRESS_SET );
260 write_param( Hi( start_page ) );
261 write_param( Lo( start_page ) );
262 write_param( Hi( end_page ) );
263 write_param( Lo( end_page ) );
265 write_command( ILI9341_CMD_MEMORY_WRITE );
277static inline void get_touch_coordinates(int16_t *x, int16_t *y)
API for Digital output driver.
API for GPIO port driver.
@ PIN_DIRECTION_DIGITAL_OUTPUT
Definition drv_port.h:69
err_t digital_out_init(digital_out_t *out, pin_name_t name)
Initialize GPIO pin.
void gl_set_driver(gl_driver_t *driver)
Sets the driver to the active state and enables drawing on whole display.
err_t port_init(port_t *port, port_name_t name, port_size_t mask, pin_direction_t direction)
Initialize GPIO port.
err_t port_write(port_t *port, port_size_t value)
Write to port.
#define WR_LOW
Definition lvgl_common.h:118
#define DC_HIGH
Definition lvgl_common.h:120
#define DC_LOW
Definition lvgl_common.h:122
#define CS_HIGH
Definition lvgl_common.h:112
#define WR_HIGH
Definition lvgl_common.h:116
#define CS_LOW
Definition lvgl_common.h:114
tp_err_t tp_press_coordinates(tp_t *ctx, tp_touch_item_t *touch_item)
Touch Panel Pressure Coordinates Check Function.
Digital output driver context structure, consisted of the following fields :
Definition drv_digital_out.h:73
The context structure for storing driver configuration.
Definition gl_types.h:148
Port driver context structure, consisted of the following fields :
Definition drv_port.h:82
Touch Panel Driver Interface Items.
Definition tp.h:199
Touch Panel Context Object.
Definition tp.h:224
Touch Point Object Definition.
Definition tp.h:137
tp_coord_t coord_y
Definition tp.h:139
tp_coord_t coord_x
Definition tp.h:138
Touch controller middle layer API.
void touch_controller_init(gl_driver_t *display_driver, uint8_t backlight)
Initializes touch controller.