]> granicus.if.org Git - esp-idf/commitdiff
component/bt: Allow configuration of default SCO_DATA_PATH in bluetooth controller
authorbaohongde <baohongde@espressif.com>
Mon, 10 Jun 2019 09:46:37 +0000 (17:46 +0800)
committerbaohongde <baohongde@espressif.com>
Mon, 10 Jun 2019 11:17:48 +0000 (19:17 +0800)
components/bt/Kconfig
components/bt/include/esp_bt.h
components/bt/lib
components/esp32/ld/esp32.rom.ld

index 346055c11ce4f86ba5409740a6352f26d9ca465a..2167d5563c4999f65fcd6a52965326ef98ee23e1 100644 (file)
@@ -6,6 +6,29 @@ config BT_ENABLED
     help
         Select this option to enable Bluetooth and show the submenu with Bluetooth configuration choices.
 
+choice BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH
+    prompt "BR/EDR Sync(SCO/eSCO) default data path"
+    depends on BT_ENABLED
+    default BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM
+    help
+        SCO data path, i.e. HCI or PCM.
+        SCO data can be sent/received through HCI synchronous packets, or the data
+        can be routed to on-chip PCM module on ESP32. PCM input/output signals can
+        be "matrixed" to GPIOs. The default data path can also be set using API
+        "esp_bredr_sco_datapath_set"
+
+    config BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI
+        bool "HCI"
+    config BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM
+        bool "PCM"
+endchoice
+
+config BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF
+    int
+    default 0 if BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI
+    default 1 if BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM
+    default 0
+
 choice BTDM_CONTROLLER_PINNED_TO_CORE_CHOICE
     prompt "The cpu core which bluetooth controller run"
     depends on BT_ENABLED && !FREERTOS_UNICORE
@@ -109,7 +132,6 @@ config BTDM_LPCLK_SEL_EXT_32K_XTAL
     bool "External 32kHz crystal"
     depends on ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
 endchoice
-
 endmenu
 
 menuconfig BLUEDROID_ENABLED
@@ -201,15 +223,15 @@ endchoice
 choice HFP_AUDIO_DATA_PATH
     prompt "audio(SCO) data path"
     depends on HFP_ENABLE
+    help
+        SCO data path, i.e. HCI or PCM. This option is set using API
+        "esp_bredr_sco_datapath_set" in Bluetooth host. Default SCO data
+        path can also be set in Bluetooth Controller.
 
 config HFP_AUDIO_DATA_PATH_PCM
     bool "PCM"
-    help
-        This enables the Serial Port Profile
 config HFP_AUDIO_DATA_PATH_HCI
     bool "HCI"
-    help
-        This enables the Serial Port Profile
 endchoice
 
 config GATTS_ENABLE
@@ -1022,8 +1044,8 @@ config BLE_HOST_QUEUE_CONGESTION_CHECK
     depends on BLUEDROID_ENABLED
     default n
     help
-        When scanning and scan duplicate is not enabled, if there are a lot of adv packets around or application layer 
-        handling adv packets is slow, it will cause the controller memory to run out. if enabled, adv packets will be 
+        When scanning and scan duplicate is not enabled, if there are a lot of adv packets around or application layer
+        handling adv packets is slow, it will cause the controller memory to run out. if enabled, adv packets will be
         lost when host queue is congested.
 
 config BLE_SCAN_DUPLICATE
index c3c1cb020afa62da4a15d3c64fbc3b6ef87d5ba2..dcb5d9015dd90b2626c4d8f4f9f63bad2b7b627a 100644 (file)
@@ -40,6 +40,7 @@ typedef struct {
     uint16_t mesh_adv_size;                 /*!< Mesh adv size for scan duplicate */
     uint16_t send_adv_reserved_size;        /*!< Controller minimum memory value */
     uint32_t  controller_debug_flag;         /*!< Controller debug log flag */
+    uint8_t bt_sco_datapath;                /*!< SCO data path, i.e. HCI or PCM module */
 } esp_bt_controller_config_t;
 
 #ifdef CONFIG_BT_ENABLED
@@ -97,6 +98,7 @@ the adv packet will be discarded until the memory is restored. */
     .mesh_adv_size = MESH_DUPLICATE_SCAN_CACHE_SIZE,                \
     .send_adv_reserved_size = SCAN_SEND_ADV_RESERVED_SIZE,          \
     .controller_debug_flag = CONTROLLER_ADV_LOST_DEBUG_BIT,         \
+    .bt_sco_datapath = CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF,    \
 };
 
 #else
index caa305942b66cafaacaf0ed23acbd71d1f327dfd..8f15bbf191025c577d8dd65832a14d4231e45a7e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit caa305942b66cafaacaf0ed23acbd71d1f327dfd
+Subproject commit 8f15bbf191025c577d8dd65832a14d4231e45a7e
index 6058a9e6103b3e3d4f70c012c4e42f67430406bf..7526e7dee19f24efa113b5459821790d63a36448 100644 (file)
@@ -1591,6 +1591,7 @@ PROVIDE ( ets_update_cpu_frequency_rom = 0x40008550 );  /* Updates g_ticks_per_u
 PROVIDE ( hci_tl_env = 0x3ffb8154 );
 PROVIDE ( ld_acl_env = 0x3ffb8258 );
 PROVIDE ( ea_env = 0x3ffb80ec );
+PROVIDE ( lc_sco_env = 0x3ffb81fc );
 PROVIDE ( lc_sco_data_path_config = 0x3ffb81f8 );
 PROVIDE ( ld_active_ch_map = 0x3ffb8334 );
 PROVIDE ( ld_bcst_acl_env = 0x3ffb8274 );