When connected via USB, the Touch Sensor Module communicates in Full Speed (12 Mbit/s) in two modes: Raw HID mode (also called HID Pipe) and HID Touch Digitizer mode. HID Touch Digitizer mode is initiated automatically as soon as the sensor module is plugged in. In order to use Raw HID mode, the module's operation mode must be changed. For more information, refer to Initializing Sensor Modules.

HID Touch Digitizer Mode

The Touch Sensor Module acts as a HID Input device and communicates directly with the OS, and is completely plug and play.

Ubuntu 17.10 - 18.04

The sensor module is not recognized as a touch screen in the Ubuntu versions 17.10 - 18.04. This has been fixed and works fine in Ubuntu 18.10.

Raw HID Mode / HID Pipe

This mode uses two HID Feature Reports to communicate with the host.

  • Send data to the sensor module by writing to Feature Report 1.
  • Read data from the sensor module by reading from Feature Report 2.

Refer to zForce Message Specification for examples of requests, responses and notifications.

USB Communication in Different Operating Systems

Depending on the system and programming language you are using to write and read from a feature report, the implementation differs. For example, in Windows, this is abstracted and the hid.dll offers a function to get and set feature reports, while in for example a UNIX based OS, you might have to implement your own function to get and set a feature report.

The communication heading below describes how to implement your own get and set feature report functions, using a control transfer.

USB Permission

Depending on operating system you might need explicit permission for your program to have access to the HID device.

How to Implement Custom Functions for Raw HID Communication

In order to communicate with the sensor module the data flow type called control transfer should be used. The control transfer usually takes the following parameters:

  • Request Type (int)
  • Request (int)
  • Value (int)
  • Index (int)
  • Data (byte array)
  • Length (int)
  • Timeout (int)

Writing to Feature Report 1

When writing to the sensor module, a full 257 bytes need to be sent no matter how long the actual message is. Take a look at the code snippet below, to see how this could be done.

uint8_t operationMode[] = { 0x01, 0x17, 0xEE, 0x15, 0x40, 0x02, 0x02, 0x00, 
							0x67, 0x0F, 0x80, 0x01, 0xFF, 0x81, 0x01, 0x00, 
							0x82, 0x01, 0x00, 0x83, 0x01, 0x00, 0x84, 0x01, 0x00 }; // The first two bytes are the header. First byte is feature report, second byte is length of the following data.
uint8_t data[257];
memcpy(data, operationMode, sizeof(operationMode));

int requestType = 0x00 | (0x01 << 5) | 0x01; // USB_HOST_TO_DEVICE | USB_TYPE_CLASS | USB_RECIPIENT_INTERFACE
int request = 0x09; // SET_CONFIGURATION = 0x09
int value = 0x0301; // 0x03 for feature report, 0x01 for feature report 1
int index = 0x0000; 
int length = sizeof(data);
int timeout = 0;

 connection.controlTransfer(
            requestType,
            request,
            value,
            index, data, length, timeout);

Reading from Feature Report 2

When reading from feature report 2, the message is always 258 bytes long.

uint8_t data[258];

int requestType = 0x80 | (0x01 << 5) | 0x01; // USB_DEVICE_TO_HOST | USB_TYPE_CLASS | USB_RECIPIENT_INTERFACE
int request = 0x01; // CLEAR_FEATURE = 0x01
int value = 0x0302; // 0x03 for feature report, 0x02 for feature report 2
int index = 0x0000;
int length = sizeof(data);
int timeout = 0;

connection.controlTransfer(
            requestType,
            request,
            value,
            index, data, length, timeout);

HID Report Descriptor

The HID Report Descriptor is subject to change. The descriptor below is from firmware version 1.47.

ItemData
Usage Page (Digitizer)05 0D 
Usage (Touch Screen)09 04 
Collection (Application)A1 01 
    Report ID (4)85 04 
    Usage (Contact Count Maximum)09 55 
    Logical Minimum (0)15 00 
    Logical Maximum (-1)25 FF 
    Report Size (8)75 08 
    Report Count (1)95 01 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 02 
    Report ID (3)85 03 
    Usage (Contact Count)09 54 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    Usage (Scan Time)09 56 
    Logical Maximum (65535)27 FF FF 00 00 
    Report Size (16)75 10 
    Unit Exponent (-4)55 0C 
    Unit (SI Lin: Time (s))66 01 10 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
    Usage (Finger)09 22 
    Collection (Logical)A1 02 
        Usage (Tip Switch)09 42 
        Logical Maximum (1)25 01 
        Report Size (1)75 01 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Contact Identifier)09 51 
        Logical Maximum (127)25 7F 
        Report Size (7)75 07 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Generic Desktop)05 01 
        Usage (X)09 30 
        Logical Maximum (65535)27 FF FF 00 00 
        Report Size (16)75 10 
        Report Count (1)95 01 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage (Y)09 31 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
        Usage Page (Digitizer)05 0D 
        Unit Exponent (-2)55 0E 
        Unit (SI Lin: Length (cm))65 11 
        Usage (Width)09 48 
        Usage (Height)09 49 
        Report Count (2)95 02 
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    End CollectionC0 
End CollectionC0 
Usage Page (Vendor-Defined 1)06 00 FF 
Usage (Vendor-Defined 1)09 01 
Collection (Application)A1 01 
    Report ID (1)85 01 
    Usage (Vendor-Defined 1)09 01 
    Report Size (8)75 08 
    Report Count (1)95 01 
    Logical Minimum (0)15 00 
    Logical Maximum (-1)25 FF 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 02 
    Usage (Vendor-Defined 2)09 02 
    Report Count (255)95 FF 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,Vol,Buf)B2 82 01 
    Report ID (2)85 02 
    Usage (Vendor-Defined 1)09 01 
    Report Count (1)95 01 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 02 
    Usage (Vendor-Defined 2)09 02 
    Report Count (255)95 FF 
    Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,Vol,Buf)B2 82 01 
    Usage (Vendor-Defined 3)09 03 
    Report Size (1)75 01 
    Logical Maximum (1)25 01 
    Report Count (1)95 01 
    Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 
    Report Size (7)75 07 
    Input (Cnst,Ary,Abs)81 01 
    Report Size (8)75 08 
    Report ID (128)85 80 
    Usage (Vendor-Defined 1)09 01 
    Feature (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 03 
    Report ID (130)85 82 
    Usage (Vendor-Defined 1)09 01 
    Feature (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 03 
End CollectionC0 

Parsed reports by Report ID

Input Report 2
Bit offsetBit countDescription
01Internal use
17(Not used)
Input Report 3
Bit offsetBit countDescription
08Contact count
816Scan Time
241Tip Switch
257Contact identifier
3216X
4816Y
6416Width
8016Height
961Tip Switch
977Contact identifier
10416X
12016Y
13616Width
15216Height
1681Tip Switch
1697Contact identifier
17616X
19216Y
20816Width
22416Height
2401Tip Switch
2417Contact identifier
24816X
26416Y
28016Width
29616Height
3121Tip Switch
3137Contact identifier
32016X
33616Y
35216Width
36816Height
3841Tip Switch
3857Contact identifier
39216X
40816Y
42416Width
44016Height
Feature Report 1 - Write
Bit offsetBit countDescription
08Payload size (bytes)
82040Payload
Feature Report 2 - Read
Bit offsetBit countDescription
08Payload size (bytes)
82040Payload
Feature Report 4
Bit offsetBit countDescription
08Contact count maximum
Feature Report 128
Bit offsetBit countDescription
08Internal use
Feature Report 130
Bit offsetBit countDescription
08Internal use