
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
432 of 487
NXP Semiconductors
UM10800
Chapter 30: LPC82x ROM API ADC drivers
30.4.2 ADC set-up
30.4.3 ADC calibration
The conditions under which self-calibration of the ADC should be performed are described
in
Section 21.3.4 “Hardware self-calibration”
.
Remark:
Once the calibration is complete, revert the calibration-related clock settings in
the ADC_CONFIG_T structure to the clock settings needed for A/D conversion.
30.4.4 ADC initialize
The ADC_CONFIG_T structure defines the configuration settings for this function. See
Section 30.4.12.1 “ADC_CONFIG_T channel configuration structure”
Table 387. adc_setup
Routine
adc_setup
Prototype
ADC_HANDLE_T* adc_setup (uint32_t base_addr, uint8_t *ram);
Input parameter
base_addr: Base address of register for the ADC block.
ram: Pointer to the memory space for ADC instance; the size is obtained from
adc_get_mem_size() function.
Return
The handle to corresponding ADC instance.
Description
Sets up the ADC instance with provided memory and the base address of the
ADC instance, and returns the handle to this instance.
Table 388. adc_calibration
Routine
adc_calibration
Prototype
void adc_calibration (ADC_HANDLE_T handle, ADC_CONFIG_T *adc_set);
Input parameter
handle: The handler of ADC driver from adc_setup().
adc_set: Configuration for ADC operation.
Return
None.
Description
Calibrate ADC controller.
Setup the ADC_CONFIG_T structure with the parameters
system_clock
and
adc_clock
. Only the system clock and the ADC clock are needed for ADC
calibration. Set the ADC clock to about 500 kHz for calibration and ensure that
the system clock is larger or equal to the ADC clock,
Table 389. adc_init
Routine
adc_init
Prototype
void adc_init (ADC_HANDLE_T *handle, ADC_CONFIG_T adc_set);
Input parameter
handle: The handle to the ADC instance.
adc_set: Configuration for ADC operation.
Return
None.
Description
Setup operation mode for ADC, then enable ADC.