Add capacitive touch LCD driver
This commit is contained in:
38
main/capacitive_touch.h
Normal file
38
main/capacitive_touch.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef CAPACITIVE_TOUCH_H
|
||||
#define CAPACITIVE_TOUCH_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "board_config.h"
|
||||
|
||||
#define TOUCH_WIDTH 320
|
||||
#define TOUCH_HEIGHT 240
|
||||
#define TOUCH_MAX_POINTS 5
|
||||
|
||||
/*
|
||||
* GT911 reports this panel as 240x320 in the vendor portrait examples.
|
||||
* The app keeps the original 320x240 landscape coordinate system.
|
||||
*/
|
||||
#define TOUCH_SWAP_XY 1
|
||||
#define TOUCH_INVERT_X 1
|
||||
#define TOUCH_INVERT_Y 0
|
||||
|
||||
typedef struct {
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t raw_x;
|
||||
uint16_t raw_y;
|
||||
uint8_t id;
|
||||
uint8_t count;
|
||||
bool pressed;
|
||||
} capacitive_touch_point_t;
|
||||
|
||||
void capacitive_touch_init(void);
|
||||
bool capacitive_touch_read(capacitive_touch_point_t *point);
|
||||
bool capacitive_touch_read_raw(uint16_t *x, uint16_t *y);
|
||||
bool capacitive_touch_is_pressed(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user