/* Pro Micro nRF52840 (nice!nano v2 compatible) + Adafruit SHT41 on a gated supply */ #include #include #include / { /* P0.17 powers the SHT41: switched on only while the sensor is in use */ sens_pwr: sensor-power { compatible = "power-domain-gpio"; enable-gpios = <&gpio0 17 (GPIO_ACTIVE_HIGH | NRF_GPIO_DRIVE_H0H1)>; startup-delay-us = <3000>; /* SHT41 power-up + breakout caps */ #power-domain-cells = <0>; zephyr,pm-device-runtime-auto; }; zephyr,user { io-channels = <&adc 0>; }; }; /* DC/DC on REG0 (VDDH -> VDD) and REG1 (VDD -> core) */ ®0 { status = "okay"; }; ®1 { regulator-initial-mode = ; }; /* I2C: SDA P0.20, SCL P0.22. "sleep" state = pins disconnected (no back-feeding) */ &pinctrl { sht_i2c_default: sht_i2c_default { group1 { psels = , ; bias-pull-up; }; }; sht_i2c_sleep: sht_i2c_sleep { group1 { psels = , ; low-power-enable; }; }; }; &i2c0 { compatible = "nordic,nrf-twim"; status = "okay"; clock-frequency = ; pinctrl-0 = <&sht_i2c_default>; pinctrl-1 = <&sht_i2c_sleep>; pinctrl-names = "default", "sleep"; zephyr,pm-device-runtime-auto; /* bus enabled only during transfers */ sht41: sht4x@44 { compatible = "sensirion,sht4x"; reg = <0x44>; repeatability = <2>; /* high precision, no heater */ power-domains = <&sens_pwr>; zephyr,pm-device-runtime-auto; }; }; /* Battery: VDDH/5, internal 0.6 V ref, gain 1/2 -> 0..1.2 V range */ &adc { #address-cells = <1>; #size-cells = <0>; status = "okay"; channel@0 { reg = <0>; zephyr,gain = "ADC_GAIN_1_2"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; zephyr,resolution = <14>; /* LSB = 6000 mV / 16384 = 0.37 mV at VDDH */ zephyr,oversampling = <3>; /* 2^3 = 8x */ }; }; /* Unused board peripherals */ &i2c1 { status = "disabled"; }; &spi2 { status = "disabled"; }; &pwm0 { status = "disabled"; }; &uart0 { status = "disabled"; }; &usbd { status = "disabled"; };