Zephyr - How to digital read the pin which is used as OUTPUT.

Hello.

I am new to Zephyr, I know how to digital read the pin which is used as INPUT

#define SW0_NODE DT_ALIAS(sw0)
static const struct gpio_dt_spec DOUTINPUT = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios,{0});
ret = gpio_pin_configure_dt(&DOUTINPUT,GPIO_INPUT);
printk("Digital value : %d",!gpio_pin_get_dt(&DOUTINPUT));

By using the gpio_pin_get_dt() function we can use to check current digital value.

But how to check the digital read of the pin which is used as OUTPUT?

Thanks in advance.

Regards,

Neeraj Dhekale

Related