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