nRF Connect SDK API
3.3.99
Loading...
Searching...
No Matches
button_assignments.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
*/
6
14
#ifndef _BUTTON_ASSIGNMENTS_H_
15
#define _BUTTON_ASSIGNMENTS_H_
16
17
#include <zephyr/drivers/gpio.h>
18
19
#define BUTTON_NOT_ASSIGNED 0xFF
20
28
#if DT_NODE_EXISTS(DT_ALIAS(sw0))
29
#define BUTTON_VOLUME_DOWN DT_GPIO_PIN(DT_ALIAS(sw0), gpios)
30
#else
31
#define BUTTON_VOLUME_DOWN BUTTON_NOT_ASSIGNED
32
#endif
33
34
#if DT_NODE_EXISTS(DT_ALIAS(sw1))
35
#define BUTTON_VOLUME_UP DT_GPIO_PIN(DT_ALIAS(sw1), gpios)
36
#else
37
#define BUTTON_VOLUME_UP BUTTON_NOT_ASSIGNED
38
#endif
39
40
#if DT_NODE_EXISTS(DT_ALIAS(sw2))
41
#define BUTTON_PLAY_PAUSE DT_GPIO_PIN(DT_ALIAS(sw2), gpios)
42
#else
43
#define BUTTON_PLAY_PAUSE BUTTON_NOT_ASSIGNED
44
#endif
45
54
#if DT_NODE_EXISTS(DT_ALIAS(sw4))
55
#define BUTTON_5 DT_GPIO_PIN(DT_ALIAS(sw4), gpios)
56
#if DT_NODE_EXISTS(DT_ALIAS(sw3))
57
#define BUTTON_4 DT_GPIO_PIN(DT_ALIAS(sw3), gpios)
58
#else
59
#define BUTTON_4 BUTTON_NOT_ASSIGNED
60
#endif
61
#elif DT_NODE_EXISTS(DT_ALIAS(sw3))
62
#define BUTTON_4 BUTTON_NOT_ASSIGNED
63
#define BUTTON_5 DT_GPIO_PIN(DT_ALIAS(sw3), gpios)
64
#else
65
#define BUTTON_4 BUTTON_NOT_ASSIGNED
66
#define BUTTON_5 BUTTON_NOT_ASSIGNED
67
#endif
68
69
#endif
/* _BUTTON_ASSIGNMENTS_H_ */
applications
nrf_audio
src
modules
button_assignments.h
Generated on Wed Jun 10 2026 17:22:24 for nRF Connect SDK API by
1.12.0