Hello,
I need an example for using the spi in zephyr and how to change the pins if necessary.
Where can I find it?
Thank you
Hello,
I need an example for using the spi in zephyr and how to change the pins if necessary.
Where can I find it?
Thank you
Hello Fausto,
there is no concrete example for the SPI peripheral showing the usage of this function, unfortunately. Since SPI and I2C generally are related to interfaces such as the sensor, its functionally is “baked into” those APIs intead.
But you could have a look the Low Power UART application, since it makes usage of the device_get_binding function.
Alternatively, you could check the BME280 application in an older revision of Zephyr, since the DEVICE_GET_ANY function has been introduced to Zephyr version 2.6.0.
Regards,
Markus
Hello Markus,
Thanks again.
I have to interface with the SPI an e-paper display, not a sensor, for which the drivers are available in zephyr.
I just want to log into the SPI and send or receive bytes,
I have the working I2C, can I use the same mode to open the device, and then access with the functions spi_write, ... read, as in the driver for the BM280?
Thank you
Fausto
Hello Fausto,
Fb62 said:I have the working I2C, can I use the same mode to open the device, and then access with the functions spi_write, ... read, as in the driver for the BM280?
yes the devicetree is a generic API that is supposed to work for all supported peripherals.
Regards,
Markus