This module describes the basic architecture of the MPLAB® Harmony ADC Driver Library and provides information and examples on its usage.
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 header file. The library interface routines are divided into various sub-sections that 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 in C language, of the ADC Driver present on Microchip's microcontrollers. The picture below provides a description of how that abstraction is modeled in the software.
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 values to digital.
DRV_ADC_Stop: Stops the ADC Driver from sampling and converting analog values to digital.