Using the nRF52832 device with the S132-v3.0 soft-device (s132_nrf52_3.0.0_softdevice) and SDK version 12 (SDK120200F12) (Customized for our application, which includes use of the non-blocking SAADC and the Bluetooth UART service )
Please indicate the proper method for activating the PA and LNA pins - our use is for monitoring radio activity
I am having difficulty getting the LNA and PA GPIO pins setup correctly. Depending where I put the init routine, It seems there is activity, but the Bluetooth stops working...
Here is the routine I found on this site: Is there more then calling this routine to do to get this to work? Is this called before/after/during bluetooth is setup?
static void pa_lna_assist(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
{
ret_code_t err_code;
static const uint32_t gpio_toggle_ch = 0;
static const uint32_t ppi_set_ch = 0;
static const uint32_t ppi_clr_ch = 1;
// Configure SoftDevice PA/LNA assist
ble_opt_t opt;
memset(&opt, 0, sizeof(ble_opt_t));
{
ret_code_t err_code;
static const uint32_t gpio_toggle_ch = 0;
static const uint32_t ppi_set_ch = 0;
static const uint32_t ppi_clr_ch = 1;
// Configure SoftDevice PA/LNA assist
ble_opt_t opt;
memset(&opt, 0, sizeof(ble_opt_t));
// Common PA/LNA config
opt.common_opt.pa_lna.gpiote_ch_id = gpio_toggle_ch; // GPIOTE channel
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch; // PPI channel for pin clearing
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch; // PPI channel for pin setting
// PA config
opt.common_opt.pa_lna.pa_cfg.active_high = 1; // Set the pin to be active high
opt.common_opt.pa_lna.pa_cfg.enable = 1; // Enable toggling
opt.common_opt.pa_lna.pa_cfg.gpio_pin = gpio_pa_pin; // The GPIO pin to toggle
// LNA config
opt.common_opt.pa_lna.lna_cfg.active_high = 1; // Set the pin to be active high
opt.common_opt.pa_lna.lna_cfg.enable = 1; // Enable toggling
opt.common_opt.pa_lna.lna_cfg.gpio_pin = gpio_lna_pin; // The GPIO pin to toggle
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
}