There are two ways to control the Analog-to-Digital Converter (ADC) in Harmony:
- Static Implementation (ADC Driver Library)
- ADC Peripheral Library (PLIB)
Only Static implementation is supported for the ADC Driver Library.
ADC Driver
The ADC Driver Library is a static driver. A device driver provides a simple well-defined interface to a hardware peripheral that can be used without operating system support or that can be easily ported to a variety of operating systems. The ADC driver provides an interface to manage the ADC module. Configuration of the ADC device driver is based on the file system_config.h. This header file contains configuration information for the ADC device driver build. Based on the selections made and the system setup, the ADC device driver will implement the selected features. These configuration settings will apply to all instances of the device driver. The header file can be placed anywhere in the application-specific folders, but the path to this header must be present in the include search for a successful build. Further details for the ADC Driver Library can be found here.
ADC PLIB
The ADC PLIB provides a low-level abstraction of the ADC module. It can be used to simplify low-level access to the module without the necessity of interacting directly with the module's registers, thus hiding differences from one microcontroller variant to another.
Interface File
The interface to the ADC library is defined in the plib_adc.h header file, which is included by the peripheral.h peripheral library header file. Any C language source (.c) file that uses the ADC library must include peripheral.h.
Please refer to "ADC Peripheral Library (PLIB) for Harmony v2" to learn how to manage the ADC using PLIB.