The APIs assume that the correct Kconfig symbols are setup as required for the application. Include files zephyr_fmac_coex.h and mpsl_cx_nrf700x.h to access these APIs.
int nrf_wifi_coex_config_pta(enum nrf_wifi_pta_wlan_op_band wlan_band,bool
antenna_mode)
This function initializes the PTA table in the coexistence hardware for either separate
antennas or shared antenna as per the configuration. This function is to be called
immediately after successful Wi-Fi®
connection or reconnection and returns 0 on success. The PTA table configurations are
different when Wi-Fi is in the 2.4
GHz band or 5 GHz band, where wlan_band
specifies which Wi-Fi band is present:
Set the input parameters:
antenna_mode = 1
antenna_mode = 0
int
nrf_wifi_coex_config_non_pta(bool antenna_mode)
Set the input parameters:
antenna_mode = 1
antenna_mode = 0
int nrf_wifi_config_sr_switch(bool antenna_mode)
This function configures SW2 to A2 for the case of separate antennas and to SW1 and A1 for a shared antenna. This function is to be called during application initialization and return 0 on success.
Set the input parameters:
antenna_mode = 1
antenna_mode = 0
This API is based on the nRF7002 Development Kit (DK) where P0.24 is connected to SW2. Verify that this configuration is correct on your board or make appropriate changes. This switch and the corresponding control are only for the purposes of supporting configurations of both shared and separate antennas on the DK as reference. Typically, a final product would support one or the other.
int nrf_wifi_coex_hw_reset(void)
This function resets the coexistence hardware and returns 0 on success. Configuration APIs
nrf_wifi_coex_config_non_pta()
and nrf_wifi_coex_config_pta()
must be called after this function to initialize coexistence in the required mode. This
effectively disables coexistence module.
void mpsl_cx_nrf700x_set_enabled(bool enable)
This function enables or disables the nRF70 Series Coexistence Interface from the Bluetooth® LE/IEEE 802.15.4 controller device. Clients of MPSL CX APIs are granted or denied access depending on the state of the nRF70 Series GRANT signal.
The Coexistence Interface is disabled by default. It can be enabled by calling this
function with enable=true
or disabled by calling
enable=false
.