Skip to content

Commit 976925a

Browse files
ddeleticDhruvaG2000
authored andcommitted
variants: Add support for nRF9160
Add support for Nordic nRF9160 DK (Demo Kit) board. More information at https://www.nordicsemi.com/Products/Development-hardware/nRF9160-DK/GetStarte Signed-off-by: Dejan Deletic <[email protected]>
1 parent 74c95bb commit 976925a

File tree

3 files changed

+219
-0
lines changed

3 files changed

+219
-0
lines changed

Diff for: variants/nrf9160dk_nrf9160/nrf9160dk_nrf9160.overlay

+192
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/ {
2+
zephyr,user {
3+
digital-pin-gpios =
4+
<&arduino_header 6 0>, /* Digital */
5+
<&arduino_header 7 0>,
6+
<&arduino_header 8 0>,
7+
<&arduino_header 9 0>,
8+
<&arduino_header 10 0>,
9+
<&arduino_header 11 0>,
10+
<&arduino_header 12 0>,
11+
<&arduino_header 13 0>,
12+
<&arduino_header 14 0>,
13+
<&arduino_header 15 0>,
14+
<&arduino_header 16 0>,
15+
<&arduino_header 17 0>,
16+
<&arduino_header 18 0>,
17+
<&arduino_header 19 0>,
18+
<&arduino_header 20 0>,
19+
<&arduino_header 21 0>,
20+
<&arduino_header 0 0>, /* Analog */
21+
<&arduino_header 1 0>,
22+
<&arduino_header 2 0>,
23+
<&arduino_header 3 0>,
24+
<&arduino_header 4 0>,
25+
<&arduino_header 5 0>,
26+
<&gpio0 13 GPIO_ACTIVE_LOW>;
27+
28+
pwm-pin-gpios =
29+
<&gpio0 13 GPIO_ACTIVE_LOW>,
30+
<&arduino_header 9 0>,
31+
<&arduino_header 11 0>,
32+
<&arduino_header 12 0>,
33+
<&arduino_header 15 0>,
34+
<&arduino_header 16 0>,
35+
<&arduino_header 17 0>;
36+
37+
adc-pin-gpios =
38+
<&arduino_header 0 0>,
39+
<&arduino_header 1 0>,
40+
<&arduino_header 2 0>,
41+
<&arduino_header 3 0>,
42+
<&arduino_header 4 0>,
43+
<&arduino_header 5 0>;
44+
45+
pwms =
46+
<&pwm0 1 255 PWM_POLARITY_NORMAL>,
47+
<&pwm0 2 255 PWM_POLARITY_NORMAL>,
48+
<&pwm0 3 255 PWM_POLARITY_NORMAL>,
49+
<&pwm1 0 255 PWM_POLARITY_NORMAL>,
50+
<&pwm1 1 255 PWM_POLARITY_NORMAL>,
51+
<&pwm1 2 255 PWM_POLARITY_NORMAL>;
52+
53+
io-channels =
54+
<&arduino_adc 0>,
55+
<&arduino_adc 1>,
56+
<&arduino_adc 2>,
57+
<&arduino_adc 3>,
58+
<&arduino_adc 4>,
59+
<&arduino_adc 5>;
60+
};
61+
};
62+
63+
&adc {
64+
#address-cells = <1>;
65+
#size-cells = <0>;
66+
67+
channel@0 {
68+
reg = <0>;
69+
zephyr,gain = "ADC_GAIN_1_6";
70+
zephyr,reference = "ADC_REF_INTERNAL";
71+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
72+
zephyr,input-positive = <NRF_SAADC_AIN0>; /* P0.02 */
73+
zephyr,resolution = <10>;
74+
};
75+
76+
channel@1 {
77+
reg = <1>;
78+
zephyr,gain = "ADC_GAIN_1_6";
79+
zephyr,reference = "ADC_REF_INTERNAL";
80+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
81+
zephyr,input-positive = <NRF_SAADC_AIN1>; /* P0.03 */
82+
zephyr,resolution = <10>;
83+
};
84+
85+
channel@2 {
86+
reg = <2>;
87+
zephyr,gain = "ADC_GAIN_1_6";
88+
zephyr,reference = "ADC_REF_INTERNAL";
89+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
90+
zephyr,input-positive = <NRF_SAADC_AIN2>; /* P0.04 */
91+
zephyr,resolution = <10>;
92+
};
93+
94+
channel@3 {
95+
reg = <3>;
96+
zephyr,gain = "ADC_GAIN_1_6";
97+
zephyr,reference = "ADC_REF_INTERNAL";
98+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
99+
zephyr,input-positive = <NRF_SAADC_AIN3>; /* P0.05 */
100+
zephyr,resolution = <10>;
101+
};
102+
103+
channel@4 {
104+
reg = <4>;
105+
zephyr,gain = "ADC_GAIN_1_6";
106+
zephyr,reference = "ADC_REF_INTERNAL";
107+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
108+
zephyr,input-positive = <NRF_SAADC_AIN4>; /* P0.28 */
109+
zephyr,resolution = <10>;
110+
};
111+
112+
channel@5 {
113+
reg = <5>;
114+
zephyr,gain = "ADC_GAIN_1_6";
115+
zephyr,reference = "ADC_REF_INTERNAL";
116+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
117+
zephyr,input-positive = <NRF_SAADC_AIN5>; /* P0.29 */
118+
zephyr,resolution = <10>;
119+
};
120+
121+
channel@6 {
122+
reg = <6>;
123+
zephyr,gain = "ADC_GAIN_1_6";
124+
zephyr,reference = "ADC_REF_INTERNAL";
125+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
126+
zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.30 */
127+
zephyr,resolution = <10>;
128+
};
129+
130+
channel@7 {
131+
reg = <7>;
132+
zephyr,gain = "ADC_GAIN_1_6";
133+
zephyr,reference = "ADC_REF_INTERNAL";
134+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
135+
zephyr,input-positive = <NRF_SAADC_AIN7>; /* P0.31 */
136+
zephyr,resolution = <10>;
137+
};
138+
};
139+
140+
&pinctrl {
141+
pwm0_default: pwm0_default {
142+
group1 {
143+
psels = <NRF_PSEL(PWM_OUT0, 0, 13)>, /* keep original config */
144+
<NRF_PSEL(PWM_OUT1, 1, 4)>,
145+
<NRF_PSEL(PWM_OUT2, 1, 6)>,
146+
<NRF_PSEL(PWM_OUT3, 1, 7)>;
147+
nordic,invert;
148+
};
149+
};
150+
151+
pwm0_sleep: pwm0_sleep {
152+
group1 {
153+
psels = <NRF_PSEL(PWM_OUT0, 0, 13)>, /* keep original config */
154+
<NRF_PSEL(PWM_OUT1, 1, 4)>,
155+
<NRF_PSEL(PWM_OUT2, 1, 6)>,
156+
<NRF_PSEL(PWM_OUT3, 1, 7)>;
157+
low-power-enable;
158+
};
159+
};
160+
161+
pwm1_default: pwm1_default {
162+
group1 {
163+
psels = <NRF_PSEL(PWM_OUT0, 1, 11)>,
164+
<NRF_PSEL(PWM_OUT1, 1, 12)>,
165+
<NRF_PSEL(PWM_OUT2, 1, 13)>;
166+
nordic,invert;
167+
};
168+
};
169+
170+
pwm1_sleep: pwm1_sleep {
171+
group1 {
172+
psels = <NRF_PSEL(PWM_OUT0, 1, 11)>,
173+
<NRF_PSEL(PWM_OUT1, 1, 12)>,
174+
<NRF_PSEL(PWM_OUT2, 1, 13)>;
175+
low-power-enable;
176+
};
177+
};
178+
};
179+
180+
&pwm0 {
181+
status = "okay";
182+
pinctrl-0 = <&pwm0_default>;
183+
pinctrl-1 = <&pwm0_sleep>;
184+
pinctrl-names = "default", "sleep";
185+
};
186+
187+
&pwm1 {
188+
status = "okay";
189+
pinctrl-0 = <&pwm1_default>;
190+
pinctrl-1 = <&pwm1_sleep>;
191+
pinctrl-names = "default", "sleep";
192+
};
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2023 Dejan Deletic
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef INCLUDE_NRF1960DK_NRF1960_PINMAP_H
8+
#define INCLUDE_NRF1960DK_NRF1960_PINMAP_H
9+
10+
#include <zephyr/drivers/gpio.h>
11+
#include <zephyr/drivers/i2c.h>
12+
#include <zephyr/kernel.h>
13+
14+
#define NRF9160DK_LED_1 D2 // P0.02
15+
#define NRF9160DK_LED_2 D3 // P0.03
16+
#define NRF9160DK_LED_3 D4 // P0.04
17+
#define NRF9160DK_LED_4 D5 // P0.05
18+
19+
#define NRF9160DK_SWITCH_1 D6 // P0.08
20+
#define NRF9160DK_SWITCH_2 D7 // P0.09
21+
#define NRF9160DK_BUTTON_1 D8 // P0.06
22+
#define NRF9160DK_BUTTON_2 D9 // P0.07
23+
24+
#endif

Diff for: variants/variants.h

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#ifdef CONFIG_BOARD_NRF52840DK_NRF52840
1515
#include "nrf52840dk_nrf52840_pinmap.h"
1616
#endif /* CONFIG_BOARD_NRF52840DK_NRF52840 */
17+
#ifdef CONFIG_BOARD_NRF9160DK_NRF9160
18+
#include "nrf9160dk_nrf9160_pinmap.h"
19+
#endif /* CONFIG_BOARD_NRF9160DK_NRF9160 */
1720
#ifdef CONFIG_BOARD_ARDUINO_MKRZERO
1821
#include "arduino_mkrzero_pinmap.h"
1922
#endif // CONFIG_BOARD_ARDUINO_MKRZERO

0 commit comments

Comments
 (0)