|
| 1 | +/* |
| 2 | + * Copyright (c) 2022 Mike Szczys |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +#ifndef __NRF52840DK_NRF52840_PINMAP_H__ |
| 8 | +#define __NRF52840DK_NRF52840_PINMAP_H__ |
| 9 | + |
| 10 | +#include <zephyr/drivers/gpio.h> |
| 11 | +#include <zephyr/drivers/i2c.h> |
| 12 | +#include <zephyr/zephyr.h> |
| 13 | + |
| 14 | +#define LED_BUILTIN 22 |
| 15 | + |
| 16 | +static struct gpio_dt_spec d0 = |
| 17 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d0_gpios); |
| 18 | +static struct gpio_dt_spec d1 = |
| 19 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d1_gpios); |
| 20 | +static struct gpio_dt_spec d2 = |
| 21 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d2_gpios); |
| 22 | +static struct gpio_dt_spec d3 = |
| 23 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d3_gpios); |
| 24 | +static struct gpio_dt_spec d4 = |
| 25 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d4_gpios); |
| 26 | +static struct gpio_dt_spec d5 = |
| 27 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d5_gpios); |
| 28 | +static struct gpio_dt_spec d6 = |
| 29 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d6_gpios); |
| 30 | +static struct gpio_dt_spec d7 = |
| 31 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d7_gpios); |
| 32 | +static struct gpio_dt_spec d8 = |
| 33 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d8_gpios); |
| 34 | +static struct gpio_dt_spec d9 = |
| 35 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d9_gpios); |
| 36 | +static struct gpio_dt_spec d10 = |
| 37 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d10_gpios); |
| 38 | +static struct gpio_dt_spec d11 = |
| 39 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d11_gpios); |
| 40 | +static struct gpio_dt_spec d12 = |
| 41 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d12_gpios); |
| 42 | +static struct gpio_dt_spec d13 = |
| 43 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios); |
| 44 | +static struct gpio_dt_spec d14 = |
| 45 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d13_gpios); |
| 46 | +static struct gpio_dt_spec d15 = |
| 47 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d15_gpios); |
| 48 | +static struct gpio_dt_spec d16 = |
| 49 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d16_gpios); |
| 50 | +static struct gpio_dt_spec d17 = |
| 51 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d17_gpios); |
| 52 | +static struct gpio_dt_spec d18 = |
| 53 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d18_gpios); |
| 54 | +static struct gpio_dt_spec d19 = |
| 55 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d19_gpios); |
| 56 | +static struct gpio_dt_spec d20 = |
| 57 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d20_gpios); |
| 58 | +static struct gpio_dt_spec d21 = |
| 59 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d21_gpios); |
| 60 | +static struct gpio_dt_spec d22 = |
| 61 | + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), d22_gpios); /* LED0 */ |
| 62 | + |
| 63 | +static struct gpio_dt_spec *arduino_pins[23] = { |
| 64 | + &d0, &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, |
| 65 | + &d11, &d12, &d13, &d14, &d15, &d16, &d17, &d18, &d19, &d20, &d21, |
| 66 | + &d22}; |
| 67 | + |
| 68 | +enum digitalPins { |
| 69 | + D0, |
| 70 | + D1, |
| 71 | + D2, |
| 72 | + D3, |
| 73 | + D4, |
| 74 | + D5, |
| 75 | + D6, |
| 76 | + D7, |
| 77 | + D8, |
| 78 | + D9, |
| 79 | + D10, |
| 80 | + D11, |
| 81 | + D12, |
| 82 | + D13, |
| 83 | + D14, |
| 84 | + D15, |
| 85 | + D16, |
| 86 | + D17, |
| 87 | + D18, |
| 88 | + D19, |
| 89 | + D20, |
| 90 | + D21, |
| 91 | + D22 /* LED0 */ |
| 92 | +}; |
| 93 | + |
| 94 | +const static struct device *i2c_dev = DEVICE_DT_GET(DT_NODELABEL(arduino_i2c)); |
| 95 | + |
| 96 | +#endif |
0 commit comments