Skip to content

IRNAS/peripheral-power

Repository files navigation

peripheral-power

This repository contains peripheral power driver that configures pin to desired state at boot time. Driver is compatible with NCS 2.2.

Setup

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 toolchain

Building and flashing

There are currently no samples to build.

west.yaml and name-allowlist

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.

Usage

To use add below snippets into your project's west.yml file and run `west update``:

  1. In remotes section, if not already added:
- name: irnas
  url-base: https://github.com/irnas
  1. In the projects section, select revision you need:
- name: irnas-peripheral-power
      repo-path: peripheral-power
      path: irnas/peripheral-power
      remote: irnas
      revision: dev

Device tree

To 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;
    };

Project

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors