mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
feat(ble): support esp ble controller spi output interface for ESP32-C2
(cherry picked from commit 0b57f8ae875e52cfc816ebbb0eb1e7c7fb46cfad) Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
This commit is contained in:
parent
9d8fc56139
commit
11230d884a
@ -308,6 +308,49 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
|||||||
help
|
help
|
||||||
Only operate in dump mode
|
Only operate in dump mode
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
bool "Output ble controller logs to SPI bus (Experimental)"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_ENABLED
|
||||||
|
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Output ble controller logs to SPI bus
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_QUEUE_SIZE
|
||||||
|
int "Number of ble controller log async SPI output queues"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
default 4
|
||||||
|
help
|
||||||
|
The number of ble controller log async SPI output queues
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_TRANS_BUF_SIZE
|
||||||
|
int "Size of ble controller log async SPI output transaction buffer size"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
default 512
|
||||||
|
help
|
||||||
|
The size of ble controller log async SPI output transaction buffer size
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_MOSI_IO_NUM
|
||||||
|
int "GPIO number of SPI MOSI"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
default 1
|
||||||
|
help
|
||||||
|
GPIO number of SPI MOSI
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_SCLK_IO_NUM
|
||||||
|
int "GPIO number of SPI SCLK"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
default 6
|
||||||
|
help
|
||||||
|
GPIO number of SPI SCLK
|
||||||
|
|
||||||
|
config BT_LE_CONTROLLER_LOG_SPI_OUT_CS_IO_NUM
|
||||||
|
int "GPIO number of SPI CS"
|
||||||
|
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
default 7
|
||||||
|
help
|
||||||
|
GPIO number of SPI CS
|
||||||
|
|
||||||
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||||
bool "Store ble controller logs to flash(Experimental)"
|
bool "Store ble controller logs to flash(Experimental)"
|
||||||
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||||
|
@ -61,6 +61,12 @@
|
|||||||
#include "hal/efuse_ll.h"
|
#include "hal/efuse_ll.h"
|
||||||
#include "soc/rtc.h"
|
#include "soc/rtc.h"
|
||||||
|
|
||||||
|
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||||
|
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
#include "ble_log/ble_log_spi_out.h"
|
||||||
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||||
|
|
||||||
/* Macro definition
|
/* Macro definition
|
||||||
************************************************************************
|
************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -208,6 +214,7 @@ enum log_out_mode {
|
|||||||
LOG_DUMP_MEMORY,
|
LOG_DUMP_MEMORY,
|
||||||
LOG_ASYNC_OUT,
|
LOG_ASYNC_OUT,
|
||||||
LOG_STORAGE_TO_FLASH,
|
LOG_STORAGE_TO_FLASH,
|
||||||
|
LOG_SPI_OUT,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool log_is_inited = false;
|
bool log_is_inited = false;
|
||||||
@ -216,6 +223,8 @@ uint8_t log_output_mode = LOG_DUMP_MEMORY;
|
|||||||
#else
|
#else
|
||||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||||
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
|
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
|
||||||
|
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
uint8_t log_output_mode = LOG_SPI_OUT;
|
||||||
#else
|
#else
|
||||||
uint8_t log_output_mode = LOG_ASYNC_OUT;
|
uint8_t log_output_mode = LOG_ASYNC_OUT;
|
||||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||||
@ -263,6 +272,13 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
|||||||
}
|
}
|
||||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||||
break;
|
break;
|
||||||
|
case LOG_SPI_OUT:
|
||||||
|
task_create = true;
|
||||||
|
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
ble_log_spi_out_init();
|
||||||
|
bt_controller_log_interface = ble_log_spi_out_write_esp;
|
||||||
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -278,6 +294,9 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
|||||||
void esp_bt_ontroller_log_deinit(void)
|
void esp_bt_ontroller_log_deinit(void)
|
||||||
{
|
{
|
||||||
ble_log_deinit_async();
|
ble_log_deinit_async();
|
||||||
|
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||||
|
ble_log_spi_out_deinit();
|
||||||
|
#endif
|
||||||
log_is_inited = false;
|
log_is_inited = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user