I've tried the following code derived from the blinky example, and a couple other things i've seen online, but i can't seem to turn pin 1.11 on.
struct gpio_dt_spec pin_dev = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios); const struct device *port = DEVICE_DT_GET(DT_NODELABEL(gpio1)); const gpio_pin_t pin = 11; int main(void) { int err; if (!device_is_ready(pin_dev.port)) { return; } err = gpio_pin_configure_dt(&pin_dev, GPIO_OUTPUT_ACTIVE); printk("Pin 1.11 has the value: %x and error code: %d\n", gpio_pin_get_raw(port, pin), err); return; }
Outputs:
Pin 1.11 has the value: 0 and error code: 0
How do i set the pin?
Note: I've tried removing CONFIG_BT from the project as this suggests that might be the problem, but it still doesn't set the pin.