2017-08-14 09:05:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) Pavol Rusnak, SatoshiLabs
|
|
|
|
*
|
|
|
|
* Licensed under TREZOR License
|
|
|
|
* see LICENSE file for details
|
|
|
|
*/
|
|
|
|
|
2017-11-11 16:16:17 +00:00
|
|
|
#ifndef TREZORHAL_TOUCH_H
|
|
|
|
#define TREZORHAL_TOUCH_H
|
2017-03-07 14:52:19 +00:00
|
|
|
|
2017-10-20 13:25:24 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-10-26 14:23:04 +00:00
|
|
|
#define TOUCH_START (1U << 24)
|
|
|
|
#define TOUCH_MOVE (2U << 24)
|
|
|
|
#define TOUCH_END (4U << 24)
|
2017-04-07 00:34:53 +00:00
|
|
|
|
2017-10-20 15:18:55 +00:00
|
|
|
void touch_init(void);
|
2017-03-07 14:52:19 +00:00
|
|
|
uint32_t touch_read(void);
|
2017-10-24 15:59:25 +00:00
|
|
|
uint32_t touch_click(void);
|
2018-01-24 12:41:02 +00:00
|
|
|
inline uint16_t touch_get_x(uint32_t evt) { return (evt >> 12) & 0xFFF; }
|
|
|
|
inline uint16_t touch_get_y(uint32_t evt) { return (evt >> 0) & 0xFFF; }
|
|
|
|
inline uint32_t touch_pack_xy(uint16_t x, uint16_t y) { return ((x & 0xFFF) << 12) | (y & 0xFFF); }
|
2017-03-07 14:52:19 +00:00
|
|
|
|
|
|
|
#endif
|