M210 protocol definition

(Rev 1.04)


M210 is a USB HID composite device with two interfaces:

Interface 0: vendor defined. (64 bytes interrupt transfer).

Interface 1: digitizer. (6 bytes interrupt transfer).

Endpoint description:

Endpoint 0: control endpoint use for enumeration and transferring command from host to device.

Endpoint 1: IN endpoint use for transferring data from device to host on interface 0.

Endpoint 2: IN endpoint use for transferring data from device to host on interface 1 (Tablet mode).



M210 device work in two modes:


Mobile mode: XY coordinate saved in the memory.


Connected mode: The communication between the M210 and the USB host is divided to:


1. Host send to device: Special commands (Host commands).

2. Device send to host:

a. Data packets (XY mode, Tablet mode).

b. Answer for received commands.

c. Device commands.


1. Host to Device.


Special commands:

The special commands are send to the device via control endpoint (endpoint 0) by Set Report request.


The commands are:


Version request – the host request from device ID and version, as a result the

device returns to the host the asked information via endpoint1.


Operation mode command – the host send to device in which operation mode

(XY or Tablet) to work and which LED (Pen or mouse) to light.

Scale & Orientation command – the host send to device the orientation of the

unit and the scaling of the active area size in tablet mode.


Erase memory - the host send erase memory command to the unit.


Upload request - the host request from device the saved note, as a result the

device returns to the host the asked information via endpoint1.

Version request:


Host Device


Report ID

(1 Byte)

Number of

Bytes

(1 Byte)

Version

Command

(1 Byte)

0x02

0x01

0x95


(Device Answer)

Device Host

Byte #

Byte

Name

7

6

5

4

3

2

1

0

0

SPECIAL_COMMAND

(0x80)

1

0

0

0

0

0

0

0

1

Command version (0xA9)

1

0

1

0

1

0

0

1

2

Product ID

(0x28)

0

0

1

0

1

0

0

0

3

Firmware version high

x

x

X

x

x

x

x

x

4

Firmware version low

x

x

X

x

x

x

x

x

5

Analog version high

x

x

X

x

x

x

x

x

6

Analog version low

x

x

X

x

x

x

x

x

7

Pad Version High

x

x

X

x

x

x

x

x

8

Pad Version Low

x

x

X

x

x

x

x

x

9

Analog Product ID (0x0E)

0

0

0

0

1

1

1

1

10

TAB_MODE

x

x

X

x

x

x

MODE


MODE:

0x00 Reserve.

0x01 XY mode.

0x02 Tablet mode.

0x03 Mobile mode.



Operation mode command:

Set operation mode (XY / tablet) and mouse/pen LED.

Host Device


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

PegasusOperationMode Command

(2 Byte)

Pen/mouse LED

(1 Byte)

XY /

tablet

(1 Byte)

0x02

0x04

0x80

0xB5

P/M LED

Mode


P/M LED:

0x00 N.C.

0x01 Pen LED

0x02 Mouse LED


Mode :

0x00 N.C.

0x01 XY

0x02 Tablet


Scale & Orientation command:

Active area size scaling and device orientation setting in tablet mode.

Host Device


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

SetScaleOrientation

Command

(2 Byte)

Scale

parameter

(1 Byte)

Orientation

parameter

(1 Byte)

0x02

0x04

0x80

0xB6

Scale

Orint.


Orint:

0x00 Top

0x01 Left

0x02 Right


Scale (active area size):

0 (largest) – 9 (smallest)


Erase memory:

Erase all notes in memory.


Host Device


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

XY

Command

(1 Byte)

0x02

0x01

0xB0


Upload:

Upload data from device memory.


Upload Sequence:


  1. Request start of upload


Host Device


Report ID

(1 Byte)

Number of

Bytes

(1 Byte)

Upload

Command

(1 Byte)

0x02

0x01

0xB5


  1. Device sends the number of data packets to host.


Device Host

Signature

(5 Bytes)

Number of packets

(2 Bytes)

Signature

(2 Bytes)

0xAA

