ADC Driver Library

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:

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 to digital values.

DRV_ADC_Stop: Stops the ADC driver from sampling and converting analog to digital values.


 Learn More

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

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
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.