Skip to content

Commit

Permalink
semtech_cfg: Add trim cap callback
Browse files Browse the repository at this point in the history
enable setting value of the trim cap for semtech driver

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Feb 20, 2024
1 parent 389f338 commit d8ee787
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions subsys/config/common/src/app_subGHz_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]),
Expand Down

0 comments on commit d8ee787

Please sign in to comment.