mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
input/touchscreen: Translate raw X/Y data into pixel coordinates
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
de5c35382a
commit
e82b762fb7
@@ -415,6 +415,22 @@ config STMPE811_SWAPXY
|
|||||||
---help---
|
---help---
|
||||||
Reverse the meaning of X and Y to handle different LCD orientations.
|
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||||
|
|
||||||
|
config STMPE811_OFFSETX
|
||||||
|
int "X offset"
|
||||||
|
default 0
|
||||||
|
depends on !STMPE811_TSC_DISABLE
|
||||||
|
---help---
|
||||||
|
Horizontal offset between the left edge of the touchscreen and
|
||||||
|
the left edge of the display area.
|
||||||
|
|
||||||
|
config STMPE811_OFFSETY
|
||||||
|
int "Y offset"
|
||||||
|
default 0
|
||||||
|
depends on !STMPE811_TSC_DISABLE
|
||||||
|
---help---
|
||||||
|
Vertical offset between the top edge of the touchscreen and
|
||||||
|
the top edge of the display area.
|
||||||
|
|
||||||
config STMPE811_THRESHX
|
config STMPE811_THRESHX
|
||||||
int "X threshold"
|
int "X threshold"
|
||||||
default 12
|
default 12
|
||||||
|
|||||||
@@ -573,6 +573,38 @@ static int stmpe811_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TSIOC_GETOFFSETX: /* arg: Pointer to int offsetx config value */
|
||||||
|
{
|
||||||
|
FAR int *ptr = (FAR int *)((uintptr_t)arg);
|
||||||
|
DEBUGASSERT(ptr != NULL);
|
||||||
|
*ptr = CONFIG_STMPE811_OFFSETX;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TSIOC_GETOFFSETY: /* arg: Pointer to int offsety config value */
|
||||||
|
{
|
||||||
|
FAR int *ptr = (FAR int *)((uintptr_t)arg);
|
||||||
|
DEBUGASSERT(ptr != NULL);
|
||||||
|
*ptr = CONFIG_STMPE811_OFFSETY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TSIOC_GETTHRESHX: /* arg: Pointer to int threshx config value */
|
||||||
|
{
|
||||||
|
FAR int *ptr = (FAR int *)((uintptr_t)arg);
|
||||||
|
DEBUGASSERT(ptr != NULL);
|
||||||
|
*ptr = CONFIG_STMPE811_THRESHX;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TSIOC_GETTHRESHY: /* arg: Pointer to int threshy config value */
|
||||||
|
{
|
||||||
|
FAR int *ptr = (FAR int *)((uintptr_t)arg);
|
||||||
|
DEBUGASSERT(ptr != NULL);
|
||||||
|
*ptr = CONFIG_STMPE811_THRESHY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -ENOTTY;
|
ret = -ENOTTY;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -76,6 +76,18 @@
|
|||||||
* struct g_tscaldata_s
|
* struct g_tscaldata_s
|
||||||
*/
|
*/
|
||||||
#define TSIOC_USESCALED _TSIOC(0x0009) /* arg: bool, yes/no */
|
#define TSIOC_USESCALED _TSIOC(0x0009) /* arg: bool, yes/no */
|
||||||
|
#define TSIOC_GETOFFSETX _TSIOC(0x000a) /* arg: Pointer to
|
||||||
|
* int X offset value
|
||||||
|
*/
|
||||||
|
#define TSIOC_GETOFFSETY _TSIOC(0x000b) /* arg: Pointer to
|
||||||
|
* int Y offset value
|
||||||
|
*/
|
||||||
|
#define TSIOC_GETTHRESHX _TSIOC(0x000c) /* arg: Pointer to
|
||||||
|
* int X threshold value
|
||||||
|
*/
|
||||||
|
#define TSIOC_GETTHRESHY _TSIOC(0x000d) /* arg: Pointer to
|
||||||
|
* int Y threshold value
|
||||||
|
*/
|
||||||
|
|
||||||
#define TSC_FIRST 0x0001 /* First common command */
|
#define TSC_FIRST 0x0001 /* First common command */
|
||||||
#define TSC_NCMDS 6 /* Six common commands */
|
#define TSC_NCMDS 6 /* Six common commands */
|
||||||
|
|||||||
Reference in New Issue
Block a user