CAT2 Peripheral Driver Library
cy_stc_dsadc_dchan_config_t Struct Reference

Description

Configure the Digital Channel.

Data Fields

const cy_stc_dsadc_gain_level_config_tgain
 Gain configuration options for the DCHAN.
 
const cy_stc_dsadc_fir_config_tfir
 FIR filter configuration options.
 
int32_t rangeLowerThreshold
 Lower threshold of the range condition. More...
 
int32_t rangeUpperThreshold
 Upper threshold of the range condition. More...
 
cy_en_dsadc_dchan_achan_select_t achan
 Analog Channel to get modulator data from. More...
 
cy_en_dsadc_dchan_sample_mode_t conversionMode
 Select the ADC Conversion Mode.
 
cy_en_dsadc_dchan_priority_t priority
 Channel Priority (Primary / Secondary Channel)
 
cy_en_dsadc_dchan_reference_vrefh_t vrefhSelect
 Reference to use for the ADC VREFH internal input. More...
 
cy_en_dsadc_dchan_reference_vrefl_t vreflSelect
 Reference to use for the ADC VREFL internal input. More...
 
cy_en_dsadc_dchan_positive_pin_t pinPositive
 Positive input pin to sample.
 
cy_en_dsadc_dchan_negative_pin_t pinNegative
 Negative input pin to sample.
 
cy_en_dsadc_aaf_mode_t aafMode
 Configure the way in which the Anti-Aliasing Filter will be used. More...
 
cy_en_dsadc_averaging_mode_t averagingMode
 Configure the Averaging mode to use in the Post Processing block. More...
 
cy_en_dsadc_averaging_samples_t averagingSamples
 Configure the number of samples to average: More...
 
cy_en_dsadc_dchan_post_processing_range_mode_t rangeMode
 Enable / Disable the range detection, or configure the range mode for 'Event Count'. More...
 
cy_en_dsadc_dchan_post_processing_range_conditional_t rangeConditional
 Set the Range Condition. More...
 
cy_en_dsadc_dchan_decimator_sinc_mode_t sincMode
 Select the decimator sinc mode (Sinc3 or Sinc4)
 
uint8_t ppRightShift
 FIR Right Shift. More...
 
uint8_t stage1DecimationRatio
 Decimation ratio for the first decimator stage Set to 64 for OSR of 64.
 
uint8_t stage2DecimationRatio
 Decimation ratio for the second decimator stage Set to 6 for OSR of 6.
 
uint8_t rightShift
 Configure the right shift for values out of the decimator. More...
 
uint8_t rateReducerRightShift
 Configure the right shift for values out of the rate reducing (second stage) decimator. More...
 
uint8_t channelSelectDelay
 Channel selection delay applied when the input channels are switched by the sequencer.
 
uint8_t validGcorBits
 Provides the exponent-1 of the number and limits its precision. More...
 
uint8_t rangeCount
 Number of times the conditional must be met before the interrupt is generated. More...
 
bool useAgc
 Enable Automatic Gain Correction for some of the settings in DCHAN Set to false to disable AGC.
 
bool enableGainCorrection
 Enable the gain correction. More...
 
bool enableOffsetCorrection
 Enable or disable offset correction of the decimator values.
 

Field Documentation

◆ rangeLowerThreshold

int32_t cy_stc_dsadc_dchan_config_t::rangeLowerThreshold

Lower threshold of the range condition.

Not all conditionals require the lower range - this value will be ignored in that condition.

◆ rangeUpperThreshold

int32_t cy_stc_dsadc_dchan_config_t::rangeUpperThreshold

Upper threshold of the range condition.

Not all conditionals require the upper range - this value will be ignored in that condition.

◆ achan

cy_en_dsadc_dchan_achan_select_t cy_stc_dsadc_dchan_config_t::achan

Analog Channel to get modulator data from.

◆ vrefhSelect

cy_en_dsadc_dchan_reference_vrefh_t cy_stc_dsadc_dchan_config_t::vrefhSelect

Reference to use for the ADC VREFH internal input.

◆ vreflSelect

cy_en_dsadc_dchan_reference_vrefl_t cy_stc_dsadc_dchan_config_t::vreflSelect

Reference to use for the ADC VREFL internal input.

◆ aafMode

cy_en_dsadc_aaf_mode_t cy_stc_dsadc_dchan_config_t::aafMode

Configure the way in which the Anti-Aliasing Filter will be used.

◆ averagingMode

cy_en_dsadc_averaging_mode_t cy_stc_dsadc_dchan_config_t::averagingMode

Configure the Averaging mode to use in the Post Processing block.

There are two averaging modes:

◆ averagingSamples

cy_en_dsadc_averaging_samples_t cy_stc_dsadc_dchan_config_t::averagingSamples

Configure the number of samples to average:

◆ rangeMode

cy_en_dsadc_dchan_post_processing_range_mode_t cy_stc_dsadc_dchan_config_t::rangeMode

Enable / Disable the range detection, or configure the range mode for 'Event Count'.

In 'Event Count' mode, the range conditional works as described by the conditional, except that the condition must be met 'rangeCount' times before the interrupt is generated.

◆ rangeConditional

cy_en_dsadc_dchan_post_processing_range_conditional_t cy_stc_dsadc_dchan_config_t::rangeConditional

Set the Range Condition.

◆ ppRightShift

uint8_t cy_stc_dsadc_dchan_config_t::ppRightShift

FIR Right Shift.

This right shift lives in the Post Processor, and requires the Post Processor be enabled (it is enabled by default)

◆ rightShift

uint8_t cy_stc_dsadc_dchan_config_t::rightShift

Configure the right shift for values out of the decimator.

Values out of the decimator can more than 32 bits, based on the quantization level, the decimation ratio of the decimator, the decimator left shift, and offset / gain correction values. The minimum value for this should be: val = log2(quantizationLevel) + MAX(LeftShiftNumBits) + N*log2(Stage1DecimationRatio) - 32 Where:

  • quantizationLevel is '9' by default
  • N is the order of the decimator (3 by default)

◆ rateReducerRightShift

uint8_t cy_stc_dsadc_dchan_config_t::rateReducerRightShift

Configure the right shift for values out of the rate reducing (second stage) decimator.

Values out of the rate reducing decimator can more than 32 bits, based on the decimation ratio of the decimator. The minimum value for this should be: val = 2 *log2(Stage2DecimationRatio)

◆ validGcorBits

uint8_t cy_stc_dsadc_dchan_config_t::validGcorBits

Provides the exponent-1 of the number and limits its precision.

Bits in the significant that are beyond the exponent are ignored. E.g., gcor=0x3, validGcorBits=2 represents the number 0.11b = 0.75 E.g., gcor=0xc, validGcorBits=4 represents the number 0.1100b = 0.75 E.g., gcor=0xc, validGcorBits=2 represents the number 1.00b = 1.0 (gcor bit number 4 is ignored) This value affects the gain correction of the DCHAN and AGC

◆ rangeCount

uint8_t cy_stc_dsadc_dchan_config_t::rangeCount

Number of times the conditional must be met before the interrupt is generated.

Requires that 'rangeMode' be configured for CY_DSADC_DCHAN_RANGE_MODE_EVENT_COUNT

◆ enableGainCorrection

bool cy_stc_dsadc_dchan_config_t::enableGainCorrection

Enable the gain correction.