From f92eb109e7749becd68b68b2bb9fd1f83c619b74 Mon Sep 17 00:00:00 2001 From: dylad Date: Tue, 6 Aug 2019 19:08:39 +0200 Subject: [PATCH] cpu/saml1x: fix adc resolution issue --- cpu/saml1x/include/periph_cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cpu/saml1x/include/periph_cpu.h b/cpu/saml1x/include/periph_cpu.h index 96a576d2c4..1df9b9df97 100644 --- a/cpu/saml1x/include/periph_cpu.h +++ b/cpu/saml1x/include/periph_cpu.h @@ -40,6 +40,17 @@ static const int8_t exti_config[1][32] = { 5, 6, 7, 0, -1, -1, 1, 2, 3, 4, -1, 5, -1, -1, 6, 7}, }; +#define HAVE_ADC_RES_T +typedef enum { + ADC_RES_6BIT = 0xff, /**< not supported */ + ADC_RES_8BIT = ADC_CTRLC_RESSEL_8BIT, /**< ADC resolution: 8 bit */ + ADC_RES_10BIT = ADC_CTRLC_RESSEL_10BIT, /**< ADC resolution: 10 bit */ + ADC_RES_12BIT = ADC_CTRLC_RESSEL_12BIT, /**< ADC resolution: 12 bit */ + ADC_RES_14BIT = 0xfe, /**< not supported */ + ADC_RES_16BIT = 0xfd /**< not supported */ +} adc_res_t; +/** @} */ + #ifdef __cplusplus } #endif