Microchip® Advanced Software Framework

conf_example.h File Reference

Chip-specific example configuration.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <adc.h>
#include <board.h>

Macros

Example configuration
#define INPUT_PIN   ADCCH_POS_PIN0
 ID of ADC input pin. More...
 
#define LED1_PIN   LED0_GPIO
 ID of LED 1 control I/O pin. More...
 
#define LED2_PIN   LED1_GPIO
 ID of LED 2 control I/O pin. More...
 
#define BUTTON_PIN   GPIO_PUSH_BUTTON_0
 ID of button input I/O pin. More...
 
#define OVERSAMPLING_FACTOR   6
 Number of calibration samples, as exponent of 2. More...
 

#define BUTTON_PIN   GPIO_PUSH_BUTTON_0

ID of button input I/O pin.

This pin is checked for active low status when the example is waiting for user input, i.e., after the external voltage supply has been adjusted.

Note
This is push button 0 on Xplain.

Referenced by wait_for_button().

#define INPUT_PIN   ADCCH_POS_PIN0

ID of ADC input pin.

This pin is the one used for all measurements with the ADC.

Note
This is PA0 of the XMEGA PORT A header on Xplain.

Referenced by main().

#define LED1_PIN   LED0_GPIO

ID of LED 1 control I/O pin.

This pin is driven low when the example is waiting for the external voltage supply to be adjusted to 0 Volts. It is driven high once calibration is done.

Note
This is LED0 on Xplain.

Referenced by main().

#define LED2_PIN   LED1_GPIO

ID of LED 2 control I/O pin.

This pin is driven low when the example is waiting for the external voltage supply to be adjusted to 0.9 Volts. It is driven high once calibration is done.

Note
This is LED1 on Xplain.

Referenced by main().

#define OVERSAMPLING_FACTOR   6

Number of calibration samples, as exponent of 2.

This determines the number of samples used for the oversampling. It is given as an exponent of 2, i.e., setting this factor to 3 gives 2^3 = 8 samples.

Note
This gives 2^6 = 64 samples.

Referenced by get_mean_sample_value().