PebbleOS v4.43.0-153-g7e4f46eff
Loading...
Searching...
No Matches
touch.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/kernel/mutex.h>

Data Structures

struct  pbl_touch_props
 Touchscreen properties, the devicetree touchscreen-* properties. More...
 
struct  pbl_touch_ops
 Touchscreen driver operations, called with the device lock held. More...
 
struct  pbl_touch_sample
 Last sample reported by a touchscreen. More...
 
struct  pbl_touch_state
 Touchscreen runtime state. More...
 
struct  pbl_touch
 Touchscreen. More...
 

Macros

#define PBL_TOUCH_STATE_DEFINE(sym)
 Define the class state of a touchscreen.
 
#define PBL_TOUCH_INIT(sym, _name, _parent, _ops, ...)
 Initialize a struct pbl_touch.
 

Functions

int pbl_touch_enable (const struct pbl_touch *touch)
 Take a reference on the touchscreen, powering it up on the first one.
 
int pbl_touch_disable (const struct pbl_touch *touch)
 Drop a reference taken with pbl_touch_enable(), powering the touchscreen down on the last one.
 
bool pbl_touch_is_enabled (const struct pbl_touch *touch)
 Check whether the touchscreen has users.
 
void pbl_touch_get_last (const struct pbl_touch *touch, struct pbl_touch_sample *sample)
 Get the last sample reported.
 
void pbl_touch_lock (const struct pbl_touch *touch)
 Take the device lock.
 
void pbl_touch_unlock (const struct pbl_touch *touch)
 Release the device lock.
 
void pbl_touch_report (const struct pbl_touch *touch, bool down, uint16_t x, uint16_t y)
 Report a sample.
 
void pbl_touch_report_gesture (const struct pbl_touch *touch, uint16_t code, uint16_t x, uint16_t y)
 Report a gesture recognized by the controller.
 

Variables

const struct pbl_touch *const TOUCH
 The board's touchscreen.