AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/adc/adc.h
static inline void adcch_enable_averaging (struct adc_channel_config
					     *ch_conf,
					     enum adcch_sampnum sample)
  {
    uint8_t rshift;

    Assert (sample >= ADC_SAMPNUM_2X);

    if (sample >= ADC_SAMPNUM_16X)
      {
	rshift = 4;
      }
    else if (sample == ADC_SAMPNUM_8X)
      {
	rshift = 3;
      }
    else if (sample == ADC_SAMPNUM_4X)
      {
	rshift = 2;
      }
    else
      {
	rshift = 1;
      }

    ch_conf->avgctrl = sample | (rshift << ADC_CH_RIGHTSHIFT_gp);
  }
/**
 * \brief Enables ADC channel averaging
 *
 * Sets the parameters number of samples used during averaging.
 *
 * \param ch_conf  Pointer to the ADC channel configuration structure
 * \param sample   Number of samples to accumulate
 *
 * \note Only the AVR XMEGA E family features this setting.
 * \note Check that "ADC_RES_MT12" param is used
 * in adc_set_conversion_parameters() call.
 */
\brief Enables ADC channel averaging
Sets the parameters number of samples used during averaging.

\param ch_conf  Pointer to the ADC channel configuration structure
\param sample   Number of samples to accumulate

\note Only the AVR XMEGA E family features this setting.
\note Check that "ADC_RES_MT12" param is used
in adc_set_conversion_parameters() call.
\ brief Enables ADC channel averaging Sets the parameters number of samples used during averaging . \ param ch_conf Pointer to the ADC channel configuration structure \ param sample Number of samples to accumulate \ note Only the AVR XMEGA E family features this setting . \ note Check that " ADC_RES_MT12 " param is used in adc_set_conversion_parameters () call .
static inline void adcch_enable_averaging (struct adc_channel_config
					     *ch_conf,
					     enum adcch_sampnum sample)
  {
    uint8_t rshift;
    Assert (sample >= ADC_SAMPNUM_2X);
    if (sample >= ADC_SAMPNUM_16X)
      {
	rshift = 4;
      }
    else if (sample == ADC_SAMPNUM_8X)
      {
	rshift = 3;
      }
    else if (sample == ADC_SAMPNUM_4X)
      {
	rshift = 2;
      }
    else
      {
	rshift = 1;
      }
    ch_conf->avgctrl = sample | (rshift << ADC_CH_RIGHTSHIFT_gp);
  }
static inline void adcch_enable_averaging ( struct adc_channel_config * ch_conf , enum adcch_sampnum sample ) { uint8_t rshift ; Assert ( sample >= ADC_SAMPNUM_2X ) ; if ( sample >= ADC_SAMPNUM_16X ) { rshift = 4 ; } else if ( sample == ADC_SAMPNUM_8X ) { rshift = 3 ; } else if ( sample == ADC_SAMPNUM_4X ) { rshift = 2 ; } else { rshift = 1 ; } ch_conf -> avgctrl = sample | ( rshift << ADC_CH_RIGHTSHIFT_gp ) ; }
\brief Enables ADC channel averaging
 Sets the parameters number of samples used during averaging.
\ brief Enables ADC channel averaging Sets the parameters number of samples used during averaging .