EVK BMD-345 - User guide
UBX-19051533 - R01
Contents
Page 23 of 27
// PA config
// Set the pin to be active high
opt.common_opt.pa_lna.pa_cfg.active_high = 1;
// Enable toggling
opt.common_opt.pa_lna.pa_cfg.enable = 1;
// The GPIO pin to toggle
opt.common_opt.pa_lna.pa_cfg.gpio_pin = gpio_pa_pin;
// LNA config
// Set the pin to be active high
opt.common_opt.pa_lna.lna_cfg.active_high = 1;
// Enable toggling
opt.common_opt.pa_lna.lna_cfg.enable = 1;
// The GPIO pin to toggle
opt.common_opt.pa_lna.lna_cfg.gpio_pin = gpio_lna_pin;
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
}
Modify the advertising_start() function to include control configuration:
static void advertising_start(void)
{
ret_code_t err_code;
//Insert the following code before calling scan_start() or advertising_start ()
/*------------------------------------------------------------------------*/
//Set PA / LNA Mode Pin: Low for Normal operation
nrf_gpio_cfg_output(PA_MODE_PIN);
nrf_gpio_pin_clear(PA_MODE_PIN);
//Set PA / LNA Select Pin: low for U.FL
nrf_gpio_cfg_output(PA_A_SEL_PIN);
nrf_gpio_pin_clear(PA_A_SEL_PIN);
//Setup PA / LNA TX and RX control pins with the SoftDevice
pa_lna_assist(PA_TX_EN_PIN,PA_RX_EN_PIN);
//Set TX power for scan responses
sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0,
RADIO_TXPOWER_TXPOWER_Neg20dBm);
//Set TX power for advertisements
sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, 0,
RADIO_TXPOWER_TXPOWER_Neg20dBm);
//Tx power setting for connections inherit the scan or advertising power setting
/*-------------------------------------------------------------------------*/
err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
APP_ERROR_CHECK(err_code);
bsp_board_led_on(ADVERTISING_LED);
}
3.3.2
Example test
Click the “build” icon or press
<F7>
to compile the example and ensure there are no errors.
Download the example to the BMD-345-Eval board, then press the RESET button on the board. The
BMD-345 will illuminate LED1 and start advertising “Nordic_Blinky”.
A logic analyzer or oscilloscope may be used to observe the control signals. Test points are located
near the BMD-345: