Can't get events from nPM1300 MFD

I would like to get the events offered by the mfd driver for VBUS detect but for some reason my callback is never triggered.

I'm doing this atm:

static void pmic_evt_cb(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
    LOG_INF("PMIC Event: %d\n", pins);
}

main:

if (!device_is_ready(pmic)) {
LOG_ERR("PMIC device not ready.\n");
return;
}
static struct gpio_callback event_cb;
gpio_init_callback(&event_cb, pmic_evt_cb, BIT(NPM1300_EVENT_VBUS_DETECTED));
mfd_npm1300_add_callback(pmic, &event_cb);


Devicetree:

npm1300_pmic: npm1300@6b {
	status = "okay";
	compatible = "nordic,npm1300";
	reg = <0x6b>;
	host-int-gpios = <&gpio1 9 0>;
	pmic-int-pin = <0>;
	
	...

Loosely following the EK sample.
Removing and attaching VBUS does not trigger my callback as I would expect. Is there something that needs to be configured to enable them?
I'm using NCS2.7

Parents
  • Hello,

    What device are you running your application on? A DK? Which one?

    If it is a DK, then depending on which one, Pin P0.0 is usually used for the LFXTAL, so unless you have modified the DK, this GPIO is not routed out to where it says P0.0 on the DK. Try using another pin. Check the back of the DK to see which pins that are used by what by default.

    Best regards,

    Edvin

Reply
  • Hello,

    What device are you running your application on? A DK? Which one?

    If it is a DK, then depending on which one, Pin P0.0 is usually used for the LFXTAL, so unless you have modified the DK, this GPIO is not routed out to where it says P0.0 on the DK. Try using another pin. Check the back of the DK to see which pins that are used by what by default.

    Best regards,

    Edvin

Children
Related