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 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* PERIPH_CPU_H */
68 
#define GPIO_MODE(pr, ie, pe)
Generate GPIO mode bitfields.
input, pull-up
input, no pull
not supported
input, pull-down