saml21/include/periph_cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef PERIPH_CPU_H
20 #define PERIPH_CPU_H
21 
22 #include "periph_cpu_common.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 enum {
32  PA = 0,
33  PB = 1,
34 };
35 
44 #define GPIO_MODE(pr, ie, pe) (pr | (ie << 1) | (pe << 2))
45 
46 #ifndef DOXYGEN
47 
51 #define HAVE_GPIO_MODE_T
52 typedef enum {
53  GPIO_IN = GPIO_MODE(0, 1, 0),
54  GPIO_IN_PD = GPIO_MODE(0, 1, 1),
55  GPIO_IN_PU = GPIO_MODE(1, 1, 1),
56  GPIO_OUT = GPIO_MODE(0, 0, 0),
57  GPIO_OD = 0xfe,
58  GPIO_OD_PU = 0xff
59 } gpio_mode_t;
61 #endif /* ndef DOXYGEN */
62 
63 #define HAVE_ADC_RES_T
64 typedef enum {
65  ADC_RES_6BIT = 0xff,
66  ADC_RES_8BIT = ADC_CTRLC_RESSEL_8BIT,
67  ADC_RES_10BIT = ADC_CTRLC_RESSEL_10BIT,
68  ADC_RES_12BIT = ADC_CTRLC_RESSEL_12BIT,
69  ADC_RES_14BIT = 0xfe,
70  ADC_RES_16BIT = 0xfd
71 } adc_res_t;
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* PERIPH_CPU_H */
78 
ADC resolution: 12 bit.
#define GPIO_MODE(pr, ie, pe)
Generate GPIO mode bitfields.
ADC resolution: 10 bit.
ADC resolution: 8 bit.
input, no pull
not supported
input, pull-down