arch/nrf53: add RPMSG HCI controller support

This commit is contained in:
raiden00pl 2023-03-11 11:08:37 +01:00 committed by Xiang Xiao
parent 760e02977f
commit bd9bfa9302
2 changed files with 44 additions and 0 deletions

View File

@ -41,6 +41,9 @@
#if defined(CONFIG_UART_BTH4)
# include <nuttx/serial/uart_bth4.h>
#endif
#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER
# include <nuttx/wireless/bluetooth/bt_rpmsghci.h>
#endif
#include "arm_internal.h"
#include "ram_vectors.h"
@ -60,6 +63,12 @@
# error Only for the NET core
#endif
#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER
# if defined(CONFIG_UART_BTH4) || defined(CONFIG_NET_BLUETOOTH)
# error Invalid configuration
# endif
#endif
/* Connections configuration ************************************************/
/* If NET_BLUETOOTH not defined */
@ -919,9 +928,41 @@ int nrf53_sdc_initialize(void)
wlerr("bt_netdev_register error: %d\n", ret);
return ret;
}
#elif defined(CONFIG_BLUETOOTH_RPMSG_SERVER)
/* Do nothing here */
#else
# error
#endif
return ret;
}
#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER
/****************************************************************************
* Name: nrf53_rpmsghci_server_initialize
****************************************************************************/
int nrf53_rpmsghci_server_initialize(const char *name)
{
int ret = OK;
/* Initialize SDC */
ret = nrf53_sdc_initialize();
if (ret < 0)
{
wlerr("nrf53_sdc_initialize error: %d\n", ret);
return ret;
}
/* Register rpmsg-HCI server */
ret = rpmshci_server_init(name, &g_bt_driver);
if (ret < 0)
{
wlerr("rpmshci_server_init error: %d\n", ret);
}
return ret;
}
#endif

View File

@ -56,6 +56,9 @@ extern "C"
****************************************************************************/
int nrf53_sdc_initialize(void);
#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER
int nrf53_rpmsghci_server_initialize(const char *name);
#endif
#undef EXTERN
#ifdef __cplusplus