29 lines
601 B
C
29 lines
601 B
C
#ifndef RESISTIVE_TOUCH_H
|
|
#define RESISTIVE_TOUCH_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#define TOUCH_WIDTH 320
|
|
#define TOUCH_HEIGHT 240
|
|
#define TOUCH_PIN_MOSI 11
|
|
#define TOUCH_PIN_SCLK 12
|
|
#define TOUCH_PIN_CS 7
|
|
#define TOUCH_PIN_IRQ 2
|
|
#define TOUCH_PIN_MISO 13
|
|
|
|
typedef struct {
|
|
uint16_t x;
|
|
uint16_t y;
|
|
uint16_t raw_x;
|
|
uint16_t raw_y;
|
|
bool pressed;
|
|
} resistive_touch_point_t;
|
|
|
|
void resistive_touch_init(void);
|
|
bool resistive_touch_read(resistive_touch_point_t *point);
|
|
bool resistive_touch_read_raw(uint16_t *x, uint16_t *y);
|
|
bool resistive_touch_is_pressed(void);
|
|
|
|
#endif
|