Lines Matching +full:child +full:- +full:prop +full:- +full:3

4  * SPDX-License-Identifier: Apache-2.0
126 "vnd,gpio-device"), ""); in ZTEST()
127 zassert_true(!strcmp(DT_PROP_LAST(TEST_DEADBEEF, compatible), "vnd,gpio-device"), ""); in ZTEST()
140 "vnd,gpio-device"), ""); in ZTEST()
156 "vnd,gpio-device"), ""); in ZTEST()
169 "vnd,gpio-device"), ""); in ZTEST()
190 "vnd,gpio-device"), ""); in ZTEST()
199 "vnd,gpio-device"), ""); in ZTEST()
284 zassert_equal(DT_PROP_OR(TEST_REG, not_a_property, -1), -1, ""); in ZTEST()
286 zassert_equal(DT_PHA_BY_IDX_OR(TEST_TEMP, dmas, 1, channel, X), 3, ""); in ZTEST()
287 zassert_equal(DT_PHA_BY_IDX_OR(TEST_TEMP, dmas, 1, not_a_cell, -1), -1, in ZTEST()
291 zassert_equal(DT_PHA_OR(TEST_TEMP, dmas, not_a_cell, -1), -1, ""); in ZTEST()
295 zassert_equal(DT_PHA_BY_NAME_OR(TEST_TEMP, dmas, tx, not_a_cell, -1), in ZTEST()
296 -1, ""); in ZTEST()
302 zassert_equal(DT_INST_PROP_OR(0, not_a_property, -1), -1, ""); in ZTEST()
306 zassert_equal(DT_INST_PROP_LEN_OR(0, a, X), 3, ""); in ZTEST()
307 zassert_equal(DT_INST_PROP_LEN_OR(0, not_a_property, -1), -1, ""); in ZTEST()
311 zassert_equal(DT_INST_PHA_BY_IDX_OR(0, dmas, 1, channel, X), 3, ""); in ZTEST()
312 zassert_equal(DT_INST_PHA_BY_IDX_OR(0, dmas, 1, not_a_cell, -1), -1, in ZTEST()
316 zassert_equal(DT_INST_PHA_OR(0, dmas, not_a_cell, -1), -1, ""); in ZTEST()
320 zassert_equal(DT_INST_PHA_BY_NAME_OR(0, dmas, tx, not_a_cell, -1), -1, in ZTEST()
438 /* Test a nested I2C bus using vnd,i2c-mux. */ in ZTEST()
450 "expected TEST_SPI_NO_CS as bus for vnd,spi-device-2"); in ZTEST()
456 * either vnd,spi-device. in ZTEST()
548 #define VND_VENDOR "A stand-in for a real vendor which can be used in examples and tests"
549 #define ZEP_VENDOR "Zephyr-specific binding"
557 zassert_false(DT_NODE_VENDOR_HAS_IDX(TEST_VENDOR, 3), ""); in ZTEST()
567 zassert_is_null(DT_NODE_VENDOR_BY_IDX_OR(TEST_VENDOR, 3, NULL), ""); in ZTEST()
582 zassert_false(DT_NODE_MODEL_HAS_IDX(TEST_MODEL, 3), ""); in ZTEST()
592 zassert_is_null(DT_NODE_MODEL_BY_IDX_OR(TEST_MODEL, 3, NULL), ""); in ZTEST()
731 zassert_equal(DT_NUM_IRQS(TEST_SPI), 3, ""); in ZTEST()
737 zassert_false(DT_IRQ_HAS_IDX(TEST_SPI_BUS_0, 3), ""); in ZTEST()
750 zassert_equal(DT_IRQ_BY_IDX(TEST_SPI_BUS_0, 0, priority), 3, ""); in ZTEST()
812 zassert_equal(DT_INST_NUM_IRQS(0), 3); in ZTEST()
818 zassert_equal(DT_INST_IRQ_HAS_IDX(0, 3), 0, ""); in ZTEST()
824 zassert_equal(DT_INST_IRQ_BY_IDX(0, 0, priority), 3, ""); in ZTEST()
832 zassert_equal(DT_INST_IRQ_BY_NAME(0, err, priority), 3, ""); in ZTEST()
838 zassert_equal(DT_INST_IRQ(0, priority), 3, ""); in ZTEST()
921 #define CLOCK_FREQUENCY_AND_COMMA(node_id, prop, idx) \ argument
922 DT_PROP_BY_PHANDLE_IDX(node_id, prop, idx, clock_frequency),
925 #define DT_GPIO_ELEM(idx, node_id, prop) \ argument
927 DT_PHA_BY_IDX(node_id, prop, idx, pin),\
928 DT_PHA_BY_IDX(node_id, prop, idx, flags),\
930 #define DT_GPIO_LISTIFY(node_id, prop) \ argument
931 { LISTIFY(DT_PROP_LEN(node_id, prop), DT_GPIO_ELEM, (,), \
932 node_id, prop) }
969 /* DT_PROP_BY_PHANDLE_IDX on a phandle-array type property */ in ZTEST()
985 /* phandle-array */ in ZTEST()
998 zassert_false(DT_PROP_HAS_NAME(TEST_PH, foos, b-c), ""); in ZTEST()
1005 /* pha-gpios index 1 has nothing, not even a phandle */ in ZTEST()
1014 /* index 3 has both pin and flags cells*/ in ZTEST()
1015 zassert_true(DT_PHA_HAS_CELL_AT_IDX(TEST_PH, pha_gpios, 3, pin), ""); in ZTEST()
1016 zassert_true(DT_PHA_HAS_CELL_AT_IDX(TEST_PH, pha_gpios, 3, flags), ""); in ZTEST()
1087 zassert_false(DT_INST_PROP_HAS_NAME(0, foos, b-c), ""); in ZTEST()
1101 /* index 3 has both pin and flags */ in ZTEST()
1102 zassert_true(DT_INST_PHA_HAS_CELL_AT_IDX(0, pha_gpios, 3, pin), ""); in ZTEST()
1103 zassert_true(DT_INST_PHA_HAS_CELL_AT_IDX(0, pha_gpios, 3, flags), ""); in ZTEST()
1174 zassert_equal(DT_GPIO_HOG_PIN_BY_IDX(TEST_GPIO_HOG_2, 0), 3, ""); in ZTEST()
1306 zassert_equal(DT_DMAS_CELL_BY_NAME(TEST_TEMP, rx, channel), 3, ""); in ZTEST()
1307 zassert_equal(DT_INST_DMAS_CELL_BY_NAME(0, rx, channel), 3, ""); in ZTEST()
1311 zassert_equal(DT_DMAS_CELL_BY_IDX(TEST_TEMP, 1, channel), 3, ""); in ZTEST()
1312 zassert_equal(DT_INST_DMAS_CELL_BY_IDX(0, 1, channel), 3, ""); in ZTEST()
1427 zassert_equal(DT_PWMS_CELL_BY_NAME(TEST_PH, red, flags), 3, ""); in ZTEST()
1432 zassert_equal(DT_PWMS_CELL(TEST_PH, flags), 3, ""); in ZTEST()
1459 zassert_equal(DT_PWMS_FLAGS(TEST_PH), 3, ""); in ZTEST()
1492 zassert_equal(DT_INST_PWMS_CELL(0, flags), 3, ""); in ZTEST()
1516 zassert_equal(DT_INST_PWMS_FLAGS_BY_NAME(0, red), 3, ""); in ZTEST()
1519 zassert_equal(DT_INST_PWMS_FLAGS(0), 3, ""); in ZTEST()
1550 zassert_equal(DT_INST_CAN_TRANSCEIVER_MIN_BITRATE(3, 0), 0, ""); in ZTEST()
1551 zassert_equal(DT_INST_CAN_TRANSCEIVER_MIN_BITRATE(3, 30000), 30000, ""); in ZTEST()
1552 zassert_equal(DT_INST_CAN_TRANSCEIVER_MIN_BITRATE(3, 40000), 40000, ""); in ZTEST()
1578 zassert_equal(DT_INST_CAN_TRANSCEIVER_MAX_BITRATE(3, 125000), 125000, ""); in ZTEST()
1579 zassert_equal(DT_INST_CAN_TRANSCEIVER_MAX_BITRATE(3, 1000000), 1000000, ""); in ZTEST()
1580 zassert_equal(DT_INST_CAN_TRANSCEIVER_MAX_BITRATE(3, 5000000), 1000000, ""); in ZTEST()
1613 zassert_equal(ARRAY_SIZE(a), 3, ""); in ZTEST()
1624 zassert_false(DT_PROP_HAS_IDX(TEST_ARRAYS, a, 3), ""); in ZTEST()
1635 COND_CODE_0(DT_PROP_HAS_IDX(TEST_ARRAYS, a, 3), (ok = 1;), ()); in ZTEST()
1643 zassert_equal(DT_PROP_LEN(TEST_ARRAYS, a), 3, ""); in ZTEST()
1648 zassert_equal(b[3], 0xdd, ""); in ZTEST()
1653 zassert_true(DT_PROP_HAS_IDX(TEST_ARRAYS, b, 3), ""); in ZTEST()
1659 zassert_equal(DT_PROP_BY_IDX(TEST_ARRAYS, b, 3), b[3], ""); in ZTEST()
1710 * For-each-node type macro tests. in ZTEST()
1713 * for-each-property type macros. in ZTEST()
1720 * "/test/enum-0" "/test/enum-1" in ZTEST()
1726 zassert_true(!strcmp(str, "/test/enum-0/test/enum-1") || in ZTEST()
1727 !strcmp(str, "/test/enum-1/test/enum-0"), ""); in ZTEST()
1733 * 0 + 2 + 3 in ZTEST()
1738 val = DT_FOREACH_STATUS_OKAY_VARGS(vnd_enum_holder, MY_FN, +) 3; in ZTEST()
1745 * 0 + 2 + 3 in ZTEST()
1750 val = DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(vnd_enum_holder, MY_FN, +) 3; in ZTEST()
1807 zassert_equal(test_gpio_1_added, 3, ""); in ZTEST()
1812 zassert_equal(ARRAY_SIZE(nodelabels), 3); in ZTEST()
1818 zassert_equal(DT_NUM_NODELABELS(DT_NODELABEL(test_nodelabel)), 3, ""); in ZTEST()
1848 #define TIMES_TWO(node_id, prop, idx) \ in ZTEST() argument
1849 (2 * DT_PROP_BY_IDX(node_id, prop, idx)), in ZTEST()
1850 #define BY_IDX_COMMA(node_id, prop, idx) DT_PROP_BY_IDX(node_id, prop, idx), in ZTEST() argument
1856 zassert_equal(ARRAY_SIZE(array_a), 3, ""); in ZTEST()
1869 zassert_equal(array_b[3], 2 * 0xDD, ""); in ZTEST()
1895 #define PATH_COMMA(node_id, prop, idx) \ in ZTEST() argument
1896 DT_NODE_PATH(DT_PROP_BY_IDX(node_id, prop, idx)), in ZTEST()
1923 #define PIN_COMMA(node_id, prop, idx) DT_GPIO_PIN_BY_IDX(node_id, prop, idx), in ZTEST() argument
1939 zassert_equal(ARRAY_SIZE(array_sep), 3, ""); in ZTEST()
1969 #define TIMES_TWO_ADD(node_id, prop, idx, arg) \ in ZTEST() argument
1970 ((2 * DT_PROP_BY_IDX(node_id, prop, idx)) + arg), in ZTEST()
1973 DT_FOREACH_PROP_ELEM_VARGS(TEST_ARRAYS, a, TIMES_TWO_ADD, 3) in ZTEST()
1976 zassert_equal(ARRAY_SIZE(array), 3, ""); in ZTEST()
1981 #define PROP_PLUS_ARG(node_id, prop, idx, arg) \ in ZTEST() argument
1982 (DT_PROP_BY_IDX(node_id, prop, idx) + arg) in ZTEST()
1986 (,), 3) in ZTEST()
1989 zassert_equal(ARRAY_SIZE(array_sep), 3, ""); in ZTEST()
1998 DT_INST_FOREACH_PROP_ELEM_VARGS(0, a, TIMES_TWO_ADD, 3) in ZTEST()
2008 3) in ZTEST()
2030 struct test_gpio_data *data = dev->data; in test_gpio_init()
2032 data->init_called = 1; in test_gpio_init()
2071 data_dev0 = devs[0]->data; in ZTEST()
2072 data_dev1 = devs[1]->data; in ZTEST()
2077 zassert_true(data_dev0->is_gpio_ctlr, ""); in ZTEST()
2078 zassert_true(data_dev1->is_gpio_ctlr, ""); in ZTEST()
2079 zassert_true(data_dev0->init_called, ""); in ZTEST()
2080 zassert_true(data_dev1->init_called, ""); in ZTEST()
2083 config_abdc = dev_abcd->config; in ZTEST()
2085 zassert_equal(config_abdc->reg_addr, 0xabcd1234, ""); in ZTEST()
2086 zassert_equal(config_abdc->reg_len, 0x500, ""); in ZTEST()
2095 zassert_equal(DT_SPI_NUM_CS_GPIOS(TEST_SPI), 3, ""); in ZTEST()
2133 /* DT_ENUM_IDX_BY_IDX and DT_ENUM_HAS_VALUE_BY_IDX on string-array enum */ in ZTEST()
2135 zassert_equal(DT_ENUM_IDX_BY_IDX(DT_NODELABEL(test_enum_string_array), val, 1), 3); in ZTEST()
2150 /* DT_ENUM_IDX_BY_IDX and DT_ENUM_HAS_VALUE_BY_IDX on int-array enum */ in ZTEST()
2151 zassert_equal(DT_ENUM_IDX_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 0), 3); in ZTEST()
2153 zassert_equal(DT_ENUM_IDX_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 2), 3); in ZTEST()
2154 zassert_equal(DT_ENUM_IDX_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 3), 7); in ZTEST()
2158 zassert_true(DT_ENUM_HAS_VALUE_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 1, 3)); in ZTEST()
2162 zassert_false(DT_ENUM_HAS_VALUE_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 2, 3)); in ZTEST()
2164 zassert_true(DT_ENUM_HAS_VALUE_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 3, 0)); in ZTEST()
2165 zassert_false(DT_ENUM_HAS_VALUE_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 3, 2)); in ZTEST()
2166 zassert_false(DT_ENUM_HAS_VALUE_BY_IDX(DT_NODELABEL(test_enum_int_array), val, 3, 1)); in ZTEST()
2185 /* DT_ENUM_IDX_OR on string-array value */ in ZTEST()
2190 /* DT_ENUM_IDX_OR on int-array value */ in ZTEST()
2193 3, ""); in ZTEST()
2224 zassert_equal(DT_INST_ENUM_IDX_BY_IDX(0, val, 1), 3, ""); in ZTEST()
2234 zassert_equal(DT_INST_ENUM_IDX_BY_IDX(0, val, 0), 3, ""); in ZTEST()
2235 zassert_equal(DT_INST_ENUM_IDX_BY_IDX(0, val, 3), 7, ""); in ZTEST()
2257 zassert_equal(DT_NUM_CLOCKS(TEST_TEMP), 3, ""); in ZTEST()
2261 zassert_false(DT_CLOCKS_HAS_IDX(TEST_TEMP, 3), ""); in ZTEST()
2277 zassert_equal(DT_CLOCKS_CELL(TEST_TEMP, bus), 3, ""); in ZTEST()
2279 /* clock-freq on fixed clock */ in ZTEST()
2300 zassert_equal(DT_INST_NUM_CLOCKS(0), 3, ""); in ZTEST()
2304 zassert_false(DT_INST_CLOCKS_HAS_IDX(0, 3), ""); in ZTEST()
2320 zassert_equal(DT_INST_CLOCKS_CELL(0, bus), 3, ""); in ZTEST()
2322 /* clock-freq on fixed clock */ in ZTEST()
2335 * The parent's label for the first instance of vnd,spi-device, in ZTEST()
2336 * child of TEST_SPI, is the same as TEST_SPI. in ZTEST()
2365 zassert_equal(ARRAY_SIZE(vals_a), 3, ""); in ZTEST()
2401 #define TEST_FUNC(child) { DT_PROP(child, val) } in ZTEST() argument
2402 #define TEST_FUNC_AND_COMMA(child) TEST_FUNC(child), in ZTEST() argument
2441 zassert_equal(ARRAY_SIZE(vals), 3, ""); in ZTEST()
2442 zassert_equal(ARRAY_SIZE(vals_sep), 3, ""); in ZTEST()
2443 zassert_equal(ARRAY_SIZE(vals_inst), 3, ""); in ZTEST()
2444 zassert_equal(ARRAY_SIZE(vals_inst_sep), 3, ""); in ZTEST()
2480 #define TEST_FUNC(child, arg) { DT_PROP(child, val) + arg } in ZTEST() argument
2481 #define TEST_FUNC_AND_COMMA(child, arg) TEST_FUNC(child, arg), in ZTEST() argument
2520 zassert_equal(ARRAY_SIZE(vals), 3, ""); in ZTEST()
2521 zassert_equal(ARRAY_SIZE(vals_sep), 3, ""); in ZTEST()
2522 zassert_equal(ARRAY_SIZE(vals_inst), 3, ""); in ZTEST()
2523 zassert_equal(ARRAY_SIZE(vals_inst_sep), 3, ""); in ZTEST()
2531 zassert_equal(vals[2].val, 3, ""); in ZTEST()
2534 zassert_equal(vals_sep[2].val, 3, ""); in ZTEST()
2537 zassert_equal(vals_inst[2].val, 3, ""); in ZTEST()
2540 zassert_equal(vals_inst_sep[2].val, 3, ""); in ZTEST()
2559 zassert_equal(DT_CHILD_NUM(TEST_CHILDREN), 3, ""); in ZTEST()
2560 zassert_equal(DT_INST_CHILD_NUM(0), 3, ""); in ZTEST()
2600 zassert_equal(count, 3, ""); in ZTEST()
2605 zassert_equal(DT_RANGES_HAS_IDX(TEST_RANGES_PCIE, 3), 0, ""); in ZTEST()
2613 zassert_equal(DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(TEST_RANGES_PCIE, 3), in ZTEST()
2666 zassert_equal(DT_RANGES_HAS_IDX(TEST_RANGES_OTHER, 3), 0, ""); in ZTEST()
2671 zassert_equal(HAS_FLAGS(TEST_RANGES_OTHER, 3), 0, ""); in ZTEST()
2798 * Combined ordinals for /test/test-children are from in ZTEST()
2824 "test-children at %zu", i); in ZTEST()
2829 * Combined ordinals for /test/test-children/child-a in ZTEST()
2851 "child-a at %zu", i); in ZTEST()
2870 zassert_equal(ARRAY_SIZE(inst_supports), 3, ""); in ZTEST()
2884 * We go through the STRINGIFY()->atoi conversion cycle to avoid in ZTEST()
2911 "temperature-sensor"), ""); in ZTEST()
2913 "reg-holder"), ""); in ZTEST()
2965 zassert_equal(DT_NUM_PINCTRL_STATES(TEST_TEMP), 3, ""); in ZTEST()
2970 zassert_equal(DT_PINCTRL_HAS_IDX(TEST_TEMP, 3), 0, ""); in ZTEST()
2989 MAKE_TOKEN(3) = 13, in ZTEST()
2994 MAKE_UPPER_TOKEN(3) = 23, in ZTEST()
3033 zassert_equal(DT_INST_NUM_PINCTRL_STATES(0), 3, ""); in ZTEST()
3038 zassert_equal(DT_INST_PINCTRL_HAS_IDX(0, 3), 0, ""); in ZTEST()
3189 zassert_between_inclusive(ids[i], 0, ARRAY_SIZE(ids) - 1, ""); in ZTEST()
3336 zassert_equal(DT_STRING_TOKEN_BY_IDX(DT_NODELABEL(test_str_array_token_1), val, 3), in ZTEST()
3351 zassert_equal(DT_STRING_UPPER_TOKEN_BY_IDX(DT_NODELABEL(test_str_array_token_1), val, 3), in ZTEST()
3410 const double f1_expected = 0.9e-3; in ZTEST()
3411 const double delta = 0.1e-4; in ZTEST()
3501 #define XMINUS - in ZTEST()
3504 const double delta = 0.1e-4; in ZTEST()
3513 zassert_within(DT_STRING_UNQUOTED_BY_IDX(DT_NODELABEL(test_stra_unquoted_f0), val, 3), in ZTEST()
3522 zassert_within(DT_STRING_UNQUOTED_BY_IDX(DT_NODELABEL(test_stra_unquoted_f1), val, 3), in ZTEST()
3531 zassert_within(DT_STRING_UNQUOTED_BY_IDX(DT_NODELABEL(test_stra_unquoted_t), val, 3), in ZTEST()
3545 DT_INST_STRING_UNQUOTED_BY_IDX(inst, val, 3), \ in ZTEST()
3555 zassert_within(STRING_UNQUOTED_BY_IDX_VAR(DT_NODELABEL(test_stra_unquoted_f0))[3], in ZTEST()
3564 zassert_within(STRING_UNQUOTED_BY_IDX_VAR(DT_NODELABEL(test_stra_unquoted_f1))[3], in ZTEST()
3573 zassert_within(STRING_UNQUOTED_BY_IDX_VAR(DT_NODELABEL(test_stra_unquoted_t))[3], in ZTEST()
3600 zassert_str_equal(DT_PROP_BY_IDX(DT_NODELABEL(test_stra_escape), val, 3), "\x01\x7F"); in ZTEST()
3630 /* reg-width on reset */ in ZTEST()
3659 /* reg-width on reset */ in ZTEST()