Delegate RF Front End and Bias settings to board.h

This commit is contained in:
George Oikonomou 2016-11-06 17:07:17 +00:00
parent d6e8e7dab4
commit d9ea888323
5 changed files with 51 additions and 2 deletions

View File

@ -471,6 +471,8 @@ rf_radio_setup()
cmd.txPower = tx_power_current->tx_power;
cmd.pRegOverride = ieee_overrides;
cmd.config.frontEndMode = RF_CORE_RADIO_SETUP_FRONT_END_MODE;
cmd.config.biasMode = RF_CORE_RADIO_SETUP_BIAS_MODE;
cmd.mode = 1;
/* Send Radio setup to RF Core */

View File

@ -371,6 +371,12 @@ prop_div_radio_setup(void)
/* Update to the correct TX power setting */
smartrf_settings_cmd_prop_radio_div_setup.txPower = tx_power_current->tx_power;
/* Adjust RF Front End and Bias based on the board */
smartrf_settings_cmd_prop_radio_div_setup.config.frontEndMode =
RF_CORE_PROP_FRONT_END_MODE;
smartrf_settings_cmd_prop_radio_div_setup.config.biasMode =
RF_CORE_PROP_BIAS_MODE;
/* Send Radio setup to RF Core */
if(rf_core_send_cmd((uint32_t)cmd, &cmd_status) != RF_CORE_CMD_OK) {
PRINTF("prop_div_radio_setup: DIV_SETUP, CMDSTA=0x%08lx, status=0x%04x\n",

View File

@ -215,6 +215,8 @@ rf_radio_setup()
cmd.txPower = tx_power;
cmd.pRegOverride = ble_overrides;
cmd.config.frontEndMode = RF_CORE_RADIO_SETUP_FRONT_END_MODE;
cmd.config.biasMode = RF_CORE_RADIO_SETUP_BIAS_MODE;
cmd.mode = 0;
/* Send Radio setup to RF Core */

View File

@ -64,6 +64,45 @@
#define RF_CORE_CHANNEL 25
#endif /* RF_CORE_CONF_IEEE_MODE_CHANNEL */
/*---------------------------------------------------------------------------*/
#define RF_CORE_FRONT_END_MODE_DIFFERENTIAL 0
#define RF_CORE_FRONT_END_MODE_SINGLE_RFP 1
#define RF_CORE_FRONT_END_MODE_SINGLE_RFN 2
#define RF_CORE_BIAS_MODE_INTERNAL 0
#define RF_CORE_BIAS_MODE_EXTERNAL 1
/*---------------------------------------------------------------------------*/
/*
* RF Front-End Mode and Bias for CMD_RADIO_SETUP (IEEE and BLE)
* Default: Differential mode, internal bias
*/
#ifdef RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE
#define RF_CORE_RADIO_SETUP_FRONT_END_MODE RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE
#else
#define RF_CORE_RADIO_SETUP_FRONT_END_MODE RF_CORE_FRONT_END_MODE_DIFFERENTIAL
#endif
#ifdef RF_CORE_CONF_RADIO_SETUP_BIAS_MODE
#define RF_CORE_RADIO_SETUP_BIAS_MODE RF_CORE_CONF_RADIO_SETUP_BIAS_MODE
#else
#define RF_CORE_RADIO_SETUP_BIAS_MODE RF_CORE_BIAS_MODE_INTERNAL
#endif
/*---------------------------------------------------------------------------*/
/*
* RF Front-End Mode and Bias for CMD_PROP_DIV_RADIO_SETUP (PROP mode)
* Default: Differential mode, external bias
*/
#ifdef RF_CORE_CONF_PROP_FRONT_END_MODE
#define RF_CORE_PROP_FRONT_END_MODE RF_CORE_CONF_PROP_FRONT_END_MODE
#else
#define RF_CORE_PROP_FRONT_END_MODE RF_CORE_FRONT_END_MODE_DIFFERENTIAL
#endif
#ifdef RF_CORE_CONF_PROP_BIAS_MODE
#define RF_CORE_PROP_BIAS_MODE RF_CORE_CONF_PROP_BIAS_MODE
#else
#define RF_CORE_PROP_BIAS_MODE RF_CORE_BIAS_MODE_EXTERNAL
#endif
/*---------------------------------------------------------------------------*/
#define RF_CORE_CMD_ERROR 0
#define RF_CORE_CMD_OK 1
/*---------------------------------------------------------------------------*/

View File

@ -137,8 +137,8 @@ rfc_CMD_PROP_RADIO_DIV_SETUP_t smartrf_settings_cmd_prop_radio_div_setup =
/* 7: .4g mode with dynamic whitening and CRC choice */
.formatConf.whitenMode = 0x7,
.config.frontEndMode = 0x0, /* Differential mode */
.config.biasMode = 0x1, /* External bias*/
.config.frontEndMode = 0x00, /* Set by the driver */
.config.biasMode = 0x00, /* Set by the driver */
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x00, /* Driver sets correct value */