From d8ee787dde287d1635b30a000025c0d0e6f1d84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Mon, 19 Feb 2024 15:17:10 +0000 Subject: [PATCH] semtech_cfg: Add trim cap callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enable setting value of the trim cap for semtech driver Signed-off-by: Robert Gałat --- subsys/config/common/src/app_subGHz_config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subsys/config/common/src/app_subGHz_config.c b/subsys/config/common/src/app_subGHz_config.c index 6ee2f2aeed..681b2d0c83 100644 --- a/subsys/config/common/src/app_subGHz_config.c +++ b/subsys/config/common/src/app_subGHz_config.c @@ -41,6 +41,7 @@ #define RADIO_SX1262_HP_MAX 0x07 #define RADIO_SX1262_DEVICE_SEL 0x00 #define RADIO_SX1262_PA_LUT 0x01 +#define RADIO_SX1262_DEFAULT_TRIM_CAP_VAL 0x1212 #define RADIO_RX_LNA_GAIN 0 #define RADIO_MAX_CAD_SYMBOL SID_PAL_RADIO_LORA_CAD_04_SYMBOL @@ -79,6 +80,12 @@ static int32_t radio_sx1262_pa_cfg(int8_t tx_power, radio_sx126x_pa_cfg_t *pa_cf return 0; } +static int32_t radio_sx1262_trim_val (uint16_t* trim_val) +{ + *trim_val = RADIO_SX1262_DEFAULT_TRIM_CAP_VAL; + return 0; +} + const radio_sx126x_regional_param_t radio_sx126x_regional_param[] = { #if defined (REGION_ALL) || defined (REGION_US915) @@ -114,6 +121,8 @@ static radio_sx126x_device_config_t radio_sx1262_cfg = { .ctrl = SX126X_TCXO_CTRL_NONE, }, + .trim_cap_val_callback = radio_sx1262_trim_val, + .regional_config = { .radio_region = RADIO_REGION, .reg_param_table_size = sizeof(radio_sx126x_regional_param) / sizeof(radio_sx126x_regional_param[0]),