Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hci_driver.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_
11#define ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_
12
20#include <stdbool.h>
21#include <zephyr/net/buf.h>
24#include <zephyr/device.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30enum {
31 /* The host should never send HCI_Reset */
33 /* The controller does not auto-initiate a DLE procedure when the
34 * initial connection data length parameters are not equal to the
35 * default data length parameters. Therefore the host should initiate
36 * the DLE procedure after connection establishment. */
38};
39
40#define IS_BT_QUIRK_NO_AUTO_DLE(bt_dev) ((bt_dev)->drv->quirks & BT_QUIRK_NO_AUTO_DLE)
41
53int bt_recv(struct net_buf *buf);
54
67};
68
69#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
76};
77#endif
78
87 const char *name;
88
91
98
108 int (*open)(void);
109
118 int (*close)(void);
119
132 int (*send)(struct net_buf *buf);
133
134#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)
146 int (*setup)(const struct bt_hci_setup_params *params);
147#endif /* defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__)*/
148};
149
161
173int bt_hci_transport_setup(const struct device *dev);
174
186int bt_hci_transport_teardown(const struct device *dev);
187
200
214
228
229#ifdef __cplusplus
230}
231#endif
232
237#endif /* ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_HCI_DRIVER_H_ */
Bluetooth data buffer API.
struct net_buf * bt_hci_evt_create(uint8_t evt, uint8_t len)
Allocate an HCI event buffer.
int bt_hci_driver_register(const struct bt_hci_driver *drv)
Register a new HCI driver to the Bluetooth stack.
struct net_buf * bt_hci_cmd_complete_create(uint16_t op, uint8_t plen)
Allocate an HCI Command Complete event buffer.
bt_hci_driver_bus
Possible values for the 'bus' member of the bt_hci_driver struct.
Definition: hci_driver.h:56
struct net_buf * bt_hci_cmd_status_create(uint16_t op, uint8_t status)
Allocate an HCI Command Status event buffer.
int bt_recv(struct net_buf *buf)
Receive data from the controller/HCI driver.
int bt_hci_transport_setup(const struct device *dev)
Setup the HCI transport, which usually means to reset the Bluetooth IC.
int bt_hci_transport_teardown(const struct device *dev)
Teardown the HCI transport.
@ BT_QUIRK_NO_RESET
Definition: hci_driver.h:32
@ BT_QUIRK_NO_AUTO_DLE
Definition: hci_driver.h:37
@ BT_HCI_DRIVER_BUS_PCCARD
Definition: hci_driver.h:59
@ BT_HCI_DRIVER_BUS_I2C
Definition: hci_driver.h:65
@ BT_HCI_DRIVER_BUS_UART
Definition: hci_driver.h:60
@ BT_HCI_DRIVER_BUS_SPI
Definition: hci_driver.h:64
@ BT_HCI_DRIVER_BUS_RS232
Definition: hci_driver.h:61
@ BT_HCI_DRIVER_BUS_IPM
Definition: hci_driver.h:66
@ BT_HCI_DRIVER_BUS_VIRTUAL
Definition: hci_driver.h:57
@ BT_HCI_DRIVER_BUS_PCI
Definition: hci_driver.h:62
@ BT_HCI_DRIVER_BUS_SDIO
Definition: hci_driver.h:63
@ BT_HCI_DRIVER_BUS_USB
Definition: hci_driver.h:58
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
Buffer management.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Bluetooth Device Address.
Definition: addr.h:40
Abstraction which represents the HCI transport to the controller.
Definition: hci_driver.h:85
uint32_t quirks
Specific controller quirks.
Definition: hci_driver.h:97
const char * name
Name of the driver.
Definition: hci_driver.h:87
int(* open)(void)
Open the HCI transport.
Definition: hci_driver.h:108
int(* send)(struct net_buf *buf)
Send HCI buffer to controller.
Definition: hci_driver.h:132
enum bt_hci_driver_bus bus
Bus of the transport (BT_HCI_DRIVER_BUS_*)
Definition: hci_driver.h:90
int(* close)(void)
Close the HCI transport.
Definition: hci_driver.h:118
int(* setup)(const struct bt_hci_setup_params *params)
HCI vendor-specific setup.
Definition: hci_driver.h:146
Definition: hci_driver.h:70
bt_addr_t public_addr
The public identity address to give to the controller.
Definition: hci_driver.h:75
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
Network buffer representation.
Definition: buf.h:1004
uint16_t len
Length of the data behind the data pointer.
Definition: buf.h:1033