gpio_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 GPIO_PARAMS_H
21 #define GPIO_PARAMS_H
22 
23 #include "board.h"
24 #include "saul/periph.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 {
35  {
36  .name = "LED 1",
37  .pin = LED0_PIN,
38  .mode = GPIO_OUT,
40  },
41 #ifdef LED1_PIN
42  {
43  .name = "LED 2",
44  .pin = LED1_PIN,
45  .mode = GPIO_OUT,
47  },
48 #endif
49 #ifdef LED2_PIN
50  {
51  .name = "LED 3",
52  .pin = LED2_PIN,
53  .mode = GPIO_OUT,
55  },
56 #endif
57 #ifdef LED3_PIN
58  {
59  .name = "LED 4",
60  .pin = LED3_PIN,
61  .mode = GPIO_OUT,
63  },
64 #endif
65 #ifdef BTN0_PIN
66  {
67  .name = "Button 1",
68  .pin = BTN0_PIN,
69  .mode = BTN0_MODE,
70  .flags = SAUL_GPIO_INVERTED,
71  },
72 #endif
73 #ifdef BTN1_PIN
74  {
75  .name = "Button 2",
76  .pin = BTN1_PIN,
77  .mode = BTN1_MODE,
78  .flags = SAUL_GPIO_INVERTED,
79  },
80 #endif
81 #ifdef BTN2_PIN
82  {
83  .name = "Button 3",
84  .pin = BTN2_PIN,
85  .mode = BTN2_MODE,
86  .flags = SAUL_GPIO_INVERTED,
87  },
88 #endif
89 #ifdef BTN3_PIN
90  {
91  .name = "Button 4",
92  .pin = BTN3_PIN,
93  .mode = BTN3_MODE,
94  .flags = SAUL_GPIO_INVERTED,
95  },
96 #endif
97 };
98 
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* GPIO_PARAMS_H */
105 
saul_gpio_params
static const saul_gpio_params_t saul_gpio_params[]
LED configuration.
Definition: gpio_params.h:33
periph.h
Parameter definitions for mapping peripherals directly to SAUL.
GPIO_OUT
@ GPIO_OUT
configure as output in push-pull mode
Definition: gpio.h:122
saul_gpio_params_t::name
const char * name
name of the device connected to this pin
Definition: periph.h:52
SAUL_GPIO_INIT_CLEAR
@ SAUL_GPIO_INIT_CLEAR
set pin inactive after init
Definition: periph.h:44
saul_gpio_params_t
Direct mapped GPIO configuration values.
Definition: periph.h:51
SAUL_GPIO_INVERTED
@ SAUL_GPIO_INVERTED
pin is used as inverted
Definition: periph.h:43