EM-X270: WinCE: Drivers Customization

From Compulab Mediawiki
Jump to: navigation, search

Display Subsystem

PXA270 built-in LCD controller

The PXA270 LCD controller can support many timing configurations covering a large number of the available TFT and STN panels. Using the CompuLab LCD adaptation service you will receive the custom LCCRs (PXA27X LCD controller registers) registry settings for your LCD panel.

You should apply these settings via registry, together with the resolution and color depth. For example for Toppoly TD035STEE1 LCD the registry setting for PXA27x LCD driver will be:

[HKEY_LOCAL_MACHINE\Drivers\Display\PXA27x\Config]
    "CxScreen"=dword:1E0; dec 480
    "CyScreen"=dword:280; dec 640
    "Bpp"=dword:10
    "LCCR0"=dword:07b008f8
    "LCCR1"=dword:06171ddf
    "LCCR2"=dword:0304067f
    "LCCR3"=dword:04300001
    "LCCR4"=dword:00000000
  • The “CxScreen” and “CyScreen” specify the display resolution.
  • Bpp (Bits Per Pixel) settings
Admolition note.png The current version of pxa270_lcd.dll supports only 16 bit colors.

Rotation

The pxa270_lcd.dll can perform GDI rotation with the following registry key:

[HKEY_LOCAL_MACHINE\System\GDI\Rotation]
    "Angle"=dword:0

Possible values are: 0, 5A, B4, 10E (0,90,180 and 270 degrees, respectively)

Admolition note.png Changes in the registry will take effect after reboot.
The actual rotation will be performed by the GDIRotation.exe utility launched automatically after the GWES.

There are many displays that are supported (the proper LCCR’s are configured according to the datasheets). A more detailed list is available at the [Developer] >> [X270] >> [Verified Panels List] link on CompuLab's website. Support of additional panels can be obtained using CompuLab's panel adaptation service.

Keypad Driver

The PXA270 keypad interface supports matrix keyboards with up to 64 keys.

Modifying the [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Keypad] registry key can customize the keypad size and layout. Here is a short explanation of the most important values:

Rows The number of rows in the matrix keypad.
Columns The number of columns in the matrix keypad.
Key[n] The virtual key assigned to Key number n (the character that will be printed on the screen when key[n] is pressed).
To learn more about the virtual keys please refer to - http://www.kbdedit.com/manual/low_level_vk_list.html
App[n] The path of the application that should be associated with the specified launch button. [n] ranges from 1 to 4.
KeypadEnable When “1”, the keypad driver is enabled (the keypad is enabled by default).

For example the default configuration for EM-X270 Eval Kit keypad(3x3) is:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Keypad]
   "KeyapdEnable"=dword:1
   "Rows"=dword:3
   "Columns"=dword:3
   "Key0"=dword:31 ;VK 1
   "Key1"=dword:32 
   "Key2"=dword:25 ;VK LEFT
   "Key3"=dword:26 ;VK UP
   "Key4"=dword:d ;VK ENTER
   "Key5"=dword:28 ;VK DOWN
   "Key6"=dword:27 ;VK RIGHT
   "Key7"=dword:37 ;VK RIGHT
   "Key8"=dword:38 ;VK 8
   "Key9"=dword:39 ;VK 9   
   "App1"="iesample.exe" ;Internet explorer
   "App2"="ceplayer.exe" ;Media player
   "App3"="ITaskMgr.exe" ;Freeware Task Manager
   "App4"="explorer.exe" ;Windows explorer



Admolition note.png The keypad size can easily be extended by modifying "Rows" or "Columns" value. Keep in mind, though, that if you extend the keypad size, you should define more virtual keys in the registry, otherwise the driver will not be initialized correctly.


Admolition note.png A full list of the 16 GPIO pins used by the keypad interface is available in the EM-X270 reference guide. At its default state, the keypad only uses 6 GPIO pins. The other 10 pins are available to be used as GPIO.

Touch Screen Driver

The EM-X270 touch screen driver can be configured for the different application’s needs with the following registry key:

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH]
    	"TouchSensitivity"=dword:8 
    	"PressureFilter"=dword:0    
        "PressureTreshold"=dword:c8
    	"PenMoveFilter"=dword:1		
        "PenMoveSensitivity"=dword:32	
        "SpikeFilter"=dword:0
        "PenUpPollingInterval"=dword:28

