drivers: spi: add helpers for initializing from DT
Add helper macros for initializing a struct spi_sconfig for a SPI
device which is defined in the devicetree. They are available from C
only due to C++ compatibility issues.
For some fields, like 'frequency', we just get the value from the
standard devicetree property. For others, like the spi_cs_control
structure's 'gpio_dev', we rely on the new DEVICE_DT_GET() macro.
This patch does not change anything for controlling SPI devices that
aren't set up in devicetree. It is entirely a convenience for driver
and application code that relies on DT.
Signed-off-by:
Martí Bolívar <marti.bolivar@nordicsemi.no>
Loading
Please sign in to comment