nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
port_state_def.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#include <soc.h>
8
9#include "port_state.h"
10
11/* This configuration file is included only once from board module and holds
12 * information about default pin states set while board is on and off.
13 */
14
15/* This structure enforces the header file is included only once in the build.
16 * Violating this requirement triggers a multiple definition error at link time.
17 */
19
20
21static const struct pin_state port0_on[] = {
22
23#if defined(CONFIG_DESKTOP_BATTERY_MEAS_NONE)
24 {6, 0}, /* battery monitor enable */
25#endif
26
27#if !defined(CONFIG_CAF_LEDS)
28 {23, 0}, /* Front LED red */
29 {25, 0}, /* Front LED green */
30 {7, 0}, /* Front LED blue */
31 {11, 0}, /* Back LED red */
32 {26, 0}, /* Back LED green */
33 {27, 0}, /* Back LED blue */
34#endif
35
36 {9, 0}, /* NFC1 */
37 {10, 0}, /* NFC2 */
38};
39
40static const struct pin_state port1_on[] = {
41 {3, 0}, /* LED3 */
42 {5, 0}, /* LED3 */
43 {7, 0}, /* LED3 */
44
45#if defined(CONFIG_CAF_LEDS)
46 {13, 1}, /* LED power enable */
47#else
48 {13, 0}, /* LED power enable */
49#endif
50};
51
52static const struct pin_state port0_off[] = {
53};
54
55static const struct pin_state port1_off[] = {
56 {13, 0}, /* LED power enable */
57};
58
59
60static const struct port_state port_state_on[] = {
61 {
62 .port = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
63 .ps = port0_on,
64 .ps_count = ARRAY_SIZE(port0_on),
65 },
66 {
67 .port = DEVICE_DT_GET(DT_NODELABEL(gpio1)),
68 .ps = port1_on,
69 .ps_count = ARRAY_SIZE(port1_on),
70 }
71};
72
73static const struct port_state port_state_off[] = {
74 {
75 .port = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
76 .ps = port0_off,
77 .ps_count = ARRAY_SIZE(port0_off),
78 },
79 {
80 .port = DEVICE_DT_GET(DT_NODELABEL(gpio1)),
81 .ps = port1_off,
82 .ps_count = ARRAY_SIZE(port1_off),
83 }
84};
static const struct pin_state port0_off[]
Definition port_state_def.h:24
static const struct pin_state port0_on[]
Definition port_state_def.h:21
static const struct port_state port_state_off[]
Definition port_state_def.h:36
static const struct port_state port_state_on[]
Definition port_state_def.h:28
const struct @16 port_state_def_include_once
static const struct pin_state port1_on[]
Definition port_state_def.h:26
static const struct pin_state port1_off[]
Definition port_state_def.h:32
Definition port_state.h:19
Definition port_state.h:24