From 64aa94d8234f3d32c48885f7e9cc39e56aa2ac38 Mon Sep 17 00:00:00 2001 From: weitianhua Date: Mon, 25 Oct 2021 20:15:13 +0800 Subject: [PATCH] Make Classic BT related document links only visible for ESP32 --- components/soc/esp32/include/soc/soc_caps.h | 3 +++ components/soc/esp32c3/include/soc/soc_caps.h | 3 +++ components/soc/esp32h2/include/soc/soc_caps.h | 3 +++ components/soc/esp32s2/include/soc/soc_caps.h | 5 ++++ components/soc/esp32s3/include/soc/soc_caps.h | 5 +++- docs/conf_common.py | 25 ++++++++++++++++++- docs/en/api-guides/performance/speed.rst | 2 +- docs/en/api-reference/bluetooth/index.rst | 2 +- docs/zh_CN/api-reference/bluetooth/index.rst | 2 +- 9 files changed, 45 insertions(+), 5 deletions(-) diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 88b6f1c8ee..ea8aed3263 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -309,3 +309,6 @@ /*------------------------------ BLE --------------------------------------------*/ #define SOC_BLE_DONT_UPDATE_OWN_RPA (1) + +/*------------------------------ Classic BT --------------------------------------------*/ +#define SOC_CLASSIC_BT_SUPPORTED (1) /* ESP32 Support Classic BT */ diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index ef4f2eb9b5..2ac41387b7 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -289,3 +289,6 @@ #define SOC_PM_SUPPORT_WIFI_PD (1) #define SOC_PM_SUPPORT_BT_PD (1) + +/*------------------------------ Classic BT --------------------------------------------*/ +#define SOC_CLASSIC_BT_SUPPORTED (0) /* ESP32-C3 doesn't support Classic BT */ diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 8ee3764fc7..645a94fa91 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -264,3 +264,6 @@ #define SOC_PM_SUPPORT_CPU_PD (1) #define SOC_PM_SUPPORT_BT_PD (1) + +/*------------------------------ Classic BT --------------------------------------------*/ +#define SOC_CLASSIC_BT_SUPPORTED (0) /* ESP32-H2 doesn't support Classic BT */ diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index f9a07606d3..7c25d5585f 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -335,5 +335,10 @@ /*-------------------------- COEXISTENCE HARDWARE PTI CAPS -------------------------------*/ #define SOC_COEX_HW_PTI (1) + +/* ---------------------------- Bluetooth ------------------------------- */ +#define SOC_BT_SUPPORTED (0) /* ESP32-S2 is Wi-Fi only */ +#define SOC_CLASSIC_BT_SUPPORTED (0) /* ESP32-S2 is Wi-Fi only */ + /* ---------------------------- Compatibility ------------------------------- */ // No contents diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index 29b9595ecb..ec7d882033 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -21,6 +21,7 @@ #define SOC_CPU_CORES_NUM 2 #define SOC_CACHE_SUPPORT_WRAP 1 #define SOC_ULP_SUPPORTED 1 +#define SOC_BT_SUPPORTED 1 #define SOC_USB_OTG_SUPPORTED 1 #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 #define SOC_RTC_SLOW_MEM_SUPPORTED 1 @@ -37,7 +38,6 @@ #define SOC_PSRAM_DMA_CAPABLE 1 #define SOC_XT_WDT_SUPPORTED 1 - /*-------------------------- SOC CAPS ----------------------------------------*/ #define SOC_APPCPU_HAS_CLOCK_GATING_BUG (1) @@ -330,3 +330,6 @@ #define SOC_SDMMC_NUM_SLOTS 2 /* Indicates that there is an option to use XTAL clock instead of PLL for SDMMC */ #define SOC_SDMMC_SUPPORT_XTAL_CLOCK 1 + +/*------------------------------ Classic BT --------------------------------------------*/ +#define SOC_CLASSIC_BT_SUPPORTED (0) /* ESP32-S3 doesn't support Classic BT */ diff --git a/docs/conf_common.py b/docs/conf_common.py index 6210a9a23f..157b2de634 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -20,7 +20,29 @@ if os.environ.get('IDF_PATH') is None: BT_DOCS = ['api-guides/blufi.rst', 'api-guides/esp-ble-mesh/**', - 'api-reference/bluetooth/**'] + 'api-reference/bluetooth/bt_le.rst', + 'api-reference/bluetooth/esp_bt_defs.rst', + 'api-reference/bluetooth/esp_bt_device.rst', + 'api-reference/bluetooth/esp_bt_main.rst', + 'api-reference/bluetooth/bt_common.rst', + 'api-reference/bluetooth/controller_vhci.rst', + 'api-reference/bluetooth/esp_gap_ble.rst', + 'api-reference/bluetooth/esp_gatt_defs.rst', + 'api-reference/bluetooth/esp_gatts.rst', + 'api-reference/bluetooth/esp_gattc.rst', + 'api-reference/bluetooth/esp_blufi.rst', + 'api-reference/bluetooth/esp-ble-mesh.rst', + 'api-reference/bluetooth/index.rst', + 'api-reference/bluetooth/nimble/index.rst'] + +CLASSIC_BT_DOCS = ['api-reference/bluetooth/classic_bt.rst', + 'api-reference/bluetooth/esp_a2dp.rst', + 'api-reference/bluetooth/esp_avrc.rst', + 'api-reference/bluetooth/esp_hf_defs.rst', + 'api-reference/bluetooth/esp_hf_client.rst', + 'api-reference/bluetooth/esp_hf_ag.rst', + 'api-reference/bluetooth/esp_spp.rst', + 'api-reference/bluetooth/esp_gap_bt.rst'] SDMMC_DOCS = ['api-reference/peripherals/sdmmc_host.rst', 'api-reference/peripherals/sd_pullup_requirements.rst'] @@ -93,6 +115,7 @@ ESP32C3_DOCS = ['hw-reference/esp32c3/**'] # format: {tag needed to include: documents to included}, tags are parsed from sdkconfig and peripheral_caps.h headers conditional_include_dict = {'SOC_BT_SUPPORTED':BT_DOCS, + 'SOC_CLASSIC_BT_SUPPORTED':CLASSIC_BT_DOCS, 'SOC_SDMMC_HOST_SUPPORTED':SDMMC_DOCS, 'SOC_SDIO_SLAVE_SUPPORTED':SDIO_SLAVE_DOCS, 'SOC_MCPWM_SUPPORTED':MCPWM_DOCS, diff --git a/docs/en/api-guides/performance/speed.rst b/docs/en/api-guides/performance/speed.rst index b97132d11c..d834d0c8ba 100644 --- a/docs/en/api-guides/performance/speed.rst +++ b/docs/en/api-guides/performance/speed.rst @@ -1,7 +1,7 @@ Maximizing Execution Speed ========================== -{IDF_TARGET_CONTROLLER_CORE_CONFIG:default="CONFIG_BT_CTRL_PINNED_TO_CORE", esp32="CONFIG_BTDM_CTRL_PINNED_TO_CORE_CHOICE"} +{IDF_TARGET_CONTROLLER_CORE_CONFIG:default="CONFIG_BT_CTRL_PINNED_TO_CORE", esp32="CONFIG_BTDM_CTRL_PINNED_TO_CORE_CHOICE", esp32s3="CONFIG_BT_CTRL_PINNED_TO_CORE_CHOICE"} {IDF_TARGET_RF_TYPE:default="Wi-Fi/BT", esp32s2="Wi-Fi"} Overview diff --git a/docs/en/api-reference/bluetooth/index.rst b/docs/en/api-reference/bluetooth/index.rst index 719373dbc7..7916e0a0c4 100644 --- a/docs/en/api-reference/bluetooth/index.rst +++ b/docs/en/api-reference/bluetooth/index.rst @@ -9,7 +9,7 @@ Bluetooth API Bluetooth Controller && VHCI Bluetooth Common Bluetooth LE - Bluetooth Classic + :SOC_CLASSIC_BT_SUPPORTED: Bluetooth Classic NimBLE ESP-BLE-MESH diff --git a/docs/zh_CN/api-reference/bluetooth/index.rst b/docs/zh_CN/api-reference/bluetooth/index.rst index d9ccbbf9b6..f2b24f207d 100644 --- a/docs/zh_CN/api-reference/bluetooth/index.rst +++ b/docs/zh_CN/api-reference/bluetooth/index.rst @@ -9,7 +9,7 @@ Bluetooth Controller && VHCI Bluetooth Common Bluetooth LE - Bluetooth Classic + :SOC_CLASSIC_BT_SUPPORTED: Bluetooth Classic NimBLE ESP-BLE-MESH