Skip to content

Commit

Permalink
refactor(boards): Move puchi_ble to power domains
Browse files Browse the repository at this point in the history
* Set a chosen `zmk,default-power-domain`
* Enable the relevant Kconfig settings for PDs.
  • Loading branch information
petejohanson committed Sep 13, 2023
1 parent 9589454 commit 3a999f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/boards/arm/puchi_ble/Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@

config BOARD_PUCHI_BLE_v1
bool "puchi_ble_v1"
imply ZMK_POWER_DOMAINS
imply ZMK_POWER_DOMAINS_DYNAMIC_DEFAULT
depends on SOC_NRF52840_QIAA
2 changes: 2 additions & 0 deletions app/boards/arm/puchi_ble/arduino_pro_micro_pins.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ pro_micro_d: &pro_micro {};
pro_micro_i2c: &i2c0 {};
pro_micro_spi: &spi0 {};
pro_micro_serial: &uart0 {};

pro_micro_power_domain: &core_power_domain {};
15 changes: 13 additions & 2 deletions app/boards/arm/puchi_ble/puchi_ble_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "arduino_pro_micro_pins.dtsi"
#include "puchi_ble_v1-pinctrl.dtsi"

/ {
Expand All @@ -19,6 +18,7 @@
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
zmk,default-power-domain = &core_power_domain;
};

leds {
Expand All @@ -35,6 +35,14 @@
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
};

core_power_domain: core_power_domain {
compatible = "power-domain-gpio", "power-domain";
startup-delay-us = <50000>;
off-on-delay-us = <50000>;
enable-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "BATTERY";
Expand Down Expand Up @@ -86,7 +94,7 @@
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
* http: //docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/
partitions {
compatible = "fixed-partitions";
Expand Down Expand Up @@ -122,3 +130,6 @@
};
};
};

// Included at the end to ensure the power domain DTS node exists
#include "arduino_pro_micro_pins.dtsi"

0 comments on commit 3a999f1

Please sign in to comment.