AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/adc/adc.h
static inline uint8_t adcch_get_gain_setting (uint8_t gain)
  {
    switch (gain)
      {
      case 0:
	return ADC_CH_GAIN_DIV2_gc;

      case 1:
	return ADC_CH_GAIN_1X_gc;

      case 2:
	return ADC_CH_GAIN_2X_gc;

      case 4:
	return ADC_CH_GAIN_4X_gc;

      case 8:
	return ADC_CH_GAIN_8X_gc;

      case 16:
	return ADC_CH_GAIN_16X_gc;

      case 32:
	return ADC_CH_GAIN_32X_gc;

      case 64:
	return ADC_CH_GAIN_64X_gc;

      case ADCCH_FORCE_1X_GAINSTAGE:
	return ADC_CH_GAIN_1X_gc;

      default:
	Assert (0);
	return 0;
      }
  }
/**
 * \internal
 * \brief Get ADC channel setting for specified gain
 *
 * Returns the setting that corresponds to specified gain.
 *
 * \param gain Valid gain factor for the measurement.
 *
 * \return Gain setting of type ADC_CH_GAIN_t.
 */
\internal
\brief Get ADC channel setting for specified gain

Returns the setting that corresponds to specified gain.

\param gain Valid gain factor for the measurement.

\return Gain setting of type ADC_CH_GAIN_t.
\ internal \ brief Get ADC channel setting for specified gain Returns the setting that corresponds to specified gain . \ param gain Valid gain factor for the measurement . \ return Gain setting of type ADC_CH_GAIN_t .
static inline uint8_t adcch_get_gain_setting (uint8_t gain)
  {
    switch (gain)
      {
      case 0:
	return ADC_CH_GAIN_DIV2_gc;
      case 1:
	return ADC_CH_GAIN_1X_gc;
      case 2:
	return ADC_CH_GAIN_2X_gc;
      case 4:
	return ADC_CH_GAIN_4X_gc;
      case 8:
	return ADC_CH_GAIN_8X_gc;
      case 16:
	return ADC_CH_GAIN_16X_gc;
      case 32:
	return ADC_CH_GAIN_32X_gc;
      case 64:
	return ADC_CH_GAIN_64X_gc;
      case ADCCH_FORCE_1X_GAINSTAGE:
	return ADC_CH_GAIN_1X_gc;
      default:
	Assert (0);
	return 0;
      }
  }
static inline uint8_t adcch_get_gain_setting ( uint8_t gain ) { switch ( gain ) { case 0 : return ADC_CH_GAIN_DIV2_gc ; case 1 : return ADC_CH_GAIN_1X_gc ; case 2 : return ADC_CH_GAIN_2X_gc ; case 4 : return ADC_CH_GAIN_4X_gc ; case 8 : return ADC_CH_GAIN_8X_gc ; case 16 : return ADC_CH_GAIN_16X_gc ; case 32 : return ADC_CH_GAIN_32X_gc ; case 64 : return ADC_CH_GAIN_64X_gc ; case ADCCH_FORCE_1X_GAINSTAGE : return ADC_CH_GAIN_1X_gc ; default : Assert ( 0 ) ; return 0 ; } }
\internal
 \brief Get ADC channel setting for specified gain
\ internal \ brief Get ADC channel setting for specified gain