101 uint16_t signedOffset = (uint16_t) offset;
105 signedOffset |= 0xFF00;
109 adc_ch->INTFLAGS = ADC_CH_CHIF_bm;
112 answer = adc_ch->RES - signedOffset;
136 adc_ch->INTFLAGS = ADC_CH_CHIF_bm;
138 answer = adc_ch->RESL -
offset;
163 adc_ch->INTFLAGS = ADC_CH_CHIF_bm;
185 uint8_t prescaler_val = adc->PRESCALER;
188 adc->PRESCALER = ADC_PRESCALER_DIV4_gc;
194 adc->PRESCALER = prescaler_val;
217 uint8_t prescaler_val = adc->PRESCALER;
220 adc->PRESCALER = ADC_PRESCALER_DIV8_gc;
226 adc->PRESCALER = prescaler_val;
253 ADC_CH_INPUTMODE_DIFF_gc,
292 NVM_CMD = NVM_CMD_READ_CALIB_ROW_gc;
293 result = pgm_read_byte(index);
296 NVM_CMD = NVM_CMD_NO_OPERATION_gc;
uint16_t ADC_ResultCh_GetWord(ADC_CH_t *adc_ch, uint8_t offset)
This function clears the interrupt flag and returns the coversion result.
uint8_t ADC_Offset_Get(ADC_t *adc)
This function get the offset of the ADC.
#define ADC_Disable(_adc)
This macro disables the selected adc.
void ADC_CalibrationValues_Set(ADC_t *adc)
This function get the calibration data from the production calibration.
uint8_t ADC_ResultCh_GetHighByte(ADC_CH_t *adc_ch)
This function clears the interrupt flag and returns the high byte of the coversion result...
#define ADC_ConvMode_and_Resolution_Config(_adc, _signedMode, _resolution)
This macro set the conversion mode and resolution in the selected adc.
#define ADC_Ch_InputMode_and_Gain_Config(_adc_ch, _inputMode, _gain)
This macro configures the input mode and gain to a specific virtual channel.
void ADC_Wait_32MHz(ADC_t *adc)
This function waits until the adc common mode is settled.
uint8_t ADC_ResultCh_GetLowByte(ADC_CH_t *adc_ch, uint8_t offset)
This function clears the interrupt flag and returns the low byte of the coversion result...
#define ADC_Prescaler_Config(_adc, _div)
This macro set the prescaler factor in the selected adc.
#define ADC_Ch_Conversion_Complete(_adc_ch)
This macro returns the channel conversion complete flag..
#define ADC_Ch_InputMux_Config(_adc_ch, _posInput, _negInput)
This macro configures the Positiv and negativ inputs.
#define ADC_Referance_Config(_adc, _convRef)
This macro set the conversion referance in the selected adc.
#define COMMEN_MODE_CYCLES
#define ADC_Ch_Conversion_Start(_adc_ch)
This macro start one channel conversion.
XMEGA ADC driver header file.
uint8_t SP_ReadCalibrationByte(uint8_t index)
void ADC_Wait_8MHz(ADC_t *adc)
This function waits until the adc common mode is settled.
#define ADC_Enable(_adc)
This macro enables the selected adc.