The following procedures are required to prepare a sensor for communication with I2C or USB Raw HID mode.
USB Raw HID Mode
The sensor has a setting called operation mode, that determines which data will be sent to the host. When communicating over USB there are two different operation modes that deliver touch data, called detection mode and detection mode HID. By default the sensor is set in the operation mode called detection mode HID. This mode delivers touch data to the operating system according to the HID standard for touch screen devices. In order for the host to receive touch data that is serialized according to Neonode's ASN.1 serialization protocol, the operation mode has to be set to detection mode. In other words, setting the operation mode to detection mode allows the host to receive touch data over USB Raw HID mode.
Do the following procedure to prepare the sensor over USB Raw HID mode.
- Power on the sensor.
Wait for the OS to enumerate the device and then enumerate the sensor in your application. Depending on which operating system that is used, the application might need permission from the operating system to access the device.
Set the sensor to the correct operation mode (detection mode) by sending a Feature Report with report id 1.
Wait for the sensor to signal that there is data to read. This comes as an Input Report 2 or you can poll Feature Report with id 2 for new data.
Read the response data from Feature Report with id 2. The data that is read reflects the current setting in the sensor.
The sensor is now ready to communicate. After the procedure, the sensor is enabled by default and will start sending ASN.1 serialized touch notifications. To disable the touch notifications, a Disable request must be sent. Refer to zForce Message Specification for examples of requests, responses and notifications.
For further details on how to communicate with the sensor over Feature Report 1 and 2 refer to USB HID Transport.
Use the following procedure to prepare the sensor over I2C.
- Power on the sensor.
- Wait for sensor to assert Data Ready pin (DR).
- Initiate 2 byte I2C read operation. Payload of this read should be EE XX where XX is the amount of bytes to read in a second I2C read operation.
Read XX amount of bytes (number of bytes to read is indicated by second byte of first I2C Read Operation). Now read a message called BootComplete. The message should be
where YY is usually "00" but can have another value. This signals that the sensor is now booted.
To enable the sensor to start sending touch notifications, do the following:
Send an Enable command:
Read the response. The response should be:
The sensor is now ready to communicate. When DR is asserted the sensor will send a touch notification or a new BootComplete. A BootComplete indicates that the sensor has restarted for some reason; Enable must then be set again. For more details, refer to I2C Transport.
Read More on Software Integration