PSoC 6 Peripheral Driver Library
cy_stc_sar_config_t Struct Reference

Description

This structure is used to initialize the SAR ADC subsystem.

The SAR ADC subsystem is highly configurable with many options. When calling Cy_SAR_Init, provide a pointer to the structure containing this configuration data. A set of enumerations is provided in this driver to help with configuring this structure.

See the Initialization and Enable section for guidance.

Data Fields

uint32_t ctrl
 Control register settings (applies to all channels)
 
uint32_t sampleCtrl
 Sample control register settings (applies to all channels)
 
uint32_t sampleTime01
 Sample time in ADC clocks for Sample Time 0 and 1.
 
uint32_t sampleTime23
 Sample time in ADC clocks for Sample Time 2 and 3.
 
uint32_t rangeThres
 Range detect threshold register for all channels.
 
cy_en_sar_range_detect_condition_t rangeCond
 Range detect condition (below, inside, output, or above) for all channels.
 
uint32_t chanEn
 Enable bits for the channels.
 
uint32_t chanConfig [CY_SAR_MAX_NUM_CHANNELS]
 Channel configuration.
 
uint32_t intrMask
 Interrupt enable mask.
 
uint32_t satIntrMask
 Saturation detection interrupt enable mask.
 
uint32_t rangeIntrMask
 Range detection interrupt enable mask.
 
uint32_t muxSwitch
 SARMUX firmware switches to connect analog signals to SAR.
 
uint32_t muxSwitchSqCtrl
 Enable SARSEQ control of specific SARMUX switches.
 
bool configRouting
 Configure or ignore routing related registers (muxSwitch, muxSwitchSqCtrl)
 
uint32_t vrefMvValue
 Reference voltage in millivolts used in converting counts to volts.