1 /* 2 * Copyright (c) 2021 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /* 8 * This file contains helper macros for dealing with the devicetree 9 * radio node's fem property, in the case that it has compatible 10 * "generic-fem-two-ctrl-pins". 11 * 12 * Do not include it directly. 13 * 14 * For these devices: 15 * 16 * Value Property 17 * --------- -------- 18 * PA pin ctx-gpios 19 * PA offset ctx-settle-time-us 20 * LNA pin crx-gpios 21 * LNA offset crx-settle-time-us 22 */ 23 24 #define HAL_RADIO_GPIO_PA_PROP_NAME "ctx-gpios" 25 #define HAL_RADIO_GPIO_PA_OFFSET_PROP_NAME "ctx-settle-time-us" 26 #define HAL_RADIO_GPIO_LNA_PROP_NAME "crx-gpios" 27 #define HAL_RADIO_GPIO_LNA_OFFSET_PROP_NAME "crx-settle-time-us" 28 29 #if FEM_HAS_PROP(ctx_gpios) 30 #define HAL_RADIO_GPIO_HAVE_PA_PIN 1 31 #define HAL_RADIO_GPIO_PA_PROP ctx_gpios 32 33 #define HAL_RADIO_GPIO_PA_OFFSET_MISSING (!FEM_HAS_PROP(ctx_settle_time_us)) 34 #define HAL_RADIO_GPIO_PA_OFFSET \ 35 DT_PROP_OR(FEM_NODE, ctx_settle_time_us, 0) 36 #else /* !FEM_HAS_PROP(ctx_gpios) */ 37 #define HAL_RADIO_GPIO_PA_OFFSET_MISSING 0 38 #endif /* FEM_HAS_PROP(ctx_gpios) */ 39 40 #if FEM_HAS_PROP(crx_gpios) 41 #define HAL_RADIO_GPIO_HAVE_LNA_PIN 1 42 #define HAL_RADIO_GPIO_LNA_PROP crx_gpios 43 44 #define HAL_RADIO_GPIO_LNA_OFFSET_MISSING (!FEM_HAS_PROP(crx_settle_time_us)) 45 #define HAL_RADIO_GPIO_LNA_OFFSET \ 46 DT_PROP_OR(FEM_NODE, crx_settle_time_us, 0) 47 #else /* !FEM_HAS_PROP(crx_gpios) */ 48 #define HAL_RADIO_GPIO_LNA_OFFSET_MISSING 0 49 #endif /* FEM_HAS_PROP(crx_gpios) */ 50