From 887f5040da68700d7f11e4fb0476a3b9003d66b5 Mon Sep 17 00:00:00 2001 From: weitianhua Date: Thu, 16 Jul 2020 15:16:21 +0800 Subject: [PATCH] Enable PCM config in host --- components/bt/Kconfig | 41 ++++++++++++++++++++++++++++++++++ components/bt/include/esp_bt.h | 6 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/components/bt/Kconfig b/components/bt/Kconfig index f967aebf42..e24f2c0448 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -78,6 +78,47 @@ menu "Bluetooth" default 1 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM default 0 + menuconfig BTDM_CTRL_PCM_ROLE_EDGE_CONFIG + bool "PCM Signal Config (Role and Polar)" + depends on BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM + default y + + choice BTDM_CTRL_PCM_ROLE + prompt "PCM Role" + depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG + help + PCM role can be configured as PCM master or PCM slave + + config BTDM_CTRL_PCM_ROLE_MASTER + bool "PCM Master" + config BTDM_CTRL_PCM_ROLE_SLAVE + bool "PCM Slave" + endchoice + + choice BTDM_CTRL_PCM_POLAR + prompt "PCM Polar" + depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG + help + PCM polarity can be configured as Falling Edge or Rising Edge + + config BTDM_CTRL_PCM_POLAR_FALLING_EDGE + bool "Falling Edge" + config BTDM_CTRL_PCM_POLAR_RISING_EDGE + bool "Rising Edge" + endchoice + + config BTDM_CTRL_PCM_ROLE_EFF + int + default 0 if BTDM_CTRL_PCM_ROLE_MASTER + default 1 if BTDM_CTRL_PCM_ROLE_SLAVE + default 0 + + config BTDM_CTRL_PCM_POLAR_EFF + int + default 0 if BTDM_CTRL_PCM_POLAR_FALLING_EDGE + default 1 if BTDM_CTRL_PCM_POLAR_RISING_EDGE + default 0 + config BTDM_CTRL_AUTO_LATENCY bool "Auto latency" depends on BTDM_CTRL_MODE_BTDM diff --git a/components/bt/include/esp_bt.h b/components/bt/include/esp_bt.h index 9d034272bd..de8b04239f 100644 --- a/components/bt/include/esp_bt.h +++ b/components/bt/include/esp_bt.h @@ -25,7 +25,7 @@ extern "C" { #endif -#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20200611 +#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20200622 /** * @brief Bluetooth mode for controller enable/disable @@ -149,6 +149,8 @@ the adv packet will be discarded until the memory is restored. */ .bt_legacy_auth_vs_evt = BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT_EFF, \ .bt_max_sync_conn = CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF, \ .ble_sca = CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF, \ + .pcm_role = CONFIG_BTDM_CTRL_PCM_ROLE_EFF, \ + .pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ }; @@ -188,6 +190,8 @@ typedef struct { */ uint8_t bt_max_sync_conn; /*!< BR/EDR maximum ACL connection numbers. Effective in menuconfig */ uint8_t ble_sca; /*!< BLE low power crystal accuracy index */ + uint8_t pcm_role; /*!< PCM role (master & slave)*/ + uint8_t pcm_polar; /*!< PCM polar trig (falling clk edge & rising clk edge) */ uint32_t magic; /*!< Magic number */ } esp_bt_controller_config_t;