diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-02-19 22:15:02 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-02-19 22:15:02 +0000 |
| commit | 44eba075165f932f6b960e5fc069be22b0c9b929 (patch) | |
| tree | 674afb2eda2b4ea3f62163232297a9cd898a90d5 /firmware/export/touchscreen.h | |
| parent | 1cb3ff0ab06cc71eb82b82e36eb22ca1d5eaa61f (diff) | |
| download | rockbox-44eba075165f932f6b960e5fc069be22b0c9b929.zip rockbox-44eba075165f932f6b960e5fc069be22b0c9b929.tar.gz rockbox-44eba075165f932f6b960e5fc069be22b0c9b929.tar.bz2 rockbox-44eba075165f932f6b960e5fc069be22b0c9b929.tar.xz | |
Add generic touchscreen driver which allows calibration (apps/ layer will follow later).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20055 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/touchscreen.h')
| -rwxr-xr-x | firmware/export/touchscreen.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/firmware/export/touchscreen.h b/firmware/export/touchscreen.h new file mode 100755 index 0000000..0d8233a --- /dev/null +++ b/firmware/export/touchscreen.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Maurus Cuelenaere + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef __TOUCHSCREEN_INCLUDE_H_ +#define __TOUCHSCREEN_INCLUDE_H_ + +struct touchscreen_calibration +{ + int x[3]; + int xfb[3]; + int y[3]; + int yfb[3]; +}; + +enum touchscreen_mode +{ + TOUCHSCREEN_POINT = 0, /* touchscreen returns pixel co-ords */ + TOUCHSCREEN_BUTTON, /* touchscreen returns BUTTON_* area codes + actual pixel value will still be accessible + from button_get_data */ +}; + +int touchscreen_calibrate(struct touchscreen_calibration *cal); +int touchscreen_to_pixels(int x, int y, int *data); +void touchscreen_set_mode(enum touchscreen_mode mode); +enum touchscreen_mode touchscreen_get_mode(void); +void touchscreen_disable_mapping(void); +void touchscreen_reset_mapping(void); + +#endif /* __TOUCHSCREEN_INCLUDE_H_ */ |