This repository contains peripheral power driver that configures pin to desired state at boot time. Driver is compatible with NCS 2.2.
If not already set up, install west and other required tools. Follow the steps here from Install the required tools up to (including) Install west.
Also install east.
Then follow these steps:
west init -m https://github.com/IRNAS/peripheral-power peripheral-power
cd peripheral-power/project
west update
# set up east globally (this only needs to be done once on each machine)
east sys-setup
# install toolchain for the version of NCS used in this project
east update toolchainThere are currently no samples to build.
The manifest file (west.yaml) that comes with this driver only
allows certain modules from Nordic's sdk-nrf and sdk-zephyr repositories,
while ignoring/blocking others.
To use add below snippets into your project's west.yml file and run `west
update``:
- In
remotessection, if not already added:
- name: irnas
url-base: https://github.com/irnas- In the
projectssection, select revision you need:
- name: irnas-peripheral-power
repo-path: peripheral-power
path: irnas/peripheral-power
remote: irnas
revision: devTo enable this driver you need to add below snippet, for selected GPIOs, into your DTS or overlay
file. For information on how to properly configure this driver see
dts/bindings/irnas,peripheral-power.yaml
my_gpio_pwr {
compatible = "irnas,peripheral-power";
power-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
initial-state = <0>;
status = "okay";
};
Driver will configure pins to as output to desired state at boot time.
To configure pin as input, add configure-input option. Initial state field will be ignored in this case:
my_gpio_pwr {
compatible = "irnas,peripheral-power";
power-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
initial-state = <0>;
status = "okay";
configure-input;
};
Enable this driver by selecting config option: CONFIG_PERIPHERAL_POWER=y. By default initialization priority of this driver is set to 79, to change that configure PERIPHERAL_POWER_INIT_PRIORITY.