feat: Added the board sparkfun micromod nrf52840 and the micromod interconnect

This commit is contained in:
thomas 2021-11-24 21:47:59 -06:00
parent 30ed237533
commit 90a29f23a4
11 changed files with 318 additions and 0 deletions

View file

@ -0,0 +1,11 @@
# SPDX-License-Identifier: MIT
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
-c
-b 0x26000
-f 0xADA52840
-o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
)

View file

@ -0,0 +1,8 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on (BOARD_SPARKFUN_MICROMOD_NRF52840)

View file

@ -0,0 +1,7 @@
#Copyright(c) 2021 The ZMK Contributors
#SPDX - License - Identifier : MIT
config BOARD_SPARKFUN_MICROMOD_NRF52840
bool "micromod_nrf52840"
depends on SOC_NRF52840_QIAA

View file

@ -0,0 +1,22 @@
#Copyright(c) 2021 The ZMK Contributors
#SPDX - License - Identifier : MIT
if BOARD_SPARKFUN_MICROMOD_NRF52840
config BOARD default "sparkfun_micromod_nrf52480"
if USB
config USB_NRFX default y
config USB_DEVICE_STACK default y
endif #USB
config BT_CTLR default BT
config ZMK_BLE default y
config ZMK_USB default y
endif #BOARD_SPARKFUN_MICROMOD_NRF52840

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/ {
micromod: connector {
compatible = "sparkfun,micromod-gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <0 0 &gpio0 29 0> /* G0 - GPIO0/P0.29 , MicroMod pad 40 */
, <1 0 &gpio0 3 0> /* G1 - GPIO1/P0.03 , MicroMod pad 42 */
, <2 0 &gpio1 13 0> /* G2 - GPIO2/P1.13 , MicroMod pad 44 */
, <3 0 &gpio1 12 0> /* G3 - GPIO3/P1.12 , MicroMod pad 46 */
, <4 0 &gpio1 11 0> /* G4 - GPIO4/P1.11 , MicroMod pad 48 */
, <5 0 &gpio0 17 0> /* G5 - GPIO5/P0.17 , MicroMod pad 73 */
, <6 0 &gpio1 6 0> /* G6 - GPIO6/P1.06 , MicroMod pad 71 */
, <7 0 &gpio1 4 0> /* G7 - GPIO7/P1.04 , MicroMod pad 69 */
, <8 0 &gpio1 14 0> /* G8 - GPIO8/P1.14 , MicroMod pad 67 */
, <9 0 &gpio0 9 0> /* G9 - GPIO9/P0.09 , MicroMod pad 65 */
, <10 0 &gpio0 10 0> /* G10 - GPIO10/P0.10 , MicroMod pad 63 */
, <11 0 &gpio0 27 0> /* D0 - P0.27 , MicroMod pad pad 10 */
, <12 0 &gpio1 8 0> /* D1 - P1.08 , MicroMod pad pad 18 */
, <13 0 &gpio1 6 0> /* PWM0 - P0.06 , MicroMod pad pad 32 */
, <14 0 &gpio1 16 0> /* PWM1 - P0.16 , MicroMod pad pad 47 */
;
};
micromod_a: connector_a {
compatible = "sparkfun,micromod-gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <0 0 &gpio0 4 0> /* A0 - ADC0/P0.04 , MicroMod pad 34 (Input Only!) */
, <1 0 &gpio0 5 0> /* A1 - ADC1/P0.05 , MicroMod pad pad 38 (Input Only!) */
;
};
};
micromod_d: &micromod {};
micromod_i2c1: &i2c0 {};
micromod_i2c2: &i2c1 {};
micromod_spi1: &spi0 {};
micromod_spi2: &spi1 {};
micromod_serial1: &uart0 {};
micromod_serial2: &uart1 {};

View file

@ -0,0 +1,143 @@
/*
* Copyright (c) 2021 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "sparkfun_micromod.dtsi"
/ {
model = "Sparkfun MicroMod nrf52840";
compatible = "sparkfun,micromod-gpio";
chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&usbd {
status = "okay";
};
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
sck-pin = <19>;
mosi-pin = <14>; // MOSI = COPI
miso-pin = <21>; // MISO = COPO
cs-gpios = <&gpio0 32 GPIO_ACTIVE_HIGH>;
};
&spi0 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
sck-pin = <28>;
mosi-pin = <31>; // MOSI = COPI
miso-pin = <2>; // MISO = COPO
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
};
&i2c0 {
compatible = "nordic,nrf-twi";
sda-pin = <8>;
scl-pin = <11>;
};
&i2c1 {
compatible = "nordic,nrf-twi";
sda-pin = <33>;
scl-pin = <24>;
};
&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <35>;
rx-pin = <42>;
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "code_partition";
reg = <0x00026000 0x000c6000>;
};
/*
* The flash starting at 0x000ec000 and ending at
* 0x000f3fff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};

View file

@ -0,0 +1,15 @@
identifier: sparkfun_micromod_nrf52840
name: sparkfun micromod nrf52840
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog

View file

@ -0,0 +1,10 @@
file_format: "1"
id: sparkfun_micromod_nrf52840
name: sparkfun micromod nrf52840
type: board
arch: arm
outputs:
- usb
- ble
url: https://www.sparkfun.com/products/16984
exposes: [micromod]

View file

@ -0,0 +1,32 @@
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_SPARKFUN_MICROMOD_NRF52840=y
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_ZMK_DISPLAY=y
CONFIG_LVGL_USE_THEME_MONO=y
CONFIG_LVGL_COLOR_TRANSP_CUSTOM=y
CONFIG_LVGL_CUSTOM_COLOR_TRANSP_RED=0x00
CONFIG_LVGL_CUSTOM_COLOR_TRANSP_GREEN=0x00
CONFIG_LVGL_CUSTOM_COLOR_TRANSP_BLUE=0x00
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

View file

@ -0,0 +1,8 @@
file_format: "1"
id: sparkfun_micromod
name: SparkFun Micro Mod
type: interconnect
url: https://www.sparkfun.com/micromod
manufacturer: SparkFun
description: |
#TODO Add this latter