AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/adc/adc.h
static inline uint16_t adc_get_calibration_data (enum adc_calibration_data
						   cal)
  {
    uint16_t data;

    switch (cal)
      {
#ifdef ADCA
      case ADC_CAL_ADCA:
	data = nvm_read_production_signature_row (ADCACAL1);
	data <<= 8;
	data |= nvm_read_production_signature_row (ADCACAL0);
	break;
#endif

#ifdef ADCB
      case ADC_CAL_ADCB:
	data = nvm_read_production_signature_row (ADCBCAL1);
	data <<= 8;
	data |= nvm_read_production_signature_row (ADCBCAL0);
	break;
#endif

#if defined(ADCA) || defined(ADCB)
      case ADC_CAL_TEMPSENSE:
	data = nvm_read_production_signature_row (TEMPSENSE1);
	data <<= 8;
	data |= nvm_read_production_signature_row (TEMPSENSE0);
	break;
#endif

      default:
	Assert (0);
	data = 0;
      }

    return data;
  }
/**
 * \brief Get calibration data
 *
 * \param cal Identifier for calibration data to get.
 */
\brief Get calibration data
\param cal Identifier for calibration data to get.
\ brief Get calibration data \ param cal Identifier for calibration data to get .
static inline uint16_t adc_get_calibration_data (enum adc_calibration_data
						   cal)
  {
    uint16_t data;
    switch (cal)
      {
#ifdef ADCA
      case ADC_CAL_ADCA:
	data = nvm_read_production_signature_row (ADCACAL1);
	data <<= 8;
	data |= nvm_read_production_signature_row (ADCACAL0);
	break;
#endif
#ifdef ADCB
      case ADC_CAL_ADCB:
	data = nvm_read_production_signature_row (ADCBCAL1);
	data <<= 8;
	data |= nvm_read_production_signature_row (ADCBCAL0);
	break;
#endif
#if defined(ADCA) || defined(ADCB)
      case ADC_CAL_TEMPSENSE:
	data = nvm_read_production_signature_row (TEMPSENSE1);
	data <<= 8;
	data |= nvm_read_production_signature_row (TEMPSENSE0);
	break;
#endif
      default:
	Assert (0);
	data = 0;
      }
    return data;
  }
static inline uint16_t adc_get_calibration_data ( enum adc_calibration_data cal ) { uint16_t data ; switch ( cal ) { #ifdef ADCA case ADC_CAL_ADCA : data = nvm_read_production_signature_row ( ADCACAL1 ) ; data <<= 8 ; data |= nvm_read_production_signature_row ( ADCACAL0 ) ; break ; #endif #ifdef ADCB case ADC_CAL_ADCB : data = nvm_read_production_signature_row ( ADCBCAL1 ) ; data <<= 8 ; data |= nvm_read_production_signature_row ( ADCBCAL0 ) ; break ; #endif #if defined ( ADCA ) || defined ( ADCB ) case ADC_CAL_TEMPSENSE : data = nvm_read_production_signature_row ( TEMPSENSE1 ) ; data <<= 8 ; data |= nvm_read_production_signature_row ( TEMPSENSE0 ) ; break ; #endif default : Assert ( 0 ) ; data = 0 ; } return data ; }
\brief Get calibration data
 \param cal Identifier for calibration data to get.
\ brief Get calibration data \ param cal Identifier for calibration data to get .