Lines Matching +full:mbox +full:- +full:cells

2  * SPDX-License-Identifier: Apache-2.0
36 * -----------------
39 * part in DT_N_<path-id>_P_<property-id> macros, or the "prop-suf"
72 * @defgroup devicetree-generic-id Node identifiers and helpers
97 * The arguments to this macro are the names of non-root nodes in the
99 * Non-alphanumeric characters in each name must be converted to
109 * current-speed = <115200>;
120 * Example usage with DT_PROP() to get the `current-speed` property:
126 * (The `current-speed` property is also in `lowercase-and-underscores`
131 * - the first argument corresponds to a child node of the root (`soc` above)
132 * - a second argument corresponds to a child of the first argument
135 * - and so on for deeper nodes in the desired node's path
137 * @param ... lowercase-and-underscores node names along the node's path,
146 * Convert non-alphanumeric characters in the node label to
156 * current-speed = <115200>;
168 * current-speed property:
178 * L2_0: l2-cache {
179 * cache-level = <2>;
185 * Example usage to get the cache-level property:
194 * @param label lowercase-and-underscores node label name
204 * non-alphanumeric characters in the alias property to underscores to
212 * my-serial = &serial1;
218 * current-speed = <115200>;
226 * `serial@40001000` node. Notice how `my-serial` in the devicetree
228 * DT_PROP() to get the current-speed property:
234 * @param alias lowercase-and-underscores alias name.
243 * instance numbers, which are zero-based indexes specific to that
246 * lowercase-and-underscores version of the compatible, @p compat.
250 * - for each compatible, instance numbers start at 0 and are contiguous
251 * - exactly one instance number is assigned for each node with a compatible,
253 * - enabled nodes (status property is `okay` or missing) are assigned the
259 * - instance numbers **in no way reflect** any numbering scheme that
263 * - there **is no general guarantee** that the same node will have
271 * compatible = "vnd,soc-serial";
273 * current-speed = <9600>;
278 * compatible = "vnd,soc-serial";
280 * current-speed = <57600>;
285 * compatible = "vnd,soc-serial";
286 * current-speed = <115200>;
292 * `"vnd,soc-serial"`, that compatible has nodes with instance numbers
306 * // have instance number 0, so this could be the current-speed
312 * // this expands to 115200, and vice-versa.
321 * Notice how `"vnd,soc-serial"` in the devicetree becomes `vnd_soc_serial`
322 * (without quotes) in the DT_INST() arguments. (As usual, `current-speed`
329 * @param compat lowercase-and-underscores compatible, without quotes
341 * parent: parent-node {
342 * child: child-node {
366 * gparent: grandparent-node {
367 * parent: parent-node {
368 * child: child-node { ... }
392 * soc-label: soc {
395 * current-speed = <115200>;
417 * @param child lowercase-and-underscores child node name
433 * node-a {
438 * node-b {
443 * node-c {
455 * This expands to a node identifier for either `node-a` or `node-b`.
456 * It will not expand to a node identifier for `node-c`, because that
459 * @param compat lowercase-and-underscores compatible, without quotes
479 * node: my-node@12345678 { ... };
487 * DT_NODE_PATH(DT_NODELABEL(node)) // "/soc/my-node@12345678"
498 * @brief Get a devicetree node's name with unit-address as a string literal
500 * This returns the node name and unit-address from a node identifier.
507 * node: my-node@12345678 { ... };
515 * DT_NODE_FULL_NAME(DT_NODELABEL(node)) // "my-node@12345678"
519 * @return the node's name with unit-address as a string in the devicetree
526 * Indexes are zero-based.
534 * c1: child-1 {};
535 * c2: child-2 {};
579 * @defgroup devicetree-generic-prop Property accessors
590 * - string: a string literal
591 * - boolean: `0` if the property is false, or `1` if it is true
592 * - int: the property's value as an integer literal
593 * - array, uint8-array, string-array: an initializer expression in braces,
596 * - phandle: a node identifier for the node with that phandle
601 * type string-array, `status` has type string, and
602 * `interrupt-controller` has type boolean.
611 * @param prop lowercase-and-underscores property name
624 * - for types array, string-array, and uint8-array, this expands
626 * - for type phandles, this expands to the number of phandles
627 * - for type phandle-array, this expands to the number of
629 * - for type phandle, this expands to 1 (so that a phandle
631 * - for type string, this expands to 1 (so that a string can be
632 * treated as a degenerate case of string-array with length 1)
636 * - reg property: use `DT_NUM_REGS(node_id)` instead
637 * - interrupts property: use `DT_NUM_IRQS(node_id)` instead
639 * It is an error to use this macro with the `ranges`, `dma-ranges`, `reg`
645 * @param prop a lowercase-and-underscores property with a logical length
660 * @param prop a lowercase-and-underscores property with a logical length
677 * - `reg` property: use DT_REG_HAS_IDX(node_id, idx) instead
678 * - `interrupts` property: use DT_IRQ_HAS_IDX(node_id, idx) instead
683 * @param prop a lowercase-and-underscores property with a logical length
692 * @brief Is name @p name available in a `foo-names` property?
696 * - `interrupts` property: use DT_IRQ_HAS_NAME(node_id, idx) instead
703 * nx: node-x {
705 * foo-names = "event", "error";
718 * @param prop a lowercase-and-underscores `prop-names` type property
719 * @param name a lowercase-and-underscores name to check
730 * `node->property[index]`.
734 * - for types array, string-array, uint8-array, and phandles,
735 * this expands to the idx-th array element as an
739 * - for type phandle, idx must be 0 and the expansion is a node
742 * - for type string, idx must be 0 and the expansion is the the
743 * entire string (this treats string like string-array of length 1)
747 * - `reg`: use DT_REG_ADDR_BY_IDX() or DT_REG_SIZE_BY_IDX() instead
748 * - `interrupts`: use DT_IRQ_BY_IDX()
749 * - `ranges`: use DT_NUM_RANGES()
750 * - `dma-ranges`: it is an error to use this property with
756 * @param prop lowercase-and-underscores property name
758 * @return a representation of the idx-th element of the property
772 * @param prop lowercase-and-underscores property name
800 * maximum-speed = "full-speed";
803 * maximum-speed = "super-speed";
811 * maximum-speed:
814 * - "low-speed"
815 * - "full-speed"
816 * - "high-speed"
817 * - "super-speed"
828 * @param prop lowercase-and-underscores property name
829 * @return zero-based index of the property's value in its enum: list
842 * @param prop lowercase-and-underscores property name
844 * @return zero-based index of the property's value in its enum if present,
855 * @param prop lowercase-and-underscores property name
856 * @param value lowercase-and-underscores enumeration value
866 * converting any non-alphanumeric characters to underscores. This can
877 * n1: node-1 {
880 * n2: node-2 {
883 * n3: node-3 {
906 * - Unlike C identifiers, the property values may begin with a
910 * - The uppercased `"FOO"` in the DTS remains `FOO` as a token. It is
913 * - The whitespace in the DTS `"123 foo"` string is converted to
917 * @param prop lowercase-and-underscores property name
933 * @param prop lowercase-and-underscores property name
945 * converting any non-alphanumeric characters to underscores, and
956 * n1: node-1 {
959 * n2: node-2 {
982 * - Unlike C identifiers, the property values may begin with a
986 * - The lowercased `"foo"` in the DTS becomes `FOO` as a token, i.e.
989 * - The whitespace in the DTS `"123 foo"` string is converted to
994 * @param prop lowercase-and-underscores property name
1010 * @param prop lowercase-and-underscores property name
1022 * This removes "the quotes" from string-valued properties.
1033 * n1: node-1 {
1036 * n2: node-2 {
1039 * n3: node-3 {
1056 * @param prop lowercase-and-underscores property name
1071 * @param prop lowercase-and-underscores property name
1081 * @brief Get an element out of a string-array property as a token.
1084 * non-alphanumeric characters to underscores. That can be useful, for example,
1088 * string-array type.
1095 * n1: node-1 {
1098 * n2: node-2 {
1108 * type: string-array
1123 * @param prop lowercase-and-underscores property name
1134 * converts non-alphanumeric characters to underscores. That can be useful, for
1138 * string-array type.
1145 * n1: node-1 {
1148 * n2: node-2 {
1158 * type: string-array
1173 * @param prop lowercase-and-underscores property name
1183 * This removes "the quotes" from string-valued item.
1189 * string-array type.
1195 * n1: node-1 {
1198 * n2: node-2 {
1206 * type: string-array
1216 * @param prop lowercase-and-underscores property name
1226 * These are special-cased to manage the impedance mismatch between
1246 * n1: node-1 {
1250 * n2: node-2 {
1254 * n3: node-3 {
1269 * @param phs lowercase-and-underscores property with type `phandle`,
1270 * `phandles`, or `phandle-array`
1273 * @param prop lowercase-and-underscores property of the phandle's node
1290 * @param phs lowercase-and-underscores property with type `phandle`,
1291 * `phandles`, or `phandle-array`
1294 * @param prop lowercase-and-underscores property of the phandle's node
1307 * @param ph lowercase-and-underscores property of @p node_id
1309 * @param prop lowercase-and-underscores property of the phandle's node
1316 * @brief Get a phandle-array specifier cell value at an index
1319 * `node->phandle_array[index].cell`. That is, the cell value is in
1327 * #gpio-cells = <2>;
1331 * #gpio-cells = <2>;
1342 * gpio-cells:
1343 * - pin
1344 * - flags
1349 * - index 0 has specifier <17 0x1>, so its `pin` cell is 17, and its
1351 * - index 1 has specifier <5 0x3>, so `pin` is 5 and `flags` is 0x3
1363 * @param pha lowercase-and-underscores property with type `phandle-array`
1365 * @param cell lowercase-and-underscores cell name within the specifier
1388 * @param pha lowercase-and-underscores property with type `phandle-array`
1390 * @param cell lowercase-and-underscores cell name within the specifier
1401 * @param pha lowercase-and-underscores property with type `phandle-array`
1402 * @param cell lowercase-and-underscores cell name
1416 * @param pha lowercase-and-underscores property with type `phandle-array`
1417 * @param cell lowercase-and-underscores cell name
1425 * @brief Get a value within a phandle-array specifier by name
1431 * `node->phandle_struct.name.cell`. That is, the cell value is in the
1439 * io-channels = <&adc1 10>, <&adc2 20>;
1440 * io-channel-names = "SENSOR", "BANDGAP";
1447 * io-channel-cells:
1448 * - input
1459 * @param pha lowercase-and-underscores property with type `phandle-array`
1460 * @param name lowercase-and-underscores name of a specifier in @p pha
1461 * @param cell lowercase-and-underscores cell name in the named specifier
1482 * @param pha lowercase-and-underscores property with type `phandle-array`
1483 * @param name lowercase-and-underscores name of a specifier in @p pha
1484 * @param cell lowercase-and-underscores cell name in the named specifier
1495 * `node->phandle_struct.name.phandle`. That is, the phandle array is
1511 * io-channels = <&adc1 10>, <&adc2 20>;
1512 * io-channel-names = "SENSOR", "BANDGAP";
1516 * Above, "io-channels" has two elements:
1518 * - the element named `"SENSOR"` has phandle `&adc1`
1519 * - the element named `"BANDGAP"` has phandle `&adc2`
1531 * non-alphanumeric characters are converted to underscores.
1534 * @param pha lowercase-and-underscores property with type `phandle-array`
1535 * @param name lowercase-and-underscores name of an element in @p pha
1554 * n1: node-1 {
1558 * n2: node-2 { ... };
1559 * n3: node-3 { ... };
1564 * - index 0 has phandle `&n2`, which is `node-2`'s phandle
1565 * - index 1 has phandle `&n3`, which is `node-3`'s phandle
1572 * DT_PHANDLE_BY_IDX(N1, foo, 0) // node identifier for node-2
1573 * DT_PHANDLE_BY_IDX(N1, foo, 1) // node identifier for node-3
1576 * Behavior is analogous for phandle-arrays.
1585 * @param prop lowercase-and-underscores property name in @p node_id
1586 * with type `phandle`, `phandles` or `phandle-array`
1600 * @param prop lowercase-and-underscores property of @p node_id
1611 * @defgroup devicetree-ranges-prop ranges property
1627 * #address-cells = <3>;
1628 * #size-cells = <2>;
1672 * #address-cells = <3>;
1673 * #size-cells = <2>;
1721 * #address-cells = <2>;
1726 * #address-cells = <3>;
1727 * #size-cells = <2>;
1774 * #address-cells = <2>;
1779 * #address-cells = <3>;
1780 * #size-cells = <2>;
1814 * #address-cells = <2>;
1819 * #address-cells = <3>;
1820 * #size-cells = <2>;
1857 * for child bus flags cells when the node is a PCIe bus.
1863 * #address-cells = <2>;
1868 * #address-cells = <3>;
1869 * #size-cells = <2>;
1906 * for child bus flags cells when the node is a PCIe bus.
1912 * #address-cells = <2>;
1917 * #address-cells = <3>;
1918 * #size-cells = <2>;
1998 * @defgroup devicetree-generic-vendor Vendor and model name helpers
2010 * Example vendor-prefixes.txt:
2012 * vnd A stand-in for a real vendor
2013 * zephyr Zephyr-specific binding
2018 * n1: node-1 {
2026 * DT_NODE_VENDOR_BY_IDX(DT_NODELABEL(n1), 0) // "A stand-in for a real vendor"
2027 * DT_NODE_VENDOR_BY_IDX(DT_NODELABEL(n1), 2) // "Zephyr-specific binding"
2036 * @return string literal of the idx-th vendor
2066 * @return string literal of the idx-th vendor
2068 * @return string literal of the idx-th vendor or "default_value"
2090 * Example vendor-prefixes.txt:
2092 * vnd A stand-in for a real vendor
2093 * zephyr Zephyr-specific binding
2097 * n1: node-1 {
2112 * @return string literal of the idx-th model
2142 * @return string literal of the idx-th model
2144 * @return string literal of the idx-th model or "default_value"
2166 * @defgroup devicetree-reg-prop reg property
2198 * @return address of the idx-th register block
2212 * @return size of the idx-th register block
2227 * @brief 64-bit version of DT_REG_ADDR()
2229 * This macro version adds the appropriate suffix for 64-bit unsigned
2250 * @param name lowercase-and-underscores register specifier name
2257 * @brief 64-bit version of DT_REG_ADDR_BY_NAME()
2259 * This macro version adds the appropriate suffix for 64-bit unsigned
2265 * @param name lowercase-and-underscores register specifier name
2274 * @param name lowercase-and-underscores register specifier name
2285 * @defgroup devicetree-interrupts-prop interrupts property
2340 * @param name lowercase-and-underscores interrupt specifier name
2351 * "node->interrupts[index].cell".
2359 * my-serial: serial@abcd1234 {
2364 * Assuming the node's interrupt domain has "#interrupt-cells = <2>;" and
2365 * the individual cells in each interrupt specifier are named "irq" and
2371 * ------------- -----
2389 * `node->interrupts.name.cell`.
2396 * @param name lowercase-and-underscores interrupt specifier name
2429 * @defgroup devicetree-generic-chosen Chosen nodes
2438 * @param prop lowercase-and-underscores property name for
2446 * @param prop lowercase-and-underscores devicetree property
2457 * @defgroup devicetree-generic-foreach "For-each" macros
2477 * identifier for the node. The remaining are passed-in by the caller.
2505 * identifier for the node. The remaining are passed-in by the caller.
2529 * child-1 {
2532 * child-2 {
2572 * child-1 {
2575 * child-2 {
2593 * "child-1", "child-2"
2609 * identifier for the child node. The remaining are passed-in by the caller.
2628 * identifier for the child node. The remaining are passed-in by the caller.
2683 * identifier for the child node. The remaining are passed-in by the caller.
2705 * identifier for the child node. The remaining are passed-in by the caller.
2736 * my-ints = <1 2 3>;
2761 * fn(node_id, prop, 0) fn(node_id, prop, 1) [...] fn(node_id, prop, n-1)
2767 * @param prop lowercase-and-underscores property name
2782 * my-gpios = <&gpioa 0 GPIO_ACTICE_HIGH>,
2809 * @param prop lowercase-and-underscores property name
2827 * remaining arguments are passed-in by the caller.
2833 * @param prop lowercase-and-underscores property name
2850 * @param prop lowercase-and-underscores property name
2911 * @param compat lowercase-and-underscores devicetree compatible
2959 * @param compat lowercase-and-underscores devicetree compatible
2975 * @defgroup devicetree-generic-exist Existence checks
3008 * - exists in the devicetree, and
3009 * - has a status property matching the second argument
3036 * @param compat lowercase-and-underscores compatible, without quotes
3045 * @param compat lowercase-and-underscores compatible, without quotes
3059 * compatible = "vnd,specific-device", "generic-device";
3075 * @param compat lowercase-and-underscores compatible, without quotes
3093 * @param compat lowercase-and-underscores compatible, without quotes
3109 * @param prop lowercase-and-underscores property name
3119 * If this returns 1, then the phandle-array property @p pha has a cell
3125 * @param pha lowercase-and-underscores property with type `phandle-array`
3127 * @param cell lowercase-and-underscores cell name whose existence to check
3139 * @param pha lowercase-and-underscores property with type `phandle-array`
3140 * @param cell lowercase-and-underscores cell name whose existence to check
3153 * @defgroup devicetree-generic-bus Bus helpers
3172 * clock-frequency = < 100000 >;
3208 * temp: temperature-sensor@76 {
3209 * compatible = "vnd,some-sensor";
3224 * @param bus lowercase-and-underscores bus type as a C token (i.e.
3236 * @defgroup devicetree-inst Instance-based devicetree APIs
3271 * @param child lowercase-and-underscores child node name
3316 * identifier for the child node. The remaining are passed-in by the caller.
3334 * identifier for the child node. The remaining are passed-in by the caller.
3383 * identifier for the child node. The remaining are passed-in by the caller.
3399 * identifier for the child node. The remaining are passed-in by the caller.
3415 * @param prop lowercase-and-underscores property name
3416 * @return zero-based index of the property's value in its enum: list
3424 * @param prop lowercase-and-underscores property name
3426 * @return zero-based index of the property's value in its enum if present,
3436 * @param prop lowercase-and-underscores property name
3437 * @param value lowercase-and-underscores enumeration value
3446 * @param prop lowercase-and-underscores property name
3454 * @param prop lowercase-and-underscores property name
3463 * @param prop lowercase-and-underscores property name
3472 * @brief Is name @p name available in a `foo-names` property?
3474 * @param prop a lowercase-and-underscores `prop-names` type property
3475 * @param name a lowercase-and-underscores name to check
3485 * @param prop lowercase-and-underscores property name
3487 * @return a representation of the idx-th element of the property
3495 * @param prop lowercase-and-underscores property name
3505 * @param prop lowercase-and-underscores property name
3525 * @param prop lowercase-and-underscores property name
3535 * @param prop lowercase-and-underscores property name
3547 * @param prop lowercase-and-underscores property name
3554 * @brief Get an element out of string-array property as a token.
3556 * @param prop lowercase-and-underscores property name
3566 * @param prop lowercase-and-underscores property name
3574 * @brief Get an element out of string-array property as an unquoted sequence of tokens.
3576 * @param prop lowercase-and-underscores property name
3586 * @param ph lowercase-and-underscores property of @p inst
3588 * @param prop lowercase-and-underscores property of the phandle's node
3598 * @param phs lowercase-and-underscores property with type `phandle`,
3599 * `phandles`, or `phandle-array`
3602 * @param prop lowercase-and-underscores property of the phandle's node
3609 * @brief Get a `DT_DRV_COMPAT` instance's phandle-array specifier value at an index
3611 * @param pha lowercase-and-underscores property with type `phandle-array`
3622 * @param pha lowercase-and-underscores property with type `phandle-array`
3632 * @brief Get a `DT_DRV_COMPAT` instance's phandle-array specifier value
3635 * @param pha lowercase-and-underscores property with type `phandle-array`
3644 * @param pha lowercase-and-underscores property with type `phandle-array`
3653 * @brief Get a `DT_DRV_COMPAT` instance's value within a phandle-array
3656 * @param pha lowercase-and-underscores property with type `phandle-array`
3657 * @param name lowercase-and-underscores name of a specifier in @p pha
3667 * @param pha lowercase-and-underscores property with type `phandle-array`
3668 * @param name lowercase-and-underscores name of a specifier in @p pha
3680 * @param pha lowercase-and-underscores property with type `phandle-array`
3681 * @param name lowercase-and-underscores name of an element in @p pha
3691 * @param prop lowercase-and-underscores property name in @p inst
3692 * with type `phandle`, `phandles` or `phandle-array`
3703 * @param prop lowercase-and-underscores property of @p inst
3719 * @brief Get a `DT_DRV_COMPAT` instance's idx-th register block's address
3722 * @return address of the instance's idx-th register block
3727 * @brief Get a `DT_DRV_COMPAT` instance's idx-th register block's size
3730 * @return size of the instance's idx-th register block
3738 * @param name lowercase-and-underscores register specifier name
3745 * @brief 64-bit version of DT_INST_REG_ADDR_BY_NAME()
3747 * This macro version adds the appropriate suffix for 64-bit unsigned
3753 * @param name lowercase-and-underscores register specifier name
3762 * @param name lowercase-and-underscores register specifier name
3776 * @brief 64-bit version of DT_INST_REG_ADDR()
3778 * This macro version adds the appropriate suffix for 64-bit unsigned
3808 * @param name lowercase-and-underscores interrupt specifier name
3859 * @param name lowercase-and-underscores property name
3872 * @param name lowercase-and-underscores property name
3883 * @param name lowercase-and-underscores property name
3901 * temp: temperature-sensor@76 {
3902 * compatible = "vnd,some-sensor";
3915 * @param compat lowercase-and-underscores compatible, without quotes
3927 * This is a special-purpose macro which can be useful when writing
3935 * temp: temperature-sensor@76 {
3936 * compatible = "vnd,some-sensor";
3962 * @param prop lowercase-and-underscores property name
3969 * compatible = "vnd,some-sensor";
3977 * compatible = "vnd,some-sensor";
3984 * compatible = "vnd,some-sensor";
4100 * @param prop lowercase-and-underscores property name
4113 * @param prop lowercase-and-underscores property name
4129 * @param prop lowercase-and-underscores property name
4147 * @param prop lowercase-and-underscores property name
4162 * @param prop lowercase-and-underscores property name
4172 * @param pha lowercase-and-underscores property with type `phandle-array`
4185 * @param pha lowercase-and-underscores property with type `phandle-array`
4226 * @param name lowercase-and-underscores interrupt specifier name
4256 * since its macro-based API is fiddly and can be hard to get right.
4306 #include <zephyr/devicetree/io-channels.h>
4312 #include <zephyr/devicetree/fixed-partitions.h>
4317 #include <zephyr/devicetree/mbox.h>