This module describes the basic architecture of the MPLAB® Harmony ADC Driver Library and provides information and examples on its use.
Library Overview
The library provides interfaces to support:
- System Interaction
- Client Core Functionality
The interface to the ADC Driver Library is defined in the drv_adc.h header file. The library interface routines are divided into various sub-sections, which address one of the blocks or the overall operation of the ADC Driver Library.
| Section | Description |
| Configuring the Library | Provides macros for configuring the system. The system must configure the driver by choosing appropriate configuration options as listed in this section. |
| System Interaction | Provides system module interfaces; device initialization, deinitialization, reinitialization and status functions. |
| Client Core Configuration | Provides interfaces for core functionality of the driver. |
| Other Functions | Provides additional ADC Driver functions. |
Abstraction Model
This library provides a low-level abstraction of the Analog-to-Digital (ADC) driver library on Microchip's microcontrollers with a convenient C language interface. See below for a description of how that abstraction is modeled in software as well as an introduction to the interface.
The ADC driver is modeled using the abstraction model, as shown in the following diagram:

Functions
DRV_ADC_InputsRegister: This function causes the driver to select a set of input registers for sampling.
Example:
DRV_HANDLE handle; // Returned from DRV_ADC_Open
DRV_ADC_InputsRegister (handle, ADC_INPUT_AN2|ADC_INPUT_AN3);
DRV_ADC_SamplesRead, DRV_ADC_SamplesReadLatest: These functions allow reading of the sample from the result buffer.
DRV_ADC_Start: Starts the ADC driver sampling and converting analog to digital values.
DRV_ADC_Stop: Stops the ADC driver from sampling and converting analog to digital values.

