| /* |
| * Copyright (c) 2017 Linaro Limited |
| * |
| * SPDX-License-Identifier: Apache-2.0 |
| */ |
| |
| /dts-v1/; |
| #include <nordic/nrf51822_qfaa.dtsi> |
| #include "bbc_microbit-pinctrl.dtsi" |
| |
| / { |
| model = "BBC Micro:bit"; |
| compatible = "bbc,microbit"; |
| |
| /* These aliases are provided for compatibility with samples */ |
| aliases { |
| sw0 = &buttonA; |
| sw1 = &buttonB; |
| }; |
| |
| chosen { |
| zephyr,console = &uart0; |
| zephyr,shell-uart = &uart0; |
| zephyr,bt-mon-uart = &uart0; |
| zephyr,bt-c2h-uart = &uart0; |
| zephyr,sram = &sram0; |
| zephyr,flash = &flash0; |
| zephyr,code-partition = &slot0_partition; |
| zephyr,display = &led_matrix; |
| }; |
| |
| gpio_keys { |
| compatible = "gpio-keys"; |
| buttonA: button_0 { |
| label = "BTN_A"; |
| gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; |
| }; |
| |
| buttonB: button_1 { |
| label = "BTN_B"; |
| gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; |
| }; |
| }; |
| |
| led_matrix: led_matrix { |
| compatible = "nordic,nrf-led-matrix"; |
| status = "okay"; |
| label = "LED_MATRIX"; |
| width = <5>; |
| height = <5>; |
| pixel-mapping = [00 13 01 14 02 |
| 23 24 25 26 27 |
| 11 08 12 28 10 |
| 07 06 05 04 03 |
| 22 16 20 15 21]; |
| row-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>, |
| <&gpio0 14 GPIO_ACTIVE_HIGH>, |
| <&gpio0 15 GPIO_ACTIVE_HIGH>; |
| col-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>, |
| <&gpio0 5 GPIO_ACTIVE_LOW>, |
| <&gpio0 6 GPIO_ACTIVE_LOW>, |
| <&gpio0 7 GPIO_ACTIVE_LOW>, |
| <&gpio0 8 GPIO_ACTIVE_LOW>, |
| <&gpio0 9 GPIO_ACTIVE_LOW>, |
| <&gpio0 10 GPIO_ACTIVE_LOW>, |
| <&gpio0 11 GPIO_ACTIVE_LOW>, |
| <&gpio0 12 GPIO_ACTIVE_LOW>; |
| refresh-frequency = <50>; |
| timer = <&timer2>; |
| pixel-group-size = <3>; |
| }; |
| }; |
| |
| &gpiote { |
| status = "okay"; |
| }; |
| |
| &gpio0 { |
| status = "okay"; |
| /* |
| * Use the sensing mechanism for all pins by default, as GPIOTE channels |
| * are needed for the LED matrix and the SW PWM. |
| */ |
| sense-edge-mask = <0xffffffff>; |
| }; |
| |
| &sw_pwm { |
| channel-count = <1>; |
| }; |
| |
| &uart0 { |
| status = "okay"; |
| current-speed = <115200>; |
| pinctrl-0 = <&uart0_default>; |
| pinctrl-1 = <&uart0_sleep>; |
| pinctrl-names = "default", "sleep"; |
| }; |
| |
| &i2c0 { |
| status = "okay"; |
| clock-frequency = <I2C_BITRATE_FAST>; |
| |
| /* See https://tech.microbit.org/hardware/i2c/ for board variants */ |
| |
| /* v1.3 MMA8653FC (= FXOS8700) + MAG3110 */ |
| pinctrl-0 = <&i2c0_default>; |
| pinctrl-1 = <&i2c0_sleep>; |
| pinctrl-names = "default", "sleep"; |
| mma8653fc@1d { |
| compatible = "nxp,fxos8700", "nxp,mma8653fc"; |
| status = "okay"; |
| reg = <0x1d>; |
| label = "MMA8653FC"; |
| int1-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; |
| int2-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>; |
| }; |
| |
| /* v1.5 variant 1 LSM303AGR */ |
| lsm303agr-magn@1e { |
| compatible = "st,lis2mdl", "st,lsm303agr-magn"; |
| status = "disabled"; |
| reg = <0x1e>; |
| label = "LSM303AGR-MAGN"; |
| irq-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* A3 */ |
| }; |
| |
| lsm303agr-accel@19 { |
| compatible = "st,lis2dh", "st,lsm303agr-accel"; |
| status = "disabled"; |
| reg = <0x19>; |
| label = "LSM303AGR-ACCEL"; |
| irq-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; |
| }; |
| }; |
| |
| &flash0 { |
| |
| partitions { |
| compatible = "fixed-partitions"; |
| #address-cells = <1>; |
| #size-cells = <1>; |
| |
| boot_partition: partition@0 { |
| label = "mcuboot"; |
| reg = <0x00000000 0x8000>; |
| }; |
| slot0_partition: partition@8000 { |
| label = "image-0"; |
| reg = <0x00008000 0x1a000>; |
| }; |
| slot1_partition: partition@22000 { |
| label = "image-1"; |
| reg = <0x00022000 0x1a000>; |
| }; |
| scratch_partition: partition@3c000 { |
| label = "image-scratch"; |
| reg = <0x0003c000 0x2000>; |
| }; |
| storage_partition: partition@3e000 { |
| label = "storage"; |
| reg = <0x0003e000 0x00002000>; |
| }; |
| }; |
| }; |