0xAA

0xAA

0xAA

0xAA

High

Low

0x55

0x55


  1. Host sends an ACK for receiving the data packets or NACK for cancel upload to device.


Host Device


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

ACK

(1 Byte)

0x02

0x01

0xB6


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

NACK

(1 Byte)

0x02

0x01

0xB7


  1. Device sends upload data to host.


Device Host


Packet number

(2 Bytes)

Data

(62 Bytes)

N

Upload Data

High

Low

N – Sequence number, each packet gets a sequence number(starting with 1), e.g. the first packet gets sequence number 1, the second 2 etc..



  1. Packets retransmission.


Host Device


5.a. In case all packets have been received successfully, the host sends an ACK

response and the upload sequence is complete.


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

ACK

(1 Byte)

0x02

0x01

0xB6


5.b. In case some packets have been lost the host sends a NACK response with

the lost packet number.


Report ID

(1 Byte)

Number of Bytes

(1 Byte)

NACK

(1 Byte)

Lost packet number

(2 Byte)

0x02

0x03

0xB7

X

High

Low

X – Lost packet number.


  1. Device send the lost packet to host (return to stage 5).


Device Host


Packet number

(2 Bytes)

Data

(62 Bytes)

X

Upload Data

High

Low

X – Lost packet number.



2. Device to Host.


a. Data Packets:


PEN-DATA packet (XY mode):

PEN-DATA packets (XY mode) are send via endpoint1.


Device Host


Byte #

Byte

Name

7

6

5

4

3

2

1

0

0

status

0

1

0

0

0

0

Battery state

1

Color

0

0

0

0

Hov

0

Sw1

Tip

2

X low

x

x

x

x

x

x

x

x

3

X high

X

x

x

x

x

x

x

x

4

Y low

X

x

x

x

x

x

x

x

5

Y high

X

x

x

x

x

x

x

x


Battery state:

0x00 no state report

0x01 battery low report

0x02 battery good report

Color:

Tip = 1 if tip was pressed, otherwise 0.

Switch-1 = 1 if tip was pressed, otherwise 0.

Hovering = 1 if the pen is moving at the air and no switch was pressed.


PEN-UP packet (XY mode):

PEN-UP packets (XY mode) are send via endpoint1.


Device Host


Byte #

Byte

Name

7

6

5

4

3

2

1

0

0

Status

0

1

0

0

0

0

Battery state

1

Color

0

0

0

0

0

0

0

0

2

X low

0

0

0

0

0

0

0

0

3

X high

0

0

0

0

0

0

0

0

4

Y low

0

0

0

0

0

0

0

0

5

Y high

0

0

0

0

0

0

0

0


Battery state (as in DATA packet above):

0x00 no state report

0x01 battery low report

0x02 battery good report



PEN-DATA packet (only in tablet mode):

PEN-DATA packets (only in tablet mode) are send via endpoint2.


Device Host


Byte #

Byte

Name

7

6

5

4

3

2

1

0

0

Report ID

(0x08)

0

0

0

0

1

0

0

0

1

X low

x

x

x

x

x

x

x

x

2

X high

x

x

x

x

x

x

x

x

3

Y low

x

x

x

x

x

x

x

x

4

Y high

x

x

x

x

x

x

x

x

5

Tablet State

0

0

0

In range

0

SW2

SW1

Tip

6

Tip Pressure LSB

x

x

x

x

x

x

x

x

7

Tip Pressure MSB

x

x

x

x

x

x

x

x



b. Answer for received commands:

Answer for received commands are send via endpoint1.


Version request: the description for version request is described before (at Host to device special commands version request).


Upload request: the description for upload request is described before (at Host to device special commands version request).


c. Device commands:

Device commands are send via endpoint1.


MODE_BUTTON:

Change mode (pen/mouse) command.


Byte #

Byte

Name

7

6

5

4

3

2

1

0

0

SPECIAL_COMMAND

(0x80)

1

0

0

0

0

0

0

0

1

Command (0xB5)

1

0

1

1

0

1

0

1