From 7a7f06a3e1753b88f776952d6a1ce58103c1fe49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Brodbeck?= Date: Fri, 7 Aug 2020 19:30:46 +0200 Subject: [PATCH] cpu/samd5x: add ADC resolution type --- cpu/samd5x/include/periph_cpu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpu/samd5x/include/periph_cpu.h b/cpu/samd5x/include/periph_cpu.h index e346efbefd..a7b39a952c 100644 --- a/cpu/samd5x/include/periph_cpu.h +++ b/cpu/samd5x/include/periph_cpu.h @@ -83,6 +83,19 @@ enum { */ #define SPI_HWCS(x) (UINT_MAX - 1) +#ifndef DOXYGEN +#define HAVE_ADC_RES_T +typedef enum { + ADC_RES_6BIT = 0xff, /**< not supported */ + ADC_RES_8BIT = ADC_CTRLB_RESSEL_8BIT, /**< ADC resolution: 8 bit */ + ADC_RES_10BIT = ADC_CTRLB_RESSEL_10BIT, /**< ADC resolution: 10 bit */ + ADC_RES_12BIT = ADC_CTRLB_RESSEL_12BIT, /**< ADC resolution: 12 bit */ + ADC_RES_14BIT = 0xfe, /**< not supported */ + ADC_RES_16BIT = 0xfd /**< not supported */ +} adc_res_t; +/** @} */ +#endif /* DOXYGEN */ + /** * @brief The MCU has a 12 bit DAC */