Skip to content

Commit 256a778

Browse files
committed
add nano 33 ble
Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
1 parent 1ebb9d7 commit 256a778

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/ {
2+
zephyr,user {
3+
d0_gpios = <&arduino_nano_header 0 0>;
4+
d1_gpios = <&arduino_nano_header 1 0>;
5+
d2_gpios = <&arduino_nano_header 2 0>;
6+
d3_gpios = <&arduino_nano_header 3 0>;
7+
d4_gpios = <&arduino_nano_header 4 0>;
8+
d5_gpios = <&arduino_nano_header 5 0>;
9+
d6_gpios = <&arduino_nano_header 6 0>;
10+
d7_gpios = <&arduino_nano_header 7 0>;
11+
d8_gpios = <&arduino_nano_header 8 0>;
12+
d9_gpios = <&arduino_nano_header 9 0>;
13+
d10_gpios = <&arduino_nano_header 10 0>;
14+
d11_gpios = <&arduino_nano_header 11 0>;
15+
d12_gpios = <&arduino_nano_header 12 0>;
16+
d13_gpios = <&arduino_nano_header 13 0>;
17+
d14_gpios = <&arduino_nano_header 14 0>; /* D14 / A0 */
18+
d15_gpios = <&arduino_nano_header 15 0>;
19+
d16_gpios = <&arduino_nano_header 16 0>;
20+
d17_gpios = <&arduino_nano_header 17 0>;
21+
d18_gpios = <&arduino_nano_header 18 0>; /* D18 / A4 / I2C-SDA */
22+
d19_gpios = <&arduino_nano_header 19 0>; /* D19 / A5 / I2C-SCL */
23+
d20_gpios = <&arduino_nano_header 20 0>;
24+
d21_gpios = <&arduino_nano_header 21 0>;
25+
};
26+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright (c) 2022 Dhruva Gole
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* All the pins that are 100 + x are gpio1 pins and < 100 are in gpio0 */
8+
#pragma once
9+
#include <zephyr/drivers/gpio.h>
10+
#include <zephyr/zephyr.h>
11+
12+
#define LED_BUILTIN 13
13+
14+
static struct gpio_dt_spec d0 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d0_gpios);
15+
static struct gpio_dt_spec d1 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d1_gpios);
16+
static struct gpio_dt_spec d2 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d2_gpios);
17+
static struct gpio_dt_spec d3 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d3_gpios);
18+
static struct gpio_dt_spec d4 =
19+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d4_gpios);
20+
static struct gpio_dt_spec d5 =
21+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d5_gpios);
22+
static struct gpio_dt_spec d6 =
23+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d6_gpios);
24+
static struct gpio_dt_spec d7 =
25+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d7_gpios);
26+
static struct gpio_dt_spec d8 =
27+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d8_gpios);
28+
static struct gpio_dt_spec d9 =
29+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d9_gpios);
30+
static struct gpio_dt_spec d10 =
31+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d10_gpios);
32+
static struct gpio_dt_spec d11 =
33+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d11_gpios);
34+
static struct gpio_dt_spec d12 =
35+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d12_gpios);
36+
static struct gpio_dt_spec d13 =
37+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios);
38+
static struct gpio_dt_spec d14 =
39+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios);
40+
static struct gpio_dt_spec d15 =
41+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d15_gpios);
42+
static struct gpio_dt_spec d16 =
43+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d16_gpios);
44+
static struct gpio_dt_spec d17 =
45+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d17_gpios);
46+
static struct gpio_dt_spec d18 =
47+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d18_gpios);
48+
static struct gpio_dt_spec d19 =
49+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d19_gpios);
50+
static struct gpio_dt_spec d20 =
51+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d20_gpios);
52+
static struct gpio_dt_spec d21 =
53+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d21_gpios);
54+
55+
static struct gpio_dt_spec *arduino_pins[22] = {
56+
&d0, &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10,
57+
&d11, &d12, &d13, &d14, &d15, &d16, &d17, &d18, &d19, &d20, &d21};
58+
59+
enum digitalPins {
60+
D0,
61+
D1,
62+
D2,
63+
D3,
64+
D4,
65+
D5,
66+
D6,
67+
D7,
68+
D8,
69+
D9,
70+
D10,
71+
D11,
72+
D12,
73+
D13,
74+
D14,
75+
D15,
76+
D16,
77+
D17,
78+
D18,
79+
D19,
80+
D20,
81+
D21
82+
};

0 commit comments

Comments
 (0)