Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hci_nxp_setup.h File Reference

NXP HCI extended API. More...

#include <zephyr/device.h>

Go to the source code of this file.

Functions

int bt_nxp_trigger_ir (const struct device *dev)
 Trigger Independent Reset (IR) on NXP Bluetooth controllers.

Detailed Description

NXP HCI extended API.

Function Documentation

◆ bt_nxp_trigger_ir()

int bt_nxp_trigger_ir ( const struct device * dev)

Trigger Independent Reset (IR) on NXP Bluetooth controllers.

This function initiates an Independent Reset sequence on the NXP Bluetooth controller. Independent Reset allows the Bluetooth controller to be reset and re-initialized without requiring a full system reset. After triggering the IR, the firmware is re-downloaded to the controller.

Note
This API is only available when CONFIG_HCI_NXP_CONFIG_IR is enabled.
Precondition
Bluetooth must be disabled before calling this function. Use bt_disable() to disable the Bluetooth stack prior to triggering IR. Failure to disable Bluetooth will result in the function returning -EAGAIN.
Postcondition
On successful completion, the Bluetooth controller is reset and firmware is re-downloaded. The application must call bt_enable() to re-activate the Bluetooth interface.

Example usage:

int err;
// Step 1: Disable Bluetooth stack
err = bt_disable();
if (err) {
LOG_ERR("Failed to disable Bluetooth: %d", err);
return err;
}
// Step 2: Trigger Independent Reset
err = bt_nxp_trigger_ir(uart_dev);
if (err) {
LOG_ERR("Failed to trigger IR: %d", err);
return err;
}
// Step 3: Re-enable Bluetooth stack
err = bt_enable(NULL);
if (err) {
LOG_ERR("Failed to re-enable Bluetooth: %d", err);
return err;
}
int bt_disable(void)
Disable Bluetooth.
int bt_enable(bt_ready_cb_t cb)
Enable Bluetooth.
#define LOG_ERR(...)
Writes an ERROR level message to the log.
Definition log.h:62
int bt_nxp_trigger_ir(const struct device *dev)
Trigger Independent Reset (IR) on NXP Bluetooth controllers.
#define NULL
Definition iar_missing_defs.h:20
Parameters
devPointer to the UART device structure used for HCI communication.
Return values
0on success.
-EAGAINif Bluetooth is not disabled. Disable Bluetooth using bt_disable() before calling this function.
-ENODEVif the UART device is not ready or feature is not enabled.
-EIOif firmware download fails after IR trigger.
otherNegative error code on other failures.