The text of a manual · part 9 of 23
VRC 4000 Software Driver Manual: Chapter 2 TBDriver Touchscreen Driver for DOS, pages 73 to 82
Pages 73 to 82 of 206, from VRC 4000 Software Driver Manual
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol VRC-4000
Page 73
Chapter 2: TBDriver Touchscreen Driver for DOS
Function: Calling Sequence:
Packet Counts AL = AH=
21 hex 1 to reset the packet count to zero 0 to preserve the packet count
Call API interrupt
Return Values:
BX =
Description:
Provides a count of the number of physical touch packets received from the touchscreen. This may be used to determine the relative performance of various different types of touchscreen.
Number of packets received
2-31
Page 74
VRC 4000 Software Driver Manual
Function:
Read Soft Calibration Coordinates
Calling Sequence: AL = 8 Call API interrupt AL = 8 Call API interrupt
Return Values:
(After each call) BX CX
Description:
=X coordinate =Y coordinate
After the first call has been issued, the screen should be touched in the bottom left hand corner. The first call will wait for this, and will only return when it has been performed. After the second call has been issued, the screen should be touched in the top right hand corner. The second call will wait for this, and will only return when it has been performed. The touches should be at the extreme edges of a full screen image. The two pairs of coordinates obtained may be stored in a file by the application, and activated when required by calling Activate Soft Calibration Coordinates. For most purposes, the usage of this call has been superseded by the Soft Calibrate API call.
See Also:
2-32
Activate Soft Calibration Coordinates De-Activate Soft Calibration Get Current Calibration
Page 75
Chapter 2: TBDriver Touchscreen Driver for DOS
Function: Read Touches Calling Sequence: AL = 1 Call API interrupt
Return Values:
AH AL BX CX DX SI DI ES
Description:
This function immediately returns one of the touch types specified. If the application is lagging behind the touches, either an F or an L will be returned from the buffer. If the application is keeping up with the touches, any of the four types are possible. The X and Y coordinates are always returned, scaled to the current scale.
= = = = = = = =
Touch type F,L,R, or N Z coordinate, if applicable X coordinate Y coordinate Pad number Time coordinate Raw X coordinate Raw Y coordinate
If the coordinates fall within the bounds of an active pad, the pad number is returned, otherwise a pad number of zero is returned. The Z coordinate is always zero for touchscreens which do not have a Z axis. The Time coordinate is the number of clock ticks that a stylus has remained stationary in contact with the screen. The X,Y,Z values and pad number are undefined and irrelevant for 'N' touch types.
2-33
Page 76
VRC 4000 Software Driver Manual
Function: Calling Sequence: Return Values:
Reset Touchscreen AL=23 hex Call API interrupt AL=1 if successful 0 if unsuccessful
Description:
2-34
Performs initialization of the touchscreen controller, in the same way as is automatically performed when TBdriver loads. The actions performed depend on the hardware in use. In some cases no initialization is necessary, so none is performed.
Page 77
Chapter 2: TBDriver Touchscreen Driver for DOS
Function: Set Scale and Origin Calling Sequence: AL = 2 AH = BX = CX = DL =
New origin New X scale New Y scale New Z scale
Call API interrupt
Return Values:
None
Description:
The new scales and origin are stored in the driver, and will be effective for as long as the driver remains in memory, or until they are changed again. The new origin will be applied to the X and the Y axis. Any existing pad definitions will not be re-mapped to the new scales, and so would probably become meaningless. The Z axis may be scaled in the range 1 to 15, but always has an origin of 1. If a Z scale greater than 15 is specified, it is set to 15. Any scale specified as zero retains its previous value.
See Also:
Get Parameters
2-35
Page 78
VRC 4000 Software Driver Manual
Function: Set Sensitivity Calling Sequence: AL = 6 BX = Sensitivity value Call API interrupt
Return Values:
None
Description:
Sets the number of clock ticks required to register a finger lift. By default, this is initially set to the most appropriate value for the hardware in use. There is no maximum value, but greater than about 5 makes the screen noticeably unresponsive. A value of 3 improves 'sliding'. Setting sensitivity to zero returns the setting to the default value for the touchscreen installed.
See Also:
2-36
Get Parameters
Page 79
Chapter 2: TBDriver Touchscreen Driver for DOS
Function: Set Stabilization Calling Sequence: AL = 18 hex AH =
Stabilization factor
Call API interrupt
Return Values:
None
Description:
Sets the number of touch coordinates from the hardware which are averaged to produce stabilized values. By default, this is initially set to the most appropriate value for the hardware in use. A value of 0 implies no stabilization is to be performed. The maximum value is 10, which means that every coordinate is the average of the preceding 10 coordinates received. Values above 10 are taken as 10.
See Also:
Get Parameters
2-37
Page 80
VRC 4000 Software Driver Manual
Function: Set Event User ISR Calling Sequence: AL = 22 hex AH CH CL ES BX DI SI DX
= = = = = = = =
0 Z axis threshold Time axis threshold Segment address of user ISR Offset address of user ISR Segment address of user stack Offset address of user stack Segment address of user data segment
Return Values: None Description:
Sets the address of a User Interrupt Service Routine to be called when a touch event occurs. There are four types of touch event: •
The touch buffer is not empty
•
A Repeat touch and either the X or Y coordinates have changed, i.e. the stylus is sliding around.
•
A Repeat touch and the Z axis threshold is crossed by the rising Z coordinate.
•
A Repeat touch and the Time axis threshold is crossed by the rising Time coordinate.
Note that the user ISR is never called in a No touch situation, and is only called in a Repeat touch situation when the X or Y coordinates have changed, or if the Z or T axis thresholds are reached. The application is thus truly event driven. If the Time axis threshold is zero, no Time axis events will occur. The same applies to the Z axis threshold. The Z axis threshold must be supplied in the scale 1 to 15.
2-38
Page 81
Chapter 2: TBDriver Touchscreen Driver for DOS
If a user stack is specified, TBdriver will switch to the user stack prior to calling the user ISR. If DI is zero, no stack switch will occur. It is highly recommended to specify a user stack, especially if the user ISR is written in a high level language. Prior to calling the user ISR, TBdriver will automatically load the DS register with the user data segment address specified here in register DX. The application will therefore have access to its variables immediately upon invocation. TBdriver saves all registers prior to calling the user ISR, and restores them after the call. The ISR is called with interrupts enabled. It must exit with a far return. The user ISR is simply called when a touch event occurs, and no details of the event are passed to it. The ISR must therefore call Read Touches to determine the touch event. It may also make any other TBdriver API calls, since the API is fully reentrant. However, it must not make any DOS or BIOS calls, and care must be taken not to re-enter any nonreentrant parts of the application. TBdriver will not re-enter the user ISR. The user ISR is not called if its segment address is zero. The application must reset the user ISR address to zero before terminating. The example program TBdex2.pas uses this feature.
2-39
Page 82
VRC 4000 Software Driver Manual
Function: Set Pre-Processing User ISR = 29 hex Calling Sequence: AL AH 00000001 00000010 00000011 ES BX DI SI DX
= Call mask for First touches for Last touches for both First and Last touches = Segment address of user ISR = Offset address of user ISR = Segment address of user stack = Offset address of user stack = Segment address of user data segment
Call API Interrupt
Return Values:
None
Description:
Sets the address of a User Interrupt Service Routine to be called immediately a First or Last touch occurs. The Pre-processing User ISR has a different function from the event processing user ISR setup by function call hex 22. It is immediately called once for each First and Last touch as it occurs, regardless of the state of the touch event buffer. The application can therefore be aware of whether the screen is being touched, or provide audio feedback, ahead of the actual de-queuing and processing of touches. If a user stack is specified, TBdriver will switch to the user stack prior to calling the user ISR. If DI is zero, no stack switch will occur. It is highly recommended to specify a user stack, especially if the user ISR is written in a high level language. If the event user ISR facility is also used, the two ISR's may specify the same stack, since they will never be inter-called.
2-40