Lines Matching +full:prop +full:- +full:2
3 * SPDX-License-Identifier: Apache-2.0
19 * @brief Get a PSEL value out of a foo-gpios or foo-pin devicetree property
21 * Many Nordic bindings have 'foo-pin' properties to specify a pin
22 * configuration as a PSEL value directly instead of using a 'foo-gpios'
25 * It would be better to use 'foo-gpios' properties instead. This type
28 * To allow for a smooth migration from 'foo-pin' to 'foo-gpios', this
30 * using whichever one of 'foo-gpios' or 'foo-pin' is in the DTS.
34 * - NRF_DT_PSEL_CHECK_*() to check the property configuration at build time
35 * - NRF_DT_GPIOS_TO_PSEL() if you only have a 'foo-gpios'
38 * @param psel_prop lowercase-and-underscores old-style 'foo-pin' property
39 * @param gpios_prop new-style 'foo-gpios' property
56 * 'node_id' has both a legacy psel-style property and a gpios
62 * @param psel_prop lowercase-and-underscores PSEL style property
63 * @param psel_prop_name human-readable string name of psel_prop
64 * @param gpios_prop lowercase-and-underscores foo-gpios style property
65 * @param gpio_prop_name human-readable string name of gpios_prop
76 "Note: you can use /delete-property/ to delete properties.")
92 "Note: you can use /delete-property/ to delete properties.")
101 * Bit number 5 4 3 2 1 0
110 * - pin P0.4 has "PSEL value" 4 (B=0 and A=4)
111 * - pin P1.5 has "PSEL value" 37 (B=1 and A=5)
121 * foo: my-node {
122 * tx-gpios = <&gpio0 4 ...>;
123 * rx-gpios = <&gpio0 5 ...>, <&gpio1 5 ...>;
129 #define NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, idx) \ argument
130 ((DT_PROP_BY_PHANDLE_IDX(node_id, prop, idx, port) << 5) | \
131 (DT_GPIO_PIN_BY_IDX(node_id, prop, idx) & 0x1F))
135 * @brief Equivalent to NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, 0)
137 #define NRF_DT_GPIOS_TO_PSEL(node_id, prop) \ argument
138 NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, 0)
142 * NRF_DT_GPIOS_TO_PSEL(node_id, prop). The default_value argument is
147 #define NRF_DT_GPIOS_TO_PSEL_OR(node_id, prop, default_value) \ argument
148 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
149 (NRF_DT_GPIOS_TO_PSEL(node_id, prop)), \
156 * To handle this, we use the "gpiote-instance" property of the GPIO node.
172 * gpiote-instance = <&gpiote0>;
176 * gpiote-instance = <&gpiote20>;
179 * foo: my-node {
180 * tx-gpios = <&gpio0 4 ...>;
181 * rx-gpios = <&gpio0 5 ...>, <&gpio1 5 ...>;
187 #define NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, idx) \ argument
188 DT_PROP(DT_PHANDLE(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx), \
193 * @brief Equivalent to NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, 0)
195 #define NRF_DT_GPIOTE_INST(node_id, prop) \ argument
196 NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, 0)
199 * Error out the build if 'prop' is set on node 'node_id' and
200 * DT_GPIO_CTLR(node_id, prop) is not an SoC GPIO controller,
201 * i.e. a node with compatible "nordic,nrf-gpio".
206 * @param prop lowercase-and-underscores PSEL style property
207 * @param prop_name human-readable string name for 'prop'
209 #define NRF_DT_CHECK_GPIO_CTLR_IS_SOC(node_id, prop, prop_name) \ argument
210 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
212 DT_GPIO_CTLR(node_id, prop), \
218 "with compatible nordic,nrf-gpio; " \
221 prop)) \
229 * Error out the build if CONFIG_PM_DEVICE=y and pinctrl-1 state (sleep) is not