A device driver simplifies programming by acting as a translator between the hardware and the application (user code), or the kernel that uses it, hiding the details of how the hardware works. Programmers can write the higher-level application code using a set of standardized calls (system calls)—independent of the specific hardware device it will control or the processor it will run on. Using a well-defined internal application programming interface (kernel API) the application code and device driver can interface in a standard way regardless of the software superstructure or underlying hardware.
Operating systems (OS) handle the details of hardware operation for a specific processor platform. Kernel (OS) internal hardware abstraction layers (HALs) and processor-specific peripheral drivers (such as I2C® or SPI bus drivers) allow even a typical device driver to be processor platform independent. This approach allows a device driver—for the AD7879 touch screen digitizer, for example—to be used without modification on any processor platform running Linux, with any graphical user interface (GUI) package and suitable application running on top of the Linux kernel. If the hardware designer decides to change to the AD7877 touch-screen controller, (s)he can do so without input from their software team. Drivers are available for both devices; and while they differ and can connect differently (the AD7877 is SPI only, and the AD7879 is SPI or I2C)—and they both have different register maps—the kernel API that is exposed to user code for touch screens is exactly the same. This puts control of the hardware back into the hands of the hardware architect.