EVK BMD-345 - User guide
UBX-19051533 - R01
Contents
Page 22 of 27
Figure 20: Change to BOARD_CUSTOM
Click OK on the Preprocessor Definitions and Options windows to close them.
Open custom_board.h and add the following lines:
// Pins required for BMD-345 PA / LNA
#define PA_RX_EN_PIN NRF_GPIO_PIN_MAP(1,6)
#define PA_TX_EN_PIN NRF_GPIO_PIN_MAP(1,5)
#define PA_MODE_PIN NRF_GPIO_PIN_MAP(1,4)
#define PA_A_SEL_PIN NRF_GPIO_PIN_MAP(1,2)
Any other custom pin definitions may be added in custom_board.h.
A small block of code needs to be added to the application to enable this feature. In main.c, add the
following function above the advertising_start() function:
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));
// Common PA / LNA config
// GPIOTE channel
opt.common_opt.pa_lna.gpiote_ch_id = gpio_toggle_ch;
// PPI channel for pin learing
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch;
// PPI channel for pin setting
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch;