summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:01 +0000
commit7cd4c176e3bd945993d59b9ea073499ab25edef6 (patch)
tree7fd661ff30e909d4564fa291bbc869a5b4f1a5c8
parent913a596e57ca476d7cb721ba3b471a6a5b593781 (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
-rw-r--r--man/citron.man217
-rw-r--r--src/citron.c342
-rw-r--r--src/citron.h69
3 files changed, 509 insertions, 119 deletions
diff --git a/man/citron.man b/man/citron.man
index 6498a73..8f291e1 100644
--- a/man/citron.man
+++ b/man/citron.man
@@ -1,21 +1,23 @@
-.\" Copyright (c) 2000-2001 Peter Kunzmann <support@@citron.de>
+.\" Copyright (c) 2000-2003 Peter Kunzmann <support@citron.de>
+.\" $Id$
.\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.man,v 1.3 2001/04/05 17:42:34 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.man,v 1.4 2003/06/24 15:43:40 eich Exp $
.\"
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
.TH CITRON __drivermansuffix__ __vendorversion__
.SH NAME
citron \- Citron Infrared Touch Driver (CiTouch)
.SH SYNOPSIS
-.nf
-.B "Section \*qInputDevice\*q"
-.BI " Identifier \*q" idevname \*q
-.B " Driver \*qcitron\*q"
-.BI " Option \*qDevice\*q \*q" devpath \*q
+.B "Section ""InputDevice"""
+.br
+.BI " Identifier """ idevname """"
+.br
+.B " Driver ""citron"""
+.br
+.BI " Option ""Device"" """ devpath """"
+.br
\ \ ...
+.br
.B EndSection
-.fi
.SH DESCRIPTION
.B citron
is a XFree86 input driver for
@@ -45,7 +47,7 @@ touches.
15.1 inch Infrared Touch
.SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
+Please refer to XF86Config(5x) for general configuration
details and for options that can be used with all input drivers. This
section only covers configuration details specific to this driver.
For better understanding please read also the
@@ -62,24 +64,24 @@ The following driver
.B Options
are supported:
.TP 7
-.BI "Option \*qDevice\*q \*q" devpath \*q
+.BI "Option ""Device"" """ devpath """
Specify the device path for the citron touch. Valid devices are:
.PP
.RS 12
-/dev/ttyS0, /dev/ttyS1, ...
-.RE
-.RS 7
+/dev/ttyS0, /dev/ttyS1, ....
This option is mandatory.
+.RE
.PP
-It's important to specify the right device Note: com1 -> /dev/ttyS0, com2 -> /dev/ttyS1, ...
+.RS 7
+It's important to specify the right device Note: com1 -> /dev/ttyS0, com2 -> /dev/ttyS1 ....
.RE
.TP 7
-.BI "Option \*qScreenNumber\*q \*q" screennumber \*q
+.BI "Option ""ScreenNumber"" """ "screennumber" """
sets the
.I screennumber
for the
-.B citron
+.I citron
InputDevice.
.PP
.RS 7
@@ -88,11 +90,9 @@ ScreenNumber: "0"
.RE
.TP 7
-.BI "Option \*qMinX\*q \*q" value \*q
-.TP 7
-.BI "Option \*qMinY\*q \*q" value \*q
+.BI "Option ""MinX, MinY"" """ value """
These are the minimum X and Y values for the
-.B citron
+.I citron
input device.
.PP
.RS 7
@@ -107,11 +107,9 @@ MinX: "0" MinY: "0"
.RE
.TP 7
-.BI "Option \*qMaxX\*q \*q" value \*q
-.TP 7
-.BI "Option \*qMaxY\*q \*q" value \*q
+.BI "Option ""MaxX, MaxY"" """ value """
These are the maximum X and Y values for the
-.B citron
+.I citron
input device.
.PP
.RS 7
@@ -126,7 +124,7 @@ MaxX: "65535" MaxY: "65535"
.RE
.TP 7
-.BI "Option \*qButtonNumber\*q \*q" value \*q
+.BI "Option ""ButtonNumber"" """ value """
This value is responsible for the
.I button number
that is returned within the xf86PostButton event message
@@ -140,7 +138,7 @@ that is returned within the xf86PostButton event message
.RE
.TP 7
-.BI "Option \*qButtonThreshold\*q \*q" value \*q
+.BI "Option ""ButtonThreshold"" """ value """
This value is responsible for the
.I button threshold.
It changes the pressure sensitivity of the touch. A higher number
@@ -184,7 +182,7 @@ the
.PP
.RE
.TP 7
-.BI "Option \*qSleepMode\*q \*q" mode \*q
+.BI "Option ""SleepMode"" """ mode """
This value is responsible for the
.I sleep-mode
of the touch.
@@ -214,7 +212,7 @@ GP_OUT output set according to the Sleep-Mode status
.RE
.TP 7
-.BI "Option \*qSleepTime\*q \*q" time \*q
+.BI "Option ""SleepTime"" """ time """
This value is responsible for the
.I sleep-time
of the touch. It is the activation time in seconds
@@ -229,7 +227,7 @@ of the touch. It is the activation time in seconds
.RE
.TP 7
-.BI "Option \*qSleepScan\*q \*q" scan \*q
+.BI "Option ""SleepScan"" """ scan """
This value is responsible for the
.I scan-time
of the touch. This is the time interval between two scan operations
@@ -245,7 +243,29 @@ of milliseconds.
.RE
.TP 7
-.BI "Option \*qPWMActive\*q \*q" value \*q
+.BI "Option ""PWMAdjSrc"" """ value """
+.RE
+.TP 7
+.BI "Option ""PWMAdjDst"" """ value """
+These parameters are used to adjust the brightness of different
+backlight inverters. At the moment 2 backlight inverters are
+used: 0=TDK 1=AC. If you want a AC backlight inverter to
+behave like an AC type you have to set
+.I PWMAdjSrc
+to 0 (TDK) and
+.I PWMAdjDst
+to 1 (AC).
+.RS 7
+.PP
+.I Range:
+"0" - "1"
+.PP
+.I Default:
+"-1" (no adjustment)
+
+.RE
+.TP 7
+.BI "Option ""PWMActive"" """ value """
This value determines the mark-to-space ratio of the
.I PWM
output while in normal operation (sleep-mode not active).
@@ -261,10 +281,9 @@ to do backlight-dimming via the touch.
.I Default:
"255" (max. brightness)
-
.RE
.TP 7
-.BI "Option \*qPWMSleep\*q \*q" value \*q
+.BI "Option ""PWMSleep"" """ value """
This value determines the mark-to-space ratio of the
.I PWM
output while in sleep-mode (->
@@ -281,41 +300,38 @@ Higher values result in longer pulse widths.
.RE
.TP 7
-.BI "Option \*qPWMFreq\*q \*q" value \*q
-This value determines the
+.BI "Option ""PWMFreq"" """ value """
+This value determines the
.I PWM
-frequency in Hertz.
+frequency in Hertz
.RS 7
.PP
-.I Range:
-"39" - "9803"
+.I Range:
+"39" - "9803"
.PP
.I Default:
"9803" (max. frequency)
.RE
.TP 7
-.BI "Option \*qClickMode\*q \*q" mode \*q
+.BI "Option ""ClickMode"" """ mode """
With mode one can select between 5
.I ClickModes
-.B \*q1\*q
-= ClickMode Enter
+.I """1"" = ClickMode Enter
With this mode every interruption of the infrared beams will
activate a ButtonPress event and after the interruption a
ButtonRelease event will be sent.
-.B \*q2\*q
-= ClickMode Dual
+.I """2"" = ClickMode Dual
With this mode every interruption will sent a Proximity event and
every second interruption a ButtonPress event. With the release of
the interruption (while one interruption is still active) a
ButtonRelease event will be sent.
-.B \*q3\*q
-= ClickMode Dual Exit
+.I """3"" = ClickMode Dual Exit
With this mode every interruption will sent a ProximityIn event and
every second interruption a ButtonPress event. With the release of
@@ -323,18 +339,16 @@ the interruption (while one interruption is still active) no
ButtonRelease event will be sent. Only if all interruptions are released
a ButtonRelease followed by a ProximityOut event will be sent.
-.B \*q4\*q
-= ClickMode ZPress
+.I """4"" = ClickMode ZPress
With this mode every interruption will sent a ProximityIn event. Only if
a certain pressure is exceeded a ButtonPress event will occur. If the
pressure falls below a certain limit a ButtonRelease event will be sent.
After also the interruption is released a ProximityOut event is generated.
-.B \*q5\*q
-= ClickMode ZPress Exit
+.I """5"" = ClickMode ZPress Exit
-This mode is similar to "Clickmode Dual Exit".
+This mode is similat to "Clickmode Dual Exit".
The first interruption of the beams will sent a ProximityIn event. Only if
a certain pressure is exceeded a ButtonPress event will occur. If the
pressure falls below a certain limit no ButtonRelease event will be sent.
@@ -350,7 +364,7 @@ a ProximityOut event is generated.
.RE
.TP 7
-.BI "Option \*qOrigin\*q \*q" value \*q
+.BI "Option ""Origin"" """ value """
This value sets the coordinates origin to one of the four corners of
the screen.
The following values are accepted:
@@ -379,7 +393,7 @@ the maximum speed.
.RE
.TP 7
-.BI "Option \*qDozeMode\*q \*q" mode \*q
+.BI "Option ""DozeMode"" """ mode """
This value is responsible for the
.I doze-mode
of the touch.
@@ -387,20 +401,15 @@ of the touch.
.PP
Determines the behaviour of the Doze-Mode.
.PP
-.B 0x00
-No message at either activation or deactivation
+0x00 No message at either activation or deactivation
-.B 0x01
-Message at activation
+0x01 Message at activation
-.B 0x02
-Message at deactivation
+0x02 Message at deactivation
-.B 0x03
-Message at activation and deactivation
+0x03 Message at activation and deactivation
-.B 0x10
-GP_OUT output set according to the Doze-Mode status
+0x10 GP_OUT output set according to the Doze-Mode status
If the GP_OUT output is already controlled by the
.I Sleep-Mode
@@ -416,7 +425,7 @@ it is no longer available as an output port anymore.
.RE
.TP 7
-.BI "Option \*qDozeTime\*q \*q" time \*q
+.BI "Option ""DozeTime"" """ time """
This value is responsible for the
.I doze-time
of the touch. It is the activation time in seconds
@@ -432,7 +441,7 @@ of the touch. It is the activation time in seconds
.RE
.TP 7
-.BI "Option \*qDozeScan\*q \*q" scan \*q
+.BI "Option ""DozeScan"" """ scan """
This value is responsible for the
.I scan-time
of the touch. This is the time interval between two scan operations
@@ -448,7 +457,7 @@ of milliseconds.
.RE
.TP 7
-.BI "Option \*qDeltaX\*q \*q" value \*q
+.BI "Option ""DeltaX"" """ value """
This value determines a virtual area at the left and right
side of the current cursor position where the cursor didn't move.
Within this area no "MotionNotify" event will be sent.
@@ -463,7 +472,7 @@ Within this area no "MotionNotify" event will be sent.
.RE
.TP 7
-.BI "Option \*qDeltaY\*q \*q" value \*q
+.BI "Option ""DeltaY"" """ value """
This value determines a virtual area at the top and bottom
of the current cursor position where the cursor didn't move.
Within this area no "MotionNotify" event will be sent.
@@ -477,7 +486,7 @@ Within this area no "MotionNotify" event will be sent.
.RE
.TP 7
-.BI "Option \*qBeep\*q \*q" value \*q
+.BI "Option ""Beep"" """ value """
This value determines if a "ButtonPress" and/or a "ButtonRelease"
event should sound the buzzer. "0" deactivates the buzzer while
every other value will activate it.
@@ -491,7 +500,7 @@ every other value will activate it.
.RE
.TP 7
-.BI "Option \*qPressVol\*q \*q" value \*q
+.BI "Option ""PressVol"" """ value """
This value determines the volume of the buzzer (0-100%)
when a "ButtonPress" event is sent.
.RS 7
@@ -505,7 +514,7 @@ when a "ButtonPress" event is sent.
.RE
.TP 7
-.BI "Option \*qPressPitch\*q \*q" value \*q
+.BI "Option ""PressPitch"" """ value """
This value determines the pitch of the tone
when a "ButtonPress" event is sent.
.RS 7
@@ -520,7 +529,7 @@ when a "ButtonPress" event is sent.
.RE
.TP 7
-.BI "Option \*qPressDur\*q \*q" value \*q
+.BI "Option ""PressDur"" """ value """
This value determines the duration of the tone in ms
when a "ButtonPress" event is sent.
.RS 7
@@ -533,7 +542,7 @@ when a "ButtonPress" event is sent.
.RE
.TP 7
-.BI "Option \*qReleaseVol\*q \*q" value \*q
+.BI "Option ""ReleaseVol"" """ value """
This value determines the volume of the buzzer (0-100%)
when a "ButtonRelease" event is sent.
.RS 7
@@ -547,7 +556,7 @@ when a "ButtonRelease" event is sent.
.RE
.TP 7
-.BI "Option \*qReleasePitch\*q \*q" value \*q
+.BI "Option ""ReleasePitch"" """ value """
This value determines the pitch of the tone when
when a "ButtonRelease" event is sent.
.RS 7
@@ -562,7 +571,7 @@ when a "ButtonRelease" event is sent.
.RE
.TP 7
-.BI "Option \*qReleseDur\*q \*q" value \*q
+.BI "Option ""ReleseDur"" """ value """
This value determines the duration of the tone in ms when
when a "ButtonRelease" event is sent.
.RS 7
@@ -577,7 +586,7 @@ when a "ButtonRelease" event is sent.
.RE
.TP 7
-.BI "Option \*qBeamTimeout\*q \*q" value \*q
+.BI "Option ""BeamTimeout"" """ value """
Determines the time span in seconds, that has to elapse before a beam is
considered defective, blanked-out and excluded from the coordinates
evaluation.
@@ -594,7 +603,7 @@ evaluation.
.RE
.TP 7
-.BI "Option \*qTouchTime\*q \*q" value \*q
+.BI "Option ""TouchTime"" """ value """
Determines the minimum time span in steps of 10ms for a valid
interruption. In order for an interruption to be
reported to the host computer as valid, it needs to remain at
@@ -610,7 +619,7 @@ the same spot for at least the time span declared here.
.RE
.TP 7
-.BI "Option \*qEnterCount\*q \*q" count \*q
+.BI "Option ""EnterCount"" """ count """
Number of skipped "enter reports". Reports are sent approx.
every 20ms.
.RS 7
@@ -624,13 +633,13 @@ every 20ms.
.RE
.TP 7
-.BI "Option \*qZEnterCount\*q \*q" count \*q
-Number of skipped "enter reports" while in pressure
+.BI "Option ""ZEnterCount"" """ count """
+Number of skipped "enter reports" while in pressure
sensitive mode. Reports are sent approx. every 20ms.
.RS 7
.PP
-.I Range:
-"0" - "31"
+.I Range:
+"0" - "31"
.PP
.I Default:
"1" (1 skipped messages = 20ms)
@@ -638,7 +647,49 @@ sensitive mode. Reports are sent approx. every 20ms.
.RE
.TP 7
-.BI "Option \*qDualCount\*q \*q" count \*q
+.BI "Option ""LockZEnterTime"" """ count """
+Minimum duration of an AreaPressEnter state (Pressure > AreaPressure)
+before a PressEnter event is issued. The time is given in 10ms steps.
+.RS 7
+.PP
+.I Range:
+"0" - "255"
+.PP
+.I Default:
+"1" (10ms)
+
+
+.RE
+.TP 7
+.BI "Option ""LockZExitTime"" """ count """
+Minimum duration of an AreaPressExit state (Pressure < AreaPressure/2)
+before a PressExit event is issued. The time is given in 10ms steps.
+.RS 7
+.PP
+.I Range:
+"0" - "255"
+.PP
+.I Default:
+"1" (10ms)
+
+
+.RE
+.TP 7
+.BI "Option ""LockZLockTime"" """ count """
+Minimum gap between a PressExit and a PressEnter event.
+The time is in 10ms steps.
+.RS 7
+.PP
+.I Range:
+"0" - "255"
+.PP
+.I Default:
+"10" (100ms)
+
+
+.RE
+.TP 7
+.BI "Option ""DualCount"" """ count """
Number of skipped "dual touch error". Reports are sent approx.
every 20ms. This option is only available for "ZPress" and
"ZPress Exit" modes.
@@ -654,4 +705,4 @@ every 20ms. This option is only available for "ZPress" and
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__).
.SH AUTHORS
-2000-2001 \- written by Citron GmbH (support@citron.de)
+2000-2003 - written by Citron GmbH (support@citron.de)
diff --git a/src/citron.c b/src/citron.c
index 5a6e006..a08e483 100644
--- a/src/citron.c
+++ b/src/citron.c
@@ -1,4 +1,4 @@
-/* Id: citron.c,v 1.8 2001/03/28 08:24:38 pk Exp $
+/* $Id$
* Copyright (c) 1998 Metro Link Incorporated
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -25,13 +25,13 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.c,v 1.7 2001/07/02 17:29:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.c,v 1.12 2003/11/06 18:38:11 tsi Exp $ */
/*
* Based, in part, on code with the following copyright notice:
*
* Copyright 1999-2001 by Thomas Thanner, Citron GmbH, Germany. <support@citron.de>
- * Copyright 1999-2001 by Peter Kunzmann, Citron GmbH, Germany. <kunzmann@citron.de>
+ * Copyright 1999-2003 by Peter Kunzmann, Citron GmbH, Germany. <kunzmann@citron.de>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -109,7 +109,11 @@
debuglevel, entercount(z) from external now poss.
enter_touched not reset by coord_exit pk
2.09 25.03.01 enter_touched also reset by press_exit, a new
- command (SetPWMFreq) for backlight dimming added pk
+ command (SetPWMFreq) for backlight dimming added
+ 2.10 24.04.01
+ command (SendLockZ) for 3-D support added
+ userstring commands added pk
+ 2.11 07.02.03 Blockduration time raised to 1sec pk
============================================================================
*/
@@ -120,8 +124,8 @@
#define INITT 0 /* Initialisation of touch in first loop */
-#define CITOUCH_VERSION 0x209
-char version[]="Touch Driver V2.09 (c) 1999-2001 Citron GmbH";
+#define CITOUCH_VERSION 0x211
+char version[]="Touch Driver V2.1.1 (c) 1999-2003 Citron GmbH";
#define CITOUCH_VERSION_MAJOR ((CITOUCH_VERSION >> 8) & 0xf)
#define CITOUCH_VERSION_MINOR ((CITOUCH_VERSION >> 4) & 0xf)
@@ -139,9 +143,14 @@ char version[]="Touch Driver V2.09 (c) 1999-2001 Citron GmbH";
#include "xf86_OSproc.h"
#include "xf86Xinput.h"
#include "xisb.h"
-#include "exevents.h" /* Needed for InitValuator/Proximity stuff*/
+#include "exevents.h" /* Needed for InitValuator/Proximity stuff*/
+/* I have to explicit declare this function, because I get an error if I compile */
+/* with "#define XF86_OS_PRIVS". I also have to put a "SYMVAR(xf86SoundKbdBell)" */
+/* statement into the "/loader/xf86sym.c file" to be able to access this function (PK) */
+/* extern void xf86SoundKbdBell(int loudness, int pitch, int duration); */
+
/* #define CIT_TIM */ /* Enable timer */
#define CIT_BEEP /* enable beep feature */
@@ -238,6 +247,20 @@ InputDriverRec CITRON = {
0
};
+static char *UserStrNames[] =
+{
+ "NAME",
+ "REV",
+ "RECEIVERBOARD",
+ "TOUCH",
+ "DISPLAY",
+ "INVERTER",
+ "MECHANICS",
+ "PAR1",
+ "PAR2",
+ NULL
+};
+
#ifdef XFree86LOADER
@@ -266,7 +289,6 @@ static XF86ModuleVersionInfo VersionRec =
{0, 0, 0, 0} /* signature of the version info structure */
};
-
/* ************************************************************************
* [SetupProc] --
*
@@ -364,6 +386,9 @@ static const char *default_options[] =
/*****************************************************************************
* Function Definitions
****************************************************************************/
+static void cit_SendLockZ(cit_PrivatePtr priv);
+static int cit_SendString(XISBuffer *b, unsigned char cmd, int cnt, char *ustr);
+static Bool cit_GetUserString(cit_PrivatePtr priv, char *ustr_name, char *ustr_cont, Bool scan_flg);
@@ -381,8 +406,13 @@ cit_SendtoTouch(DeviceIntPtr dev)
int i,j;
unsigned char buf[MAX_BYTES_TO_TRANSFER*2+2];
- DBG(DDS, ErrorF("%scit_SendtoTouch(numbytes=0x%02X, data[0]=%02x, data[1]=%02x, data[2]=%02x, data[3]=%02x, ...)\n", CI_INFO, priv->dds.numbytes,
- priv->dds.data[0], priv->dds.data[1], priv->dds.data[2], priv->dds.data[3]));
+ DBG(DDS, ErrorF("%scit_SendtoTouch(numbytes=0x%02X, ", CI_INFO, priv->dds.numbytes));
+
+ for(i=0; i<priv->dds.numbytes; i++)
+ {
+ DBG(DDS, ErrorF("%02x ", priv->dds.data[i]));
+ }
+ DBG(DDS, ErrorF(")\n"));
j=0;
buf[j++] = CTS_STX; /* transmit start of packet */
@@ -403,7 +433,14 @@ cit_SendtoTouch(DeviceIntPtr dev)
for(i=0; i<j; i++)
{
- if(i%16 == 0) DBG(DDS, ErrorF("\n"));
+ if(i == 0)
+ {
+ DBG(DDS, ErrorF("%s sent=", CI_INFO));
+ }
+ else if(i%16 == 0)
+ {
+ DBG(DDS, ErrorF("\n"));
+ }
DBG(DDS, ErrorF("%02x ",buf[i]));
}
@@ -419,7 +456,7 @@ cit_ParseCommand(DeviceIntPtr dev)
cit_PrivatePtr priv = (cit_PrivatePtr)(local->private);
int i;
- DBG(DDS, ErrorF("%scit_ParseCommand(numbytes=0x%02X, data= ", CI_INFO, priv->dds.numbytes));
+ DBG(DDS, ErrorF("%scit_ParseCommand: numbytes=0x%02X, data= ", CI_INFO, priv->dds.numbytes));
for(i=0; i<priv->dds.numbytes; i++)
DBG(DDS, ErrorF("%02x ", priv->dds.data[i]));
@@ -431,7 +468,10 @@ cit_ParseCommand(DeviceIntPtr dev)
case C_SETPWM:
priv->pwm_active = priv->dds.data[1];
priv->pwm_sleep = priv->dds.data[2];
- DBG(DDS, ErrorF("%scit_ParseCommand(PWM Active:%d PWM Sleep:%d \n", CI_INFO, priv->pwm_active, priv->pwm_sleep));
+ /* And now a dirty hack */
+ priv->dds.data[1] = cit_AdjustBright(priv, priv->dds.data[1]);
+ priv->dds.data[2] = cit_AdjustBright(priv, priv->dds.data[2]);
+ DBG(DDS, ErrorF("%scit_ParseCommand: PWM Active:%d PWM Sleep:%d \n", CI_INFO, priv->dds.data[1], priv->dds.data[2]));
break;
case C_SETPWMFREQ:
@@ -459,9 +499,17 @@ cit_ParseCommand(DeviceIntPtr dev)
priv->button_threshold = priv->dds.data[1];
DBG(DDS, ErrorF("%scit_ParseCommand: Button Threshold:%d \n", CI_INFO, priv->button_threshold));
break;
-
+
+ case C_SETLOCKZ:
+ priv->lockz_enter_time = priv->dds.data[1];
+ priv->lockz_exit_time = priv->dds.data[2];
+ priv->lockz_lock_time = priv->dds.data[3];
+ DBG(DDS, ErrorF("%scit_ParseCommand: LockZ: enter %d, exit %d, lock %d \n", CI_INFO,
+ priv->lockz_enter_time, priv->lockz_exit_time, priv->lockz_lock_time));
+ break;
+
default:
- DBG(DDS, ErrorF("%scit_ParseCommand: Command %d not found\n", CI_INFO, priv->dds.data[0]));
+ DBG(DDS, ErrorF("%scit_ParseCommand: Command %d [0x%02x] not found\n", CI_INFO, priv->dds.data[0], priv->dds.data[0]));
break;
}
@@ -528,9 +576,16 @@ cit_DriverComm(DeviceIntPtr dev)
cit_SetEnterCount(priv); /* set enter_count according click_mode */
ErrorF("%sZEnterCount set to %d \n", CI_INFO, priv->enter_count_Z);
break;
+
+ case D_PWMADJ:
+ priv->pwm_src = priv->dds.data[i++];
+ priv->pwm_dst = priv->dds.data[i++];
+ cit_SendPWM(priv); /* Set PWM for active and sleep mode */
+ ErrorF("%spwm_src=%d, pwm_dst=%d \n", CI_INFO, priv->pwm_src, priv->pwm_dst);
+ break;
default:
- ErrorF("%sNot known command: %d - Get a recent driver\n", CI_WARNING, priv->dds.data[1]);
+ ErrorF("%sNot known command: %d [0x%02x] - Get a recent driver\n", CI_WARNING, priv->dds.data[1], priv->dds.data[1]);
break;
}
}
@@ -541,8 +596,10 @@ xf86CitronPrint (int nr, LedCtrl *ctrl)
{
DBG(8, ErrorF("%s------------------------------------------\n", CI_INFO));
DBG(8, ErrorF("%sxf86CitronFeedback%d(dev, ctrl)\n", CI_INFO, nr));
- DBG(8, ErrorF("%s ctrl->led_values.......:%d [0x%08lX]\n", CI_INFO, ctrl->led_values, ctrl->led_values));
- DBG(8, ErrorF("%s ctrl->led_mask.........:%d [0x%08lX]\n", CI_INFO, ctrl->led_mask, ctrl->led_mask));
+ DBG(8, ErrorF("%s ctrl->led_values.......:%ld [0x%08lX]\n", CI_INFO,
+ ctrl->led_values, ctrl->led_values));
+ DBG(8, ErrorF("%s ctrl->led_mask.........:%ld [0x%08lX]\n", CI_INFO,
+ (unsigned long)ctrl->led_mask, (unsigned long)ctrl->led_mask));
DBG(8, ErrorF("%s ctrl->id...............:%d\n", CI_INFO, ctrl->id));
}
@@ -597,9 +654,9 @@ xf86CitronFeedback0 (DeviceIntPtr dev, LedCtrl *ctrl)
}
}
- DBG(DDS, ErrorF("%s 1 led_values = %08x\n", CI_INFO, ctrl->led_values));
- ctrl->led_values = 0x12345678;
- DBG(DDS, ErrorF("%s 2 led_values = %08x\n", CI_INFO, ctrl->led_values));
+ DBG(DDS, ErrorF("%s 1 led_values = %08lx\n", CI_INFO, ctrl->led_values));
+ ctrl->led_values = (unsigned long)GetTimeInMillis();
+ DBG(DDS, ErrorF("%s 2 led_values = %08lx\n", CI_INFO, ctrl->led_values));
}
@@ -658,7 +715,7 @@ cit_StartTimer(cit_PrivatePtr priv, int nr)
{
priv->timer_ptr[nr] = TimerSet(priv->timer_ptr[nr], 0, priv->timer_val1[nr],
priv->timer_callback[nr], (pointer)priv);
- DBG(5, ErrorF ("%scit_StartTimer[%d] called PTR=%08x\n", CI_INFO, nr, priv->timer_ptr));
+ DBG(5, ErrorF ("%scit_StartTimer[%d] called PTR=%p\n", CI_INFO, nr, (void *)priv->timer_ptr));
}
@@ -669,7 +726,7 @@ static void
cit_CloseTimer(cit_PrivatePtr priv, int nr)
{
- DBG(5, ErrorF ("%scit_CloseTimer[%d] called PTR=%08x\n", CI_INFO, nr, priv->timer_ptr));
+ DBG(5, ErrorF ("%scit_CloseTimer[%d] called PTR=%p\n", CI_INFO, nr, (void *)priv->timer_ptr));
if(priv->timer_ptr[nr])
{
TimerFree(priv->timer_ptr[nr]);
@@ -690,7 +747,8 @@ cit_SuperVisionTimer(OsTimerPtr timer, CARD32 now, pointer arg)
cit_PrivatePtr priv = (cit_PrivatePtr) arg;
int sigstate;
- DBG(5, ErrorF ("%scit_SuperVisionTimer called %d\n", CI_INFO, GetTimeInMillis()));
+ DBG(5, ErrorF ("%scit_SuperVisionTimer called %ld\n", CI_INFO,
+ (unsigned long)GetTimeInMillis()));
sigstate = xf86BlockSIGIO ();
@@ -748,7 +806,8 @@ CitronPreInit (InputDriverPtr drv, IDevPtr dev, int flags)
int errmaj, errmin;
#endif
- ErrorF ("%sCitronPreInit called - xcalloc=%d\n", CI_INFO, sizeof(cit_PrivateRec));
+ ErrorF ("%sCitronPreInit called - xcalloc=%d\n", CI_INFO,
+ (int)sizeof(cit_PrivateRec));
/* DBG(2, ErrorF("\txf86Verbose=%d\n", xf86Verbose));*/
if ((!local) || (!priv))
{
@@ -836,6 +895,10 @@ CitronPreInit (InputDriverPtr drv, IDevPtr dev, int flags)
ErrorF("%sSleep Time: %d\n", CI_CONFIG, priv->sleep_time_act);
priv->sleep_time_scan = xf86SetIntOption(local->options, "SleepScan", 65535);
ErrorF("%sSleep Scan: %d\n", CI_CONFIG, priv->sleep_time_scan);
+ priv->pwm_src = xf86SetIntOption(local->options, "PWMAdjSrc", -1);
+ ErrorF("%sPWMAdjSrc: %d\n", CI_CONFIG, priv->pwm_src);
+ priv->pwm_dst = xf86SetIntOption(local->options, "PWMAdjDst", -1);
+ ErrorF("%sPWMAdjDst: %d\n", CI_CONFIG, priv->pwm_dst);
priv->pwm_active = xf86SetIntOption(local->options, "PWMActive", 255);
ErrorF("%sPWM Active: %d\n", CI_CONFIG, priv->pwm_active);
priv->pwm_sleep = xf86SetIntOption(local->options, "PWMSleep", 255);
@@ -880,6 +943,12 @@ CitronPreInit (InputDriverPtr drv, IDevPtr dev, int flags)
ErrorF("%sZEnterCount: %d\n", CI_CONFIG, priv->enter_count_Z);
priv->pwm_freq = xf86SetIntOption(priv->local->options, "PWMFreq", -1);
ErrorF("%sPWMFreq: %d\n", CI_CONFIG, priv->pwm_freq);
+ priv->lockz_enter_time = xf86SetIntOption(priv->local->options, "LockZEnterTime", 1);
+ ErrorF("%sLockZEnterTime: %d\n", CI_CONFIG, priv->lockz_enter_time);
+ priv->lockz_exit_time = xf86SetIntOption(priv->local->options, "LockZExitTime", 1);
+ ErrorF("%sLockZExitTime: %d\n", CI_CONFIG, priv->lockz_exit_time);
+ priv->lockz_lock_time = xf86SetIntOption(priv->local->options, "LockZLockTime", 10);
+ ErrorF("%sLockLockTime: %d\n", CI_CONFIG, priv->lockz_lock_time);
cit_SetEnterCount(priv); /* set enter_count according click_mode */
@@ -1525,7 +1594,7 @@ QueryHardware (LocalDevicePtr local, int *errmaj, int *errmin)
unsigned char x;
int i, cnt;
int err; /* for WAIT */
-
+ char UsrStr[CTS_USERSTRING_LEN+1];
/* Reset the IRT from any mode and wait for end of warmstart */
DBG(5, ErrorF("%sQueryHardware called\n", CI_INFO));
@@ -1660,10 +1729,6 @@ QueryHardware (LocalDevicePtr local, int *errmaj, int *errmin)
LOBYTE(CIT_DEF_MAX_Y),
HIBYTE(CIT_DEF_MAX_Y));
- cit_SendCommand(priv->buffer, C_SETPWM, 2,
- LOBYTE(priv->pwm_active),
- LOBYTE(priv->pwm_sleep));
-
cit_SendCommand(priv->buffer, C_SETBEAMTIMEOUT, 2,
LOBYTE(priv->beam_timeout),
HIBYTE(priv->beam_timeout));
@@ -1686,9 +1751,11 @@ QueryHardware (LocalDevicePtr local, int *errmaj, int *errmin)
HIBYTE(priv->doze_time_scan));
cit_SendCommand(priv->buffer, C_SETTRANSMISSION, 1, TM_TRANSMIT);
- cit_SendCommand(priv->buffer, C_SETSCANNING, 1, 1);
+/* cit_SendCommand(priv->buffer, C_SETSCANNING, 1, SC_ENABLE); */
+ cit_SendPWM(priv); /* Set PWM for active and sleep mode */
cit_SendPWMFreq(priv); /* Set PWM Frequency */
+ cit_SendLockZ(priv); /* LockZ timing */
if(priv->query_state == 0) /* do error reporting only 1 time */
{
@@ -1745,8 +1812,25 @@ QueryHardware (LocalDevicePtr local, int *errmaj, int *errmin)
*errmaj = LDR_NOHARDWARE;
return (!Success);
}
+
+ i=0;
+ while(UserStrNames[i] != NULL)
+ {
+ if (cit_GetUserString(priv, UserStrNames[i], UsrStr, FALSE) != Success) /* scanning is still disabled */
+ {
+ ErrorF("%sNo UserString read from Touch.\n",CI_NOTICE);
+ break;
+ }
+ else
+ ErrorF("%sUserString: %s=%s\n",CI_INFO, UserStrNames[i], UsrStr);
+ i++;
+ }
+
}
+ /* now we can start beam scanning */
+ cit_SendCommand(priv->buffer, C_SETSCANNING, 1, SC_ENABLE);
+
DBG(6, ErrorF("%s\t+ Touch initialized - %d\n",CI_INFO, priv->query_state));
return (Success);
@@ -1981,6 +2065,60 @@ cit_SendCommand (XISBuffer *b, unsigned char cmd, int cnt, ...)
va_end(ap);
}
+/*****************************************************************************
+ * [cit_SendString]
+ ****************************************************************************/
+static int
+cit_SendString(XISBuffer *b, unsigned char cmd, int cnt, char *ustr)
+{
+ int i,j;
+ unsigned char buf[CTS_OEMSTRING_LEN];
+
+ if(((strlen((char *)ustr)+1) > cnt) || (cnt > sizeof(buf)))
+ {
+ DBG(5, ErrorF("%scit_SendString: String too long\n", CI_ERROR));
+ return(!Success);
+ }
+
+
+ DBG(9, ErrorF("%scit_SendString(cmd=0x%02x numbytes=0x%02X, %s\n", CI_INFO, cmd, cnt, ustr));
+
+
+ j=0;
+ buf[j++] = CTS_STX; /* transmit start of packet */
+ buf[j++] = cmd; /* Transmit command */
+
+ for(i=0; i<cnt; i++)
+ {
+ if ((ustr[i] >= CTS_CTRLMIN) && (ustr[i] <= CTS_CTRLMAX))
+ { /* data has to be encoded */
+ buf[j++] = CTS_ESC;
+ buf[j++] = ustr[i] | CTS_ENCODE;
+ }
+ else buf[j++] = ustr[i];
+ }
+ buf[j++] = CTS_ETX; /* end of packet */
+
+ XisbWrite(b, buf, j);
+
+
+ for(i=0; i<j; i++)
+ {
+ if(i == 0)
+ {
+ DBG(9, ErrorF("%s sent=", CI_INFO));
+ }
+ else if(i%16 == 0)
+ {
+ DBG(9, ErrorF("\n"));
+ }
+ DBG(9, ErrorF("%02x ",buf[i]));
+ }
+
+
+ DBG(9, ErrorF("\n"));
+ return(Success);
+}
/*****************************************************************************
* [cit_GetInitialErrors]
@@ -2033,6 +2171,7 @@ static Bool cit_GetInitialErrors(cit_PrivatePtr priv)
+ 0x00010000UL * (unsigned long)priv->packet[4]
+ 0x10000000UL * (unsigned long)priv->packet[5];
DBG(6, ErrorF("%sinitial errors = 0x%08lX\n", CI_NOTICE, errors));
+
if (errors == 0x00000000UL)
{
ErrorF("%sNo initialization errors detected.\n", CI_INFO);
@@ -2318,6 +2457,86 @@ static Bool cit_GetRevision(cit_PrivatePtr priv, int selection)
}
+
+/*****************************************************************************
+ * [cit_GetUserString]
+ ****************************************************************************/
+static Bool cit_GetUserString(cit_PrivatePtr priv, char *ustr_name, char *ustr_cont, Bool scan_flg)
+{
+ int ustrlen;
+ int err;
+ Bool res;
+
+ DBG(8, ErrorF("%scit_GetUserString called\n", CI_INFO));
+
+ ustrlen = strlen((char *)ustr_name);
+
+ /* Test if there is a string at all and that this string is not too long */
+ if((ustrlen <= 0) || (ustrlen > CTS_USERNAME_LEN))
+ {
+ DBG(5, ErrorF("%scit_GetUserString: No strname specified or string too long\n", CI_ERROR));
+ return (!Success);
+ }
+
+/* switch off scanning to get no further coordinate packets if scanning is enabled*/
+ if(scan_flg)
+ {
+ cit_SendCommand(priv->buffer, C_SETSCANNING, 1, SC_DISABLE);
+
+ WAIT(150); /* wait for 150ms to enshure the command has been sent */
+ }
+ cit_Flush(priv); /* now flush the buffer in order to get the userstring */
+
+ cit_SendString(priv->buffer, C_GETUSERSTRING, ustrlen+1, ustr_name);
+ /*
+ touch responds within 1 millisecond,
+ but it takes some time, until the command is sent and received!
+ This time was measured with serial logger and is according to commands up to
+ 628ms, so we set duration time to 1 sec
+ */
+ cit_SetBlockDuration(priv, 1000000); /* 1 sec */
+ while (((res = cit_GetPacket(priv)) != Success) && (priv->lex_mode != cit_idle));
+
+ if(scan_flg)
+ cit_SendCommand(priv->buffer, C_SETSCANNING, 1, SC_ENABLE);
+
+ if (res != Success)
+ {
+ DBG(5, ErrorF("%sNo packet received!\n", CI_NOTICE));
+ return (!Success);
+ }
+ /* examine packet */
+ if (priv->packeti < 2)
+ {
+ DBG(5, ErrorF("%sWrong packet length (expected >= %d, received %d bytes)\n", CI_NOTICE,
+ 2, priv->packeti));
+ return (!Success);
+ }
+ if (priv->packet[0] != (C_GETUSERSTRING & CMD_REP_CONV))
+ {
+ DBG(5, ErrorF("%sWrong packet identifier (expected 0x%02X, received 0x%02X)\n", CI_NOTICE,
+ (C_GETUSERSTRING & CMD_REP_CONV), priv->packet[0]));
+ return (!Success);
+ }
+
+ /* this is our packet! check contents */
+ if(strncmp(ustr_name, (char *)&priv->packet[1], CTS_USERNAME_LEN) == 0) /* Name is ok */
+ {
+ strncpy(ustr_cont, (char *)&priv->packet[strlen((char *)&priv->packet[1])+2], CTS_USERSTRING_LEN);
+ DBG(5, ErrorF("%s cit_GetUserString: %s=%s \n", CI_INFO, ustr_name, ustr_cont));
+ }
+ else
+ {
+ DBG(5, ErrorF("%s cit_GetUserString: %s != %s\n", CI_ERROR,
+ ustr_name, &priv->packet[1]));
+ return (!Success);
+ }
+
+ return (Success);
+}
+
+
+
/*****************************************************************************
* [cit_ProcessPacket]
****************************************************************************/
@@ -2579,6 +2798,22 @@ static void cit_SetEnterCount(cit_PrivatePtr priv)
/*****************************************************************************
+ * [cit_SendPWM] send pwm for acive and sleep
+ ****************************************************************************/
+static void cit_SendPWM(cit_PrivatePtr priv)
+{
+ int pwm_active, pwm_sleep;
+
+ pwm_active = cit_AdjustBright(priv, priv->pwm_active);
+ pwm_sleep = cit_AdjustBright(priv, priv->pwm_sleep);
+
+ cit_SendCommand(priv->buffer, C_SETPWM, 2, LOBYTE(pwm_active),
+ LOBYTE(pwm_sleep));
+
+ DBG(3,ErrorF("%scit_SendPWM: active=%d, sleep=%d\n", CI_CONFIG, pwm_active, pwm_sleep));
+}
+
+/*****************************************************************************
* [cit_SendPWMFreq] send pwm frequency of PWM signal to the touch
****************************************************************************/
static void cit_SendPWMFreq(cit_PrivatePtr priv)
@@ -2595,4 +2830,49 @@ static void cit_SendPWMFreq(cit_PrivatePtr priv)
}
+/*****************************************************************************
+ * [cit_SendLockZ] send LockZ timing to the touch
+ ****************************************************************************/
+static void cit_SendLockZ(cit_PrivatePtr priv)
+{
+ cit_SendCommand(priv->buffer, C_SETLOCKZ, 3, LOBYTE(priv->lockz_enter_time),
+ LOBYTE(priv->lockz_exit_time),
+ LOBYTE(priv->lockz_lock_time));
+ DBG(3,ErrorF("%scit_SendLockZ: enter=%d, exit=%d, lock=%d\n", CI_CONFIG,
+ priv->lockz_enter_time,priv->lockz_exit_time, priv->lockz_lock_time));
+}
+
+
+/*****************************************************************************
+ * [cit_AdjustBright] Adjust Brightness according to the brightness table
+ * if you have a AC and want to adjust it that it works like a TDK you have
+ * to set src to BL_TDK and dst to BL_AC
+ ****************************************************************************/
+static int cit_AdjustBright(cit_PrivatePtr priv, int val)
+{
+ int i;
+ int src_val;
+
+ DBG(9,ErrorF("%scit_AdjustBright entered val=%d, src=%d, dst=%d\n", CI_CONFIG, val, priv->pwm_src, priv->pwm_dst));
+
+ if((priv->pwm_src < 0) || (priv->pwm_dst < 0))
+ return(val); /* No adjust */
+
+ if((priv->pwm_src <= BL_AC) && (priv->pwm_dst <= BL_MAX) && (val < 256)) /* test if value is ok */
+ src_val = cit_bright_adjust[priv->pwm_src][val]; /* get value in candela */
+ else
+ {
+ DBG(3,ErrorF("%scit_AdjustBright: Wrong value src=%d dst=%d\n", CI_CONFIG, priv->pwm_src, priv->pwm_dst));
+ return(-1);
+ }
+
+ for(i=0; i<256; i++)
+ {
+ if(cit_bright_adjust[priv->pwm_dst][i] >= src_val)
+ return (i);
+ }
+ return (255);
+}
+
+
diff --git a/src/citron.h b/src/citron.h
index 502a673..c1c1ec8 100644
--- a/src/citron.h
+++ b/src/citron.h
@@ -1,4 +1,4 @@
-/* Id: citron.h,v 1.3 2001/03/28 08:24:38 pk Exp $
+/* $Id$
* Copyright (c) 1998 Metro Link Incorporated
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -25,13 +25,13 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.h,v 1.3 2001/10/28 03:33:56 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.h,v 1.5 2003/11/03 05:11:47 tsi Exp $ */
/*
* Based, in part, on code with the following copyright notice:
*
* Copyright 1999-2001 by Thomas Thanner, Citron GmbH, Germany. <support@citron.de>
- *
+ * Copyright 1999-2003 by Peter Kunzmann, Citron GmbH, Germany. <kunzmann@citron.de> *
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
@@ -81,6 +81,8 @@
#define CTS_OEMSTRING_LEN 256 /* Length of the OEM string */
#define CTS_FPGA_LEN 28 /* Length of the FPGA version string */
#define CTS_SENSORCOUNT_LEN 1 /* Length of sensorcount report */
+#define CTS_USERNAME_LEN 14 /* User name length without trailing zero (GetUserString) */
+#define CTS_USERSTRING_LEN 127 /* Length of the Userstring without trailing zero */
#define CTS_MAX_HWASSY 32 /* Maximum number of hardware codeable assy numbers */
@@ -113,10 +115,14 @@
/* SetTransmission command parameter values */
#define TM_TRANSMIT 0x01 /* Enable the transmission of messages (report will be transmitted always) */
-#define TM_NONE 0x00 /* Disable transmission of messages and disable the XON/XOFF protocol */
+/* TM_NONE 0x00 */ /* Disable transmission of messages and disable the XON/XOFF protocol */
#define TM_RXDFLOW 0x10 /* Enable the XON/XOFF protocol for the transmitter (IRT will send XON/XOFF to the host) */
#define TM_TXDFLOW 0x20 /* Enable the XON/XOFF protocol for the receiver (host will sned XON/XOFF to the IRT) */
+/* SetScanning command parameter values */
+#define SC_DISABLE 0x00 /* Disable scanning */
+#define SC_ENABLE 0x01 /* Enable scanning */
+
/* Sleep- and Doze-Mode command parameters */
#define TS_QUIET 0x00 /* Disable the generation of TouchSaver messages */
#define TS_ACTIMSG 0x01 /* Enable the generation of messages on sleep- or doze-mode activation */
@@ -250,6 +256,8 @@
#define D_DEBUG 0x03
#define D_ENTERCOUNT 0x04
#define D_ZENTERCOUNT 0x05
+#define D_PWMADJ 0x06
+
/* Message identifiers */
#define R_DUALTOUCHERROR 0x18 /* Invalid multiple touches are detected */
@@ -266,6 +274,8 @@
#define R_POLYAREADEF 0x2a
#define R_IDLE 0x34
#define R_SCANTIMING 0x56
+#define R_LOCKZ 0x52 /* LockZ timings report */
+#define R_USERSTRING 0x66 /* Userstring report */
/* Command identifiers */
#define C_SOFTRESET 0x80
@@ -322,12 +332,16 @@
#define C_GETTOUCHTIME 0xd0
#define C_SETTOUCHTIME 0xd1
+#define C_GETLOCKZ 0xd2
+#define C_SETLOCKZ 0xd3
#define C_CLEARMACRO 0xe0
#define C_ENDMACRORECORD 0xe1
#define C_EXECMACRO 0xe2
#define C_GETFREEMACROSPACE 0xe3
#define C_STARTMACRORECORD 0xe5
+#define C_GETUSERSTRING 0xe6
+#define C_SETUSERSTRING 0xe7
#define C_GETPORT 0xf0
#define C_GETPWM 0xf1
@@ -379,6 +393,7 @@ typedef struct {
+
/*****************************************************************************
* X-Header
****************************************************************************/
@@ -439,6 +454,8 @@ typedef struct _cit_privateRec
int pwm_sleep; /* PWM duty cycle during touch saver mode */
int pwm_active; /* PWM duty cycle during regular operation */
int pwm_freq; /* PWM base frequency */
+ int pwm_src; /* Source for PWM adjust BL_TDK or BL_AC */
+ int pwm_dst; /* Destination for PWM adjust BL_TDK or BL_AC */
int state;
/* additional parameters */
int last_x; /* last cooked data */
@@ -471,6 +488,10 @@ typedef struct _cit_privateRec
int raw_min_y;
int raw_max_y;
int pressure_sensors; /* number of pressure sensors */
+ int lockz_enter_time; /* Minimum duration of AreaPressEnter state before a PressEnter event is issued. Steps: 10ms */
+ int lockz_exit_time; /* Minimum duration of AreaPressExit state before a PressEnter event is issued. Steps: 10ms */
+ int lockz_lock_time; /* Minimum gap between PressExit and PressEnter event. Steps: 10ms */
+
#define MAX_TIMER 2 /* Max. concurrent timers */
#define FAKE_TIMER 0 /* Timer for faked exit message */
@@ -487,11 +508,47 @@ typedef struct _cit_privateRec
Bool proximity;
cit_State lex_mode;
XISBuffer *buffer;
- unsigned char packet[CTS_PACKET_SIZE]; /* packet being/just read */
+ unsigned char packet[CTS_PACKET_SIZE]; /* packet being/just read */
CitronDDS dds; /* Structure for Byte transfer to the driver via LedFeedbackControl */
}
cit_PrivateRec, *cit_PrivatePtr;
+
+
+
+#define BL_TDK 0 /* TDK Inverter */
+#define BL_AC 1 /* Applied Concepts inverter */
+#define BL_MAX 1 /* Max. Tables */
+
+const unsigned short cit_bright_adjust[2] [256] =
+{
+ {1,1,2,2,2,3,3,3,4,4,5,5,6,7,8,10,11,13,14,16,18,20,23,25,27,30,33,36,39,42,45,49,52,56,60,64,68,72,76,
+ 80,85,89,94,99,104,109,114,119,124,130,135,141,147,153,159,165,171,177,183,190,196,203,209,216,223,230,
+ 237,244,251,258,265,273,280,288,295,303,311,319,326,334,342,350,359,367,375,383,392,400,408,417,426,434,
+ 443,452,460,469,478,487,496,505,514,523,532,541,550,560,569,578,587,597,606,615,625,634,644,653,663,672,
+ 682,691,701,710,720,730,739,749,758,768,778,787,797,807,816,826,836,845,855,865,874,884,893,903,913,922,
+ 932,941,951,960,970,979,989,998,1008,1017,1027,1036,1045,1054,1064,1073,1082,1091,1100,1109,1119,1128,
+ 1136,1145,1154,1163,1172,1181,1189,1198,1207,1215,1224,1232,1240,1249,1257,1265,1273,1281,1289,1297,1305,
+ 1313,1321,1329,1336,1344,1351,1359,1366,1373,1380,1387,1395,1401,1408,1415,1422,1428,1435,1441,1448,1454,
+ 1460,1466,1472,1478,1484,1489,1495,1500,1506,1511,1516,1521,1526,1531,1536,1541,1545,1549,1554,1558,1562,
+ 1566,1570,1574,1577,1581,1584,1587,1590,1593,1596,1599,1601,1604,1606,1608,1610,1612,1614,1616,1617,1618,
+ 1620,1621,1622,1622,1623,1623}, /* TDK */
+
+ {113,117,122,126,131,135,140,144,149,154,159,164,168,173,178,183,189,194,199,204,210,215,220,226,231,237,
+ 243,248,254,260,265,271,277,283,289,295,301,307,313,320,326,332,338,345,351,357,364,370,377,383,390,397,
+ 403,410,417,423,430,437,444,451,458,465,472,479,486,493,500,507,514,521,529,536,543,550,558,565,572,580,
+ 587,594,602,609,617,624,632,639,647,655,662,670,677,685,693,700,708,716,723,731,739,747,755,762,770,778,
+ 786,794,801,809,817,825,833,841,849,856,864,872,880,888,896,904,912,920,928,935,943,951,959,967,975,983,
+ 991,999,1007,1015,1023,1030,1038,1046,1054,1062,1070,1078,1086,1093,1101,1109,1117,1125,1133,1140,1148,
+ 1156,1164,1171,1179,1187,1194,1202,1210,1217,1225,1233,1240,1248,1256,1263,1271,1278,1286,1293,1301,1308,
+ 1315,1323,1330,1337,1345,1352,1359,1367,1374,1381,1388,1395,1402,1409,1417,1424,1431,1438,1444,1451,1458,
+ 1465,1472,1479,1485,1492,1499,1506,1512,1519,1525,1532,1538,1545,1551,1557,1564,1570,1576,1582,1589,1595,
+ 1601,1607,1613,1619,1625,1631,1636,1642,1648,1654,1659,1665,1670,1676,1681,1687,1692,1697,1703,1708,1713,
+ 1718,1723,1728,1733,1738,1743,1748,1752,1757,1762,1766,1771,1775,1779,1784,1788,1792,1796,1801,1805,1809}, /* AC */
+};
+
+
+
/******************************************************************************
* Declarations
*****************************************************************************/
@@ -526,7 +583,9 @@ static void cit_SetBlockDuration (cit_PrivatePtr priv, int block_duration);
static void cit_ReinitSerial(cit_PrivatePtr priv);
static int cit_ZPress(cit_PrivatePtr priv);
static void cit_SetEnterCount(cit_PrivatePtr priv);
+static void cit_SendPWM(cit_PrivatePtr priv);
static void cit_SendPWMFreq(cit_PrivatePtr priv);
+static int cit_AdjustBright(cit_PrivatePtr priv, int val);
#ifdef CIT_TIM
static void cit_StartTimer(cit_PrivatePtr priv, int nr);