how can nrf51822 make 2.4G communication and BLE communication arbitrary switch?
how can nrf51822 make 2.4G communication and BLE communication arbitrary switch?
2.4G communication
The nRF5 always work at 2.4GHz - do you mean switching between BLE and some other protocol (both at 2.4GHz) ?
No, the nRF5 always work at BLE,then i want to switch the 2.4G any time。I mean switching between BLE and 2.4G.
switching between BLE and 2.4G
that makes no sense - BLE is 2.4GHz.
https://en.wikipedia.org/wiki/Bluetooth_Low_Energy#Technical_details
what is the meaning of "makes no sense - BLE is 2.4GHz"? I mean the function of BLE and 2.4GHz can used to work together. The example of "/proprietary_rf/esb_ptx" in SDK12.1 can used in the example of "ble_uart_app".
what is the meaning of "makes no sense - BLE is 2.4GHz"? I mean the function of BLE and 2.4GHz can used to work together. The example of "/proprietary_rf/esb_ptx" in SDK12.1 can used in the example of "ble_uart_app".
I asked you before if you meant switching between BLE and some other protocol and you said, "NO".
Now you're saying that you do want to switching between BLE and some other protocol ?
I got idea for switching between BLE and 2.4GHZ.But when i was disabled to softdevice using "sd_softdevice_disable()",the program come in "while (loop);". If i want to close the softdevice, what am i going to do? My idea is this code for switching between BLE and 2.4GHz. nrf_gpio_cfg_output(LED_BLE); //ble±êÖ¾
nrf_gpio_pin_write(LED_BLE, 0); //³õʼ״̬µçƽÀµÍʹ֮²»ÁÁ
nrf_gpio_cfg_output(LED_TXS); //2.4G±êÖ¾
nrf_gpio_pin_write(LED_TXS, 0); //³õʼ״̬µçƽÀµÍʹ֮²»ÁÁ
nrf_gpio_cfg_input(switch_24toble,NRF_GPIO_PIN_NOPULL);
ble_stack_init();
ble_app_cfg_start();
// Enter main loop.
for (;;)
{
pinvalue = nrf_gpio_pin_read(switch_24toble);
if (pinvalue == 1)
{
running_mode = BLE;
}
else
{
running_mode = GHZ;
}
power_manage();
if (running_mode != previous_mode)
{
previous_mode = running_mode;
if (running_mode == BLE)
{
AppTx_stop(); //Í£Ö¹·¢ËÍ£¬¿ªÊ¼ble
ble_stack_init();
ble_app_cfg_start();
}
else if (running_mode == GHZ)
{
//ble_app_cfg_stop();
ble_stack_stop(); //Í£Ö¹ble£¬×¢Òâֹͣ˳Ðò£»¿ªÊ¼2.4GHZ
esb_tx_init(); //³õʼ»¯·¢ËÍÅäÖÃ
ret = AppTx_Send((uint8_t *)buf,5); //·¢ËÍÒ»Ö¡¹Ì¶¨Ö¡£¬²âÊÔÓÃ
if (ret < 0)
{
ret = 0;
}
}
void ble_stack_stop(void)
{
uint32_t err_code;
err_code = softdevice_handler_sd_disable();
APP_ERROR_CHECK(err_code);
}
uint32_t softdevice_handler_sd_disable(void)
{
uint32_t err_code = sd_softdevice_disable();
#if 1
if (err_code == NRF_SUCCESS)
{
m_softdevice_enabled = false;
nrf_drv_clock_on_sd_disable();
}
#else
m_softdevice_enabled = !(err_code == NRF_SUCCESS);
#endif
return err_code;
}