Top Banner
DOC101699-1- rev 02 -2014-01-17 - Created by:6644 Page 1 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS DOC101699-1 Touch_Keypad_Access
12

DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

Sep 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 1 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

DOC101699-1 Touch_Keypad_Access

Page 2: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 2 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

INDEX INDEX .......................................................................................................................................... 2 Revision History ............................................................................................................................ 3 Abbreviation .................................................................................................................................. 3 1 Introduction .......................................................................................................................... 4 2 Access HID Touch Keypad ..................................................................................................... 5

2.1 HIDAPI library ................................................................................................................ 5 2.2 Allocate HD Touch Keypad Device with HIDAPI ................................................................ 6

3 HID Touch Keypad Message ................................................................................................... 8 4 Demo Application .................................................................................................................. 9

4.1 Preparation .................................................................................................................... 9 4.2 Use of Demo Application ................................................................................................. 9

5 Appendix .............................................................................................................................11

Page 3: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 3 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

Revision History

Abbreviation

Abbreviation Description

Created Approved

Rev Date By Date By Description

1 2013.12.04 Wei Jing 2013-12-16 André Kråkenes Preliminary Document

2 2014.01.17 Wei Jing 2014-02-17 André Kråkenes Update Firmware info for all types of 8” and 13”.

Page 4: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 4 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

1 Introduction

Commonly, USB HID device communicate with OS by transfer formatted message. The message could be pre-defined by device manufacturer or universal standard. By profiling the message, the user

application could monitor the action performed on HID device.

This document introduces the method to access the touch keypad on an AIPC or IPC unit: How to

allocate touch keypad device and translate the profiled messages of touch buttons.

Page 5: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 5 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

2 Access HID Touch Keypad

The provided demo application is using a 3rd part open source library “HIDAPI” to access the HID touch pad. This chapter will describe the HID device access steps with the reference of HIDAPI.

Claim: HIDAPI is introduced as a reference tool for HID device access. Hatteland Display

does not take any responsibility on copyright and license for the use of HIDAPI library.

HIDAPI is open to BSD and original HIDAPI license for commercial and closed-source

users. For more information about license, please check on hidapi website.

2.1 HIDAPI library

HIDAPI libaray (www.signal11.us/oss/hidapi) provides the interfaces to access HID devices in multiplatform. In Windows platform, HIDAPI integrates Windows base library functions and simplify

the HID device access procedure.

The following form will show the interface functions exported form hidapi.dll

