These are software components that provide an interface to the hardware peripherals connected to the CPU. Each peripheral will have its own device driver. The device driver allows the set¬ting of various parameters associated with the operation of a peripheral, transfer data from CPU to the peripheral or vice-versa, provides polling or interrupts based signalling mechanism for initiation/completion of operation.

It also implements the ISR for the peripheral.For example, the device driver for a camera interface may implement the following functionality:

Setting the resolution: the camera may supports two resolutions 320x240 pixels, 640x480 pixels, and the device driver will allow applications to choose between these two modes. For this purpose the driver usually accesses a HW register provided by the Camera Interface, which contains bits to set the resolution. The driver in turn provides an API through the as to the applications which is independent of the camera hardware.

Name:  Device Drivers.jpg
Views: 50
Size:  25.2 KB

Data transfer: copy the captured image data from the camera inter¬face's memory to the CPU's main memory for further processing.

Interrupt the CPU, to indicate capture of a frame or multiple frames, and implement the ISR. Developing a device driver requires a thorough understanding of the hardware peripheral, including its register set, the data transfer mechanism and the interrupt mechanism.

Drivers are critical components which operate very close to the as kernel and run in privileged modes. Any bug in a device driver can cause unwanted operation or even crash the system. In addition, each as provides its own device driver architecture and developers need to understand and adhere to these specifications.