2023-02-15 12:57:54 +00:00
|
|
|
#ifndef _TOUCH_H
|
|
|
|
#define _TOUCH_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2024-03-04 14:46:58 +00:00
|
|
|
#include "secbool.h"
|
2023-02-15 12:57:54 +00:00
|
|
|
|
|
|
|
#define TOUCH_START (1U << 24)
|
|
|
|
#define TOUCH_MOVE (1U << 25)
|
|
|
|
#define TOUCH_END (1U << 26)
|
|
|
|
|
2024-03-04 14:46:58 +00:00
|
|
|
secbool touch_init(void);
|
2023-02-15 12:57:54 +00:00
|
|
|
void touch_power_on(void);
|
|
|
|
void touch_power_off(void);
|
2023-12-17 22:51:10 +00:00
|
|
|
void touch_wait_until_ready(void);
|
|
|
|
|
2024-03-04 14:46:58 +00:00
|
|
|
secbool touch_sensitivity(uint8_t value);
|
2023-02-15 12:57:54 +00:00
|
|
|
uint32_t touch_read(void);
|
|
|
|
uint32_t touch_click(void);
|
|
|
|
uint32_t touch_is_detected(void);
|
|
|
|
|
|
|
|
static inline uint16_t touch_unpack_x(uint32_t evt) {
|
|
|
|
return (evt >> 12) & 0xFFF;
|
|
|
|
}
|
|
|
|
static inline uint16_t touch_unpack_y(uint32_t evt) {
|
|
|
|
return (evt >> 0) & 0xFFF;
|
|
|
|
}
|
|
|
|
static inline uint32_t touch_pack_xy(uint16_t x, uint16_t y) {
|
|
|
|
return ((x & 0xFFF) << 12) | (y & 0xFFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_TOUCH_H
|