Hello,
I am trying to make GPIO P0.07 to high, in my nrf5340 Audio DK. Externally I am connecting an LED between P0.07 and GND. But it not showing any voltage between them. below is my code
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(newpin), testpin_gpios);
int main(void)
{
int ret;
if (!gpio_is_ready_dt(&led)) {
printk("Error: LED device %s is not ready\n", led.port->name);
return 0;
}
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
printk("Error %d: Failed to configure LED pin\n", ret);
return 0;
}
My overlay file is
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/ {
testpin: zephyr,user {
testpin-gpios = <&gpio0 7 0>;
};
aliases {
newpin = &testpin;
};
};
&gpio0 {
status = "okay";
};
&gpiote {
status = "okay";
};
my config file
Fullscreen
1
2
3
4
5
CONFIG_PRINTK=y
CONFIG_PWM=y
CONFIG_GPIO=y
CONFIG_LOG=y
CONFIG_PWM_LOG_LEVEL_DBG=y
But the board's inbuilt red led is glowing.