This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

why pa_assist changed my NRF_GPIOTE->CONFIG[0] nterrupt configuration,Program can‘nt enter interrupt?

now,i have a problem,My interrupt configuration,

NRF_GPIOTE->CONFIG[0] =  (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)

                                           | (EXIT_PIN << GPIOTE_CONFIG_PSEL_Pos) 

                                         | (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);

that Equivalent to  NRF_GPIOTE->CONFIG[0] =0x00031f01,if i use the pa_assist(PA_TXEN, PA_RXEN_NONE);

this function changed my interrupt configuration to NRF_GPIOTE->CONFIG[0] =0x0;when pa_assist(PA_TXEN, PA_RXEN_NONE) wroks  NRF_GPIOTE->CONFIG[0] =0x31103, I just according 0x31103 find what it relation the pa_assist,so i don't use pa_assist(PA_TXEN, PA_RXEN_NONE), it works ok.

      so if i use pa_assist,my interrupt configuration is Invalid,you know why?

the below is my function,  PA_TXEN  is 17, EXIT_PIN   is 31

void pa_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 assist
ble_opt_t opt;
memset(&opt, 0, sizeof(ble_opt_t));
// Common PA config
opt.common_opt.pa_lna.gpiote_ch_id = gpio_toggle_ch; // GPIOTE channel
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_set_ch; // PPI channel for pin clearing
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_clr_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

// opt.common_opt.pa_lna.lna_cfg.active_high = 1;
// opt.common_opt.pa_lna.lna_cfg.enable = 1;
// 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);
}

my english is not good.

Thank you very much

Parents Reply Children
No Data
Related