When I follow the use_gpio_pin_directly manual I get a compilation error:
```
/home/gal/dev/ism330bx_driver_contribution/zephyr/include/zephyr/devicetree.h:196:36: error: 'DT_N_NODELABEL_user_dbg_pin_P_gpios_IDX_0_VAL_pin' undeclared (first use in this function)
196 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
```
Why doesn't it find the gpios?
Here's a small main():
Here's my DTS:
#include <zephyr/dt-bindings/sensor/ism330bx.h>
// /home/gal/dev/ism330bx_driver_contribution/zephyr/include/zephyr/dt-bindings/sensor/ism330bx.h
/ {
model = "ISM sample board";
ism330bx_on: ism330bx-on {
compatible = "nordic,gpio-pins";
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
&gpio1 {
status = "okay";
};
&spi1 {
status = "okay";
pinctrl-0 = <&ism330bx_default>;
pinctrl-1 = <&ism330bx_sleep>;
pinctrl-names = "default", "sleep";
compatible = "nordic,nrf-spim";
cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
ism330bx@0 {
compatible = "st,ism330bx";
reg = <0>;
accel-range = <ISM330BX_ACCL_DT_FS_2G>;
accel-odr = <ISM330BX_ACCL_DT_ODR_OFF>;
gyro-range = <ISM330BX_GYRO_DT_FS_125DPS>;
gyro-odr = <ISM330BX_GYRO_DT_ODR_OFF>;
int1-gpios = <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
// int2-gpios = <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; // TODO: Disable this pin in the driver init()
// power_resources = <&ism330bx_on>;
spi-max-frequency = <8000000>;
};
};
&pinctrl {
// ism330bx
ism330bx_default: ism330bx_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
<NRF_PSEL(SPIM_MOSI, 1, 12)>,
<NRF_PSEL(SPIM_MISO, 1, 13)>;
};
};
ism330bx_sleep: ism330bx_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
<NRF_PSEL(SPIM_MOSI, 1, 12)>,
<NRF_PSEL(SPIM_MISO, 1, 13)>;
low-power-enable;
};
};
};