From 3082455aecc98532807aba3226321a94d2ed4b0c Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Oct 2020 00:45:59 -0500 Subject: Refactor driver to use Sensor API --- app/boards/arm/nrfmicro/nrfmicro_13.dts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/boards/arm/nrfmicro') diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts index 95bd8ad..840014a 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts @@ -26,6 +26,14 @@ }; }; + vbatt { + compatible = "zmk,battery-voltage-divider"; + label = "VOLTAGE_DIVIDER"; + io-channels = <&adc 2>; + output-ohms = <2000000>; + full-ohms = <(2000000 + 820000)>; + }; + }; &gpio0 { -- cgit v1.2.3 From 162c6b77db27c158b05ed65effa8d8ded68ba9b7 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Oct 2020 00:50:39 -0500 Subject: clang-format and add missing defconfig values --- app/boards/arm/nrfmicro/nrfmicro_13_defconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/boards/arm/nrfmicro') diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig index cac1164..0421653 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig @@ -10,6 +10,10 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +CONFIG_ADC=y + +CONFIG_NEWLIB_LIBC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -- cgit v1.2.3 From 8efcd80f3ae594a489339ac23de8890399f22f59 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Oct 2020 00:57:32 -0500 Subject: Add missing ADC and fix formatting --- app/boards/arm/nrfmicro/nrfmicro_13.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/boards/arm/nrfmicro') diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts index ae6c1af..5ae11ba 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts @@ -25,8 +25,8 @@ label = "Blue LED"; }; }; - - ext-power { + + ext-power { compatible = "zmk,ext-power-generic"; label = "EXT_POWER"; control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; -- cgit v1.2.3 From adb07926b1d6760e63e19134b338f8b1ba460483 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 24 Oct 2020 18:52:34 -0500 Subject: Remove newlib dep --- app/boards/arm/nrfmicro/nrfmicro_13_defconfig | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/boards/arm/nrfmicro') diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig index 0421653..4e44ea3 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig @@ -12,8 +12,6 @@ CONFIG_GPIO=y CONFIG_ADC=y -CONFIG_NEWLIB_LIBC=y - CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -- cgit v1.2.3 From a0087311038e9b21c2a45499e669d1300af16f83 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 26 Oct 2020 16:01:57 -0500 Subject: Implement Kconfig and enhance error checks --- app/boards/arm/nrfmicro/Kconfig.defconfig | 3 +++ app/boards/arm/nrfmicro/nrfmicro_13_defconfig | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/boards/arm/nrfmicro') diff --git a/app/boards/arm/nrfmicro/Kconfig.defconfig b/app/boards/arm/nrfmicro/Kconfig.defconfig index 7957b4a..a3c02c2 100644 --- a/app/boards/arm/nrfmicro/Kconfig.defconfig +++ b/app/boards/arm/nrfmicro/Kconfig.defconfig @@ -35,6 +35,9 @@ if BOARD_NRFMICRO_13 config BOARD_NRFMICRO_CHARGER default y +config ZMK_BATTERY_VOLTAGE_DIVIDER + default y + endif # BOARD_NRFMICRO_13 endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13 diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig index 4e44ea3..cac1164 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig @@ -10,8 +10,6 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y -CONFIG_ADC=y - CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -- cgit v1.2.3