The touch screen driver is implemented to detect the "pen down" interrupt and then poll for a "pen up" event. The polling interval can be specified in milliseconds in the "PenUpPollingInterval" value (defaults to 25 Hz). Each sample should be filtered due to the noise sourced from LCD, backlight and mechanical vibrations. Failing to do so can drastically reduce the accuracy and reliability of the entire touch screen system. The tradeoff of heavy filtering is touch sensitivity needed, for example: for drawing with the touch screen. The driver implements the following filters:

  • Spike Filter calculates the average of the measured samples and discards the sample, whose coordinates are most different from the sample's average. It can be set on/off by providing "1"/ "0" as the "SpikeFilter" value.
  • Pen Movement Filter gets the coordinates of the touched point and compares them to coordinates of the previously touched point. If their difference is smaller than the adjusted threshold ("PenMoveSensitivity" value), the filter treats this point as noise and discards it.

The filter can be set on/off by providing "1"/ "0" as the "PenMoveFilter" value.

  • Pressure Threshold Filter checks the sample's pressure value and accepts sample only if this value is greater than the adjusted threshold ("PressureTreshold" value).

The filter can be set on/off by providing "1"/ "0" as the "PressureFilter" value.


Admolition note.png By default the Spike and Pen Movement filters are enabled. If your application requires better response and accuracy from the touch screen, decrease the "PenMoveSensitivity" value.
Admolition note.png "TouchSensitivity" controls the codec hardware touch sensitivity. Set it to 1 for maximum sensitivity and 63 for minimum sensitivity

Battery Driver

The battery charging process can be tuned to support different types of batteries, by the following registry key:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Battery]
 	"CVChargerTimeout"=dword:2
        "CVChargerStartVoltageTreshold"=dword:ED8
        "CCChargerStartVoltageTreshold"= dword:F6E

The battery charging process starts with constant current phase and ends with constant voltage phase. In order to start each of the above charging phases the battery voltage (in milli volts) should be lower than CCChargerStartVoltageTreshold and CVChargerStartVoltageTreshold, respectively. With the "CVChargerTimeout" registry value, the total time for the constant voltage charging phase can be set.

Network Drivers

Using the following registry settings you can set up static parameters for the network connections:
For example, the following registry settings disable DHCP and define the static IP 10.1.44 for the EB-X270 Ethernet controller:

[HKEY_LOCAL_MACHINE\Comm\DM9CE1\Parms\TcpIp]
	"EnableDHCP"=dword:0
	"IpAddress"="10.1.1.44"
	"Subnetmask"="255.255.255.0"
        "DefaultGateway"="10.1.1.1"
	"DNS"="212.150.48.169"

And for Wi2Wi W2SW0001 (uses Marvell GSPI8686 core) Wireless LAN adapter:

[HKEY_LOCAL_MACHINE\Comm\GSPI86861\Parms\TCPIP]	
       "EnableDHCP"=dword:0
	"IpAddress"="10.1.1.44"
	"Subnetmask"="255.255.255.0"
        "DefaultGateway"="10.1.1.1"
	"DNS"="212.150.48.169"

Customizing System Power States

While using a battery power, you can change the system power state transition timeouts using the following registry keys:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts]
    "BattSuspendTimeout"=dword:0 
    "BattBacklightTimeout"=dword:0 
    "BattUserIdle"=dword:0

If you need customized power behavior while running your application, consider the following recommendations:

  • To avoid device suspension, an application can send a keystroke using keybd_event(). Even sending an UP keystroke, you may still get a keyboard click, so use KEYEVENTF_SILENT to prevent the click from occurring. You should send a key that is currently not being used by the Windows CE operating system so that you can eliminate any potential keyboard conflict. In the following example, an F4 UP keystroke is sent: keybd_event(VK_F4, 0, KEYEVENTF_KEYUP | KEYEVENTF_SILENT, 0)
  • A better solution is to use the SystemIdleTimerReset() API from Coredll.dll. This does not disable the timeout, but resets the idle timer count back to zero. Since the minimum idle timer you can set is one minute, calling this API at intervals of less than one minute will prevent the device from entering suspend mode.

See Also