mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-30 16:20:24 +00:00
h5: add hci_transport_h5_enable_bcsp_mode() to use BCSP with CSR chipsets
This commit is contained in:
parent
ca93b47d3c
commit
daa2e90cf2
@ -73,7 +73,7 @@ Chipset | Type | HCI Transport | SCO over HCI (2) |
|
||||
---------------------------- |-----------| ----------------|------------------|----------------|---------
|
||||
Broadcom UART | Dual mode | H4, H5 | Probably | bcm | Max UART baudrate 2 mbps
|
||||
Broadcom USB Dongles | Dual mode | USB | Yes | bcm |
|
||||
CSR UART | Dual mode | H4, H5 | No (didn't work) | csr |
|
||||
CSR UART | Dual mode | H4, H5, BCSP | No (didn't work) | csr |
|
||||
CSR USB Dongles | Dual mode | USB | Yes | csr |
|
||||
Dialog Semiconductor DA14581 | LE | H4, SPI | n.a. | da14581 | Official HCI firmware used
|
||||
EM 9301 | LE | SPI | n.a. | em9301 | Custom HCI SPI implementation
|
||||
|
@ -19,6 +19,9 @@ The most common one is the official "UART Transport", also called H4. It require
|
||||
### HCI H5
|
||||
The "Three-Wire UART Transport", also called H5, makes use of the SLIP protocol to transmit a packet and can deal with packet loss and bit-errors by retransmission. While it is possible to use H5 really with "three wires" without hardware handshake, we recommend to use a full UART with hardware handshake. If your design lacks the hardware handshake, H5 is your only option.
|
||||
|
||||
### BCSP
|
||||
The predecessor of H5. The main difference to H5 is that Even Parity is used for BCSP. To use BCSP with BTstack, you use the H5 transport and can call *hci_transport_h5_enable_bcsp_mode*
|
||||
|
||||
### eHCILL
|
||||
Finally, Texas Instruments extended H4 to create the "eHCILL transport" layer that allows both sides to enter sleep mode without loosing synchronisation. While it is easier to implement than H5, it it is only supported by TI chipsets and cannot handle packet loss or bit-errors.
|
||||
|
||||
@ -49,7 +52,7 @@ Chipset | Type | HCI Transport | BD_ADDR (1) | SCO over HCI
|
||||
-------------------- |-----------| ---------------|--------------|------------------|--------|----------------------|----------------|---------
|
||||
Broadcom UART | Dual mode | H4, H5 | Rarely | Probably (2) | No | Maybe (3) | bcm | Max UART baudrate 2 mbps
|
||||
Broadcom USB Dongles | Dual mode | USB | Yes | Yes | No | No | bcm |
|
||||
CSR UART | Dual mode | H4, H5 | Rarely | No (didn't work) | No | No | csr |
|
||||
CSR UART | Dual mode | H4, H5, BCSP | Rarely | No (didn't work) | No | No | csr |
|
||||
CSR USB Dongles | Dual mode | USB | Mostly | Yes | No | No | csr |
|
||||
Dialog DA14581 | LE | H4, SPI | No | n.a. | No | No | da14581 | Official HCI firmware included in BTstack
|
||||
EM 9301 | LE | SPI | No | n.a. | No | No | em9301 | Custom HCI SPI implementation
|
||||
|
@ -198,6 +198,9 @@ int main(int argc, const char * argv[]){
|
||||
hci_init(transport, (void*) &config);
|
||||
hci_set_link_key_db(link_key_db);
|
||||
|
||||
// enable BCSP mode for CSR chipsets - auto detect might not work
|
||||
// hci_transport_h5_enable_bcsp_mode();
|
||||
|
||||
// enable auto-sleep mode
|
||||
// hci_transport_h5_set_auto_sleep(300);
|
||||
|
||||
|
@ -149,6 +149,11 @@ const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * u
|
||||
*/
|
||||
void hci_transport_h5_set_auto_sleep(uint16_t inactivity_timeout_ms);
|
||||
|
||||
/*
|
||||
* @brief Enable BSCP mode H5, by enabling event parity
|
||||
*/
|
||||
void hci_transport_h5_enable_bcsp_mode(void);
|
||||
|
||||
/*
|
||||
* @brief
|
||||
*/
|
||||
|
@ -141,6 +141,7 @@ static int hci_transport_link_actions;
|
||||
static const btstack_uart_block_t * btstack_uart;
|
||||
static btstack_uart_config_t uart_config;
|
||||
static btstack_uart_sleep_mode_t btstack_uart_sleep_mode;
|
||||
static int hci_transport_bcsp_mode;
|
||||
|
||||
// Prototypes
|
||||
static void hci_transport_h5_process_frame(uint16_t frame_size);
|
||||
@ -766,6 +767,12 @@ static int hci_transport_h5_open(void){
|
||||
return res;
|
||||
}
|
||||
|
||||
//
|
||||
if (hci_transport_bcsp_mode){
|
||||
log_info("H5: enable even parity for BCSP mode");
|
||||
btstack_uart->set_parity(1);
|
||||
}
|
||||
|
||||
// check if wake on RX can be used
|
||||
btstack_uart_sleep_mode = BTSTACK_UART_SLEEP_OFF;
|
||||
int supported_sleep_modes = 0;
|
||||
@ -881,3 +888,7 @@ const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * u
|
||||
void hci_transport_h5_set_auto_sleep(uint16_t inactivity_timeout_ms){
|
||||
link_inactivity_timeout_ms = inactivity_timeout_ms;
|
||||
}
|
||||
|
||||
void hci_transport_h5_enable_bcsp_mode(void){
|
||||
hci_transport_bcsp_mode = 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user