Hardware:
Custom DA14683 Board
Latest SDK = 1.0.14.1081 (Last updated in 2018)
Situation:
This question applies to any demo, but lets take the BMS demo for an example.
From hw_rf.h, I can see where the tx power levels are defined in this enum:
typedef enum { HW_RF_PWR_LUT_0dbm = 0, /**< TX PWR attenuation 0 dbm */ HW_RF_PWR_LUT_m1dbm = 1, /**< TX PWR attenuation -1 dbm */ HW_RF_PWR_LUT_m2dbm = 2, /**< TX PWR attenuation -2 dbm */ HW_RF_PWR_LUT_m3dbm = 3, /**< TX PWR attenuation -3 dbm */ HW_RF_PWR_LUT_m4dbm = 4, /**< TX PWR attenuation -4 dbm */ } HW_RF_PWR_LUT_SETTING;
From hw_rf.c, I can see the function that sets the TX power level:
void hw_rf_set_tx_power_ble(HW_RF_PWR_LUT_SETTING lut) { RFCU->RF_TX_PWR_BLE_REG = lut; rf_tx_power_luts.tx_power_ble = lut; }
...But the "hw_rf_set_tx_power_ble()" function does not appear to be called anywhere.
...Also none of the enums from "HW_RF_PWR_LUT_SETTING" appear anywhere in the project.
It is unclear where the TX power is being defined. It is also unclear at what point in the power up sequence the TX power is being set.
Questions:
1) Where is the default TX Power level defined? (file and line please)
2) At what point in the BLE radio initialization sequence is the TX power level set? (file and line please)
3) If I wanted to change the BLE radio TX power level, what is the correct sequence of operations to do so? (do I need to power down the radio first?, just stop advertising?, etc)