How to config nrf9160 IO?

Hi:

nrf9160dk_nrf9160_ns.overlay

/ {
	ctrl {
		compatible = "gpio-ctrl";
		ctrl0: ctrl_0 {
			gpios = < &gpio0 15 0x0 >;
			label = "Ctrl IO";
		};
	};
};

#define CTRL0_NODE DT_ALIAS(ctrl0)
static const struct gpio_dt_spec co2_pwr_pin = GPIO_DT_SPEC_GET(CTRL0_NODE, gpios);

....
	int ret;
	if (!device_is_ready(co2_pwr_pin.port)) {
		return;
	}
	ret = gpio_pin_configure_dt(&co2_pwr_pin, GPIO_OUTPUT_ACTIVE);
	if (ret < 0) {
		return;
	}
	gpio_pin_set_dt(&co2_pwr_pin,1);
....

Error in build this configuration.

Parents Reply Children
Related