I want to add a simple GPIO pin that act as output pin, in the peripheral_uart example .
in main.c
#include <drivers/gpio.h>
//#define GPIO0_LABEL DT_PROP(DT_NODELABEL(gpiocus0), label)
//#define GPIO0_STATUS DT_PROP(DT_NODELABEL(gpiocus0), status)
//#define PIN 10
//#define FLAGS 0
#define LEDBLUE_NODE DT_ALIAS(ledblue)
#define LEDBLUE DT_GPIO_LABEL(LEDBLUE_NODE, gpios)
#define LEDBLUEPIN DT_GPIO_PIN(LEDBLUE_NODE, gpios)
#define FLAGS DT_GPIO_FLAGS(LEDBLUE_NODE, gpios)
added these line main()
{
const struct device *dev;
bool led_is_on = true;
int ret;
dev = device_get_binding(LEDBLUE);
ret = gpio_pin_configure(dev, LEDBLUEPIN, GPIO_OUTPUT_ACTIVE | FLAGS);
for (;;) {
dk_set_led(RUN_STATUS_LED, (++blink_status) % 2);
k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL));
gpio_pin_set(dev, LEDBLUEPIN, 1);//(dev, LEDBLUEPIN, (int)led_is_on);
led_is_on = !led_is_on;
k_msleep(500);
printk("hello2");
}
I could not see any change in the GPIO pin.
I have tried followed the below links,
So, kindly show me any simple method to just turn on a GPIO and Read a pin from a GPIO by the way of OVERLAY FILE.