What is device driver?

Discussion in 'Embedded Systems and Microcontrollers' started by devendra.devgupta, Jun 15, 2013.

  1. devendra.devgupta

    Thread Starter New Member

    Jun 15, 2013
    Hi friends
    I have interfaced custom hardware to my embedded board, the custom hardware communicates with the board using a custom protocol over rs485 line, Now there is two level of code abstraction here
    1) Code for initializing the uart, writing to uart and reading from uart for particular controller
    2) Code for initializing the custom hardware using uart functions as in point 1.
    I have a very basic question here which code is called device driver here. please let me know as i am little bit confused here
    Thanks in advance
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    The "device driver" typically refers to the lowest level of code,that which directly controls the hardware.

    As both (1) and (2) seem to be controlling hardware I would say you have two device drivers here, they both contain drivers.

    That's not unusual as each piece of hardware will get it's own driver.
  3. LDC3

    Active Member

    Apr 27, 2013
    I agree with Ernie that both pieces of code are device drivers. You can also distinguish the code since the first is the driver for the UART and the second is for the additional hardware. When you install Windows on a computer, it asks you which printer you are using so it can install a printer (device) driver. Windows already has installed the USB device driver, along with the video driver, the parallel port driver (if you have one), etc. Also, when you plug in an new item on the USB port, Windows will install a device driver for that.