使用ST7789v(320×240)显示驱动,XPT2046触摸驱动。
一、lv_indev.cpp代码
/**
* @file lv_port_indev_templ.c
*
*/
/*Copy this file as "lv_port_indev.c" and set this value to "1" to enable content*/
#if 1
/*********************
* INCLUDES
*********************/
#include "../porting/lv_port_indev.h"
#include "../lvgl/lvgl.h"
#include "Arduino.h"
#include "../XPT2046_Bitbang_Slim/XPT2046_Bitbang.h"
#include "../touch/touch.h"
static void touchpad_init(void);
static void touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data);
static bool touchpad_is_pressed(void);
static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y);
/**********************
* STATIC VARIABLES
**********************/
lv_indev_t * indev_touchpad;
extern TouchPoint touch;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_port_indev_init(void)
{
static lv_indev_dr