1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/arduino-zero: configure ADC channels

This commit is contained in:
Alexandre Abadie 2019-10-22 11:19:26 +02:00
parent 789cbb9a79
commit 76ca2f5a08
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 20 additions and 1 deletions

View File

@ -2,6 +2,7 @@ CPU = samd21
CPU_MODEL = samd21g18a
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc

View File

@ -194,7 +194,25 @@ static const pwm_conf_t pwm_config[] = {
* @name ADC configuration
* @{
*/
#define ADC_NUMOF (0)
/* ADC Default values */
#define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512
#define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND
#define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X
#define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V
static const adc_conf_chan_t adc_channels[] = {
/* port, pin, muxpos */
{GPIO_PIN(PA, 2), ADC_INPUTCTRL_MUXPOS_PIN0}, /* A0 */
{GPIO_PIN(PB, 8), ADC_INPUTCTRL_MUXPOS_PIN2}, /* A1 */
{GPIO_PIN(PB, 9), ADC_INPUTCTRL_MUXPOS_PIN3}, /* A2 */
{GPIO_PIN(PA, 4), ADC_INPUTCTRL_MUXPOS_PIN4}, /* A3 */
{GPIO_PIN(PA, 5), ADC_INPUTCTRL_MUXPOS_PIN5}, /* A4 */
{GPIO_PIN(PB, 2), ADC_INPUTCTRL_MUXPOS_PIN10}, /* A5 */
};
#define ADC_NUMOF ARRAY_SIZE(adc_channels)
/** @} */
/**