Re: List of Device Names: device_get_binding()


Warren Gay <ve3wwg@...>
 

Thanks Marc. It took a fairly painful process to produce a list
because of how it is spread among several include files. But I was 
finally able to produce a list using:

$ cpp -E -traditional-cpp \
        -I $ZEPHYR_BASE/dts/common \
        -I $ZEPHYR_BASE/dts \
        -I $ZEPHYR_BASE/dts/arm \
        -I $ZEPHYR_BASE/include \
        $ZEPHYR_BASE/dts/arm/st/stm32f407.dtsi | grep label
In file included from /home/wwg/zephyr/dts/arm/st/stm32f4.dtsi:10:0,
                 from /home/wwg/zephyr/dts/arm/st/stm32f401.dtsi:8,
                 from /home/wwg/zephyr/dts/arm/st/stm32f405.dtsi:9,
                 from /home/wwg/zephyr/dts/arm/st/stm32f407.dtsi:8:
/home/wwg/zephyr/dts/arm/st/mem.h:111:2: error: #error "Flash, RAM, and CCM sizes not defined for this chip"
 #error "Flash, RAM, and CCM sizes not defined for this chip"
  ^~~~~
label = "FLASH_CTRL";
label = "FLASH_STM32";
label = "STM32_CLK_RCC";
label = "GPIOA";
label = "GPIOB";
label = "GPIOC";
label = "GPIOD";
label = "GPIOE";
label = "GPIOH";
label = "UART_1";
label = "UART_2";
label = "UART_6";
label= "I2C_1";
label= "I2C_2";
label= "I2C_3";
label = "SPI_1";
label= "OTGFS";
label = "SPI_2";
label = "SPI_3";
label = "GPIOF";
label = "GPIOG";
label = "GPIOH";
label = "GPIOI";
label = "UART_3";
label = "UART_4";
label = "UART_5";

I assume the device name comes from the label. It would be nice if the
API documentation would mention this sort of thing.

Warren


On Sat, May 5, 2018 at 6:41 PM, Marc Reilly <marc.reilly@...> wrote:
Hi Warren,

I'm no expert, but I for the latest master branch at least I think the device names come from the device tree files. 
Look for the .DTS file in your board folder, then follow the .dtsi includes until you see a node for spi. The device name will be the label.

Cheers
Marc

On Sun., 6 May 2018, 08:29 Warren Gay, <ve3wwg@...> wrote:
For the call:

  struct device *device_get_binding(const char *name)

How do I determine the name to provide for SPIx for example, 
for a stm32f407 board?  Is there a file constructed in the zephyr tree that
I can consult?

Warren


Join devel@lists.zephyrproject.org to automatically receive all group messages.