gpio_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Inria
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 
21 #ifndef GPIO_PARAMS_H
22 #define GPIO_PARAMS_H
23 
24 #include "board.h"
25 #include "saul/periph.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 {
36 #ifdef AUTO_INIT_LED0
37  {
38  .name = "LED(blue)",
39  .pin = LED0_PIN,
40  .mode = GPIO_OUT
41  },
42 #endif
43  {
44  .name = "LED(green)",
45  .pin = LED1_PIN,
46  .mode = GPIO_OUT
47  },
48  {
49  .name = "LED(red)",
50  .pin = LED2_PIN,
51  .mode = GPIO_OUT
52  },
53  {
54  .name = "Button(B1 User)",
55  .pin = BTN0_PIN,
56  .mode = BTN0_MODE,
57  .flags = SAUL_GPIO_INVERTED,
58  },
59  {
60  .name = "Button(B2 User)",
61  .pin = BTN1_PIN,
62  .mode = BTN1_MODE,
63  .flags = SAUL_GPIO_INVERTED,
64  },
65  {
66  .name = "Button(B3 User)",
67  .pin = BTN2_PIN,
68  .mode = BTN2_MODE,
69  .flags = SAUL_GPIO_INVERTED,
70  },
71 };
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* GPIO_PARAMS_H */
78 
board.h
Pin definitions and board configuration options.
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_params
static const saul_gpio_params_t saul_gpio_params[]
GPIO pin configuration.
Definition: gpio_params.h:34
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