PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

API Reference | Functions
Functions
PDL API Reference » AUTONOMOUS ANALOG (Autonomous Analog Block) » SAR ADC (Successive-Approximation Register Analog to Digital Converter)

## General Description

## API Reference
| Initialization Functions
| This set of functions is used to configure the ADC.
| Status Functions
| Conversion Functions
| FIR Filter Functions

## Functions
cy_en_autanalog_status_t | Cy_AutAnalog_SAR_LoadOffsetGainCorr (uint8_t sarIdx, uint16_t chanGain[], int16_t chanOffset[])
| Loads the offset and gain correction coefficients for the ADC channels. More...

## Function Documentation

## ◆ Cy_AutAnalog_SAR_LoadOffsetGainCorr()

cy_en_autanalog_status_t Cy_AutAnalog_SAR_LoadOffsetGainCorr | ( | uint8_t | sarIdx,
|  | uint16_t | chanGain[],
|  | int16_t | chanOffset[]
| ) |  |

Loads the offset and gain correction coefficients for the ADC channels.

Note
  Only the eight channels of the ADC can be corrected.
  Refer to cy_stc_autanalog_sar_hs_chan_t::posCoeff and cy_stc_autanalog_sar_hs_chan_t::negCoeff OR to cy_stc_autanalog_sar_mux_chan_t::posCoeff and cy_stc_autanalog_sar_mux_chan_t::negCoeff

Parameters

  sarIdx | The index of the ADC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::sar.
  chanGain | The array of gain correction coefficients for the eight channels of the ADC.

Note
  The default value of Gain Correction Coefficient is 1.
  This parameter is intended to correct sources of the gain error in the ADC channel (from the GPIO to the ADC input).
  Multiplies the 12-bit ADC conversion by X.XXXXXXXXXXXXXXX
  Range: 1/2^15 = (0.000030517578125) to 2 - (1/2^15) = (1.999969482421875)

Parameters

  chanOffset | The array of offset correction coefficients for the eight channels of the ADC.

Note
  Default value of Offset Correction Coefficient is 0.
  This parameter is intended to correct sources of the offset error in the ADC channel (from the GPIO to the ADC input).
  The signed offset values range from -2048 (0x800) to +2047 (0x7FF) is added to the 12-bit ADC conversion.

Returns
  Status of initialization, cy_en_autanalog_status_t.