csr: try to enable SCO over HCI - doesn't work with tested CSR8811 inside BTM805

This commit is contained in:
Matthias Ringwald 2016-01-22 21:58:35 +01:00
parent 2c2bf480af
commit fc62ef06d9

View File

@ -39,7 +39,7 @@
* btstack_chipset_csr.c
*
* Adapter to use CSR-based chipsets with BTstack
*
* SCO over HCI doesn't work over H4 connection and BTM805 module from Microchip Bluetooth Audio Developer Kit (CSR8811)
*/
#include "btstack_chipset_csr.h"
@ -55,12 +55,24 @@
// minimal CSR init script to configure PSKEYs and activate them
static const uint8_t init_script[] = {
// Set ANA_Freq PSKEY to 26MHz
// Set ANA_Freq to 26MHz
0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xfe, 0x01, 0x01, 0x00, 0x00, 0x00, 0x90, 0x65,
// Set HCI_NOP_DISABLE
0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xf2, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
#ifdef HAVE_SCO_OVER_HCI
// Set HOSTIO_MAP_SCO_PCM to 0
0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xab, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
// Set ENABLE_SCO_STREAMS to 0
0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0x03, 0x70, 0x00, 0x00, 0xc9, 0x22, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
#endif
// Set UART baudrate to 115200
0x01, 0x00, 0xFC, 0x15, 0xc2, 0x02, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x03, 0x70, 0x00, 0x00, 0xea, 0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc2,
// WarmReset
0x01, 0x00, 0xFC, 0x13, 0xc2, 0x02, 0x00, 0x09, 0x00, 0x03, 0x0e, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
@ -87,6 +99,7 @@ static void update_init_script_command(uint8_t *hci_cmd_buffer){
uint16_t varid = READ_BT_16(hci_cmd_buffer, 10);
if (varid != 0x7003) return;
uint16_t key = READ_BT_16(hci_cmd_buffer, 14);
log_info("csr: pskey 0x%04x", key);
if (key != 0x01ea) return;
// check for baud rate
@ -122,7 +135,6 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){
// support for warm boot command
uint16_t varid = READ_BT_16(hci_cmd_buffer, 10);
log_info("csr: varid 0x%04x", varid);
if (varid == 0x4002){
return BTSTACK_CHIPSET_WARMSTART_REQUIRED;
}