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 
20 #ifndef PERIPH_CPU_H
21 #define PERIPH_CPU_H
22 
23 #include "periph_cpu_common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 static const int8_t exti_config[2][32] = {
33  { 0, 1, 2, 3, 4, 5, 6, 7, -1, 9, 10, 11, 12, 13, 14, 15,
34  0, 1, 2, 3, 4, 5, 6, 7, 12, 13, -1, 15, -1, -1, 10, 11},
35  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
36  0, 1, -1, -1, -1, -1, 6, 7, -1, -1, -1, -1, -1, -1, 14, 15},
37 };
38 
42 enum {
43  PA = 0,
44  PB = 1,
45 };
46 
55 #define GPIO_MODE(pr, ie, pe) (pr | (ie << 1) | (pe << 2))
56 
57 #ifndef DOXYGEN
58 
62 #define HAVE_GPIO_MODE_T
63 typedef enum {
64  GPIO_IN = GPIO_MODE(0, 1, 0),
65  GPIO_IN_PD = GPIO_MODE(0, 1, 1),
66  GPIO_IN_PU = GPIO_MODE(1, 1, 1),
67  GPIO_OUT = GPIO_MODE(0, 0, 0),
68  GPIO_OD = 0xfe,
69  GPIO_OD_PU = 0xff
70 } gpio_mode_t;
72 #endif /* ndef DOXYGEN */
73 
74 #define HAVE_ADC_RES_T
75 typedef enum {
76  ADC_RES_6BIT = 0xff,
77  ADC_RES_8BIT = ADC_CTRLC_RESSEL_8BIT,
78  ADC_RES_10BIT = ADC_CTRLC_RESSEL_10BIT,
79  ADC_RES_12BIT = ADC_CTRLC_RESSEL_12BIT,
80  ADC_RES_14BIT = 0xfe,
81  ADC_RES_16BIT = 0xfd
82 } adc_res_t;
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* PERIPH_CPU_H */
89 
ADC resolution: 12 bit.
#define GPIO_MODE(pr, ie, pe)
Generate GPIO mode bitfields.
ADC resolution: 10 bit.
ADC resolution: 8 bit.
static const int8_t exti_config[2][32]
Mapping of pins to EXTI lines, -1 means not EXTI possible.
input, no pull
not supported
input, pull-down