gpio_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Marian Buschsieweke
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 
9 #pragma once
10 
20 #include "board.h"
21 #include "saul/periph.h"
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
32  {
33  {
34  .name = "LED Green",
35  .pin = LED_GREEN_PIN,
36  .mode = GPIO_OUT,
37  },
38  {
39  .name = "LED Red",
40  .pin = LED_RED_PIN,
41  .mode = GPIO_OUT,
42  },
43  {
44  .name = "LED Yellow",
45  .pin = LED_YELLOW_PIN,
46  .mode = GPIO_OUT,
47  },
48  {
49  .name = "LED Blue",
50  .pin = LED_BLUE_PIN,
51  .mode = GPIO_OUT,
52  },
53  {
54  .name = "BTN Left",
55  .pin = BTN_LEFT_PIN,
56  .mode = BTN_LEFT_MODE,
57  .flags = SAUL_GPIO_INVERTED,
58  },
59  {
60  .name = "BTN Right",
61  .pin = BTN_RIGHT_PIN,
62  .mode = BTN_RIGHT_MODE,
63  .flags = SAUL_GPIO_INVERTED,
64  },
65  {
66  .name = "BTN Up",
67  .pin = BTN_UP_PIN,
68  .mode = BTN_UP_MODE,
69  .flags = SAUL_GPIO_INVERTED,
70  },
71  {
72  .name = "BTN Down",
73  .pin = BTN_DOWN_PIN,
74  .mode = BTN_DOWN_MODE,
75  .flags = SAUL_GPIO_INVERTED,
76  },
77  {
78  .name = "BTN Select",
79  .pin = BTN_SELECT_PIN,
80  .mode = BTN_DOWN_MODE,
81  .flags = SAUL_GPIO_INVERTED,
82  },
83 };
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
@ GPIO_OUT
select GPIO MASK as output
Definition: periph_cpu.h:164
#define LED_GREEN_PIN
LED1 is a green LED.
Definition: board.h:74
#define LED_RED_PIN
LED0 is a red LED.
Definition: board.h:71
#define BTN_RIGHT_PIN
GPIO pin for button "RIGHT".
Definition: board.h:87
#define BTN_LEFT_PIN
GPIO pin for button "LEFT".
Definition: board.h:82
#define LED_YELLOW_PIN
GPIO pin for yellow LED.
Definition: board.h:47
#define BTN_UP_MODE
GPIO mode for button "UP".
Definition: board.h:93
#define BTN_LEFT_MODE
GPIO mode for button "LEFT".
Definition: board.h:83
#define BTN_DOWN_PIN
GPIO pin for button "DOWN".
Definition: board.h:97
#define BTN_UP_PIN
GPIO pin for button "UP".
Definition: board.h:92
#define BTN_SELECT_PIN
GPIO pin for button "SELECT".
Definition: board.h:102
#define BTN_DOWN_MODE
GPIO mode for button "DOWN".
Definition: board.h:98
#define BTN_RIGHT_MODE
GPIO mode for button "RIGHT".
Definition: board.h:88
static const saul_gpio_params_t saul_gpio_params[]
Expose LEDs and buttons via SAUL.
Definition: gpio_params.h:31
Parameter definitions for mapping peripherals directly to SAUL.
@ SAUL_GPIO_INVERTED
pin is used as inverted
Definition: periph.h:42
Direct mapped GPIO configuration values.
Definition: periph.h:50
const char * name
name of the device connected to this pin
Definition: periph.h:51
Board specific definitions for the Zigduino board.