Skip to content

Commit

Permalink
Configure berylline to use raytac dongle
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmkk3 authored Aug 11, 2023
1 parent 585cc70 commit b84a053
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#
---
include:
- board: raytac_mdbt50q_rx
shield: berylline_dongle
- board: nice_nano_v2
shield: berylline_left
- board: nice_nano_v2
Expand Down
4 changes: 4 additions & 0 deletions config/boards/shields/arm/raytac_mdbt50q_rx/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
3 changes: 3 additions & 0 deletions config/boards/shields/arm/raytac_mdbt50q_rx/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config BOARD_RAYTAC_MDBT50Q_RX
bool "Raytac MDBT50Q-RX"
depends on SOC_NRF52840_QIAA
19 changes: 19 additions & 0 deletions config/boards/shields/arm/raytac_mdbt50q_rx/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if BOARD_RAYTAC_MDBT50Q_RX

config BOARD
default "Raytac MDBT50Q-RX"

if USB

config USB_NRFX
default y

config USB_DEVICE_STACK
default y

endif # USB

config BT_CTLR
default BT

endif # BOARD_RAYTAC_MDBT50Q_RX
66 changes: 66 additions & 0 deletions config/boards/shields/arm/raytac_mdbt50q_rx/raytac_mdbt50q_rx.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>

/ {
model = "Raytac MDBT50Q-RX";

chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};

&adc {
status = "okay";
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

// Application starts at 0x1000 after the MBR.
code_partition: partition@1000 {
label = "code_partition";
reg = <0x00001000 0x000ec000>;
};

// Define storage partition before the bootloader, which starts at
// 0xf4000. Only 7 pages is allocated for storage since that's the
// default on the older Adafruit bootloader that these dongles are
// preloaded with.
storage_partition: partition@ed000 {
label = "storage";
reg = <0x000ed000 0x00007000>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_RAYTAC_MDBT50Q_RX=y

# Follow DeviceTree partition.
CONFIG_USE_DT_CODE_PARTITION=y

# Build UF2 firmware.
CONFIG_BUILD_OUTPUT_UF2=y

# Enable MPU.
CONFIG_ARM_MPU=y

# Enable hardware stack protection.
CONFIG_HW_STACK_PROTECTION=y

# Enable basic functionality.
CONFIG_ADC=y
CONFIG_GPIO=y

# Use NVS for settings.
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

# Set NVS sector count to reflect storage partition size.
CONFIG_SETTINGS_NVS_SECTOR_COUNT=7

# Use maximum Bluetooth transmit power.
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

# Include support for Coded PHY.
CONFIG_BT_CTLR_PHY_CODED=y
4 changes: 2 additions & 2 deletions config/boards/shields/berylline/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_BERYLLINE_LEFT
if SHIELD_BERYLLINE_DONGLE

config ZMK_KEYBOARD_NAME
default "Berylline"
Expand All @@ -11,7 +11,7 @@ config ZMK_SPLIT_BLE_ROLE_CENTRAL

endif

if SHIELD_BERYLLINE_LEFT || SHIELD_BERYLLINE_RIGHT
if SHIELD_BERYLLINE_DONGLE || SHIELD_BERYLLINE_LEFT || SHIELD_BERYLLINE_RIGHT

config ZMK_SPLIT
default y
Expand Down
3 changes: 3 additions & 0 deletions config/boards/shields/berylline/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_BERYLLINE_DONGLE
def_bool $(shields_list_contains,berylline_dongle)

config SHIELD_BERYLLINE_LEFT
def_bool $(shields_list_contains,berylline_left)

Expand Down
1 change: 1 addition & 0 deletions config/boards/shields/berylline/berylline_dongle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2
7 changes: 7 additions & 0 deletions config/boards/shields/berylline/berylline_dongle.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "berylline03.dtsi"

0 comments on commit b84a053

Please sign in to comment.