title: How to use Zephry SPI driver directly?
body: <p>I couldn't find any sample that uses SPI API directly from the application. Instead, there are many sensors that use SPI as a bus.</p>
  <p>Trying to write it from scratch, I've encountered a problem with getting the device binding to a <code>spi-device</code> node. I should also mention that I have working samples of other peripherals like GPIOs or ADC, so I believe it is a problem with SPI, not the project configuration.</p>
  <p>Here is the excerpt of the devicetree:</p>
  <pre><code>&amp;spi1 {
      pinctrl-0 = &lt;&amp;spi1_sck_pb3 &amp;spi1_miso_pb4 &amp;spi1_mosi_pb5&gt;;
      cs-gpios = &lt;&amp;gpiob 9 GPIO_ACTIVE_LOW&gt;;
      status = &quot;okay&quot;;
  
      spi1_dev0: spi-device@0 {
          reg = &lt;0&gt;;
          spi-max-frequency = &lt;1000000&gt;;
          label = &quot;spi_dev1&quot;;
          status = &quot;okay&quot;;    
      };
  };
  </code></pre>
  <p>I've set the SPI in the project config:</p>
  <pre><code>CONFIG_GPIO=y
  CONFIG_SPI=y
  CONFIG_SPI_STM32=y
  CONFIG_SPI_STM32_USE_HW_SS=n
  </code></pre>
  <p>But unfortunately, the DT node of the <code>spi1_dev0</code> deice cannot be resolved</p>
  <pre><code>const struct device *spi_dev = device_get_binding(DT_NODELABEL(spi1_dev0));
  const struct spi_config *spi_cfg = SPI_CONFIG_DT(DT_NODELABEL(spi1_dev0), SPI_WORD_SET(8), 10);
  </code></pre>
  <blockquote>
  <p>[build] zephyr/include/generated/devicetree_unfixed.h:11068:34: error:
  'DT_N_S_soc_S_spi_40013000_S_spi_device_0' undeclared (first use in
  this function); did you mean
  'DT_N_S_soc_S_spi_40013000_S_spi_device_0_BUS'?</p>
  </blockquote>
  <p>I also tried to use <code>DT_BUS</code> on top of <code>DT_NODELABEL</code> but without success.</p>
  <p>Is it possible to use buses like SPI or I2C directly?</p>