ADC Driver Library for Harmony v2

This module describes the basic architecture of theMPLAB® 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 theDRV_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.

SectionDescription
Configuring the LibraryProvides macros for configuring the system. The system must configure the driver by choosing appropriate configuration options as listed in this section.
System InteractionProvides system module interfaces: device initialization, deinitialization, reinitialization and status functions.
Client Core ConfigurationProvides interfaces for core functionality of the driver.
Other FunctionsProvides 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.

adc-driver-model.png

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.


 Learn More

 
Harmony ADC Tutorial
Learn more >
 
Example Code and Projects
Learn more >
 
Entire ADC Driver Interface
Learn more >
 
ADC Hardware Description
Learn more >