(http://www.signal11.us/oss/hidapi/hidapi/doxygen/html/group__API.html)

Page 6: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 6 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows

Drivers. It can be found under “Human Interface Devices” in Device manager with a device name

“HID-compliant device”.

Because the touch keypad and touch screen share the same USB interface, it is necessary to indicate the correct device path at enumeration stage.

Here comes Detailed Hardware ID for touch keypad Product ID: Check the table below with proper type number

Vendor ID: 0EEF Column ID: 03

Model Product ID

08" AIPC HD 0x72E1

08" AIPC HD – SCC 0x72E1

08" DIS HD 0x72E1

13.3" AIPC HD - CCC - CCFL 0x7200

13.3" AIPC HD - CCC - LED 0x7200

13.3" AIPC HD - CCFL 0x7200

13.3" AIPC HD - LED 0x7200

13.3" DIS HD - CCFL 0x7200

13.3" DIS HD - LED 0x7200

13.3" IPC HD - CCFL 0x7200

13.3" IPC HD - LED 0x7200

08" AIPC Mini OS 0x72E1

08" DIS TCP 0x72E1

13.3" AIPC Mini OS (XXL) 0x72E2

13.3” AIPC Mini OS 0x72E2

13.3” AIPC Mini OS LED 0x72E2

13.3” AIPC Mini OS XXL LED 0x72E2

13.3” IPC Mini OS 0x72E2

13.3” IPC Mini OS LED 0x72E2

13.3” IPC Mini OS XXL LED 0x72E2

Page 7: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 7 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

HIDAPI provides a API “hid_enumerate” which gets all the HID device path in system. The example

code below shows the enumeration and keypad allocation process: //enumurate all the HID devices struct hid_device_info *devs, *cur_dev; devs = hid_enumerate(0x0, 0x0); cur_dev = devs; while (cur_dev) { //Compare VID and PID if(cur_dev->vendor_id==TOUCH_VID && cur_dev->product_id == TOUCH_PID) { if(cur_dev->path) { //Search "Col03" in current device path,

//if yes, Touch keypad is found. if(strstr(cur_dev->path,"col03")!=NULL) break; } } cur_dev = cur_dev->next; } if(cur_dev == NULL) { MessageBox(_T("Can't find target HID device!"),NULL,MB_ICONWARNING); return; }

After allocating the correct hardware ID, the corresponding hid_device_info is used for further operation.

Page 8: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 8 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

3 HID Touch Keypad Message HID device establishes the communication protocol in the format of “Packet”. The packet is described

with the information of size, valid report id and values. The packet description is stored in HID device firmware.

In HD touch keypad, any operations on button will activate a report packet sent from touch controller

to HID driver in OS. The virtual button packet is composed with 6 bytes in a 64byte packet length (the

remaining bytes are 0x00)

Byte Valid Value Purpose

0 0x03 Report ID

1 (Check the list below with

proper type number)

n/a

2 0x36 n/a

3 0x2F n/a

4 0x80/0x81 Button Up/Down

5 0x00/0x01/0x02 BRT’-’/Power/BRT’+’

The user can use hid_read API to get the packet(64 bytes) from low level driver and analyse the info

to get the current keypad status.

Model Byte[1]

08" AIPC HD 0x04

08" AIPC HD – SCC 0x04

08" DIS HD 0x04

13.3" AIPC HD - CCC - CCFL 0x06

13.3" AIPC HD - CCC - LED 0x06

13.3" AIPC HD - CCFL 0x06

13.3" AIPC HD - LED 0x06

13.3" DIS HD - CCFL 0x06

13.3" DIS HD - LED 0x06

13.3" IPC HD - CCFL 0x06

13.3" IPC HD - LED 0x06

08" AIPC Mini OS 0x04

08" DIS TCP 0x04

13.3" AIPC Mini OS (XXL) 0x04

13.3” AIPC Mini OS 0x04

13.3” AIPC Mini OS LED 0x04

13.3” AIPC Mini OS XXL LED 0x04

13.3” IPC Mini OS 0x04

13.3” IPC Mini OS LED 0x04

13.3” IPC Mini OS XXL LED 0x04

Page 9: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 9 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

4 Demo Application

The demo application is developed by Hatteland Display as a reference tool for Touch Keypad access. It has dependency with HD_AIPC_IPC_API and HIDAPI.

4.1 Preparation 1. Install Hatteland_Driver_Setup_AIPC-x.xxxx.exe (For AIPC) or Hatteland_Driver_Setup_IPC-

x.x.xxx.exe(for IPC) 2. Install vcredist_x86.exe – Microsoft Visual C++ x86 redistributable.

vcredist_x64.exe – Microsoft Visual C++ x64 redistributable.

3. Run AIPC_IPC_BUTTON_DEMO.exe in administration privilege.

4.2 Use of Demo Application 1. Press “Access HID Driver” to load touch keypad device.

2. Press touch keypad button and monitor the status log change in demo application

Page 10: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 10 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

3. Press ‘+’ and ‘-’ buttons, the screen brightness will be changed accordingly.

Page 11: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 11 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

5 Appendix

The code is to describe the simple procedure of accessing HID device via HIDAPI only. Not compliable.

void main(void)

{

//enumurate all the HID devices

struct hid_device_info *devs, *cur_dev;

devs = hid_enumerate(0x0, 0x0);

cur_dev = devs;

while (cur_dev)

{

//Compare VID and PID

if(cur_dev->vendor_id==TOUCH_VID && cur_dev->product_id ==

TOUCH_PID)

{

if(cur_dev->path)

{

//Search "Col03" in current device path,

//if yes, Touch keypad is found.

if(strstr(cur_dev->path,"col03")!=NULL)

break;

}

}

cur_dev = cur_dev->next;

}

if(cur_dev == NULL)

{

MessageBox(_T("Can't find target HID

device!"),NULL,MB_ICONWARNING);

return;

}

//Free Enumeration

hid_free_enumeration(devs);

//Open HID device

handle = hid_open(TOUCH_VID, TOUCH_PID, NULL);

if (!handle) {

printf("unable to open device\n");

return 1;

}

// Set the hid_read() function to be non-blocking.

hid_set_nonblocking(handle, 1);

//Profile button key press

while(1)

{

res = hid_read(handle, buf, 64);

if(res > 0)

{

if(buf[0]!=0x03)

{

printf("Error in Report ID!\n")

Page 12: DOC101699-1 Touch Keypad Access · 2.2 Allocate HD Touch Keypad Device with HIDAPI HD Touch Keypad is mounted as a USB-HID device in operating system with the generic Windows Drivers.

DOC101699-1- rev 02 -2014-01-17 - Created by:6644

Page 12 of 12 Hatteland Display AS, Åmsosen, N-5578 Nedre Vats, Norway

Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com

DOC101699-1_Touch_Keypad_Access All intellectual properties belongs to Hatteland Display AS

}

else

{

if((buf[1]!=0x04) || (buf[2]!=0x36) ||

(buf[3]!=0x2F))

{

printf("Error in Report Message!\n")

}

else

{

switch(buf[4])

{

case 0x81:

printf("Down ");

break;

case 0x80:

printf("Up ");

break;

default:

printf("Unknown Action ")

break;

}

switch(buf[5])

{

case 0x00:

printf("BRT-\n");

break;

case 0x01:

printf("Power\n");

break;

case 0x02:

printf("BRT+\n");

break;

default:

printf("Unknown Key\n");

break;

}

}

}

}

}

}