1/* 2 * Copyright (c) 2020 Lingao Meng 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7/dts-v1/; 8#include <nordic/nrf52833_qiaa.dtsi> 9#include "bbc_microbit_v2-pinctrl.dtsi" 10#include <zephyr/dt-bindings/input/input-event-codes.h> 11 12/ { 13 model = "BBC Micro:bit V2"; 14 compatible = "bbc,microbit-v2"; 15 16 /* These aliases are provided for compatibility with samples */ 17 aliases { 18 sw0 = &buttonA; 19 sw1 = &buttonB; 20 magn0 = &lsm303agr_magn; 21 accel0 = &lsm303agr_accel; 22 watchdog0 = &wdt0; 23 }; 24 25 chosen { 26 zephyr,console = &uart0; 27 zephyr,shell-uart = &uart0; 28 zephyr,bt-mon-uart = &uart0; 29 zephyr,bt-c2h-uart = &uart0; 30 zephyr,sram = &sram0; 31 zephyr,flash = &flash0; 32 zephyr,code-partition = &slot0_partition; 33 zephyr,display = &led_matrix; 34 }; 35 36 gpio_keys { 37 compatible = "gpio-keys"; 38 buttonA: button_0 { 39 label = "BTN_A"; 40 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; 41 zephyr,code = <INPUT_KEY_A>; 42 }; 43 44 buttonB: button_1 { 45 label = "BTN_B"; 46 gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; 47 zephyr,code = <INPUT_KEY_B>; 48 }; 49 }; 50 51 led_matrix: led_matrix { 52 compatible = "nordic,nrf-led-matrix"; 53 status = "okay"; 54 width = <5>; 55 height = <5>; 56 pixel-mapping = [00 01 02 03 04 57 10 11 12 13 14 58 20 21 22 23 24 59 30 31 32 33 34 60 40 41 42 43 44]; 61 row-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>, 62 <&gpio0 22 GPIO_ACTIVE_HIGH>, 63 <&gpio0 15 GPIO_ACTIVE_HIGH>, 64 <&gpio0 24 GPIO_ACTIVE_HIGH>, 65 <&gpio0 19 GPIO_ACTIVE_HIGH>; 66 col-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>, 67 <&gpio0 11 GPIO_ACTIVE_LOW>, 68 <&gpio0 31 GPIO_ACTIVE_LOW>, 69 <&gpio1 5 GPIO_ACTIVE_LOW>, 70 <&gpio0 30 GPIO_ACTIVE_LOW>; 71 refresh-frequency = <50>; 72 timer = <&timer4>; 73 pwm = <&pwm0>; 74 pixel-group-size = <4>; 75 }; 76 77 edge_connector: connector { 78 compatible = "microbit,edge-connector"; 79 #gpio-cells = <2>; 80 gpio-map-mask = <0xffffffff 0xffffffc0>; 81 gpio-map-pass-thru = <0 0x3f>; 82 gpio-map = <0 0 &gpio0 2 0>, /* P0 */ 83 <1 0 &gpio0 3 0>, /* P1 */ 84 <2 0 &gpio0 4 0>, /* P2 */ 85 <3 0 &gpio0 31 0>, /* P3 */ 86 <4 0 &gpio0 28 0>, /* P4 */ 87 <5 0 &gpio0 14 0>, /* P5 */ 88 <6 0 &gpio1 5 0>, /* P6 */ 89 <7 0 &gpio0 11 0>, /* P7 */ 90 <8 0 &gpio0 10 0>, /* P8 */ 91 <9 0 &gpio0 9 0>, /* P9 */ 92 <10 0 &gpio0 30 0>, /* P10 */ 93 <11 0 &gpio0 23 0>, /* P11 */ 94 <12 0 &gpio0 12 0>, /* P12 */ 95 <13 0 &gpio0 17 0>, /* P13 */ 96 <14 0 &gpio0 1 0>, /* P14 */ 97 <15 0 &gpio0 13 0>, /* P15 */ 98 <16 0 &gpio1 2 0>, /* P16 */ 99 <19 0 &gpio0 26 0>, /* P19 */ 100 <20 0 &gpio1 0 0>; /* P20 */ 101 }; 102}; 103 104&gpiote { 105 status = "okay"; 106}; 107 108&gpio0 { 109 status = "okay"; 110}; 111 112&gpio1 { 113 status = "okay"; 114}; 115 116&pwm1 { 117 /* buzzer */ 118 status = "okay"; 119 pinctrl-0 = <&pwm1_default>; 120 pinctrl-1 = <&pwm1_sleep>; 121 pinctrl-names = "default", "sleep"; 122}; 123 124&uart0 { 125 compatible = "nordic,nrf-uart"; 126 status = "okay"; 127 current-speed = <115200>; 128 pinctrl-0 = <&uart0_default>; 129 pinctrl-1 = <&uart0_sleep>; 130 pinctrl-names = "default", "sleep"; 131}; 132 133&i2c0 { 134 compatible = "nordic,nrf-twim"; 135 status = "okay"; 136 clock-frequency = <I2C_BITRATE_FAST>; 137 138 /* See https://tech.microbit.org/hardware/i2c/ for board variants */ 139 140 pinctrl-0 = <&i2c0_default>; 141 pinctrl-1 = <&i2c0_sleep>; 142 pinctrl-names = "default", "sleep"; 143 lsm303agr_magn: lsm303agr-magn@1e { 144 compatible = "st,lis2mdl", "st,lsm303agr-magn"; 145 status = "okay"; 146 reg = <0x1e>; 147 irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* A3 */ 148 }; 149 150 lsm303agr_accel: lsm303agr-accel@19 { 151 compatible = "st,lis2dh", "st,lsm303agr-accel"; 152 status = "okay"; 153 reg = <0x19>; 154 irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; 155 }; 156}; 157 158&flash0 { 159 160 partitions { 161 compatible = "fixed-partitions"; 162 #address-cells = <1>; 163 #size-cells = <1>; 164 165 boot_partition: partition@0 { 166 label = "mcuboot"; 167 reg = <0x00000000 0xC000>; 168 }; 169 slot0_partition: partition@c000 { 170 label = "image-0"; 171 reg = <0x0000C000 0x32000>; 172 }; 173 slot1_partition: partition@3e000 { 174 label = "image-1"; 175 reg = <0x0003E000 0x32000>; 176 }; 177 scratch_partition: partition@70000 { 178 label = "image-scratch"; 179 reg = <0x00070000 0xA000>; 180 }; 181 storage_partition: partition@7a000 { 182 label = "storage"; 183 reg = <0x0007A000 0x00006000>; 184 }; 185 }; 186}; 187 188zephyr_udc0: &usbd { 189 compatible = "nordic,nrf-usbd"; 190 status = "okay"; 191}; 192