BLE 5, Thread, Zigbee Modules, BT840/F/E/X/XE
Ver 1.16 Dec.. 2019
ret_code_t err_code;
memset(&opt, 0, sizeof(ble_opt_t));
err_code = nrf_drv_gpiote_init();
if(err_code != NRF_ERROR_INVALID_STATE)
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_init();
//if(err_code != MODULE_ALREADY_INITIALIZED)
APP_ERROR_CHECK(err_code);
nrf_ppi_channel_t ppi_set_ch;
nrf_ppi_channel_t ppi_clr_ch;
err_code = nrf_drv_ppi_channel_alloc(&ppi_set_ch);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_alloc(&ppi_clr_ch);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(false);
if((gpio_pa_pin == NULL) && (gpio_lna_pin == NULL))
{
err_code = NRF_ERROR_INVALID_PARAM;
APP_ERROR_CHECK(err_code);
}
if(gpio_pa_pin != NULL)
{
if(gpiote_ch == NULL)
{
err_code = nrf_drv_gpiote_out_init(gpio_pa_pin, &config);
APP_ERROR_CHECK(err_code);
gpiote_ch = nrf_drv_gpiote_out_task_addr_get(gpio_pa_pin);
}
// 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 tx
}
if(gpio_lna_pin != NULL)
{
if(gpiote_ch == NULL)
{
err_code = nrf_drv_gpiote_out_init(gpio_lna_pin, &config);
APP_ERROR_CHECK(err_code);
20
Содержание BlurNor BT840 Series
Страница 10: ...BLE 5 Thread Zigbee Modules BT840 F E X XE Ver 1 16 Dec 2019 BT840 and BT840E mechanical drawings top view 10 ...
Страница 11: ...BLE 5 Thread Zigbee Modules BT840 F E X XE Ver 1 16 Dec 2019 BT840X and BT840XE mechanical drawings 11 ...
Страница 13: ...BLE 5 Thread Zigbee Modules BT840 F E X XE Ver 1 16 Dec 2019 BT840F pin assignments 13 ...