MPLAB® Harmony v2 Device Drivers Overview

The basic driver operations allow an application to interact with a device, reading and writing data, as if it was a simple file. More specific operations are present on most drivers and the kind of specific operations available depends on the peripheral whose functionality is being exposed by the driver. A driver has the following fundamental responsibilities:

  • Providing a highly-abstracted interface to a peripheral
  • Controlling access to a peripheral
  • Managing the state of a peripheral

The following diagram illustrates how a driver interacts with the other pieces of the system:

  • Drivers are used directly by your application code, middleware (TCP/IP, USB, etc…), system services, and other drivers (SD Card Driver to SPI Driver).
  • The driver calls various system services to perform the tasks that are possibly shared across other drivers (Interrupts and Timers).
  • The driver also calls the peripheral library of the peripheral to which it is abstracting the interface.
  • Driver State machine can be invoked by the system task service (polling system) or the driver state machine can be invoked from an interrupt service routine.
harmony_blocks.png

If you would like to see an example of how a Device Driver is used to control a specific peripheral, please click on the following link.

 
USART Drivers
Learn more >
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.