Skip to content
Commit d6cfa10b authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

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: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent 6008e7ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment