Open Devices Wide Screen 2.0Open Devices Wide Screen 2.0

Open Devices

For some of the Xperia™ devices, we provide Android™ Open Source Project (AOSP) device configurations on GitHub. This means that the software will be open for you as a developer to use and contribute to. This is a way for us to support the open Android community, and it is also a tool for us to facilitate and verify contributions to AOSP.

!
无中文翻译

SmartWatch hacker guide

Do you have an idea for how to use SmartWatch in new ways? Then feel free to use the reference information below as a base to build an alternative firmware version. But keep in mind this is for advanced developers only – we do not provide any support or instructions for how to create your own firmware.

General information about SmartWatch

Display

  • The display controller is LD7131 and it is controlled via SPI port 1.
  • Display power is enabled by GPIO PC1.
  • The resolution is 128×128 pixels.
  • 65536 colours.

Bluetooth™

Buzzer

  • The vibrator is controlled by GPIO PB8.

I2C peripherals

  • The accelerometer is an LIS3DH from ST.
  • Datasheet for LIS3DH.
  • Accelerometer I2C address:  0x30
  • Interrupt line PB9.

Touch sensors

  • The touch sensor is from The Cypress, CY8C20236A-24LKXI.
  • Information about CY8C20236.
  • Sensor is reset by GPIO PB0.
  • Sensor I2C address: 0xA

Touch sensor protocol

//Mode bitflags
//Set when we have new data to read. Must be reset by host after reading
#define    	MODE_W4_ACK							0x01
 
//If not set only i2c will wake us up</em>
#define		MODE_WAKE_ON_TOUCH						0x02
 
//Stop scanning sensors. Must be set if command is issued</em>
#define		MODE_SCAN_DISABLE						0x04
 
//Enables the cypress algorithm.
#define		MODE_CYPRESS_ALGO						0x08
 
//Use sensorCompMul to compensate for sensor sensitivity
//(value = value * sensorCompMul[i] / 10)
#define		MODE_SENSOR_COMPENSATION				        0x20
 
//MODE_W4_ACK not used
#define		MODE_POLLED							0x40
 
//Go to sleep after (ticksInactiveBeforeSleep / 8)s
#define		MODE_SLEEP_ENABLE						0x80
 
//Commands
//Set Finger Threshold values for all sensors individually
#define		COMMAND_SET_FINGER_THLD					        0x01
 
//Set Baseline Update value
#define		COMMAND_SET_BL_UPDATE_THLD				        0x02
 
//Set Noise threshold value
#define		COMMAND_SET_NOISE_THLD					        0x03
 
//Set Noise Negative threshold value
#define		COMMAND_SET_NOISE_NEGATIVE_THLD			                0x04
 
//Set Hysteresis value
#define		COMMAND_SET_HYSTERESIS					        0x05
 
//Set Debounce value
#define		COMMAND_SET_DEBOUNCE					        0x06
 
//Set LowBaselineReset value
#define		COMMAND_SET_LOW_BASELINE_RESET			                0x07
 
//Set Prescaler value
#define		COMMAND_SET_PRESCALER					        0x08
 
//Set Idac value
#define		COMMAND_SET_IDAC_VALUES					        0x09
 
//Set Resolution and Speed values values
#define		COMMAND_SET_SCAN_MODE					        0x0a
 
//Set sensorCompMul values for all sensors individually
#define		COMMAND_SET_COMP_MUL					        0x0b
 
//Get version info
#define		COMMAND_GET_VERSION						0x0c
 
//Set number of ticks (8 Hz) before going to sleep
#define		COMMAND_SET_TICKS_BEFORE_SLEEP			                0x0d
 
//Set number of ticks (8 Hz) to sleep before checking for activity
#define		COMMAND_SET_TICKS_TO_SLEEP				        0x0e
 
//Set the highest x/y value where calcPosLevel will be used
#define		COMMAND_SET_POS_LEVEL_MIN				        0x0f
 
//Set the lowest x/y value where calcPosLevel will be used
#define		COMMAND_SET_POS_LEVEL_MAX			        	0x10
 
//Set for maxLevelStartValue (used in calcPosLevel)
#define		COMMAND_SET_MAX_LEVEL_START_VALUE		                0x11
 
//Call touch_initialize_baselines();
#define		COMMAND_DO_INIT_BASELINES				        0x12
 
//Call touch_init();
#define		COMMAND_DO_INIT_TOUCH					        0x13
 
//Set calibrateLevel. 0=use default idac value.
#define		COMMAND_SET_CALIBRATE_LEVEL				        0x14
 
//Indicates unknown command
#define		COMMAND_UNKNOWN							0xfe
 
//Indicates completed command
#define		COMMAND_COMPLETED						0xff
 
//Read value of register, X is register to read, Y becomes the result.
#define 	COMMAND_GET_REG							0x21
 
//Read value of register, X is register to set, Y is value to set.
#define 	COMMAND_SET_REG							0x22
 
//Set Idac value
#define		COMMAND_GET_IDAC_VALUES					        0x23
 
typedef struct I2C_regs {
	BYTE mode; //See defines above
 
	BYTE command; //See defines above
 
	//sensor activity, one bit per sensor
	WORD sensorActiveMask;
 
	BYTE bX; //X position.
 
	BYTE bY; //Y position
 
	//Sensor difference counts, also used as parameter values for commands to and from Master
	WORD wSns0;
	WORD wSns1;
	WORD wSns2;
	WORD wSns3;
	WORD wSns4;
	WORD wSns5;
	WORD wSns6;
	WORD wSns7;
	WORD wSns8;
 
	WORD wSnsRaw0;
	WORD wSnsRaw1;
	WORD wSnsRaw2;
	WORD wSnsRaw3;
	WORD wSnsRaw4;
	WORD wSnsRaw5;
	WORD wSnsRaw6;
	WORD wSnsRaw7;
	WORD wSnsRaw8;
 
	WORD wSnsBase0;
	WORD wSnsBase1;
	WORD wSnsBase2;
	WORD wSnsBase3;
	WORD wSnsBase4;
	WORD wSnsBase5;
	WORD wSnsBase6;
	WORD wSnsBase7;
	WORD wSnsBase8;
} I2C_REGS;
 
// Usage:
// If MODE_POLLED is not set MODE_W4_ACK must be reset after each read.
// If a command is successfully executed command is set to COMMAND_COMPLETED.
// Set command to 0 to resume operation.
// To re-initialize the touch block send COMMAND_DO_INIT_TOUCH.
// To avoid strange values when modifying parameters
// MODE_SCAN_DISABLE can be set before commands are sent.
 
/*
 Example: Setting a new value (c8) for IDAC value
 w 05 0 68 9 5 5 0 0 0 c8 p
 
 read back and verify that the command is executed
 r 05 @mode @command p
 
 set command to 0 to resume
 w 05 0 68 0 p
*/