~ubuntu-branches/ubuntu/natty/xf86-input-wacom/natty

« back to all changes in this revision

Viewing changes to src/wcmISDV4.h

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2010-03-31 07:20:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100331072020-kme2simx91izo45u
Tags: 1:0.10.5-0ubuntu1
* Merge from debian.
* rules: Run xsfclean on clean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 by Red Hat, Inc.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
 
 
20
#ifndef WCMISDV4_H
 
21
#define WCMISDV4_H
 
22
 
 
23
/* packet length for individual models */
 
24
#define ISDV4_PKGLEN_TOUCH93    5
 
25
#define ISDV4_PKGLEN_TOUCH9A    7
 
26
#define ISDV4_PKGLEN_TPCPEN     9
 
27
#define ISDV4_PKGLEN_TPCCTL     11
 
28
#define ISDV4_PKGLEN_TOUCH2FG   13
 
29
 
 
30
#define HEADER_BIT      0x80
 
31
#define CONTROL_BIT     0x40
 
32
#define DATA_ID_MASK    0x3F
 
33
#define TOUCH_CONTROL_BIT 0x10
 
34
 
 
35
/* ISDV4 protocol parsing structs. */
 
36
 
 
37
/* Query reply data */
 
38
typedef struct {
 
39
        unsigned char data_id;   /* always 00H */
 
40
        uint16_t x_max;
 
41
        uint16_t y_max;
 
42
        uint16_t pressure_max;
 
43
        uint8_t  tilt_x_max;
 
44
        uint8_t  tilt_y_max;
 
45
        uint16_t version;
 
46
} ISDV4QueryReply;
 
47
 
 
48
/* Touch Query reply data */
 
49
typedef struct {
 
50
        uint8_t data_id;        /* always 01H */
 
51
        uint8_t panel_resolution;
 
52
        uint8_t sensor_id;
 
53
        uint16_t x_max;
 
54
        uint16_t y_max;
 
55
        uint8_t capacity_resolution;
 
56
        uint16_t version;
 
57
} ISDV4TouchQueryReply;
 
58
 
 
59
/* Touch Data format. Note that capacity and finger2 are only set for some
 
60
 * devices (0 on all others) */
 
61
typedef struct {
 
62
        uint8_t status;         /* touch down/up */
 
63
        uint16_t x;
 
64
        uint16_t y;
 
65
        uint16_t capacity;
 
66
        struct {
 
67
                uint8_t status;         /* touch down/up */
 
68
                uint16_t x;
 
69
                uint16_t y;
 
70
        } finger2;
 
71
} ISDV4TouchData;
 
72
 
 
73
/* Coordinate data format */
 
74
typedef struct {
 
75
        uint8_t proximity;      /* in proximity? */
 
76
        uint8_t tip;            /* tip/eraser pressed? */
 
77
        uint8_t side;           /* side switch pressed? */
 
78
        uint8_t eraser;         /* eraser pressed? */
 
79
        uint16_t x;
 
80
        uint16_t y;
 
81
        uint16_t pressure;
 
82
        uint8_t tilt_x;
 
83
        uint8_t tilt_y;
 
84
} ISDV4CoordinateData;
 
85
 
 
86
#endif /* WCMISDV4_H */
 
87
 
 
88
/* vim: set noexpandtab shiftwidth=8: */