Lines Matching refs:struct
56 Get a struct device from a devicetree node
60 :ref:`struct device <device_model_api>` corresponding to a devicetree node.
62 For example, with this devicetree fragment, you might want the struct device
108 const struct device *const uart_dev = DEVICE_DT_GET(MY_SERIAL);
126 ``struct device`` by combining :c:func:`device_get_binding` with the device
132 const struct device *uart_dev = device_get_binding(dev_name);
146 const struct device *const uart_dev = DEVICE_DT_GET(MY_SERIAL);
390 enable the driver via Kconfig and :ref:`get the struct device <dt-get-device>`
399 ``struct device`` for each ``status = "okay"`` devicetree node with a
418 a ``struct device`` for each one. There are two options for instantiating each
419 ``struct device``: using instance numbers, and using node labels.
423 - Each ``struct device``\ 's name should be set to its devicetree node's
440 struct my_dev_data {
443 struct my_dev_cfg {
449 static int my_driver_api_func1(const struct device *dev, uint32_t *foo) { /* ... */ }
450 static int my_driver_api_func2(const struct device *dev, uint64_t bar) { /* ... */ }
451 static struct some_api my_api_funcs = {
486 Finally, define an instantiation macro, which creates each ``struct device``
498 static struct my_dev_data my_data_##inst = { \
502 static const struct my_dev_cfg my_cfg_##inst = { \
577 static struct my_dev_data my_data_##idx = { \
581 static const struct my_dev_cfg my_cfg_##idx = { /* ... */ }; \
594 ``CREATE_MY_DEVICE`` to instantiate each ``struct device``:
615 At times, one ``struct device`` depends on another ``struct device`` and