melta101
melta101
DIIDevHeads IoT Integration Server
Created by melta101 on 12/23/2024 in #📦-middleware-and-os
How to Configure DTS and Struct for SPI Controller Driver with Child Nodes in Zephyr?
Hello Guys, I am developing a SPI Controller Driver for TI processors for Zephyr, I have a doubt on how do i set the Dts to look like? ideally it should like this if we include soc.dtsi, board.dts, overlay.dts &spi1 { compatible = "ti,omap-spi"; reg = <0x48030000 0x1000>; interrupts = <25>; #address-cells = <1>; #size-cells = <0>; spi1_device0: spi-device@0 { reg = <0>; spi-max-frequency = <1000000>; spi-cs-delay = <5>; word_length = <8> }; spi1_device1: spi-device@1 { reg = <1>; spi-max-frequency = <2000000>; spi-cs-delay = <10>; word_length = <32> }; }; As of now, I am getting the SPI controller to have 4 CS, no DMA, no slave mode how do i set my struct config to accomodate the above? it would be simple if there was no child nodes like the below struct spi_omap_config { DEVICE_MMIO_NAMED_ROM(base); uint32_t irq; }; but with child nodes in the equation, i am so confused...
19 replies