Abstract:
A device driver in a computer system being controlled by an application program has selectable algorithms for making desired changes to the signals produced by an external device. The signal changes are in addition to any changes which are needed for conforming the external device signals into a data structure required by the application. Selectable algorithms include a data filtering capability as well as a procedure to enhance the data produced by the external device.

Description:
This is a continuation of co-pending application Ser. No. 07/348,636 filed on May 8, 1989. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention relates to computers, and more particularly to device drivers which provide interface services between a computer and its external devices. 
     Conventional microprocessor based machines known as personal computers (PC), typically include external devices such as a cathode ray tube (CRT) display, keyboard, tablet, mouse and a printer for generating or receiving various data which are passed into or out of the PC. In the case where signals are generated by a user manipulating one or more of the external devices, such signals represent data that must be changed into a form suitable for an application program which is operating in the computer and which needs to receive that data. Conversely, any data produced by the application program must also be changed into suitable form before such data can be used by one of the external devices. 
     Usually containing many lines of code, application programs typically include device drivers which are relatively small programs for controlling and interfacing with external devices. Device drivers provide data structuring ability so that the application program and the external devices can communicate with one another. There is one device driver for each external device which will have access to or be accessed by the application program. This arrangement thus permits great flexibility to accommodate any differences between one particular external device and another. For example, coordinate pointing devices such as a mouse, joystick and a tablet can each be used so long as the three respective device drivers can be loaded into the application program. Moreover, devices of the same type but which have different operating characteristics, can each be accommodated. 
     With the rise in popularity of computer applications which require graphical inputs, the conventional digitizing tablet is often used as an external device. As can be appreciated, there are now many tablet devices available which has resulted in a correspondingly large number of tablet device drivers to accommodate the variety of commercial offerings and graphical input capabilities. 
     A problem has arisen if additional data processing is desired for inputs which may contain unwanted noise or if some special data handling is needed for an individual user. For example, a handicapped user may have trouble creating smooth straight or curved lines on a tablet. Since application programs contain relatively large amounts of code, changes may be difficult and thus costly to implement. Although device drivers contain relatively small amounts of code, each of the proliferation must be rewritten to accommodate the special changes. Again, making changes require much effort and attendant cost. 
     SUMMARY OF THE INVENTION 
     The above-mentioned problems and disadvantages of the prior art arrangements are overcome by the provision of a new and improved device driver made in accordance with the teachings of the present invention. In a preferred embodiment, the present invention is capable of incorporating a transform which a user selects from a prescribed group of transforms. Each of the transforms have data manipulating abilities beyond the capabilities of prior art device drivers which translate the data structure of external device signals so that they can be recognized by the application program coupled to receive those signals. This arrangement also permits the user to make coarse and fine adjustments to the external device signals. The coarse adjustment is the result of the user making a specific transform selection from the group. The fine adjustment is the result of the user defining the value of one or more variables which control the behavior of the selected transform itself. As further explanation, if the selected transform is a noise filter, the transform itself determines what type of noise is removed while a variable in that transform can be used to control how much noise is to be removed. 
     When the device driver of the present invention is first loaded for use with an application program, a command line parameter is preferably supplied enabling the user to make a selection of which transform from the group is to be incorporated. Other command line parameters are available for specifying the initial settings of an variable used within the selected transform. 
     The present invention provides services to both the application and to the transforms. The application services include enabling and disabling device driver output, programming the report rate of the tablet, reinitializing the hardware, and defining the value of the transform variable as desired by the user. Some of the transform services include the provision of an interface for passing data from the transform to the application, provision of an error handling routine and provision of an end of-interrupt routine. 
     In a working embodiment of the present invention, four data-transforming algorithms have been implemented for selection by the user. One is transparent, two are data filtering, and the fourth is data enhancing. The transparent algorithm enables the present invention to operate as a prior art device driver so that external devices can communicate to the application program. One of the two filtering algorithms acts for making the application program less sensitive to certain inputs representing motions of the external device. The other data filtering algorithm and the data enhancing algorithm are both useful of making curved motions of the external device look relatively smoother. 
     As a result, the present invention permits a handicapped user to draw straight and curved lines on a tablet sued in connection with a graphical application program. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The various features of the present invention may be more fully understood from the following description when read together with the accompanying drawings in which: 
     FIG. 1 illustrates an overflow block diagram of the data processing system of the present invention. 
     FIG. 2 depicts a memory map of a device driver made in accordance with the teachings of the present invention; 
     FIG. 3 shows the general structure of a data transforming algorithm used in the present invention; and 
     FIG. 4 presents a slider used for changing the value of a transform variable. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     It should be understood that an actual working embodiment of a device driver made in accordance with the teachings of the present invention has been implemented on a PC which is compatible with an IBM PC AT model personal computer. One of the preferred external devices is a conventional digitizing tablet, such as but not limited to the MM1201, MM 961 and CR1212 tablets made by Summagraphic, which uses the RS 232 serial interface port of a PC. The device driver code was first written using 80×86 Assembler Code and is included as Appendices A and B, which are included in this patent specification. For ease of presentation and understanding, the preferred embodiment of the present invention will be described with respect to the working embodiment. However, it is understood that the present invention is not to be limited to the teachings of the working embodiment. 
     Depicted in FIG. 1 is an overview block diagram of a data processing 4 which embodies the present invention. The data processing system 4 includes a processor 5 and a memory 6 interconnected by means of a memory bus. The memory 6 is shown to include an application program 7 and a device driver code module 10. 
     Depicted in FIG. 2 is a memory map of one embodiment of the device driver 10 made in accordance with the teachings of the present invention. An arrow 12 shows the direction of increasing memory addresses. The low addressed memory is at address 14 and the high addressed memory is at address 16. A permanent code space 18 contains the code used by the device driver 10 during system execution. In the code space 18 are instructions such as the interrupt service routine and the device driver enabling and disabling procedures. 
     A transform loading area 20 is a section of empty memory located within the device driver 10. Starting with the lowest available memory address, a user selected data transforming algorithm, which is known as the transform, is read into this area. The size of the area is initially set to be at least equal to the size of the largest expected transform. 
     The device driver 10 of the present invention preferably contains four data transforming algorithms. Two are filtering algorithms that remove unwanted noise which may be present in the data generated by either the tablet or human operator. The other two algorithms provided data enhancement. These four algorithms will be described in more detail in a later portion of the this discussion. 
     When the device driver 10 is being loaded, a user (computer operator) makes a selection of a command line parameter that specifies which data transforming algorithm (transform) is to be used. This parameter is a text string that contains the file and path name of the file containing the chosen algorithm. Other command line parameters are available for specifying initial setting of any other variable if such is needed by the transform. 
     The last section of the device driver is a temporary installation code area 22. The code in this area initializes the data structures used by the device driver 10, initializes the hardware managed by the device driver, loads the transform into the transform loading area 20, takes over the necessary interrupt vectors, and performs error checking on all device drive parameters supplied by the user. 
     After being loaded, the first action taken by the device driver is to initialize itself and the hardware it manages. Thus, it programs the serial port, redirects the serial port interrupt vector to point to its interrupt handler routine, and loads the user selected transform. The transform is loaded by reading an executable binary image from the file specified on the command line. The image is read into the blank transform loading area 20 located within the program code of the device driver 10. 
     After the initialization has been successfully completed, the code in the area 22 then proceeds to return to the operating system any memory that is not needed by the device driver 10. The memory that is returned starts immediately after the transform and includes any unused memory in both the transform loading area 20 and the temporary installation code area 22. 
     As previously mentioned, the present invention preferably contains four data transforming algorithms which are each located within its own file. In the working embodiment of the present invention, the files are recorded on a hard disk in an area separated from the device driver code. The selected file is retrieved as needed. This arrangement also allows easy distribution of any subsequently developed transforms since new device drive code is not required every time a new transformed is created. 
     Depicted in FIG. 2 is a diagram showing the general structure of a transform 40 that is used by the device driver of FIG. 1. Having three major components, the transform 40 is divided into a gateway 42, a data block 44 and a code 46. Since the separately stored algorithms are dynamically relocatable upon user selection, the address references within each algorithm are with respect to the address where that algorithm begins. The gateway 42 is provided in a fixed location which is communicated to the device driver 10 so that only the selected algorithm is executed and not all four algorithms. The gateway arrangement permits each algorithm to have multiple entry points. 
     In the aforementioned working embodiment of the present invention, the gateway 42 is the first three bytes of each algorithm and is actually a jump instruction. The first byte is a jump opcode and the other two form the destination address relative to the beginning of that algorithm. The device driver transfers control to the algorithm by jumping to this jump instruction. Since the addresses within the gateway 42 are only associated with the selected algorithm, the transform 40 contains information for controlling which entry point is to be accessed. The information to be loaded in the gateway 42 is determined when the user makes a selection of the command line parameter. 
     The data block 44 contains information for obtaining the length of the chosen algorithm, the upper and lower limits for the value of any variable used in that algorithm, and a variable space for the magnitude of the variable itself. In addition, there is space for the addresses of the device driver routines that handle errors and pass data to the application. There is also space for the addresses of two buffers. The first buffer is for raw data from the external device and the second is for data that is transformed in accordance with the selected algorithm and is to be sent to the application. 
     The first word of the data block 44 is the length of the entire algorithm in bytes. With reference back to FIG. 2, this information is used by the installation code in the code area 22 for determining the memory addresses of unused memory locations after the selected algorithm is loaded into the transform loading area 20. In the working embodiment, this first word is 16 bits long so that no more 65535 bytes is available for the longest data transforming algorithm. 
     The next two words define the range of values that the transform variable may assume. The lower bound is specified first, followed by the upper bound. The transform supplies these values so that the device driver can validate the transform variable specified by the user. The transform variable is validated when the device driver is loaded and a new value of the variable is specified through the device driver application services. 
     In order to permit relatively easy development of new transforms, the device driver provides three transform services. The first passes date to the application. The second is an error handling routine that reinitializes the hardware. The third service simply provides the transform with an end of interrupt routine. All of these services return control to the device driver and cause the execution of the interrupt handler to be terminated. The three words that follow the data relating to the bounds of the transform variable are the addresses of these services relative to the start address of the device driver. The device driver initializes these words when it loads the transform. 
     A pair of buffers are provided so that data can be passed to and from the transform. The data block at the beginning of each transform contains a pair of words that specify the addresses of the buffers. The first buffer is the input buffer. The device driver receives data from the hardware and places it into this buffer before jumping to the transform. The second buffer is the output buffer where the transform places data that is ready to be sent to the application. 
     Also included in the data block is storage space for the transform variable. When the device driver is loade, it fills this storage space with the value of this variable specified by the user. The user can change this value dynamically after the device driver is loaded through a service provided by the device driver. 
     Any environmental information needed by the transform is also passed to it through the data block. This arrangement is useful because there are some conditions, such as system idle periods, where it is undesirable for the transform to add points to the data stream. A variable is used by the device driver to notify the transform when these conditions exist. 
     The transform code 46 is located after the data block 44. This is the code that implements the data filtering or enhancing features of the present invention. The code 46 is actually in the form of a finite state machine (FSM). Giving the transform the structure of an FSM increases the amount of processor bandwidth available to the computer. As further explanation, the data from an external device such as a digitizing tablet is in the form of a five byte packet. These bytes enter the system through the serial ports, each one causing an interrupt. By using a small amount of processor bandwidth each time a byte arrives, the transform receives more bandwidth than it would otherwise receive if it was not called until the entire packet was available. Furthermore, since the bandwidth used by the transform is distributed over time, the computer system is less affected by its loss. 
     Thus when an interrupt occurs indicating that a byte of tablet data has arrived, the device driver takes the data and puts it into the input buffer. The device driver then enters one of the states of the transform by jumping through the transform gateway. The jump address of the gateway determines which state of the transform is entered. The entered state then takes the data from the input buffer, performs its function and stores any partial results, and updates the gateway jump address to be that of the next state to be executed. Control is then returned to the device driver through one of the three provided transform services. 
     In the actual working embodiment of the present invention, four transforms have been implemented. As will be described below, one is transparent, two are data filtering, and the last is data enhancing. The transparent transform simply operates to collect data until an entire packet has been accumulated. The device driver is then directed to deliver the packet to the application. With this transform being used in to the present invention, the device driver operates in the same manner as a prior art device driver. 
     The second transform, called the four point averaging transform, collects coordinate pairs (each complete data packet being defined as a pair of coordinates representing position information)) from the tablet and averages them together to produce a single coordinate pair which is subsequently transmitted to the application. This transform operates to smooth the data (especially data representing curve information) and acts as a noise filter. Since only one coordinate pair is used by the application for every four pairs generated by the tablet, this transform also reduces the amount of data used by the application. 
     Known as the X-percent of the Way There Algorithm, the third transform operates to calculate the distance between two coordinate pairs generated by the tablet. It then determines a replacement pair of coordinates which are at a distance that is X percent of the calculated distance. The replacement pair of coordinates are later transmitted to the application. Unlike the previously described transform, this one is not data reducing since a coordinate pair is produced for every pair generated by the tablet. The transform variable is the X-percent variable. 
     In the working embodiment, a separate program (first written in the C program language) is evoked by the user for setting the actual value of this transform variable. Presented in FIG. 4 is a slider 80 having a horizontal bar 82 which shows the present value of the transform variable v (which is the X-percent variable of the transform) to be 100, representing 100 percent. The scale 84 above the horizontal bar 82 is shown with a range of values between zero percent and 100 percent. The value of transform variable v is also displayed in region 88. By locating a CRT display cursor (under the control of a tablet) within minus region 86 and causing an activation by a user action recognized by the separate program, the horizontal bar 82 will move left thereby decreasing in value. Then by deactivating minus region 86 via an appropriate action by the user the movement of the bar 82 will cease and stop at a value. The value of the transform variable v is thus fixed at the new value which is displayed in region 88. Similarly, by activating plus region 90, the horizontal bar 82 will move towards the right and the value of the transform variable v shown in region 88 increases until a deactivation action is recognized by the separate program. In the working embodiment, the range of zero to 100 percent is actually corresponds to a range from one to 99 percent respectively. This arrangement avoids zero as a value for the X-percent which would result in no data being sent to the application. This transform is particularly useful with the invention recited in the United States application having Ser. No. 108,176, filed on Oct. 14, 1987, and assigned to the same Assignee as the present invention. 
     The third transform, called the Pseudo B-Spline transform, operates to produce three coordinate pairs for use by the application. The three pairs are derived from each coordinate pair generated by the tablet. This algorithm keeps in a buffer a historical record of not only the last three coordinate points, designated as A, B and C, produced by the tablet, but also the next coordinate point, designated as D. It should be explained that a coordinate point is a pair of values which represent a position in a suitable planar coordinate system, such as the x y coordinates of a Cartesian plane. When the new point D is received additional points B&#39; and B&#34; are calculated in accordance with the respective equations given below: 
     
         B&#39;=[-2A+17B+7C-D]/21 
    
     
         B&#34;=[-A=7B=17C-2D]/21 
    
     Points B, B&#39; and B&#34; are sent to the application and the buffer containing points A, B and C is rolled backwards so that point B becomes A, point C becomes point B and point D becomes C. The purpose of this algorithm is to make more smooth the curve which is apparently produced if all originally generated points were joined with straight lines. This transform is based on well known and conventional algorithms called B Spline techniques. However, it is clear that any other desired routine can be implemented as desired for generating extra points. 
     While the invention has been described with reference to specific embodiments, it will be apparent that improvements and modifications may be made within the purview of the invention without departing from the spirit and scope thereof as defined in the appended claims. For example, even though a RS-232 serial port is used as the interface with the external device, a parallel or other proprietary interface can be utilized. Moreover, the tablet pointing device can also be replaced by a touch screen CRT. 
     In the aforementioned working embodiment, the device driver must be specified when the driver is first loaded for use with a particular application. A new device driver service can be added that would allow users to dynamically change transforms in a manner similar to the way the transform variable is changed in the X-percent of the Way transform. 
     The present embodiments are thus to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. ##SPC1##