chipset/nxp: send HCI_CMD_SET_SCO_DATA_PATH command

This commit is contained in:
Matthias Ringwald 2023-04-07 18:33:48 +02:00
parent 3c07636cec
commit d0f26bf0c7

View File

@ -72,6 +72,10 @@
#define NXP_MAX_RESEND_COUNT 5
// vendor commands
#define NXP_OPCODE_SET_SCO_DATA_PATH 0xFC1D
#define NXP_OPCODE_SET_BDADDR 0xFC22
// prototypes
static void nxp_send_chunk_v1(void);
static void nxp_done_with_status(uint8_t status);
@ -404,15 +408,44 @@ void btstack_chipset_nxp_download_firmware_with_uart(const btstack_uart_t *uart_
nxp_start();
}
// init script support
static enum {
NXP_INIT_SEND_SCO_CONFIG,
NXP_INIT_DONE,
} nxp_init_state;
static void chipset_init(const void *transport_config){
static void nxp_init(const void *transport_config){
UNUSED(transport_config);
nxp_init_state = NXP_INIT_SEND_SCO_CONFIG;
}
static btstack_chipset_result_t nxp_next_command(uint8_t * hci_cmd_buffer) {
switch (nxp_init_state){
case NXP_INIT_SEND_SCO_CONFIG:
#if defined(ENABLE_SCO_OVER_HCI) || defined(ENABLE_SCO_OVER_PCM)
little_endian_store_16(hci_cmd_buffer, 0, NXP_OPCODE_SET_SCO_DATA_PATH);
hci_cmd_buffer[2] = 1;
#ifdef ENABLE_SCO_OVER_HCI
// Voice Path: Host
hci_cmd_buffer[3] = 0;
#else
// Voice Path: PCM/I2S
hci_cmd_buffer[3] = 1;
#endif
nxp_init_state = NXP_INIT_DONE;
return BTSTACK_CHIPSET_VALID_COMMAND;
#endif
break;
case NXP_INIT_DONE:
break;
}
return BTSTACK_CHIPSET_DONE;
}
static btstack_chipset_t btstack_chipset_nxp = {
.name = "NXP",
.init = chipset_init,
.next_command = NULL,
.init = nxp_init,
.next_command = nxp_next_command,
.set_baudrate_command = NULL,
.set_bd_addr_command = NULL
};