How to set an interrupt on LDSW via GPIO in the NPM1300 using the nRF Connect SDK.

I am using NCS v2.5.1 and working on a project where I need to turn off the system using a button that triggers an interrupt on a GPIO. I want this GPIO to control a load switch to turn it on and off. Where both the GPIO and the load switch are part of the NPM1300. How can I achieve this using the nRF Connect SDK?

Is there any configuration available in overlay file? 

Parents Reply
  • Hi, yes this is possible.

    You have to add
    enable-gpios = <&npm1300_ek_gpio 0 GPIO_ACTIVE_HIGH>; 
    to the load swtich/LDO settings portion of your overlay.

    You also have to add the gpio controller in the i2c configuration portion of the overlay. 

    example:

    &arduino_i2c {
       npm1300_ek_pmic: pmic@6b {
           compatible = "nordic,npm1300";
           reg = <0x6b>;
    
           npm1300_ek_gpio: gpio-controller {
               compatible = "nordic,npm1300-gpio";
               gpio-controller;
               #gpio-cells = <2>;
               ngpios = <5>;
           };
    
    };
    
    npm1300_ek_ldo1: LDO1 {
        regulator-initial-mode = <NPM1300_LDSW_MODE_LDSW>;
        // soft-start-microamp = <20000>;
        enable-gpios = <&npm1300_ek_gpio 0 GPIO_ACTIVE_HIGH>;
        
    };

Children
Related