diff --git a/.cproject b/.cproject
index 856c3b1..e757dfc 100644
--- a/.cproject
+++ b/.cproject
@@ -9,10 +9,9 @@
-
-
-
-
+
+
+
diff --git a/.gitignore b/.gitignore
index cfcb420..bd6fdc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,147 @@
build
libopus
+managed_components
+
+# Created by https://www.toptal.com/developers/gitignore/api/c,c++,eclipse
+# Edit at https://www.toptal.com/developers/gitignore?templates=c,c++,eclipse
+
+### C ###
+# Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+#*.lib
+#*.a
+#*.la
+#*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+
+### C++ ###
+# Prerequisites
+
+# Compiled Object files
+*.slo
+
+# Precompiled Headers
+
+# Compiled Dynamic libraries
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+
+# Executables
+
+### Eclipse ###
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# CDT- autotools
+.autotools
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+# Annotation Processing
+.apt_generated/
+.apt_generated_test/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+# Uncomment this line if you wish to ignore the project description file.
+# Typically, this file would be tracked if it contains build/dependency configurations:
+#.project
+
+### Eclipse Patch ###
+# Spring Boot Tooling
+.sts4-cache/
+
+# End of https://www.toptal.com/developers/gitignore/api/c,c++,eclipse
diff --git a/.project b/.project
index 967646e..dec6168 100644
--- a/.project
+++ b/.project
@@ -21,4517 +21,4032 @@
build/ide/esp_idf_components/app_trace/app_trace.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_trace/app_trace.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_trace/app_trace.c
build/ide/esp_idf_components/app_trace/app_trace_util.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_trace/app_trace_util.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_trace/app_trace_util.c
build/ide/esp_idf_components/app_trace/host_file_io.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_trace/host_file_io.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_trace/host_file_io.c
- build/ide/esp_idf_components/app_update/esp_app_desc.c
+ build/ide/esp_idf_components/app_update/esp_ota_app_desc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_update/esp_app_desc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_update/esp_ota_app_desc.c
build/ide/esp_idf_components/app_update/esp_ota_ops.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_update/esp_ota_ops.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_update/esp_ota_ops.c
build/ide/esp_idf_components/console/commands.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/console/commands.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/commands.c
build/ide/esp_idf_components/console/esp_console_repl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/console/esp_console_repl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/esp_console_repl.c
build/ide/esp_idf_components/console/split_argv.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/console/split_argv.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/split_argv.c
build/ide/esp_idf_components/cxx/cxx_exception_stubs.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cxx/cxx_exception_stubs.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/cxx/cxx_exception_stubs.cpp
build/ide/esp_idf_components/cxx/cxx_guards.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cxx/cxx_guards.cpp
-
-
- build/ide/esp_idf_components/driver/adc_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/adc_common.c
-
-
- build/ide/esp_idf_components/driver/dac_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/dac_common.c
-
-
- build/ide/esp_idf_components/driver/gpio.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/gpio.c
-
-
- build/ide/esp_idf_components/driver/i2c.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/i2c.c
-
-
- build/ide/esp_idf_components/driver/i2s.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/i2s.c
-
-
- build/ide/esp_idf_components/driver/ledc.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/ledc.c
-
-
- build/ide/esp_idf_components/driver/mcpwm.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/mcpwm.c
-
-
- build/ide/esp_idf_components/driver/pcnt.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/pcnt.c
-
-
- build/ide/esp_idf_components/driver/periph_ctrl.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/periph_ctrl.c
-
-
- build/ide/esp_idf_components/driver/rmt.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/rmt.c
-
-
- build/ide/esp_idf_components/driver/rtc_io.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/rtc_io.c
-
-
- build/ide/esp_idf_components/driver/rtc_module.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/rtc_module.c
-
-
- build/ide/esp_idf_components/driver/sdio_slave.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdio_slave.c
-
-
- build/ide/esp_idf_components/driver/sdmmc_host.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdmmc_host.c
-
-
- build/ide/esp_idf_components/driver/sdmmc_transaction.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdmmc_transaction.c
-
-
- build/ide/esp_idf_components/driver/sdspi_crc.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdspi_crc.c
-
-
- build/ide/esp_idf_components/driver/sdspi_host.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdspi_host.c
-
-
- build/ide/esp_idf_components/driver/sdspi_transaction.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sdspi_transaction.c
-
-
- build/ide/esp_idf_components/driver/sigmadelta.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/sigmadelta.c
-
-
- build/ide/esp_idf_components/driver/spi_bus_lock.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/spi_bus_lock.c
-
-
- build/ide/esp_idf_components/driver/spi_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/spi_common.c
-
-
- build/ide/esp_idf_components/driver/spi_master.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/spi_master.c
-
-
- build/ide/esp_idf_components/driver/spi_slave.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/spi_slave.c
-
-
- build/ide/esp_idf_components/driver/timer.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/timer.c
-
-
- build/ide/esp_idf_components/driver/touch_sensor_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/touch_sensor_common.c
-
-
- build/ide/esp_idf_components/driver/twai.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/twai.c
-
-
- build/ide/esp_idf_components/driver/uart.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/uart.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/cxx/cxx_guards.cpp
build/ide/esp_idf_components/esp-tls/esp_tls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp-tls/esp_tls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp-tls/esp_tls.c
build/ide/esp_idf_components/esp-tls/esp_tls_error_capture.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp-tls/esp_tls_error_capture.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp-tls/esp_tls_error_capture.c
build/ide/esp_idf_components/esp-tls/esp_tls_mbedtls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp-tls/esp_tls_mbedtls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp-tls/esp_tls_mbedtls.c
- build/ide/esp_idf_components/esp32/cache_err_int.c
+ build/ide/esp_idf_components/esp_adc/adc_cali.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/cache_err_int.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/adc_cali.c
- build/ide/esp_idf_components/esp32/cache_sram_mmu.c
+ build/ide/esp_idf_components/esp_adc/adc_cali_curve_fitting.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/cache_sram_mmu.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/adc_cali_curve_fitting.c
- build/ide/esp_idf_components/esp32/clk.c
+ build/ide/esp_idf_components/esp_adc/adc_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/clk.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/adc_common.c
- build/ide/esp_idf_components/esp32/crosscore_int.c
+ build/ide/esp_idf_components/esp_adc/adc_continuous.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/crosscore_int.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/adc_continuous.c
- build/ide/esp_idf_components/esp32/dport_access.c
+ build/ide/esp_idf_components/esp_adc/adc_oneshot.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/dport_access.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/adc_oneshot.c
- build/ide/esp_idf_components/esp32/esp_himem.c
+ build/ide/esp_idf_components/esp_app_format/esp_app_desc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/esp_himem.c
-
-
- build/ide/esp_idf_components/esp32/hw_random.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/hw_random.c
-
-
- build/ide/esp_idf_components/esp32/spiram.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/spiram.c
-
-
- build/ide/esp_idf_components/esp32/spiram_psram.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/spiram_psram.c
-
-
- build/ide/esp_idf_components/esp32/system_api_esp32.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp32/system_api_esp32.c
-
-
- build/ide/esp_idf_components/esp_adc_cal/esp_adc_cal_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_adc_cal/esp_adc_cal_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_app_format/esp_app_desc.c
build/ide/esp_idf_components/esp_event/default_event_loop.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_event/default_event_loop.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_event/default_event_loop.c
build/ide/esp_idf_components/esp_event/esp_event.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_event/esp_event.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_event/esp_event.c
build/ide/esp_idf_components/esp_event/esp_event_private.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_event/esp_event_private.c
-
-
- build/ide/esp_idf_components/esp_event/event_loop_legacy.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_event/event_loop_legacy.c
-
-
- build/ide/esp_idf_components/esp_event/event_send.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_event/event_send.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_event/esp_event_private.c
build/ide/esp_idf_components/esp_http_client/esp_http_client.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_client/esp_http_client.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_client/esp_http_client.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/adc_share_hw_ctrl.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/adc_share_hw_ctrl.c
build/ide/esp_idf_components/esp_hw_support/clk_ctrl_os.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/clk_ctrl_os.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/clk_ctrl_os.c
- build/ide/esp_idf_components/esp_hw_support/compare_set.c
+ build/ide/esp_idf_components/esp_hw_support/cpu.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/compare_set.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/cpu.c
- build/ide/esp_idf_components/esp_hw_support/cpu_util.c
+ build/ide/esp_idf_components/esp_hw_support/esp_clk.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/cpu_util.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/esp_clk.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/esp_gpio_reserve.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/esp_gpio_reserve.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/esp_memory_utils.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/esp_memory_utils.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/hw_random.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/hw_random.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/intr_alloc.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/intr_alloc.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/mac_addr.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/mac_addr.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/periph_ctrl.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/periph_ctrl.c
build/ide/esp_idf_components/esp_hw_support/regi2c_ctrl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/regi2c_ctrl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/regi2c_ctrl.c
- build/ide/esp_idf_components/esp_ipc/ipc.c
+ build/ide/esp_idf_components/esp_hw_support/rtc_module.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_ipc/ipc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/rtc_module.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/rtc_wdt.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/rtc_wdt.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/sar_periph_ctrl_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/sar_periph_ctrl_common.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/sleep_gpio.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/sleep_gpio.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/sleep_modem.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/sleep_modem.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/sleep_modes.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/sleep_modes.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/sleep_wake_stub.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/sleep_wake_stub.c
+
+
+ build/ide/esp_idf_components/esp_mm/cache_esp32.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_mm/cache_esp32.c
+
+
+ build/ide/esp_idf_components/esp_mm/esp_cache.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_mm/esp_cache.c
+
+
+ build/ide/esp_idf_components/esp_mm/esp_mmu_map.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_mm/esp_mmu_map.c
build/ide/esp_idf_components/esp_netif/esp_netif_defaults.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/esp_netif_defaults.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/esp_netif_defaults.c
build/ide/esp_idf_components/esp_netif/esp_netif_handlers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/esp_netif_handlers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/esp_netif_handlers.c
build/ide/esp_idf_components/esp_netif/esp_netif_objects.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/esp_netif_objects.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/esp_netif_objects.c
+
+
+ build/ide/esp_idf_components/esp_partition/partition.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_partition/partition.c
+
+
+ build/ide/esp_idf_components/esp_partition/partition_target.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_partition/partition_target.c
build/ide/esp_idf_components/esp_pm/pm_impl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_pm/pm_impl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_pm/pm_impl.c
build/ide/esp_idf_components/esp_pm/pm_locks.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_pm/pm_locks.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_pm/pm_locks.c
build/ide/esp_idf_components/esp_pm/pm_trace.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_pm/pm_trace.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_pm/pm_trace.c
+
+
+ build/ide/esp_idf_components/esp_psram/esp_psram.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_psram/esp_psram.c
+
+
+ build/ide/esp_idf_components/esp_psram/mmu_psram_flash.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_psram/mmu_psram_flash.c
build/ide/esp_idf_components/esp_ringbuf/ringbuf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_ringbuf/ringbuf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_ringbuf/ringbuf.c
- build/ide/esp_idf_components/esp_serial_slave_link/essl.c
+ build/ide/esp_idf_components/esp_system/crosscore_int.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_serial_slave_link/essl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/crosscore_int.c
- build/ide/esp_idf_components/esp_serial_slave_link/essl_sdio.c
+ build/ide/esp_idf_components/esp_system/debug_stubs.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_serial_slave_link/essl_sdio.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/debug_stubs.c
- build/ide/esp_idf_components/esp_serial_slave_link/essl_spi.c
+ build/ide/esp_idf_components/esp_system/esp_err.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_serial_slave_link/essl_spi.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/esp_err.c
- build/ide/esp_idf_components/esp_system/esp_async_memcpy.c
+ build/ide/esp_idf_components/esp_system/esp_ipc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/esp_async_memcpy.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/esp_ipc.c
- build/ide/esp_idf_components/esp_system/intr_alloc.c
+ build/ide/esp_idf_components/esp_system/esp_system.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/intr_alloc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/esp_system.c
+
+
+ build/ide/esp_idf_components/esp_system/freertos_hooks.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/freertos_hooks.c
+
+
+ build/ide/esp_idf_components/esp_system/int_wdt.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/int_wdt.c
build/ide/esp_idf_components/esp_system/panic.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/panic.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/panic.c
- build/ide/esp_idf_components/esp_system/sleep_modes.c
+ build/ide/esp_idf_components/esp_system/stack_check.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/sleep_modes.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/stack_check.c
build/ide/esp_idf_components/esp_system/startup.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/startup.c
-
-
- build/ide/esp_idf_components/esp_system/system_api.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/system_api.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/startup.c
build/ide/esp_idf_components/esp_system/system_time.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/system_time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/system_time.c
- build/ide/esp_idf_components/esp_websocket_client/esp_websocket_client.c
+ build/ide/esp_idf_components/esp_system/ubsan.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_websocket_client/esp_websocket_client.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/ubsan.c
+
+
+ build/ide/esp_idf_components/esp_system/xt_wdt.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/xt_wdt.c
build/ide/esp_idf_components/freertos/FreeRTOS-openocd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/FreeRTOS-openocd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-openocd.c
- build/ide/esp_idf_components/freertos/croutine.c
+ build/ide/esp_idf_components/freertos/app_startup.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/croutine.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/app_startup.c
- build/ide/esp_idf_components/freertos/event_groups.c
+ build/ide/esp_idf_components/freertos/heap_idf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/event_groups.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/heap_idf.c
- build/ide/esp_idf_components/freertos/freertos_v8_compat.c
+ build/ide/esp_idf_components/freertos/port_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/freertos_v8_compat.c
-
-
- build/ide/esp_idf_components/freertos/list.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/list.c
-
-
- build/ide/esp_idf_components/freertos/queue.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/queue.c
-
-
- build/ide/esp_idf_components/freertos/stream_buffer.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/stream_buffer.c
-
-
- build/ide/esp_idf_components/freertos/tasks.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/tasks.c
-
-
- build/ide/esp_idf_components/freertos/timers.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/timers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/port_common.c
build/ide/esp_idf_components/hal/adc_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/adc_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/adc_hal.c
+
+
+ build/ide/esp_idf_components/hal/adc_hal_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/adc_hal_common.c
+
+
+ build/ide/esp_idf_components/hal/adc_oneshot_hal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/adc_oneshot_hal.c
build/ide/esp_idf_components/hal/aes_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/aes_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/aes_hal.c
- build/ide/esp_idf_components/hal/cpu_hal.c
+ build/ide/esp_idf_components/hal/brownout_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/cpu_hal.c
-
-
- build/ide/esp_idf_components/hal/dac_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/dac_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/brownout_hal.c
build/ide/esp_idf_components/hal/efuse_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/efuse_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/efuse_hal.c
+
+
+ build/ide/esp_idf_components/hal/emac_hal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/emac_hal.c
build/ide/esp_idf_components/hal/gpio_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/gpio_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/gpio_hal.c
build/ide/esp_idf_components/hal/i2c_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/i2c_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/i2c_hal.c
build/ide/esp_idf_components/hal/i2c_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/i2c_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/i2c_hal_iram.c
build/ide/esp_idf_components/hal/i2s_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/i2s_hal.c
-
-
- build/ide/esp_idf_components/hal/interrupt_controller_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/interrupt_controller_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/i2s_hal.c
build/ide/esp_idf_components/hal/ledc_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/ledc_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/ledc_hal.c
build/ide/esp_idf_components/hal/ledc_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/ledc_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/ledc_hal_iram.c
build/ide/esp_idf_components/hal/mcpwm_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/mcpwm_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/mcpwm_hal.c
+
+
+ build/ide/esp_idf_components/hal/mmu_hal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/mmu_hal.c
build/ide/esp_idf_components/hal/mpu_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/mpu_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/mpu_hal.c
build/ide/esp_idf_components/hal/pcnt_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/pcnt_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/pcnt_hal.c
build/ide/esp_idf_components/hal/rmt_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/rmt_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/rmt_hal.c
build/ide/esp_idf_components/hal/rtc_io_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/rtc_io_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/rtc_io_hal.c
build/ide/esp_idf_components/hal/sdio_slave_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/sdio_slave_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/sdio_slave_hal.c
+
+
+ build/ide/esp_idf_components/hal/sdm_hal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/sdm_hal.c
build/ide/esp_idf_components/hal/sha_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/sha_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/sha_hal.c
- build/ide/esp_idf_components/hal/sigmadelta_hal.c
+ build/ide/esp_idf_components/hal/spi_flash_encrypt_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/sigmadelta_hal.c
-
-
- build/ide/esp_idf_components/hal/soc_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/soc_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_flash_encrypt_hal_iram.c
build/ide/esp_idf_components/hal/spi_flash_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_flash_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_flash_hal.c
build/ide/esp_idf_components/hal/spi_flash_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_flash_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_flash_hal_iram.c
build/ide/esp_idf_components/hal/spi_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_hal.c
build/ide/esp_idf_components/hal/spi_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_hal_iram.c
build/ide/esp_idf_components/hal/spi_slave_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_slave_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_slave_hal.c
build/ide/esp_idf_components/hal/spi_slave_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/spi_slave_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/spi_slave_hal_iram.c
build/ide/esp_idf_components/hal/timer_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/timer_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/timer_hal.c
+
+
+ build/ide/esp_idf_components/hal/timer_hal_iram.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/timer_hal_iram.c
build/ide/esp_idf_components/hal/touch_sensor_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/touch_sensor_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/touch_sensor_hal.c
build/ide/esp_idf_components/hal/twai_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/twai_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/twai_hal.c
build/ide/esp_idf_components/hal/twai_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/twai_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/twai_hal_iram.c
build/ide/esp_idf_components/hal/uart_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/uart_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/uart_hal.c
build/ide/esp_idf_components/hal/uart_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/uart_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/uart_hal_iram.c
build/ide/esp_idf_components/hal/wdt_hal_iram.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/wdt_hal_iram.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/wdt_hal_iram.c
build/ide/esp_idf_components/heap/heap_caps.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/heap/heap_caps.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/heap_caps.c
build/ide/esp_idf_components/heap/heap_caps_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/heap/heap_caps_init.c
-
-
- build/ide/esp_idf_components/heap/heap_tlsf.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/heap/heap_tlsf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/heap_caps_init.c
build/ide/esp_idf_components/heap/multi_heap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/heap/multi_heap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/multi_heap.c
+
+
+ build/ide/esp_idf_components/http_parser/http_parser.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/http_parser/http_parser.c
build/ide/esp_idf_components/log/log.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/log/log.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/log/log.c
build/ide/esp_idf_components/log/log_buffers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/log/log_buffers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/log/log_buffers.c
build/ide/esp_idf_components/log/log_freertos.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/log/log_freertos.c
-
-
- build/ide/esp_idf_components/mdns/mdns.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mdns/mdns.c
-
-
- build/ide/esp_idf_components/mdns/mdns_console.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mdns/mdns_console.c
-
-
- build/ide/esp_idf_components/mdns/mdns_networking.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mdns/mdns_networking.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/log/log_freertos.c
build/ide/esp_idf_components/newlib/abort.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/abort.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/abort.c
build/ide/esp_idf_components/newlib/assert.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/assert.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/assert.c
build/ide/esp_idf_components/newlib/heap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/heap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/heap.c
build/ide/esp_idf_components/newlib/locks.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/locks.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/locks.c
build/ide/esp_idf_components/newlib/newlib_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/newlib_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/newlib_init.c
build/ide/esp_idf_components/newlib/poll.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/poll.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/poll.c
build/ide/esp_idf_components/newlib/pthread.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/pthread.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/pthread.c
build/ide/esp_idf_components/newlib/random.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/random.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/random.c
+
+
+ build/ide/esp_idf_components/newlib/realpath.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/realpath.c
build/ide/esp_idf_components/newlib/reent_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/reent_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/reent_init.c
build/ide/esp_idf_components/newlib/stdatomic.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/stdatomic.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/stdatomic.c
build/ide/esp_idf_components/newlib/syscalls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/syscalls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/syscalls.c
+
+
+ build/ide/esp_idf_components/newlib/sysconf.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/sysconf.c
build/ide/esp_idf_components/newlib/termios.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/termios.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/termios.c
build/ide/esp_idf_components/newlib/time.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/time.c
build/ide/esp_idf_components/perfmon/xtensa_perfmon_access.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/perfmon/xtensa_perfmon_access.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/perfmon/xtensa_perfmon_access.c
build/ide/esp_idf_components/perfmon/xtensa_perfmon_apis.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/perfmon/xtensa_perfmon_apis.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/perfmon/xtensa_perfmon_apis.c
build/ide/esp_idf_components/perfmon/xtensa_perfmon_masks.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/perfmon/xtensa_perfmon_masks.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/perfmon/xtensa_perfmon_masks.c
build/ide/esp_idf_components/pthread/pthread.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/pthread/pthread.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/pthread/pthread.c
build/ide/esp_idf_components/pthread/pthread_cond_var.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/pthread/pthread_cond_var.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/pthread/pthread_cond_var.c
build/ide/esp_idf_components/pthread/pthread_local_storage.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/pthread/pthread_local_storage.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/pthread/pthread_local_storage.c
+
+
+ build/ide/esp_idf_components/pthread/pthread_rwlock.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/pthread/pthread_rwlock.c
+
+
+ build/ide/esp_idf_components/pthread/pthread_semaphore.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/pthread/pthread_semaphore.c
build/ide/esp_idf_components/sdmmc/sdmmc_cmd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_cmd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_cmd.c
build/ide/esp_idf_components/sdmmc/sdmmc_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_common.c
build/ide/esp_idf_components/sdmmc/sdmmc_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_init.c
build/ide/esp_idf_components/sdmmc/sdmmc_io.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_io.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_io.c
build/ide/esp_idf_components/sdmmc/sdmmc_mmc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_mmc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_mmc.c
build/ide/esp_idf_components/sdmmc/sdmmc_sd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/sdmmc/sdmmc_sd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/sdmmc/sdmmc_sd.c
+
+
+ build/ide/esp_idf_components/soc/dport_access_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/dport_access_common.c
build/ide/esp_idf_components/soc/lldesc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/lldesc.c
-
-
- build/ide/esp_idf_components/soc/memory_layout_utils.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/memory_layout_utils.c
-
-
- build/ide/esp_idf_components/soc/soc_include_legacy_warn.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/soc_include_legacy_warn.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/lldesc.c
build/ide/esp_idf_components/spi_flash/cache_utils.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/cache_utils.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/cache_utils.c
build/ide/esp_idf_components/spi_flash/esp_flash_api.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/esp_flash_api.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/esp_flash_api.c
build/ide/esp_idf_components/spi_flash/esp_flash_spi_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/esp_flash_spi_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/esp_flash_spi_init.c
+
+
+ build/ide/esp_idf_components/spi_flash/flash_brownout_hook.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/flash_brownout_hook.c
build/ide/esp_idf_components/spi_flash/flash_mmap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/flash_mmap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/flash_mmap.c
build/ide/esp_idf_components/spi_flash/flash_ops.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/flash_ops.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/flash_ops.c
build/ide/esp_idf_components/spi_flash/memspi_host_driver.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/memspi_host_driver.c
-
-
- build/ide/esp_idf_components/spi_flash/partition.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/partition.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/memspi_host_driver.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_boya.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_boya.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_boya.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_drivers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_drivers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_drivers.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_gd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_gd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_gd.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_generic.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_generic.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_generic.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_issi.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_issi.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_issi.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_mxic.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_mxic.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_mxic.c
+
+
+ build/ide/esp_idf_components/spi_flash/spi_flash_chip_mxic_opi.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_mxic_opi.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_th.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_th.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_th.c
build/ide/esp_idf_components/spi_flash/spi_flash_chip_winbond.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_chip_winbond.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_chip_winbond.c
build/ide/esp_idf_components/spi_flash/spi_flash_os_func_app.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_os_func_app.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_os_func_app.c
build/ide/esp_idf_components/spi_flash/spi_flash_os_func_noos.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/spi_flash_os_func_noos.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_os_func_noos.c
+
+
+ build/ide/esp_idf_components/spi_flash/spi_flash_wrap.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/spi_flash/spi_flash_wrap.c
build/ide/esp_idf_components/spiffs/esp_spiffs.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/esp_spiffs.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/esp_spiffs.c
build/ide/esp_idf_components/spiffs/spiffs_api.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs_api.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs_api.c
build/ide/esp_idf_components/tcp_transport/transport.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcp_transport/transport.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/tcp_transport/transport.c
+
+
+ build/ide/esp_idf_components/tcp_transport/transport_internal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/tcp_transport/transport_internal.c
+
+
+ build/ide/esp_idf_components/tcp_transport/transport_socks_proxy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/tcp_transport/transport_socks_proxy.c
build/ide/esp_idf_components/tcp_transport/transport_ssl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcp_transport/transport_ssl.c
-
-
- build/ide/esp_idf_components/tcp_transport/transport_tcp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcp_transport/transport_tcp.c
-
-
- build/ide/esp_idf_components/tcp_transport/transport_utils.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcp_transport/transport_utils.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/tcp_transport/transport_ssl.c
build/ide/esp_idf_components/tcp_transport/transport_ws.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcp_transport/transport_ws.c
-
-
- build/ide/esp_idf_components/tcpip_adapter/tcpip_adapter_compat.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/tcpip_adapter/tcpip_adapter_compat.c
-
-
- build/ide/esp_idf_components/ulp/ulp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/ulp/ulp.c
-
-
- build/ide/esp_idf_components/ulp/ulp_macro.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/ulp/ulp_macro.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/tcp_transport/transport_ws.c
build/ide/esp_idf_components/unity/unity_port_esp32.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/unity/unity_port_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity_port_esp32.c
build/ide/esp_idf_components/unity/unity_runner.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/unity/unity_runner.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity_runner.c
+
+
+ build/ide/esp_idf_components/unity/unity_utils_cache.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity_utils_cache.c
+
+
+ build/ide/esp_idf_components/unity/unity_utils_freertos.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity_utils_freertos.c
+
+
+ build/ide/esp_idf_components/unity/unity_utils_memory.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity_utils_memory.c
build/ide/esp_idf_components/vfs/vfs.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/vfs/vfs.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/vfs/vfs.c
build/ide/esp_idf_components/vfs/vfs_console.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/vfs/vfs_console.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/vfs/vfs_console.c
+
+
+ build/ide/esp_idf_components/vfs/vfs_eventfd.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/vfs/vfs_eventfd.c
build/ide/esp_idf_components/vfs/vfs_semihost.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/vfs/vfs_semihost.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/vfs/vfs_semihost.c
build/ide/esp_idf_components/vfs/vfs_uart.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/vfs/vfs_uart.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/vfs/vfs_uart.c
build/ide/esp_idf_components/wear_levelling/Partition.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/Partition.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/Partition.cpp
build/ide/esp_idf_components/wear_levelling/SPI_Flash.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/SPI_Flash.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/SPI_Flash.cpp
build/ide/esp_idf_components/wear_levelling/WL_Ext_Perf.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/WL_Ext_Perf.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/WL_Ext_Perf.cpp
build/ide/esp_idf_components/wear_levelling/WL_Ext_Safe.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/WL_Ext_Safe.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/WL_Ext_Safe.cpp
build/ide/esp_idf_components/wear_levelling/WL_Flash.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/WL_Flash.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/WL_Flash.cpp
build/ide/esp_idf_components/wear_levelling/crc32.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/crc32.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/crc32.cpp
build/ide/esp_idf_components/wear_levelling/wear_levelling.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wear_levelling/wear_levelling.cpp
-
-
- build/ide/esp_idf_components/xtensa/debug_helpers.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/debug_helpers.c
-
-
- build/ide/esp_idf_components/xtensa/debug_helpers_asm.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/debug_helpers_asm.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/wear_levelling/wear_levelling.cpp
build/ide/esp_idf_components/xtensa/eri.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/eri.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/xtensa/eri.c
- build/ide/esp_idf_components/xtensa/expression_with_stack_xtensa.c
+ build/ide/esp_idf_components/xtensa/xt_trax.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/expression_with_stack_xtensa.c
-
-
- build/ide/esp_idf_components/xtensa/expression_with_stack_xtensa_asm.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/expression_with_stack_xtensa_asm.S
-
-
- build/ide/esp_idf_components/xtensa/trax.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/trax.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/xtensa/xt_trax.c
build/ide/esp_idf_components/xtensa/xtensa_intr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/xtensa_intr.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/xtensa/xtensa_intr.c
build/ide/esp_idf_components/xtensa/xtensa_intr_asm.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/xtensa_intr_asm.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/xtensa/xtensa_intr_asm.S
- build/ide/esp_idf_components/app_trace/gcov/gcov_rtio.c
+ build/ide/esp_idf_components/app_trace/port/port_uart.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/app_trace/gcov/gcov_rtio.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/app_trace/port/port_uart.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_clock_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_clock_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_clock_init.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_common.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_common_loader.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_common_loader.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_common_loader.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_efuse.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_efuse.c
-
-
- build/ide/esp_idf_components/bootloader_support/src/bootloader_flash.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_flash.c
-
-
- build/ide/esp_idf_components/bootloader_support/src/bootloader_flash_config_esp32.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_flash_config_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_efuse.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_mem.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_mem.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_mem.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_random.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_random.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_random.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_random_esp32.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_random_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_random_esp32.c
build/ide/esp_idf_components/bootloader_support/src/bootloader_utility.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/bootloader_utility.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/bootloader_utility.c
build/ide/esp_idf_components/bootloader_support/src/esp_image_format.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/esp_image_format.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/esp_image_format.c
build/ide/esp_idf_components/bootloader_support/src/flash_encrypt.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/flash_encrypt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/flash_encrypt.c
build/ide/esp_idf_components/bootloader_support/src/flash_partitions.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/flash_partitions.c
-
-
- build/ide/esp_idf_components/bootloader_support/src/flash_qio_mode.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/flash_qio_mode.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/flash_partitions.c
build/ide/esp_idf_components/bootloader_support/src/secure_boot.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/secure_boot.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/secure_boot.c
- build/ide/esp_idf_components/coap/port/coap_debug.c
+ build/ide/esp_idf_components/console/argtable3/arg_cmd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/port/coap_debug.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_cmd.c
- build/ide/esp_idf_components/coap/port/coap_mbedtls.c
+ build/ide/esp_idf_components/console/argtable3/arg_date.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/port/coap_mbedtls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_date.c
- build/ide/esp_idf_components/coap/port/coap_notls.c
+ build/ide/esp_idf_components/console/argtable3/arg_dbl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/port/coap_notls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_dbl.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_dstr.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_dstr.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_end.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_end.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_file.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_file.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_hashtable.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_hashtable.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_int.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_int.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_lit.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_lit.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_rem.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_rem.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_rex.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_rex.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_str.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_str.c
+
+
+ build/ide/esp_idf_components/console/argtable3/arg_utils.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/arg_utils.c
build/ide/esp_idf_components/console/argtable3/argtable3.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/console/argtable3/argtable3.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/argtable3/argtable3.c
build/ide/esp_idf_components/console/linenoise/linenoise.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/console/linenoise/linenoise.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/console/linenoise/linenoise.c
- build/ide/esp_idf_components/driver/esp32/adc.c
+ build/ide/esp_idf_components/driver/dac/dac_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/esp32/adc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/dac/dac_common.c
- build/ide/esp_idf_components/driver/esp32/dac.c
+ build/ide/esp_idf_components/driver/dac/dac_continuous.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/esp32/dac.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/dac/dac_continuous.c
- build/ide/esp_idf_components/driver/esp32/touch_sensor.c
+ build/ide/esp_idf_components/driver/dac/dac_cosine.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/driver/esp32/touch_sensor.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/dac/dac_cosine.c
+
+
+ build/ide/esp_idf_components/driver/dac/dac_oneshot.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/dac/dac_oneshot.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/adc_dma_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/adc_dma_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/adc_i2s_deprecated.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/adc_i2s_deprecated.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/adc_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/adc_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/dac_common_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/dac_common_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/i2s_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/i2s_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/mcpwm_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/mcpwm_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/pcnt_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/pcnt_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/rmt_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/rmt_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/sigma_delta_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/sigma_delta_legacy.c
+
+
+ build/ide/esp_idf_components/driver/deprecated/timer_legacy.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/timer_legacy.c
+
+
+ build/ide/esp_idf_components/driver/gpio/gpio.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/gpio/gpio.c
+
+
+ build/ide/esp_idf_components/driver/gpio/gpio_glitch_filter_ops.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/gpio/gpio_glitch_filter_ops.c
+
+
+ build/ide/esp_idf_components/driver/gpio/rtc_io.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/gpio/rtc_io.c
+
+
+ build/ide/esp_idf_components/driver/gptimer/gptimer.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/gptimer/gptimer.c
+
+
+ build/ide/esp_idf_components/driver/gptimer/gptimer_priv.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/gptimer/gptimer_priv.c
+
+
+ build/ide/esp_idf_components/driver/i2c/i2c.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/i2c/i2c.c
+
+
+ build/ide/esp_idf_components/driver/i2s/i2s_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/i2s/i2s_common.c
+
+
+ build/ide/esp_idf_components/driver/i2s/i2s_pdm.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/i2s/i2s_pdm.c
+
+
+ build/ide/esp_idf_components/driver/i2s/i2s_std.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/i2s/i2s_std.c
+
+
+ build/ide/esp_idf_components/driver/ledc/ledc.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/ledc/ledc.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_cap.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_cap.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_cmpr.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_cmpr.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_com.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_com.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_fault.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_fault.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_gen.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_gen.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_oper.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_oper.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_sync.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_sync.c
+
+
+ build/ide/esp_idf_components/driver/mcpwm/mcpwm_timer.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/mcpwm/mcpwm_timer.c
+
+
+ build/ide/esp_idf_components/driver/pcnt/pulse_cnt.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/pcnt/pulse_cnt.c
+
+
+ build/ide/esp_idf_components/driver/rmt/rmt_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/rmt/rmt_common.c
+
+
+ build/ide/esp_idf_components/driver/rmt/rmt_encoder.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/rmt/rmt_encoder.c
+
+
+ build/ide/esp_idf_components/driver/rmt/rmt_rx.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/rmt/rmt_rx.c
+
+
+ build/ide/esp_idf_components/driver/rmt/rmt_tx.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/rmt/rmt_tx.c
+
+
+ build/ide/esp_idf_components/driver/sdio_slave/sdio_slave.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/sdio_slave/sdio_slave.c
+
+
+ build/ide/esp_idf_components/driver/sdmmc/sdmmc_host.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/sdmmc/sdmmc_host.c
+
+
+ build/ide/esp_idf_components/driver/sdmmc/sdmmc_transaction.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/sdmmc/sdmmc_transaction.c
+
+
+ build/ide/esp_idf_components/driver/sigma_delta/sdm.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/sigma_delta/sdm.c
+
+
+ build/ide/esp_idf_components/driver/spi/spi_bus_lock.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/spi_bus_lock.c
+
+
+ build/ide/esp_idf_components/driver/touch_sensor/touch_sensor_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/touch_sensor/touch_sensor_common.c
+
+
+ build/ide/esp_idf_components/driver/twai/twai.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/twai/twai.c
+
+
+ build/ide/esp_idf_components/driver/uart/uart.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/uart/uart.c
+
+
+ build/ide/esp_idf_components/efuse/esp32/esp_efuse_fields.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/esp32/esp_efuse_fields.c
build/ide/esp_idf_components/efuse/esp32/esp_efuse_table.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/esp32/esp_efuse_table.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/esp32/esp_efuse_table.c
+
+
+ build/ide/esp_idf_components/efuse/esp32/esp_efuse_utility.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/esp32/esp_efuse_utility.c
build/ide/esp_idf_components/efuse/src/esp_efuse_api.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp_efuse_api.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/src/esp_efuse_api.c
build/ide/esp_idf_components/efuse/src/esp_efuse_fields.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp_efuse_fields.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/src/esp_efuse_fields.c
build/ide/esp_idf_components/efuse/src/esp_efuse_utility.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp_efuse_utility.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/src/esp_efuse_utility.c
build/ide/esp_idf_components/esp-tls/esp-tls-crypto/esp_tls_crypto.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp-tls/esp-tls-crypto/esp_tls_crypto.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp-tls/esp-tls-crypto/esp_tls_crypto.c
- build/ide/esp_idf_components/esp_adc_cal/esp32/esp_adc_cal.c
+ build/ide/esp_idf_components/esp_adc/deprecated/esp_adc_cal_common_legacy.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_adc_cal/esp32/esp_adc_cal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/deprecated/esp_adc_cal_common_legacy.c
- build/ide/esp_idf_components/esp_common/src/brownout.c
+ build/ide/esp_idf_components/esp_adc/esp32/adc_cali_line_fitting.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/brownout.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/esp32/adc_cali_line_fitting.c
- build/ide/esp_idf_components/esp_common/src/dbg_stubs.c
+ build/ide/esp_idf_components/esp_coex/esp32/esp_coex_adapter.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/dbg_stubs.c
-
-
- build/ide/esp_idf_components/esp_common/src/esp_err.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/esp_err.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_coex/esp32/esp_coex_adapter.c
build/ide/esp_idf_components/esp_common/src/esp_err_to_name.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/esp_err_to_name.c
-
-
- build/ide/esp_idf_components/esp_common/src/freertos_hooks.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/freertos_hooks.c
-
-
- build/ide/esp_idf_components/esp_common/src/int_wdt.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/int_wdt.c
-
-
- build/ide/esp_idf_components/esp_common/src/mac_addr.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/mac_addr.c
-
-
- build/ide/esp_idf_components/esp_common/src/stack_check.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/stack_check.c
-
-
- build/ide/esp_idf_components/esp_common/src/task_wdt.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_common/src/task_wdt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_common/src/esp_err_to_name.c
build/ide/esp_idf_components/esp_eth/src/esp_eth.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth.c
- build/ide/esp_idf_components/esp_eth/src/esp_eth_mac_esp32.c
+ build/ide/esp_idf_components/esp_eth/src/esp_eth_mac_esp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_mac_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_mac_esp.c
build/ide/esp_idf_components/esp_eth/src/esp_eth_netif_glue.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_netif_glue.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_netif_glue.c
- build/ide/esp_idf_components/esp_eth/src/esp_eth_phy.c
+ build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_802_3.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_802_3.c
build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_dp83848.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy_dp83848.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_dp83848.c
build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_ip101.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy_ip101.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_ip101.c
- build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_ksz8041.c
+ build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_ksz80xx.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy_ksz8041.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_ksz80xx.c
- build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_lan8720.c
+ build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_lan87xx.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy_lan8720.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_lan87xx.c
build/ide/esp_idf_components/esp_eth/src/esp_eth_phy_rtl8201.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_eth/src/esp_eth_phy_rtl8201.c
-
-
- build/ide/esp_idf_components/esp_gdbstub/esp32/gdbstub_esp32.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_gdbstub/esp32/gdbstub_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_eth/src/esp_eth_phy_rtl8201.c
build/ide/esp_idf_components/esp_gdbstub/src/gdbstub.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_gdbstub/src/gdbstub.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/gdbstub.c
+
+
+ build/ide/esp_idf_components/esp_gdbstub/src/gdbstub_transport.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/gdbstub_transport.c
build/ide/esp_idf_components/esp_gdbstub/src/packet.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_gdbstub/src/packet.c
-
-
- build/ide/esp_idf_components/esp_gdbstub/xtensa/gdbstub_xtensa.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_gdbstub/xtensa/gdbstub_xtensa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/packet.c
build/ide/esp_idf_components/esp_hid/src/esp_hid_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hid/src/esp_hid_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hid/src/esp_hid_common.c
build/ide/esp_idf_components/esp_hid/src/esp_hidd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hid/src/esp_hidd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hid/src/esp_hidd.c
build/ide/esp_idf_components/esp_hid/src/esp_hidh.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hid/src/esp_hidh.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hid/src/esp_hidh.c
build/ide/esp_idf_components/esp_http_client/lib/http_auth.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_client/lib/http_auth.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_client/lib/http_auth.c
build/ide/esp_idf_components/esp_http_client/lib/http_header.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_client/lib/http_header.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_client/lib/http_header.c
build/ide/esp_idf_components/esp_http_client/lib/http_utils.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_client/lib/http_utils.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_client/lib/http_utils.c
build/ide/esp_idf_components/esp_http_server/src/httpd_main.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_main.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_main.c
build/ide/esp_idf_components/esp_http_server/src/httpd_parse.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_parse.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_parse.c
build/ide/esp_idf_components/esp_http_server/src/httpd_sess.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_sess.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_sess.c
build/ide/esp_idf_components/esp_http_server/src/httpd_txrx.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_txrx.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_txrx.c
build/ide/esp_idf_components/esp_http_server/src/httpd_uri.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_uri.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_uri.c
build/ide/esp_idf_components/esp_http_server/src/httpd_ws.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/httpd_ws.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/httpd_ws.c
build/ide/esp_idf_components/esp_https_ota/src/esp_https_ota.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_https_ota/src/esp_https_ota.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_https_ota/src/esp_https_ota.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp_clk_tree_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp_clk_tree_common.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_common.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_io.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_io.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_io_i2c.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_io_i2c.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_io_i2s.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_io_i2s.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_io_spi.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_io_spi.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_nt35510.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_nt35510.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_ops.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_ops.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_ssd1306.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_ssd1306.c
+
+
+ build/ide/esp_idf_components/esp_lcd/src/esp_lcd_panel_st7789.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_lcd/src/esp_lcd_panel_st7789.c
build/ide/esp_idf_components/esp_local_ctrl/proto-c/esp_local_ctrl.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_local_ctrl/proto-c/esp_local_ctrl.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_local_ctrl/proto-c/esp_local_ctrl.pb-c.c
build/ide/esp_idf_components/esp_local_ctrl/src/esp_local_ctrl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_local_ctrl/src/esp_local_ctrl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_local_ctrl/src/esp_local_ctrl.c
build/ide/esp_idf_components/esp_local_ctrl/src/esp_local_ctrl_handler.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_local_ctrl/src/esp_local_ctrl_handler.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_local_ctrl/src/esp_local_ctrl_handler.c
- build/ide/esp_idf_components/esp_netif/loopback/esp_netif_loopback.c
+ build/ide/esp_idf_components/esp_local_ctrl/src/esp_local_ctrl_transport_httpd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/loopback/esp_netif_loopback.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_local_ctrl/src/esp_local_ctrl_transport_httpd.c
build/ide/esp_idf_components/esp_netif/lwip/esp_netif_lwip.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/lwip/esp_netif_lwip.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/esp_netif_lwip.c
build/ide/esp_idf_components/esp_netif/lwip/esp_netif_lwip_defaults.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/lwip/esp_netif_lwip_defaults.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/esp_netif_lwip_defaults.c
- build/ide/esp_idf_components/esp_netif/lwip/esp_netif_sta_list.c
+ build/ide/esp_idf_components/esp_netif/lwip/esp_netif_sntp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_netif/lwip/esp_netif_sta_list.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/esp_netif_sntp.c
+
+
+ build/ide/esp_idf_components/esp_phy/src/btbb_init.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_phy/src/btbb_init.c
+
+
+ build/ide/esp_idf_components/esp_phy/src/lib_printf.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_phy/src/lib_printf.c
+
+
+ build/ide/esp_idf_components/esp_phy/src/phy_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_phy/src/phy_common.c
+
+
+ build/ide/esp_idf_components/esp_phy/src/phy_init.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_phy/src/phy_init.c
+
+
+ build/ide/esp_idf_components/esp_phy/src/phy_override.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_phy/src/phy_override.c
+
+
+ build/ide/esp_idf_components/esp_psram/esp32/esp_himem.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_psram/esp32/esp_himem.c
+
+
+ build/ide/esp_idf_components/esp_psram/esp32/esp_psram_extram_cache.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_psram/esp32/esp_psram_extram_cache.c
+
+
+ build/ide/esp_idf_components/esp_psram/esp32/esp_psram_impl_quad.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_psram/esp32/esp_psram_impl_quad.c
build/ide/esp_idf_components/esp_rom/patches/esp_rom_crc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_rom/patches/esp_rom_crc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_crc.c
+
+
+ build/ide/esp_idf_components/esp_rom/patches/esp_rom_efuse.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_efuse.c
build/ide/esp_idf_components/esp_rom/patches/esp_rom_longjmp.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_rom/patches/esp_rom_longjmp.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_longjmp.S
+
+
+ build/ide/esp_idf_components/esp_rom/patches/esp_rom_spiflash.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_spiflash.c
build/ide/esp_idf_components/esp_rom/patches/esp_rom_sys.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_rom/patches/esp_rom_sys.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_sys.c
build/ide/esp_idf_components/esp_rom/patches/esp_rom_uart.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_rom/patches/esp_rom_uart.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_rom/patches/esp_rom_uart.c
+
+
+ build/ide/esp_idf_components/esp_system/port/brownout.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/brownout.c
build/ide/esp_idf_components/esp_system/port/cpu_start.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/cpu_start.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/cpu_start.c
+
+
+ build/ide/esp_idf_components/esp_system/port/esp_system_chip.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/esp_system_chip.c
build/ide/esp_idf_components/esp_system/port/panic_handler.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/panic_handler.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/panic_handler.c
+
+
+ build/ide/esp_idf_components/esp_system/task_wdt/task_wdt.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/task_wdt/task_wdt.c
+
+
+ build/ide/esp_idf_components/esp_system/task_wdt/task_wdt_impl_timergroup.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/task_wdt/task_wdt_impl_timergroup.c
build/ide/esp_idf_components/esp_timer/src/esp_timer.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_timer/src/esp_timer.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_timer/src/esp_timer.c
build/ide/esp_idf_components/esp_timer/src/esp_timer_impl_lac.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_timer/src/esp_timer_impl_lac.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_timer/src/esp_timer_impl_lac.c
build/ide/esp_idf_components/esp_timer/src/ets_timer_legacy.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_timer/src/ets_timer_legacy.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_timer/src/ets_timer_legacy.c
build/ide/esp_idf_components/esp_timer/src/system_time.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_timer/src/system_time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_timer/src/system_time.c
build/ide/esp_idf_components/esp_wifi/esp32/esp_adapter.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/esp32/esp_adapter.c
-
-
- build/ide/esp_idf_components/esp_wifi/src/coexist.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/coexist.c
-
-
- build/ide/esp_idf_components/esp_wifi/src/lib_printf.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/lib_printf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/esp32/esp_adapter.c
build/ide/esp_idf_components/esp_wifi/src/mesh_event.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/mesh_event.c
-
-
- build/ide/esp_idf_components/esp_wifi/src/phy_init.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/phy_init.c
-
-
- build/ide/esp_idf_components/esp_wifi/src/phy_override.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/phy_override.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/mesh_event.c
build/ide/esp_idf_components/esp_wifi/src/smartconfig.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/smartconfig.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/smartconfig.c
build/ide/esp_idf_components/esp_wifi/src/smartconfig_ack.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/smartconfig_ack.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/smartconfig_ack.c
build/ide/esp_idf_components/esp_wifi/src/wifi_default.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/wifi_default.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/wifi_default.c
+
+
+ build/ide/esp_idf_components/esp_wifi/src/wifi_default_ap.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/wifi_default_ap.c
build/ide/esp_idf_components/esp_wifi/src/wifi_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/wifi_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/wifi_init.c
build/ide/esp_idf_components/esp_wifi/src/wifi_netif.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_wifi/src/wifi_netif.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_wifi/src/wifi_netif.c
build/ide/esp_idf_components/espcoredump/src/core_dump_binary.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_binary.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_binary.c
build/ide/esp_idf_components/espcoredump/src/core_dump_checksum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_checksum.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_checksum.c
build/ide/esp_idf_components/espcoredump/src/core_dump_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_common.c
build/ide/esp_idf_components/espcoredump/src/core_dump_elf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_elf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_elf.c
build/ide/esp_idf_components/espcoredump/src/core_dump_flash.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_flash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_flash.c
build/ide/esp_idf_components/espcoredump/src/core_dump_uart.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/core_dump_uart.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/core_dump_uart.c
build/ide/esp_idf_components/fatfs/diskio/diskio.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/diskio/diskio.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/diskio/diskio.c
build/ide/esp_idf_components/fatfs/diskio/diskio_rawflash.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/diskio/diskio_rawflash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/diskio/diskio_rawflash.c
build/ide/esp_idf_components/fatfs/diskio/diskio_sdmmc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/diskio/diskio_sdmmc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/diskio/diskio_sdmmc.c
build/ide/esp_idf_components/fatfs/diskio/diskio_wl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/diskio/diskio_wl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/diskio/diskio_wl.c
build/ide/esp_idf_components/fatfs/src/ff.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/src/ff.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/src/ff.c
build/ide/esp_idf_components/fatfs/src/ffunicode.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/src/ffunicode.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/src/ffunicode.c
build/ide/esp_idf_components/fatfs/vfs/vfs_fat.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/vfs/vfs_fat.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/vfs/vfs_fat.c
build/ide/esp_idf_components/fatfs/vfs/vfs_fat_sdmmc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/vfs/vfs_fat_sdmmc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/vfs/vfs_fat_sdmmc.c
build/ide/esp_idf_components/fatfs/vfs/vfs_fat_spiflash.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/vfs/vfs_fat_spiflash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/vfs/vfs_fat_spiflash.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_master.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/croutine.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_master.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/croutine.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_master_serial.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/event_groups.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_master_serial.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/event_groups.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_master_tcp.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/list.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_master_tcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/list.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_slave.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/queue.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_slave.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/queue.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_slave_serial.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/stream_buffer.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_slave_serial.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/stream_buffer.c
- build/ide/esp_idf_components/freemodbus/common/esp_modbus_slave_tcp.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/tasks.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/common/esp_modbus_slave_tcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/tasks.c
- build/ide/esp_idf_components/freemodbus/modbus/mb.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/timers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/mb.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/timers.c
- build/ide/esp_idf_components/freemodbus/modbus/mb_m.c
+ build/ide/esp_idf_components/freertos/esp_additions/freertos_v8_compat.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/mb_m.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/esp_additions/freertos_v8_compat.c
- build/ide/esp_idf_components/freemodbus/port/port.c
+ build/ide/esp_idf_components/freertos/esp_additions/idf_additions.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/port.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/esp_additions/idf_additions.c
- build/ide/esp_idf_components/freemodbus/port/portevent.c
+ build/ide/esp_idf_components/hal/esp32/cache_hal_esp32.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portevent.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/esp32/cache_hal_esp32.c
- build/ide/esp_idf_components/freemodbus/port/portevent_m.c
+ build/ide/esp_idf_components/hal/esp32/clk_tree_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portevent_m.c
-
-
- build/ide/esp_idf_components/freemodbus/port/portother.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portother.c
-
-
- build/ide/esp_idf_components/freemodbus/port/portother_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portother_m.c
-
-
- build/ide/esp_idf_components/freemodbus/port/portserial.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portserial.c
-
-
- build/ide/esp_idf_components/freemodbus/port/portserial_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/portserial_m.c
-
-
- build/ide/esp_idf_components/freemodbus/port/porttimer.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/porttimer.c
-
-
- build/ide/esp_idf_components/freemodbus/port/porttimer_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/port/porttimer_m.c
-
-
- build/ide/esp_idf_components/freertos/port/port_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/port_common.c
-
-
- build/ide/esp_idf_components/hal/esp32/adc_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/adc_hal.c
-
-
- build/ide/esp_idf_components/hal/esp32/brownout_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/brownout_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/esp32/clk_tree_hal.c
build/ide/esp_idf_components/hal/esp32/efuse_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/efuse_hal.c
-
-
- build/ide/esp_idf_components/hal/esp32/emac_hal.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/emac_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/esp32/efuse_hal.c
build/ide/esp_idf_components/hal/esp32/gpio_hal_workaround.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/gpio_hal_workaround.c
-
-
- build/ide/esp_idf_components/hal/esp32/interrupt_descriptor_table.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/interrupt_descriptor_table.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/esp32/gpio_hal_workaround.c
build/ide/esp_idf_components/hal/esp32/touch_sensor_hal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/hal/esp32/touch_sensor_hal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/hal/esp32/touch_sensor_hal.c
- build/ide/esp_idf_components/jsmn/src/jsmn.c
+ build/ide/esp_idf_components/heap/port/memory_layout_utils.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/jsmn/src/jsmn.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/port/memory_layout_utils.c
+
+
+ build/ide/esp_idf_components/heap/tlsf/tlsf.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/tlsf/tlsf.c
build/ide/esp_idf_components/json/cJSON/cJSON.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/json/cJSON/cJSON.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/json/cJSON/cJSON.c
build/ide/esp_idf_components/json/cJSON/cJSON_Utils.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/json/cJSON/cJSON_Utils.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/json/cJSON/cJSON_Utils.c
- build/ide/esp_idf_components/libsodium/port/randombytes_esp32.c
+ build/ide/esp_idf_components/lwip/port/sockets_ext.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/port/randombytes_esp32.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/sockets_ext.c
build/ide/esp_idf_components/mbedtls/port/esp_bignum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/esp_bignum.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/esp_bignum.c
build/ide/esp_idf_components/mbedtls/port/esp_hardware.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/esp_hardware.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/esp_hardware.c
build/ide/esp_idf_components/mbedtls/port/esp_mem.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/esp_mem.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/esp_mem.c
build/ide/esp_idf_components/mbedtls/port/esp_timing.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/esp_timing.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/esp_timing.c
build/ide/esp_idf_components/mbedtls/port/mbedtls_debug.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/mbedtls_debug.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/mbedtls_debug.c
build/ide/esp_idf_components/mbedtls/port/net_sockets.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/net_sockets.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/net_sockets.c
build/ide/esp_idf_components/mqtt/esp-mqtt/mqtt_client.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mqtt/esp-mqtt/mqtt_client.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mqtt/esp-mqtt/mqtt_client.c
build/ide/esp_idf_components/newlib/port/esp_time_impl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/newlib/port/esp_time_impl.c
-
-
- build/ide/esp_idf_components/nghttp/port/http_parser.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/port/http_parser.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/newlib/port/esp_time_impl.c
build/ide/esp_idf_components/nvs_flash/src/nvs_api.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_api.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_api.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_cxx_api.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_cxx_api.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_cxx_api.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_handle_locked.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_handle_locked.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_handle_locked.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_handle_simple.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_handle_simple.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_handle_simple.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_item_hash_list.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_item_hash_list.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_item_hash_list.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_page.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_page.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_page.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_pagemanager.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_pagemanager.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_pagemanager.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_partition.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_partition.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_partition.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_partition_lookup.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_partition_lookup.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_partition_lookup.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_partition_manager.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_partition_manager.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_partition_manager.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_storage.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_storage.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_storage.cpp
build/ide/esp_idf_components/nvs_flash/src/nvs_types.cpp
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nvs_flash/src/nvs_types.cpp
-
-
- build/ide/esp_idf_components/openssl/library/ssl_bio.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_bio.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_cert.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_cert.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_err.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_err.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_lib.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_lib.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_methods.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_methods.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_pkey.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_pkey.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_stack.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_stack.c
-
-
- build/ide/esp_idf_components/openssl/library/ssl_x509.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/library/ssl_x509.c
-
-
- build/ide/esp_idf_components/openssl/platform/ssl_pm.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/platform/ssl_pm.c
-
-
- build/ide/esp_idf_components/openssl/platform/ssl_port.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/openssl/platform/ssl_port.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/nvs_flash/src/nvs_types.cpp
build/ide/esp_idf_components/protocomm/proto-c/constants.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/proto-c/constants.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/proto-c/constants.pb-c.c
build/ide/esp_idf_components/protocomm/proto-c/sec0.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/proto-c/sec0.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/proto-c/sec0.pb-c.c
build/ide/esp_idf_components/protocomm/proto-c/sec1.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/proto-c/sec1.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/proto-c/sec1.pb-c.c
+
+
+ build/ide/esp_idf_components/protocomm/proto-c/sec2.pb-c.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/proto-c/sec2.pb-c.c
build/ide/esp_idf_components/protocomm/proto-c/session.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/proto-c/session.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/proto-c/session.pb-c.c
build/ide/esp_idf_components/soc/esp32/adc_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/adc_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/adc_periph.c
build/ide/esp_idf_components/soc/esp32/dac_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/dac_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/dac_periph.c
+
+
+ build/ide/esp_idf_components/soc/esp32/dport_access.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/dport_access.c
build/ide/esp_idf_components/soc/esp32/gpio_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/gpio_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/gpio_periph.c
build/ide/esp_idf_components/soc/esp32/i2c_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/i2c_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/i2c_periph.c
build/ide/esp_idf_components/soc/esp32/i2s_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/i2s_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/i2s_periph.c
build/ide/esp_idf_components/soc/esp32/interrupts.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/interrupts.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/interrupts.c
+
+
+ build/ide/esp_idf_components/soc/esp32/lcd_periph.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/lcd_periph.c
build/ide/esp_idf_components/soc/esp32/ledc_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/ledc_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/ledc_periph.c
+
+
+ build/ide/esp_idf_components/soc/esp32/mcpwm_periph.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/mcpwm_periph.c
build/ide/esp_idf_components/soc/esp32/pcnt_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/pcnt_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/pcnt_periph.c
build/ide/esp_idf_components/soc/esp32/rmt_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/rmt_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/rmt_periph.c
build/ide/esp_idf_components/soc/esp32/rtc_io_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/rtc_io_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/rtc_io_periph.c
build/ide/esp_idf_components/soc/esp32/sdio_slave_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/sdio_slave_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/sdio_slave_periph.c
+
+
+ build/ide/esp_idf_components/soc/esp32/sdm_periph.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/sdm_periph.c
build/ide/esp_idf_components/soc/esp32/sdmmc_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/sdmmc_periph.c
-
-
- build/ide/esp_idf_components/soc/esp32/sigmadelta_periph.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/sigmadelta_periph.c
-
-
- build/ide/esp_idf_components/soc/esp32/soc_memory_layout.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/soc_memory_layout.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/sdmmc_periph.c
build/ide/esp_idf_components/soc/esp32/spi_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/spi_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/spi_periph.c
build/ide/esp_idf_components/soc/esp32/timer_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/timer_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/timer_periph.c
build/ide/esp_idf_components/soc/esp32/touch_sensor_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/touch_sensor_periph.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/touch_sensor_periph.c
+
+
+ build/ide/esp_idf_components/soc/esp32/twai_periph.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/twai_periph.c
build/ide/esp_idf_components/soc/esp32/uart_periph.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/soc/esp32/uart_periph.c
-
-
- build/ide/esp_idf_components/spi_flash/esp32/flash_ops_esp32.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/esp32/flash_ops_esp32.c
-
-
- build/ide/esp_idf_components/spi_flash/esp32/spi_flash_rom_patch.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spi_flash/esp32/spi_flash_rom_patch.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/soc/esp32/uart_periph.c
build/ide/esp_idf_components/wifi_provisioning/proto-c/wifi_config.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/proto-c/wifi_config.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/proto-c/wifi_config.pb-c.c
build/ide/esp_idf_components/wifi_provisioning/proto-c/wifi_constants.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/proto-c/wifi_constants.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/proto-c/wifi_constants.pb-c.c
+
+
+ build/ide/esp_idf_components/wifi_provisioning/proto-c/wifi_ctrl.pb-c.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/proto-c/wifi_ctrl.pb-c.c
build/ide/esp_idf_components/wifi_provisioning/proto-c/wifi_scan.pb-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/proto-c/wifi_scan.pb-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/proto-c/wifi_scan.pb-c.c
build/ide/esp_idf_components/wifi_provisioning/src/handlers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/handlers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/handlers.c
build/ide/esp_idf_components/wifi_provisioning/src/manager.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/manager.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/manager.c
build/ide/esp_idf_components/wifi_provisioning/src/scheme_console.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/scheme_console.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/scheme_console.c
build/ide/esp_idf_components/wifi_provisioning/src/scheme_softap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/scheme_softap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/scheme_softap.c
build/ide/esp_idf_components/wifi_provisioning/src/wifi_config.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/wifi_config.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/wifi_config.c
+
+
+ build/ide/esp_idf_components/wifi_provisioning/src/wifi_ctrl.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/wifi_ctrl.c
build/ide/esp_idf_components/wifi_provisioning/src/wifi_scan.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wifi_provisioning/src/wifi_scan.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wifi_provisioning/src/wifi_scan.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/port/eloop.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/port/eloop.c
build/ide/esp_idf_components/wpa_supplicant/port/os_xtensa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/port/os_xtensa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/port/os_xtensa.c
- build/ide/esp_idf_components/xtensa/esp32/trax_init.c
+ build/ide/esp_idf_components/bootloader_support/bootloader_flash/src/bootloader_flash.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/xtensa/esp32/trax_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/bootloader_flash/src/bootloader_flash.c
+
+
+ build/ide/esp_idf_components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c
+
+
+ build/ide/esp_idf_components/bootloader_support/bootloader_flash/src/flash_qio_mode.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/bootloader_flash/src/flash_qio_mode.c
build/ide/esp_idf_components/bootloader_support/src/idf/bootloader_sha.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/bootloader_support/src/idf/bootloader_sha.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborencoder.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborencoder.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborencoder_close_container_checked.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborencoder_close_container_checked.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborerrorstrings.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborerrorstrings.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborparser.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborparser.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborparser_dup_string.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborparser_dup_string.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborpretty.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborpretty.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborpretty_stdio.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborpretty_stdio.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cbortojson.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cbortojson.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/cborvalidation.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/cborvalidation.c
-
-
- build/ide/esp_idf_components/cbor/tinycbor/src/open_memstream.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cbor/tinycbor/src/open_memstream.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/bootloader_support/src/idf/bootloader_sha.c
build/ide/esp_idf_components/cmock/CMock/src/cmock.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/cmock/CMock/src/cmock.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/cmock/CMock/src/cmock.c
- build/ide/esp_idf_components/coap/libcoap/src/address.c
+ build/ide/esp_idf_components/driver/dac/esp32/dac_dma.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/address.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/dac/esp32/dac_dma.c
- build/ide/esp_idf_components/coap/libcoap/src/async.c
+ build/ide/esp_idf_components/driver/deprecated/esp32/dac_legacy.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/async.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/deprecated/esp32/dac_legacy.c
- build/ide/esp_idf_components/coap/libcoap/src/block.c
+ build/ide/esp_idf_components/driver/spi/gpspi/spi_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/block.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/gpspi/spi_common.c
- build/ide/esp_idf_components/coap/libcoap/src/coap_event.c
+ build/ide/esp_idf_components/driver/spi/gpspi/spi_master.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/coap_event.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/gpspi/spi_master.c
- build/ide/esp_idf_components/coap/libcoap/src/coap_hashkey.c
+ build/ide/esp_idf_components/driver/spi/gpspi/spi_slave.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/coap_hashkey.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/gpspi/spi_slave.c
- build/ide/esp_idf_components/coap/libcoap/src/coap_io.c
+ build/ide/esp_idf_components/driver/spi/sdspi/sdspi_crc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/coap_io.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/sdspi/sdspi_crc.c
- build/ide/esp_idf_components/coap/libcoap/src/coap_session.c
+ build/ide/esp_idf_components/driver/spi/sdspi/sdspi_host.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/coap_session.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/sdspi/sdspi_host.c
- build/ide/esp_idf_components/coap/libcoap/src/coap_time.c
+ build/ide/esp_idf_components/driver/spi/sdspi/sdspi_transaction.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/coap_time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/spi/sdspi/sdspi_transaction.c
- build/ide/esp_idf_components/coap/libcoap/src/encode.c
+ build/ide/esp_idf_components/driver/touch_sensor/esp32/touch_sensor.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/encode.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/driver/touch_sensor/esp32/touch_sensor.c
- build/ide/esp_idf_components/coap/libcoap/src/mem.c
+ build/ide/esp_idf_components/esp_adc/deprecated/esp32/esp_adc_cal_legacy.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/mem.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/net.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/net.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/option.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/option.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/pdu.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/pdu.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/resource.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/resource.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/str.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/str.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/subscribe.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/subscribe.c
-
-
- build/ide/esp_idf_components/coap/libcoap/src/uri.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/coap/libcoap/src/uri.c
-
-
- build/ide/esp_idf_components/efuse/src/esp32/esp_efuse_api.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp32/esp_efuse_api.c
-
-
- build/ide/esp_idf_components/efuse/src/esp32/esp_efuse_fields.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp32/esp_efuse_fields.c
-
-
- build/ide/esp_idf_components/efuse/src/esp32/esp_efuse_utility.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/efuse/src/esp32/esp_efuse_utility.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_adc/deprecated/esp32/esp_adc_cal_legacy.c
build/ide/esp_idf_components/esp_http_server/src/util/ctrl_sock.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_http_server/src/util/ctrl_sock.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_http_server/src/util/ctrl_sock.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/cache_sram_mmu.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/cache_sram_mmu.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/chip_info.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/chip_info.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/cpu_region_protect.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/cpu_region_protect.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/esp_clk_tree.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/esp_clk_tree.c
+
+
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/io_mux.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/io_mux.c
build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_clk.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_clk.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/rtc_clk.c
build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_clk_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_clk_init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/rtc_clk_init.c
build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_init.c
-
-
- build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_pm.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_pm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/rtc_init.c
build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_sleep.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_sleep.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/rtc_sleep.c
build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_time.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/rtc_time.c
- build/ide/esp_idf_components/esp_hw_support/port/esp32/rtc_wdt.c
+ build/ide/esp_idf_components/esp_hw_support/port/esp32/sar_periph_ctrl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_hw_support/port/esp32/rtc_wdt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_hw_support/port/esp32/sar_periph_ctrl.c
+
+
+ build/ide/esp_idf_components/esp_mm/port/esp32/ext_mem_layout.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_mm/port/esp32/ext_mem_layout.c
+
+
+ build/ide/esp_idf_components/esp_netif/lwip/netif/esp_pbuf_ref.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/netif/esp_pbuf_ref.c
+
+
+ build/ide/esp_idf_components/esp_netif/lwip/netif/ethernetif.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/netif/ethernetif.c
+
+
+ build/ide/esp_idf_components/esp_netif/lwip/netif/wlanif.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_netif/lwip/netif/wlanif.c
build/ide/esp_idf_components/fatfs/port/freertos/ffsystem.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/fatfs/port/freertos/ffsystem.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/fatfs/port/freertos/ffsystem.c
- build/ide/esp_idf_components/freemodbus/modbus/ascii/mbascii.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/port_systick.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/ascii/mbascii.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/port_systick.c
- build/ide/esp_idf_components/freemodbus/modbus/ascii/mbascii_m.c
+ build/ide/esp_idf_components/heap/port/esp32/memory_layout.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/ascii/mbascii_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfunccoils.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfunccoils.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfunccoils_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfunccoils_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncdiag.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncdiag.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncdisc.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncdisc.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncdisc_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncdisc_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncholding.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncholding.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncholding_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncholding_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncinput.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncinput.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncinput_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncinput_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbfuncother.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbfuncother.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/functions/mbutils.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/functions/mbutils.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/rtu/mbcrc.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/rtu/mbcrc.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/rtu/mbrtu.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/rtu/mbrtu.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/rtu/mbrtu_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/rtu/mbrtu_m.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/tcp/mbtcp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/tcp/mbtcp.c
-
-
- build/ide/esp_idf_components/freemodbus/modbus/tcp/mbtcp_m.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/modbus/tcp/mbtcp_m.c
-
-
- build/ide/esp_idf_components/freemodbus/serial_master/modbus_controller/mbc_serial_master.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/serial_master/modbus_controller/mbc_serial_master.c
-
-
- build/ide/esp_idf_components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c
-
-
- build/ide/esp_idf_components/freemodbus/tcp_master/modbus_controller/mbc_tcp_master.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/tcp_master/modbus_controller/mbc_tcp_master.c
-
-
- build/ide/esp_idf_components/freemodbus/tcp_master/port/port_tcp_master.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/tcp_master/port/port_tcp_master.c
-
-
- build/ide/esp_idf_components/freemodbus/tcp_slave/modbus_controller/mbc_tcp_slave.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/tcp_slave/modbus_controller/mbc_tcp_slave.c
-
-
- build/ide/esp_idf_components/freemodbus/tcp_slave/port/port_tcp_slave.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freemodbus/tcp_slave/port/port_tcp_slave.c
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/port.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/port.c
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/portasm.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/portasm.S
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/xtensa_context.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/xtensa_context.S
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/xtensa_init.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/xtensa_init.c
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/xtensa_overlay_os_hook.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/xtensa_overlay_os_hook.c
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/xtensa_vector_defaults.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/xtensa_vector_defaults.S
-
-
- build/ide/esp_idf_components/freertos/port/xtensa/xtensa_vectors.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/freertos/port/xtensa/xtensa_vectors.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/heap/port/esp32/memory_layout.c
build/ide/esp_idf_components/lwip/apps/dhcpserver/dhcpserver.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/apps/dhcpserver/dhcpserver.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/apps/dhcpserver/dhcpserver.c
build/ide/esp_idf_components/lwip/apps/ping/esp_ping.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/apps/ping/esp_ping.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/apps/ping/esp_ping.c
build/ide/esp_idf_components/lwip/apps/ping/ping.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/apps/ping/ping.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/apps/ping/ping.c
build/ide/esp_idf_components/lwip/apps/ping/ping_sock.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/apps/ping/ping_sock.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/apps/ping/ping_sock.c
build/ide/esp_idf_components/lwip/apps/sntp/sntp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/apps/sntp/sntp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/apps/sntp/sntp.c
- build/ide/esp_idf_components/lwip/port/esp32/vfs_lwip.c
+ build/ide/esp_idf_components/lwip/port/debug/lwip_debug.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/vfs_lwip.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/debug/lwip_debug.c
+
+
+ build/ide/esp_idf_components/lwip/port/esp32xx/vfs_lwip.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/esp32xx/vfs_lwip.c
+
+
+ build/ide/esp_idf_components/lwip/port/freertos/sys_arch.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/freertos/sys_arch.c
+
+
+ build/ide/esp_idf_components/lwip/port/hooks/lwip_default_hooks.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/hooks/lwip_default_hooks.c
+
+
+ build/ide/esp_idf_components/lwip/port/hooks/tcp_isn_default.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/port/hooks/tcp_isn_default.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/aes.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/aes.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/aes.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/aesce.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/aesce.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/aesni.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/aesni.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/arc4.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/arc4.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/aesni.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/aria.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/aria.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/aria.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/asn1parse.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/asn1parse.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/asn1parse.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/asn1write.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/asn1write.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/asn1write.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/base64.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/base64.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/base64.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/bignum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/bignum.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/bignum.c
- build/ide/esp_idf_components/mbedtls/mbedtls/library/blowfish.c
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/bignum_core.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/blowfish.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/bignum_core.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/bignum_mod.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/bignum_mod.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/bignum_mod_raw.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/bignum_mod_raw.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/camellia.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/camellia.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/camellia.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ccm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ccm.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/certs.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/certs.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ccm.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/chacha20.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/chacha20.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/chacha20.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/chachapoly.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/chachapoly.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/chachapoly.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/cipher.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/cipher.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/cipher.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/cipher_wrap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/cipher_wrap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/cipher_wrap.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/cmac.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/cmac.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/cmac.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/constant_time.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/constant_time.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/constant_time.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ctr_drbg.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ctr_drbg.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ctr_drbg.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/debug.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/debug.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/debug.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/des.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/des.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/des.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/dhm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/dhm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/dhm.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ecdh.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ecdh.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ecdh.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ecdsa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ecdsa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ecdsa.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ecjpake.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ecjpake.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ecjpake.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ecp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ecp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ecp.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ecp_curves.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ecp_curves.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ecp_curves.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/entropy.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/entropy.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/entropy.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/entropy_poll.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/entropy_poll.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/entropy_poll.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/error.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/error.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/error.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/gcm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/gcm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/gcm.c
- build/ide/esp_idf_components/mbedtls/mbedtls/library/havege.c
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/hash_info.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/havege.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/hash_info.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/hkdf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/hkdf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/hkdf.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/hmac_drbg.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/hmac_drbg.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/hmac_drbg.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/lmots.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/lmots.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/lms.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/lms.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/md.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/md.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/md2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/md2.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/md4.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/md4.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/md.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/md5.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/md5.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/md5.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/memory_buffer_alloc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/memory_buffer_alloc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/memory_buffer_alloc.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/mps_reader.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/mps_reader.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/mps_reader.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/mps_trace.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/mps_trace.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/mps_trace.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/nist_kw.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/nist_kw.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/nist_kw.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/oid.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/oid.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/oid.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/padlock.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/padlock.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/padlock.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pem.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pem.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pem.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pk.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pk.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pk.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pk_wrap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pk_wrap.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/pkcs11.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pkcs11.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pk_wrap.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pkcs12.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pkcs12.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pkcs12.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pkcs5.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pkcs5.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pkcs5.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/pkcs7.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pkcs7.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pkparse.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pkparse.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pkparse.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/pkwrite.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/pkwrite.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/pkwrite.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/platform.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/platform.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/platform.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/platform_util.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/platform_util.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/platform_util.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/poly1305.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/poly1305.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/poly1305.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_aead.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_aead.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_aead.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_cipher.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_cipher.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_cipher.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_client.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_client.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_client.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_driver_wrappers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_driver_wrappers.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_driver_wrappers.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_ecp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_ecp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_ecp.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_hash.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_hash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_hash.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_mac.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_mac.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_mac.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_pake.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_pake.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_rsa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_rsa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_rsa.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_se.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_se.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_se.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_slot_management.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_slot_management.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_slot_management.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_crypto_storage.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_crypto_storage.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_crypto_storage.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_its_file.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/psa_its_file.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_its_file.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/psa_util.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/psa_util.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ripemd160.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ripemd160.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ripemd160.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/rsa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/rsa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/rsa.c
- build/ide/esp_idf_components/mbedtls/mbedtls/library/rsa_internal.c
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/rsa_alt_helpers.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/rsa_internal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/rsa_alt_helpers.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/sha1.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/sha1.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/sha1.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/sha256.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/sha256.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/sha256.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/sha512.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/sha512.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/sha512.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_cache.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_cache.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_cache.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_ciphersuites.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_ciphersuites.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_ciphersuites.c
- build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_cli.c
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_client.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_cli.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_client.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_cookie.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_cookie.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_cookie.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_debug_helpers_generated.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_debug_helpers_generated.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_msg.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_msg.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_srv.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_srv.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_msg.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_ticket.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_ticket.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_ticket.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_tls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls12_client.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls12_client.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls12_server.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls12_server.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls13_client.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls13_client.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls13_generic.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls13_generic.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls13_keys.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/ssl_tls13_keys.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls13_keys.c
+
+
+ build/ide/esp_idf_components/mbedtls/mbedtls/library/ssl_tls13_server.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/ssl_tls13_server.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/threading.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/threading.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/threading.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/timing.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/timing.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/timing.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/version.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/version.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/version.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/version_features.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/version_features.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/version_features.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509_create.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509_create.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509_create.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509_crl.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509_crl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509_crl.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509_crt.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509_crt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509_crt.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509_csr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509_csr.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509_csr.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509write_crt.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509write_crt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509write_crt.c
build/ide/esp_idf_components/mbedtls/mbedtls/library/x509write_csr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/x509write_csr.c
-
-
- build/ide/esp_idf_components/mbedtls/mbedtls/library/xtea.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/mbedtls/library/xtea.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/mbedtls/library/x509write_csr.c
build/ide/esp_idf_components/mbedtls/port/aes/esp_aes_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/aes/esp_aes_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/aes/esp_aes_common.c
+
+
+ build/ide/esp_idf_components/mbedtls/port/aes/esp_aes_gcm.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/aes/esp_aes_gcm.c
build/ide/esp_idf_components/mbedtls/port/aes/esp_aes_xts.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/aes/esp_aes_xts.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/aes/esp_aes_xts.c
build/ide/esp_idf_components/mbedtls/port/esp32/bignum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/esp32/bignum.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/esp32/bignum.c
build/ide/esp_idf_components/mbedtls/port/md/esp_md.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/md/esp_md.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/md/esp_md.c
build/ide/esp_idf_components/mbedtls/port/sha/esp_sha.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/sha/esp_sha.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/sha/esp_sha.c
build/ide/esp_idf_components/mqtt/esp-mqtt/lib/mqtt_msg.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mqtt/esp-mqtt/lib/mqtt_msg.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mqtt/esp-mqtt/lib/mqtt_msg.c
build/ide/esp_idf_components/mqtt/esp-mqtt/lib/mqtt_outbox.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mqtt/esp-mqtt/lib/mqtt_outbox.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mqtt/esp-mqtt/lib/mqtt_outbox.c
build/ide/esp_idf_components/mqtt/esp-mqtt/lib/platform_esp32_idf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mqtt/esp-mqtt/lib/platform_esp32_idf.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_buf.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_buf.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_callbacks.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_callbacks.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_debug.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_debug.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_frame.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_frame.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_hd.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_hd.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_hd_huffman.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_hd_huffman.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_hd_huffman_data.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_hd_huffman_data.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_helper.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_helper.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_http.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_http.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_map.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_map.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_mem.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_mem.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_npn.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_npn.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_option.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_option.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_outbound_item.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_outbound_item.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_pq.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_pq.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_priority_spec.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_priority_spec.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_queue.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_queue.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_rcbuf.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_rcbuf.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_session.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_session.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_stream.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_stream.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_submit.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_submit.c
-
-
- build/ide/esp_idf_components/nghttp/nghttp2/lib/nghttp2_version.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/nghttp/nghttp2/lib/nghttp2_version.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mqtt/esp-mqtt/lib/platform_esp32_idf.c
build/ide/esp_idf_components/protobuf-c/protobuf-c/protobuf-c/protobuf-c.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protobuf-c/protobuf-c/protobuf-c/protobuf-c.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protobuf-c/protobuf-c/protobuf-c/protobuf-c.c
build/ide/esp_idf_components/protocomm/src/common/protocomm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/src/common/protocomm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/common/protocomm.c
build/ide/esp_idf_components/protocomm/src/security/security0.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/src/security/security0.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/security/security0.c
build/ide/esp_idf_components/protocomm/src/security/security1.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/src/security/security1.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/security/security1.c
+
+
+ build/ide/esp_idf_components/protocomm/src/security/security2.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/security/security2.c
build/ide/esp_idf_components/protocomm/src/transports/protocomm_console.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/src/transports/protocomm_console.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/transports/protocomm_console.c
build/ide/esp_idf_components/protocomm/src/transports/protocomm_httpd.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/protocomm/src/transports/protocomm_httpd.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/transports/protocomm_httpd.c
build/ide/esp_idf_components/spiffs/spiffs/src/spiffs_cache.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs/src/spiffs_cache.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs/src/spiffs_cache.c
build/ide/esp_idf_components/spiffs/spiffs/src/spiffs_check.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs/src/spiffs_check.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs/src/spiffs_check.c
build/ide/esp_idf_components/spiffs/spiffs/src/spiffs_gc.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs/src/spiffs_gc.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs/src/spiffs_gc.c
build/ide/esp_idf_components/spiffs/spiffs/src/spiffs_hydrogen.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs/src/spiffs_hydrogen.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs/src/spiffs_hydrogen.c
build/ide/esp_idf_components/spiffs/spiffs/src/spiffs_nucleus.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/spiffs/spiffs/src/spiffs_nucleus.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/spiffs/spiffs/src/spiffs_nucleus.c
+
+
+ build/ide/esp_idf_components/unity/port/esp/unity_utils_memory_esp.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/port/esp/unity_utils_memory_esp.c
build/ide/esp_idf_components/unity/unity/src/unity.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/unity/unity/src/unity.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/unity/unity/src/unity.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_common.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_hostap.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_owe.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_owe.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_scan.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_scan.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/esp_wps.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wps.c
build/ide/esp_idf_components/wpa_supplicant/src/ap/ap_config.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/ap/ap_config.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/ap_config.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/ap/comeback_token.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/comeback_token.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/ap/ieee802_11.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/ieee802_11.c
build/ide/esp_idf_components/wpa_supplicant/src/ap/ieee802_1x.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/ap/ieee802_1x.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/ieee802_1x.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/ap/pmksa_cache_auth.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/pmksa_cache_auth.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/ap/sta_info.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/sta_info.c
build/ide/esp_idf_components/wpa_supplicant/src/ap/wpa_auth.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/ap/wpa_auth.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/wpa_auth.c
build/ide/esp_idf_components/wpa_supplicant/src/ap/wpa_auth_ie.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/ap/wpa_auth_ie.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/ap/wpa_auth_ie.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/common/bss.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/bss.c
build/ide/esp_idf_components/wpa_supplicant/src/common/dragonfly.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/common/dragonfly.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/dragonfly.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/common/ieee802_11_common.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/ieee802_11_common.c
build/ide/esp_idf_components/wpa_supplicant/src/common/sae.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/common/sae.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/sae.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/common/sae_pk.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/sae_pk.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/common/scan.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/scan.c
build/ide/esp_idf_components/wpa_supplicant/src/common/wpa_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/common/wpa_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/common/wpa_common.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-ccm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/aes-ccm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-ccm.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-gcm.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-gcm.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-omac1.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/aes-omac1.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-omac1.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-siv.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/aes-siv.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-siv.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-unwrap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/aes-unwrap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-unwrap.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/aes-wrap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/aes-wrap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/aes-wrap.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/ccmp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/ccmp.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/crypto/crypto_mbedtls-bignum.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/crypto_mbedtls-bignum.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/crypto/crypto_mbedtls-ec.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/crypto_mbedtls-ec.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/crypto/crypto_mbedtls.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/crypto_mbedtls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/ccmp.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/crypto_ops.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/crypto_ops.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/crypto_ops.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/des-internal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/des-internal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/des-internal.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/dh_group5.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/dh_group5.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/dh_group5.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/dh_groups.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/dh_groups.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/dh_groups.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/md4-internal.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/md4-internal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/md4-internal.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/ms_funcs.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/ms_funcs.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/ms_funcs.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/rc4.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/rc4.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/rc4.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha1-prf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha1-prf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha1-prf.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha1-tlsprf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha1-tlsprf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha1-tlsprf.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha1-tprf.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha1-tprf.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha256-kdf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha256-kdf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha256-kdf.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha256-prf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha256-prf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha256-prf.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha256-tlsprf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha256-tlsprf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha256-tlsprf.c
+
+
+ build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha384-prf.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha384-prf.c
build/ide/esp_idf_components/wpa_supplicant/src/crypto/sha384-tlsprf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/sha384-tlsprf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto/sha384-tlsprf.c
- build/ide/esp_idf_components/wpa_supplicant/src/crypto/tls_mbedtls.c
+ build/ide/esp_idf_components/wpa_supplicant/src/eap_common/eap_wsc_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/crypto/tls_mbedtls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_common/eap_wsc_common.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/chap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/chap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/chap.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_common.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_fast.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_fast.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_fast.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_fast_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_fast_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_fast_common.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_fast_pac.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_fast_pac.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_fast_pac.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_mschapv2.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_mschapv2.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_mschapv2.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_peap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_peap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_peap.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_peap_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_peap_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_peap_common.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_tls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_tls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_tls.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_tls_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_tls_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_tls_common.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/eap_ttls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/eap_ttls.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/eap_ttls.c
build/ide/esp_idf_components/wpa_supplicant/src/eap_peer/mschapv2.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/eap_peer/mschapv2.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_common.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_dpp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_dpp.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_hostap.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_wpa2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_wpa2.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.c
-
-
- build/ide/esp_idf_components/wpa_supplicant/src/esp_supplicant/esp_wps.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/esp_supplicant/esp_wps.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/eap_peer/mschapv2.c
build/ide/esp_idf_components/wpa_supplicant/src/rsn_supp/pmksa_cache.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/rsn_supp/pmksa_cache.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/rsn_supp/pmksa_cache.c
build/ide/esp_idf_components/wpa_supplicant/src/rsn_supp/wpa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/rsn_supp/wpa.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/rsn_supp/wpa.c
build/ide/esp_idf_components/wpa_supplicant/src/rsn_supp/wpa_ie.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/rsn_supp/wpa_ie.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/rsn_supp/wpa_ie.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/base64.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/base64.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/base64.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/bitfield.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/bitfield.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/bitfield.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/common.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/ext_password.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/ext_password.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/ext_password.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/json.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/json.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/json.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/uuid.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/uuid.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/uuid.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/wpa_debug.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/wpa_debug.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/wpa_debug.c
build/ide/esp_idf_components/wpa_supplicant/src/utils/wpabuf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/utils/wpabuf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/utils/wpabuf.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_attr_build.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_attr_build.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_attr_build.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_attr_parse.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_attr_parse.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_attr_parse.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_attr_process.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_attr_process.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_attr_process.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_common.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_common.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_common.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_dev_attr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_dev_attr.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_dev_attr.c
build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_enrollee.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_enrollee.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/src/wps/wps_enrollee.c
- build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_registrar.c
+ build/ide/esp_idf_components/esp_gdbstub/src/port/xtensa/gdbstub-entry.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_registrar.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/port/xtensa/gdbstub-entry.S
- build/ide/esp_idf_components/wpa_supplicant/src/wps/wps_validate.c
+ build/ide/esp_idf_components/esp_gdbstub/src/port/xtensa/gdbstub_xtensa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/wpa_supplicant/src/wps/wps_validate.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/port/xtensa/gdbstub_xtensa.c
- build/ide/esp_idf_components/asio/asio/asio/src/asio.cpp
+ build/ide/esp_idf_components/esp_gdbstub/src/port/xtensa/xt_debugexception.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/asio/asio/asio/src/asio.cpp
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_gdbstub/src/port/xtensa/xt_debugexception.S
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/debug_helpers.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/debug_helpers.c
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/debug_helpers_asm.S
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/debug_helpers_asm.S
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/debug_stubs.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/debug_stubs.c
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/esp_ipc_isr.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/esp_ipc_isr.c
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/esp_ipc_isr_handler.S
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/esp_ipc_isr_handler.S
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/esp_ipc_isr_routines.S
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/esp_ipc_isr_routines.S
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/expression_with_stack.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/expression_with_stack.c
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/expression_with_stack_asm.S
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/expression_with_stack_asm.S
build/ide/esp_idf_components/esp_system/port/arch/xtensa/panic_arch.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/arch/xtensa/panic_arch.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/panic_arch.c
build/ide/esp_idf_components/esp_system/port/arch/xtensa/panic_handler_asm.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/arch/xtensa/panic_handler_asm.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/panic_handler_asm.S
+
+
+ build/ide/esp_idf_components/esp_system/port/arch/xtensa/trax.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/arch/xtensa/trax.c
+
+
+ build/ide/esp_idf_components/esp_system/port/soc/esp32/cache_err_int.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/soc/esp32/cache_err_int.c
build/ide/esp_idf_components/esp_system/port/soc/esp32/clk.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/soc/esp32/clk.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/soc/esp32/clk.c
- build/ide/esp_idf_components/esp_system/port/soc/esp32/dport_panic_highint_hdl.S
+ build/ide/esp_idf_components/esp_system/port/soc/esp32/highint_hdl.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/soc/esp32/dport_panic_highint_hdl.S
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/soc/esp32/highint_hdl.S
build/ide/esp_idf_components/esp_system/port/soc/esp32/reset_reason.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/esp_system/port/soc/esp32/reset_reason.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/soc/esp32/reset_reason.c
+
+
+ build/ide/esp_idf_components/esp_system/port/soc/esp32/system_internal.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/esp_system/port/soc/esp32/system_internal.c
build/ide/esp_idf_components/espcoredump/src/port/xtensa/core_dump_port.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/espcoredump/src/port/xtensa/core_dump_port.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/espcoredump/src/port/xtensa/core_dump_port.c
- build/ide/esp_idf_components/expat/expat/expat/lib/xmlparse.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/expat/expat/expat/lib/xmlparse.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c
- build/ide/esp_idf_components/expat/expat/expat/lib/xmlrole.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/expat/expat/expat/lib/xmlrole.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S
- build/ide/esp_idf_components/expat/expat/expat/lib/xmltok.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/expat/expat/expat/lib/xmltok.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S
- build/ide/esp_idf_components/expat/expat/expat/lib/xmltok_impl.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/expat/expat/expat/lib/xmltok_impl.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c
- build/ide/esp_idf_components/expat/expat/expat/lib/xmltok_ns.c
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/expat/expat/expat/lib/xmltok_ns.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c
+
+
+ build/ide/esp_idf_components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S
build/ide/esp_idf_components/lwip/lwip/src/api/api_lib.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/api_lib.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/api_lib.c
build/ide/esp_idf_components/lwip/lwip/src/api/api_msg.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/api_msg.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/api_msg.c
build/ide/esp_idf_components/lwip/lwip/src/api/err.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/err.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/err.c
build/ide/esp_idf_components/lwip/lwip/src/api/if_api.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/if_api.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/if_api.c
build/ide/esp_idf_components/lwip/lwip/src/api/netbuf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/netbuf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/netbuf.c
build/ide/esp_idf_components/lwip/lwip/src/api/netdb.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/netdb.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/netdb.c
build/ide/esp_idf_components/lwip/lwip/src/api/netifapi.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/netifapi.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/netifapi.c
build/ide/esp_idf_components/lwip/lwip/src/api/sockets.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/sockets.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/sockets.c
build/ide/esp_idf_components/lwip/lwip/src/api/tcpip.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/api/tcpip.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/api/tcpip.c
build/ide/esp_idf_components/lwip/lwip/src/core/def.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/def.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/def.c
build/ide/esp_idf_components/lwip/lwip/src/core/dns.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/dns.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/dns.c
build/ide/esp_idf_components/lwip/lwip/src/core/inet_chksum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/inet_chksum.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/inet_chksum.c
build/ide/esp_idf_components/lwip/lwip/src/core/init.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/init.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/init.c
build/ide/esp_idf_components/lwip/lwip/src/core/ip.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ip.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ip.c
build/ide/esp_idf_components/lwip/lwip/src/core/mem.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/mem.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/mem.c
build/ide/esp_idf_components/lwip/lwip/src/core/memp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/memp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/memp.c
build/ide/esp_idf_components/lwip/lwip/src/core/netif.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/netif.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/netif.c
build/ide/esp_idf_components/lwip/lwip/src/core/pbuf.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/pbuf.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/pbuf.c
build/ide/esp_idf_components/lwip/lwip/src/core/raw.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/raw.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/raw.c
build/ide/esp_idf_components/lwip/lwip/src/core/stats.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/stats.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/stats.c
build/ide/esp_idf_components/lwip/lwip/src/core/sys.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/sys.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/sys.c
build/ide/esp_idf_components/lwip/lwip/src/core/tcp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/tcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/tcp.c
build/ide/esp_idf_components/lwip/lwip/src/core/tcp_in.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/tcp_in.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/tcp_in.c
build/ide/esp_idf_components/lwip/lwip/src/core/tcp_out.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/tcp_out.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/tcp_out.c
build/ide/esp_idf_components/lwip/lwip/src/core/timeouts.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/timeouts.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/timeouts.c
build/ide/esp_idf_components/lwip/lwip/src/core/udp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/udp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/udp.c
+
+
+ build/ide/esp_idf_components/lwip/lwip/src/netif/bridgeif.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/bridgeif.c
+
+
+ build/ide/esp_idf_components/lwip/lwip/src/netif/bridgeif_fdb.c
+ 1
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/bridgeif_fdb.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ethernet.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ethernet.c
-
-
- build/ide/esp_idf_components/lwip/lwip/src/netif/lowpan6.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/lowpan6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ethernet.c
build/ide/esp_idf_components/lwip/lwip/src/netif/slipif.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/slipif.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/debug/lwip_debug.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/debug/lwip_debug.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/freertos/sys_arch.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/freertos/sys_arch.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/hooks/lwip_default_hooks.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/hooks/lwip_default_hooks.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/hooks/tcp_isn_default.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/hooks/tcp_isn_default.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/netif/dhcp_state.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/netif/dhcp_state.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/netif/ethernetif.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/netif/ethernetif.c
-
-
- build/ide/esp_idf_components/lwip/port/esp32/netif/wlanif.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/port/esp32/netif/wlanif.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/slipif.c
build/ide/esp_idf_components/mbedtls/port/aes/block/esp_aes.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/aes/block/esp_aes.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/aes/block/esp_aes.c
build/ide/esp_idf_components/mbedtls/port/sha/parallel_engine/esp_sha1.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/sha/parallel_engine/esp_sha1.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/sha/parallel_engine/esp_sha1.c
build/ide/esp_idf_components/mbedtls/port/sha/parallel_engine/esp_sha256.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/sha/parallel_engine/esp_sha256.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/sha/parallel_engine/esp_sha256.c
build/ide/esp_idf_components/mbedtls/port/sha/parallel_engine/esp_sha512.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/sha/parallel_engine/esp_sha512.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/sha/parallel_engine/esp_sha512.c
build/ide/esp_idf_components/mbedtls/port/sha/parallel_engine/sha.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/mbedtls/port/sha/parallel_engine/sha.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/mbedtls/port/sha/parallel_engine/sha.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_auth/crypto_auth.c
+ build/ide/esp_idf_components/protocomm/src/crypto/srp6a/esp_srp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_auth/crypto_auth.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/crypto/srp6a/esp_srp.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box.c
+ build/ide/esp_idf_components/protocomm/src/crypto/srp6a/esp_srp_mpi.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/protocomm/src/crypto/srp6a/esp_srp_mpi.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box_easy.c
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-bignum.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box_easy.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-bignum.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box_seal.c
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-ec.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/crypto_box_seal.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-ec.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-rsa.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls-rsa.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_hash/crypto_hash.c
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_hash/crypto_hash.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c
+ build/ide/esp_idf_components/wpa_supplicant/esp_supplicant/src/crypto/tls_mbedtls.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_kx/crypto_kx.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_kx/crypto_kx.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/crypto_sign.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/crypto_sign.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/crypto_stream.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/crypto_stream.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/randombytes/randombytes.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/randombytes/randombytes.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/sodium/codecs.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/sodium/codecs.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/sodium/core.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/sodium/core.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/sodium/runtime.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/sodium/runtime.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/sodium/utils.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/sodium/utils.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/sodium/version.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/sodium/version.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/crypto/tls_mbedtls.c
build/ide/esp_idf_components/lwip/lwip/src/apps/netbiosns/netbiosns.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/apps/netbiosns/netbiosns.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/apps/netbiosns/netbiosns.c
build/ide/esp_idf_components/lwip/lwip/src/apps/sntp/sntp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/apps/sntp/sntp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/apps/sntp/sntp.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/autoip.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/autoip.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/autoip.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/dhcp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/dhcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/dhcp.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/etharp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/etharp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/etharp.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/icmp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/icmp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/icmp.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/igmp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/igmp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/igmp.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/ip4.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/ip4.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/ip4.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/ip4_addr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/ip4_addr.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/ip4_addr.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/ip4_frag.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/ip4_frag.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/ip4_frag.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv4/ip4_napt.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv4/ip4_napt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv4/ip4_napt.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/dhcp6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/dhcp6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/dhcp6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/ethip6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/ethip6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/ethip6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/icmp6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/icmp6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/icmp6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/inet6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/inet6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/inet6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/ip6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/ip6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/ip6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/ip6_addr.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/ip6_addr.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/ip6_addr.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/ip6_frag.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/ip6_frag.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/ip6_frag.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/mld6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/mld6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/mld6.c
build/ide/esp_idf_components/lwip/lwip/src/core/ipv6/nd6.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/core/ipv6/nd6.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/core/ipv6/nd6.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/auth.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/auth.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/auth.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/ccp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/ccp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/ccp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/chap-md5.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/chap-md5.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/chap-md5.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/chap-new.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/chap-new.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/chap-new.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/chap_ms.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/chap_ms.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/chap_ms.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/demand.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/demand.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/demand.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/eap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/eap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/eap.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/ecp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/ecp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/ecp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/eui64.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/eui64.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/eui64.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/fsm.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/fsm.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/fsm.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/ipcp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/ipcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/ipcp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/ipv6cp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/ipv6cp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/ipv6cp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/lcp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/lcp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/lcp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/magic.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/magic.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/magic.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/mppe.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/mppe.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/mppe.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/multilink.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/multilink.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/multilink.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/ppp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/ppp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/ppp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/pppapi.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/pppapi.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/pppapi.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/pppcrypt.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/pppcrypt.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/pppcrypt.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/pppoe.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/pppoe.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/pppoe.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/pppol2tp.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/pppol2tp.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/pppol2tp.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/pppos.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/pppos.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/pppos.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/upap.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/upap.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/upap.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/utils.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/utils.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/utils.c
build/ide/esp_idf_components/lwip/lwip/src/netif/ppp/vj.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/lwip/lwip/src/netif/ppp/vj.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/lwip/lwip/src/netif/ppp/vj.c
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c
+ build/ide/esp_idf_components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c
1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/core_ristretto255.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/core_ristretto255.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_verify/sodium/verify.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_verify/sodium/verify.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c
-
-
- build/ide/esp_idf_components/libsodium/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c
- 1
- /home/carlos/espressif/idf-v4.3.5/esp-idf-v4.3.5/components/libsodium/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c
+ /home/karl/espressif/esp-idf-v5.1.1/components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c
diff --git a/README.md b/README.md
index 3724a1e..4b22187 100644
--- a/README.md
+++ b/README.md
@@ -19,26 +19,23 @@ audio streams with sample rates up to 48Khz maybe more, I didn't test.
Please check out the task list and feel free to fill in.
-I dropped the usage of ADF completely but copied stripped down, needed components to this project.
+I dropped the usage of ADF completely but copied stripped down, needed components to this project (using ESP-ADF v2.6).
This was necessary because ADF was using flac in closed source precompiled library
-which made it impossible to get good results for multiroom syncing. IDF's I2S driver was also copied
-to project's components and adapted. Originally it wasn't possible to pre load DMA buffers with audio
-samples and therefore no precise sync could be achieved.
+which made it impossible to get good results for multiroom syncing.
### Codebase
-The codebase is split into components and build on ESP-IDF v4.3.5. I still
+The codebase is split into components and build on ESP-IDF v5.1.1. I still
have some refactoring on the todo list as the concept has started to settle and
allow for new features can be added in a structured manner. In the code you
will find parts that are only partly related features and still not on the task
list. Also there is a lot of code clean up needed.
Components
- - audio-board : taken from ADF, stripped down to strictly necessary parts for usage with Lyrat v4.3
- - audio-hal : taken from ADF, stripped down to strictly necessary parts for usage with Lyrat v4.3
- - audio-sal : taken from ADF, stripped down to strictly necessary parts for usage with Lyrat v4.3
- - custom_board :
- - custom-driver : modified I2S driver from IDF v4.3.1 which supports preloading DMA buffers with valid data
+ - audio-board : taken from ADF, stripped down to strictly necessary parts for playback
+ - audio-hal : taken from ADF, stripped down to strictly necessary parts for playback
+ - audio-sal : taken from ADF, stripped down to strictly necessary parts for playback
+ - custom_board : generic board component to support easy integration of DACs
- dsp_processor : Audio Processor, low pass filters, effects, etc.
- esp-dsp : Submodule to the ESP-ADF done by David Douard
- esp-peripherals : taken from ADF, stripped down to strictly necessary parts for usage with Lyrat v4.3
@@ -216,29 +213,13 @@ Then on every `git commit`, a few sanity/formatting checks will be performed.
## Task list
-- [ok] Fix to alinge with above
-- [ok] put kconfig to better locations in tree
- * add codec description
-- [ok] Integrate ESP wifi provision
-- [ok] Find and connect to Avahi broadcasted Snapcast server name
-- [ ] Add a client command interface layer like volume/mute control
+- [ ] put kconfig to better locations in tree
- [ ] add missing codec's (ogg)
-- [ok] test esp-dsp functionality after ADF drop
-- [ok] Check compatibility with different HW than Lyrat v4.3
-- [ok] rework dsp_processor and test. At the moment only dspfStereo and dspfBassBoost will work. Also ensure/test we got enough RAM on WROVER modules
-- [ ] reduce dsp_processor memory footprint
- [ ] dsp_processor: add equalizer
- * Control interface for equalizer
+- [ ] Control interface for equalizer (component: ui_http_server)
- [ ] clean and polish code (remove all unused variables etc.)
-- [ok] Improve Documentation, e.g. Hardware guide (supported codecs)
-- [ ] upgrade to IDF v5
-- [ ] in IDF v5 use native i2s driver, as it supports preloading DMA buffer with valid data now
+- [ ] Improve Documentation
- [ ] Throw out ADF copied components from project tree and use CmakeLists.txt to pull in necessary files from ADF
## Minor task
- - [ok] soft mute - play sample in buffer with decreasing volume
- - [ok] hard mute - using ADF's HAL
- - [ok] Startup: do not start parsing on samples to codec before sample ring buffer hits requested buffer size.
- - [ok] Start from empty buffer
- - [ ] fill in missing component descriptions in Readme.md
- - [ok] DAC latency setting from android app
+- [ ] fill in missing component descriptions in Readme.md
diff --git a/components/audio_board/CMakeLists.txt b/components/audio_board/CMakeLists.txt
index 438ffcd..b9be317 100644
--- a/components/audio_board/CMakeLists.txt
+++ b/components/audio_board/CMakeLists.txt
@@ -1,10 +1,9 @@
set(COMPONENT_ADD_INCLUDEDIRS ./include)
# Edit following two lines to set component requirements (see docs)
-set(COMPONENT_REQUIRES )
-set(COMPONENT_PRIV_REQUIRES audio_sal audio_hal esp_peripherals)
+set(COMPONENT_REQUIRES driver)
+set(COMPONENT_PRIV_REQUIRES esp_peripherals audio_sal audio_hal)
-#[[
if (CONFIG_ESP_LYRAT_V4_2_BOARD)
message(STATUS "Current board name is " CONFIG_ESP_LYRAT_V4_2_BOARD)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./lyrat_v4_2)
@@ -13,7 +12,6 @@ set(COMPONENT_SRCS
./lyrat_v4_2/board_pins_config.c
)
endif()
-]]
if (CONFIG_ESP_LYRAT_V4_3_BOARD)
message(STATUS "Current board name is " CONFIG_ESP_LYRAT_V4_3_BOARD)
@@ -33,7 +31,6 @@ set(COMPONENT_SRCS
)
endif()
-
if (CONFIG_ESP_LYRAT_MINI_V1_1_BOARD)
message(STATUS "Current board name is " CONFIG_ESP_LYRAT_MINI_V1_1_BOARD)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./lyrat_mini_v1_1)
@@ -43,7 +40,7 @@ set(COMPONENT_SRCS
)
endif()
-#[[
+
if (CONFIG_ESP_LYRATD_MSC_V2_1_BOARD)
message(STATUS "Current board name is " CONFIG_ESP_LYRATD_MSC_V2_1_BOARD)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./lyratd_msc_v2_1)
@@ -68,10 +65,11 @@ list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_korvo_du1906)
set(COMPONENT_SRCS
./esp32_korvo_du1906/board.c
./esp32_korvo_du1906/board_pins_config.c
-./esp32_korvo_du1906/du1906_bar_pattern.c
+#./esp32_korvo_du1906/du1906_bar_pattern.c
)
endif()
+
if (CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD)
message(STATUS "Current board name is " CONFIG_ESP32_S2_KALUGA_1_V1_2_BOARD)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_s2_kaluga_1_v1_2)
@@ -80,6 +78,62 @@ set(COMPONENT_SRCS
./esp32_s2_kaluga_1_v1_2/board_pins_config.c
)
endif()
+
+#[[
+if (CONFIG_ESP32_S3_KORVO2_V3_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_S3_KORVO2_V3_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_s3_korvo2_v3)
+set(COMPONENT_SRCS
+./esp32_s3_korvo2_v3/board.c
+./esp32_s3_korvo2_v3/board_pins_config.c
+)
+endif()
+
+if (CONFIG_ESP32_S3_KORVO2L_V1_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_S3_KORVO2L_V1_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_s3_korvo2l_v1)
+set(COMPONENT_SRCS
+./esp32_s3_korvo2l_v1/board.c
+./esp32_s3_korvo2l_v1/board_pins_config.c
+)
+endif()
+
+if (CONFIG_ESP32_S3_BOX_LITE_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_S3_BOX_LITE_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_s3_box_lite)
+set(COMPONENT_SRCS
+./esp32_s3_box_lite/board.c
+./esp32_s3_box_lite/board_pins_config.c
+)
+endif()
+
+if (CONFIG_ESP32_S3_BOX_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_S3_BOX_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_s3_box)
+set(COMPONENT_SRCS
+./esp32_s3_box/board.c
+./esp32_s3_box/board_pins_config.c
+)
+endif()
+
+if (CONFIG_ESP32_C3_LYRA_V2_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_C3_LYRA_V2_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_c3_lyra)
+set(COMPONENT_SRCS
+./esp32_c3_lyra/board.c
+./esp32_c3_lyra/board_pins_config.c
+./esp32_c3_lyra/C3_lyra_sys_pattern.c
+)
+endif()
+
+if (CONFIG_ESP32_C6_DEVKIT_BOARD)
+message(STATUS "Current board name is " CONFIG_ESP32_C6_DEVKIT_BOARD)
+list(APPEND COMPONENT_ADD_INCLUDEDIRS ./esp32_c6_devkit)
+set(COMPONENT_SRCS
+./esp32_c6_devkit/board.c
+./esp32_c6_devkit/board_pins_config.c
+)
+endif()
]]
register_component()
diff --git a/components/audio_board/Kconfig.projbuild b/components/audio_board/Kconfig.projbuild
index 050309a..d0c2dba 100644
--- a/components/audio_board/Kconfig.projbuild
+++ b/components/audio_board/Kconfig.projbuild
@@ -1,54 +1,331 @@
-menu "Audio HAL"
+menu "Audio Board"
-choice AUDIO_BOARD
- prompt "Audio board"
- default ESP_LYRAT_V4_3_BOARD
- help
- Select an audio board to use with the ESP-ADF
-config AUDIO_BOARD_CUSTOM
- bool "Custom audio board"
-config ESP_LYRAT_V4_3_BOARD
- bool "ESP32-Lyrat V4.3"
-config ESP_LYRAT_V4_2_BOARD
- bool "ESP32-Lyrat V4.2"
-config ESP_LYRATD_MSC_V2_1_BOARD
- bool "ESP32-LyraTD-MSC V2.1"
-config ESP_LYRATD_MSC_V2_2_BOARD
- bool "ESP32-LyraTD-MSC V2.2"
-config ESP_LYRAT_MINI_V1_1_BOARD
- bool "ESP32-Lyrat-Mini V1.1"
-config ESP32_KORVO_DU1906_BOARD
- bool "ESP32_KORVO_DU1906"
-config ESP32_S2_KALUGA_1_V1_2_BOARD
- bool "ESP32-S2-Kaluga-1 v1.2"
-config ESP_AI_THINKER_ES8388_BOARD
- bool "ESP-AI-Thinker-ES8388 v2.2"
+ config I2S_USE_MSB_FORMAT
+ bool
+ default n
+ help
+ Specifies if the I2S should use MSB format instead. Some DACs (such as PT8211) need this enabled to ensure
+ compatibility with their LSBJ timing under their native bit-depth. This option is only adjusted by the DAC
+ choice and is not exposed to menuconfig.
+ See https://github.com/schreibfaul1/ESP32-audioI2S/blob/1d9b299d0197f99fc70335295adcd226dc220f88/src/Audio.cpp#L4929
-endchoice
+ choice AUDIO_BOARD
+ prompt "Audio board"
+ default ESP_LYRAT_V4_3_BOARD
+ help
+ Select an audio board to use with the ESP-ADF
+ config AUDIO_BOARD_CUSTOM
+ bool "Custom audio board"
+ config ESP_LYRAT_V4_3_BOARD
+ bool "ESP32-Lyrat V4.3"
+ config ESP_LYRAT_V4_2_BOARD
+ bool "ESP32-Lyrat V4.2"
+ config ESP_LYRATD_MSC_V2_1_BOARD
+ bool "ESP32-LyraTD-MSC V2.1"
+ config ESP_LYRATD_MSC_V2_2_BOARD
+ bool "ESP32-LyraTD-MSC V2.2"
+ config ESP_LYRAT_MINI_V1_1_BOARD
+ bool "ESP32-Lyrat-Mini V1.1"
+ config ESP32_KORVO_DU1906_BOARD
+ bool "ESP32_KORVO_DU1906"
+ config ESP32_S2_KALUGA_1_V1_2_BOARD
+ bool "ESP32-S2-Kaluga-1 v1.2"
+ config ESP_AI_THINKER_ES8388_BOARD
+ bool "ESP-AI-Thinker-ES8388 v2.2"
+ #config ESP32_S3_KORVO2_V3_BOARD
+ # bool "ESP32-S3-Korvo-2 v3"
+ #config ESP32_S3_KORVO2L_V1_BOARD
+ # bool "ESP32-S3-Korvo-2L v1"
+ #config ESP32_S3_BOX_LITE_BOARD
+ # bool "ESP32-S3-BOX-Lite"
+ #config ESP32_S3_BOX_BOARD
+ # bool "ESP32-S3-BOX"
+ #config ESP32_C3_LYRA_V2_BOARD
+ # bool "ESP32-C3-Lyra-v2.0"
+ #config ESP32_C6_DEVKIT_BOARD
+ # bool "ESP32-C6-DEVKIT"
-choice ESP32_KORVO_DU1906_DAC
- prompt "ESP32 KORVO DU1906 Board DAC chip"
- depends on ESP32_KORVO_DU1906_BOARD
- default ESP32_KORVO_DU1906_DAC_TAS5805M
- help
- Select DAC chip to use on ESP32_KORVO_DU1906 board
+ endchoice
-config ESP32_KORVO_DU1906_DAC_TAS5805M
- bool "ESP32_KORVO_DU1906_DAC_TAS5805M"
-config ESP32_KORVO_DU1906_DAC_ES7148
- bool "ESP32_KORVO_DU1906_DAC_ES7148"
+ choice ESP32_KORVO_DU1906_DAC
+ prompt "ESP32 KORVO DU1906 Board DAC chip"
+ depends on ESP32_KORVO_DU1906_BOARD
+ default ESP32_KORVO_DU1906_DAC_TAS5805M
+ help
+ Select DAC chip to use on ESP32_KORVO_DU1906 board
-endchoice
+ config ESP32_KORVO_DU1906_DAC_TAS5805M
+ bool "ESP32_KORVO_DU1906_DAC_TAS5805M"
+ config ESP32_KORVO_DU1906_DAC_ES7148
+ bool "ESP32_KORVO_DU1906_DAC_ES7148"
-choice ESP32_KORVO_DU1906_ADC
- prompt "ESP32 KORVO DU1906 Board ADC chip"
- depends on ESP32_KORVO_DU1906_BOARD
- default ESP32_KORVO_DU1906_ADC_ES7243
- help
- Select ADC chip to use on ESP32_KORVO_DU1906 board
+ endchoice
-config ESP32_KORVO_DU1906_ADC_ES7243
- bool "ESP32_KORVO_DU1906_ADC_ES7243"
-endchoice
+ choice ESP32_KORVO_DU1906_ADC
+ prompt "ESP32 KORVO DU1906 Board ADC chip"
+ depends on ESP32_KORVO_DU1906_BOARD
+ default ESP32_KORVO_DU1906_ADC_ES7243
+ help
+ Select ADC chip to use on ESP32_KORVO_DU1906 board
+
+ config ESP32_KORVO_DU1906_ADC_ES7243
+ bool "ESP32_KORVO_DU1906_ADC_ES7243"
+ endchoice
+
+ menu "Custom Audio Board"
+ depends on AUDIO_BOARD_CUSTOM
+
+ choice GENERIC_BOARD_DAC
+ prompt "DAC chip"
+ default DAC_MA120
+ help
+ Select a DAC connected to the generic ESP32 board
+
+ config DAC_PCM51XX
+ bool "TI PCM51XX/TAS57XX based DAC"
+
+ config DAC_PCM5102A
+ bool "TI PCM5102A based DAC"
+
+ config DAC_MA120
+ bool "Infineon MA120 ClassD AMP"
+
+ config DAC_MA120X0
+ bool "Infineon MA120X0 ClassD AMP"
+
+ config DAC_ADAU1961
+ bool "Analog Devices ADAU1961 DAC"
+
+ config DAC_MAX98357
+ bool "Analog Devices MAX98357 DAC"
+
+ config DAC_TAS5805M
+ bool "Texas Instruments TAS5805M"
+
+ config DAC_PT8211
+ bool "Princeton Technology PT8211"
+ select I2S_USE_MSB_FORMAT
+
+ endchoice
+
+ menu "DAC I2C control interface"
+ config DAC_I2C_SDA
+ int "SDA pin"
+ default 12 if DAC_ADAU1961
+ default 21 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A || DAC_TAS5805M
+ default -1 if DAC_PT8211
+ help
+ I2C SDA pin of the DAC control interface
+ config DAC_I2C_SCL
+ int "SCL pin"
+ default 14 if DAC_ADAU1961
+ default 22 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A
+ default 27 if DAC_TAS5805M
+ default -1 if DAC_PT8211
+ help
+ I2C SCL pin of the DAC control interface
+ config DAC_I2C_ADDR
+ hex "I2C address"
+ default 0x70 if DAC_ADAU1961
+ default 0x20 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A
+ default 0x2D if DAC_TAS5805M
+ default 0x00 if DAC_PT8211
+ help
+ I2C Address of the DAC control interface
+ endmenu
+
+ menu "I2S master interface"
+ config MASTER_I2S_MCLK_PIN
+ int "Master i2s mclk"
+ default 3 if DAC_ADAU1961
+ default 0
+ help
+ Master audio interface master clock.
+
+ config MASTER_I2S_BCK_PIN
+ int "Master i2s bck"
+ default 15 if DAC_ADAU1961
+ default 23 if DAC_MAX98357
+ default 26 if DAC_TAS5805M
+ default 23
+
+ help
+ Master audio interface bit clock.
+
+ config MASTER_I2S_LRCK_PIN
+ int "Master i2s lrck"
+ default 13 if DAC_ADAU1961
+ default 24 if DAC_MAX98357
+ default 25 if DAC_TAS5805M
+ default 2
+ help
+ Master audio interface left/right sync clock.
+
+ config MASTER_I2S_DATAOUT_PIN
+ int "Master i2s data out"
+ default 4 if DAC_ADAU1961
+ default 25 if DAC_MAX98357
+ default 22 if DAC_TAS5805M
+ default 14
+ help
+ Master audio interface data out.
+
+ endmenu
+
+ menu "DAC-Operation-Mode"
+ depends on DAC_TAS5805M
+
+ config DAC_BRIDGE_MODE
+ bool "Enable Bridge-Mode"
+ default false if DAC_TAS5805M
+ help
+ If enabled left channel will be played with more power. To use the right channel please change Word-Select-Setting in Logic-Level-Settings.
+ endmenu
+
+ menu "I2S slave interface"
+ config SLAVE_I2S_BCK_PIN
+ int "Slave i2s bck"
+ default 26
+ help
+ Slave audio interface bit clock.
+ config SLAVE_I2S_MCLK_PIN
+ int "Slave i2s mclk"
+ default 0
+ help
+ Slave audio interface bit clock.
+ config SLAVE_I2S_LRCK_PIN
+ int "Slave i2s lrck"
+ default 12
+ help
+ Slave audio interface left/right sync clock.
+
+ config SLAVE_I2S_DATAOUT_PIN
+ int "Slave i2s data out"
+ default 5
+ help
+ Slave audio interface data out.
+ endmenu
+
+ menu "Merus MA120x0 interface Configuration"
+ depends on DAC_MA120X0
+
+ config MA120X0_NENABLE_PIN
+ int "Master enable/disable for ma120x0"
+ default 16
+ help
+ GPIO number to control enable/disable.
+
+ config MA120X0_NMUTE_PIN
+ int "Master mute/unmute for ma120x0"
+ default 2
+ help
+ GPIO number to controm mute/unmute.
+
+ config MERUS_NERR_PIN
+ int "NERR monitor pin"
+ default 21
+ help
+ GPIO number to monitor NERROR.
+
+ config MERUS_NCLIP_PIN
+ int "Clip indication pin"
+ default 22
+ help
+ GPIO number low if clip observed
+ endmenu
+
+ menu "Merus MA120 interface Configuration"
+ depends on DAC_MA120
+
+ config MA120_ENABLE_PIN
+ int "Master enable/disable for ma120x0"
+ default 16
+ help
+ GPIO number to control enable/disable.
+
+ config MA120_NMUTE_PIN
+ int "Master mute/unmute for ma120x0"
+ default 2
+ help
+ GPIO number to controm mute/unmute.
+
+ config MERUS_NERR_PIN
+ int "NERR monitor pin"
+ default 21
+ help
+ GPIO number to monitor NERROR.
+
+ config MERUS_NCLIP_PIN
+ int "Clip indication pin"
+ default 22
+ help
+ GPIO number low if clip observed
+ endmenu
+
+ menu "TI PCM5102A interface Configuration"
+ depends on DAC_PCM5102A
+
+ config PCM5102A_MUTE_PIN
+ int "Master mute/unmute for PCM5102A"
+ default 18
+ help
+ GPIO number to control mute/unmute.
+ This is labeled "X(S)MT" on chip/boards
+ endmenu
+
+ menu "MAX98357 interface Configuration"
+ depends on DAC_MAX98357
+
+ config MAX98357_MUTE_PIN
+ int "Master mute/mode for MAX98357"
+ default 18
+ help
+ GPIO number to control mute/mode. This require a special resistor to select the correct mode.
+ You need to put a serie resistor to select the mode (GPIO --> Resistor --> SD):
+ LEFT only : 0ohm (direct connection)
+ RIGHT only : 220Kohm
+ (L+R)/2 : 1Mohm
+ Refer to Analog Devices' doc for more infos.
+ This is labeled "SD" on chip/boards.
+ endmenu
+
+ menu "PT8211 interface Configuration"
+ depends on DAC_PT8211
+
+ config PT8211_MUTE_PIN
+ int "Master mute/unmute"
+ default -1
+ help
+ GPIO number to control mute/unmute.
+ Note that PT8211 does not have a mute control pin. This output is intended to control external circuit (e.g., amplifier).
+
+ config PT8211_MUTE_ACTIVE_LOW
+ bool "Mute active LOW"
+ default false
+ help
+ Output LOW instead of HIGH on mute/unmute pin when in mute state.
+
+ endmenu
+
+ menu "Logic-Level-Settings"
+ config INVERT_MCLK_LEVEL
+ bool "Invert Logic Level MCLK"
+ default false
+ help
+ Invert the Logic-Level of MCLK.
+ config INVERT_WORD_SELECT_LEVEL
+ bool "Invert Logic Level WordSelect"
+ default false
+ help
+ Some Dacs can bridge their outputs. Word-Select is used for selecting the played audio channel. This will switch L/R.
+ config INVERT_BCLK_LEVEL
+ bool "Invert Logic Level BCLK"
+ default false
+ help
+ Invert the Logic-Level of BCLK.
+
+ endmenu
+
+ endmenu
endmenu
diff --git a/components/audio_board/ai_thinker_es8388/board_def.h b/components/audio_board/ai_thinker_es8388/board_def.h
index 2161188..84bc376 100644
--- a/components/audio_board/ai_thinker_es8388/board_def.h
+++ b/components/audio_board/ai_thinker_es8388/board_def.h
@@ -42,57 +42,62 @@
#define AUXIN_DETECT_GPIO GPIO_NUM_12
#define HEADPHONE_DETECT GPIO_NUM_19
#define PA_ENABLE_GPIO GPIO_NUM_21
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
#define GREEN_LED_GPIO GPIO_NUM_22
extern audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE;
-#define AUDIO_CODEC_DEFAULT_CONFIG() \
- { \
- .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
- .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
- .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
- .i2s_iface = { \
- .mode = AUDIO_HAL_MODE_SLAVE, \
- .fmt = AUDIO_HAL_I2S_NORMAL, \
- .samples = AUDIO_HAL_48K_SAMPLES, \
- .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
- }, \
-};
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+/**
+ * @brief Button Function Definition
+ */
#define INPUT_KEY_NUM 6
-#define INPUT_KEY_DEFAULT_INFO() \
- { \
- { \
- .type = PERIPH_ID_BUTTON, \
- .user_id = INPUT_KEY_USER_ID_REC, \
- .act_id = BUTTON_REC_ID, \
- }, \
- { \
- .type = PERIPH_ID_BUTTON, \
- .user_id = INPUT_KEY_USER_ID_MODE, \
- .act_id = BUTTON_MODE_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_SET, \
- .act_id = BUTTON_SET_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_PLAY, \
- .act_id = BUTTON_PLAY_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_VOLUP, \
- .act_id = BUTTON_VOLUP_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
- .act_id = BUTTON_VOLDOWN_ID, \
- } \
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
}
#endif
diff --git a/components/audio_board/ai_thinker_es8388/board_pins_config.c b/components/audio_board/ai_thinker_es8388/board_pins_config.c
index 55b2c23..da3fab4 100644
--- a/components/audio_board/ai_thinker_es8388/board_pins_config.c
+++ b/components/audio_board/ai_thinker_es8388/board_pins_config.c
@@ -24,60 +24,51 @@
*
*/
+#include
+
#include "audio_error.h"
#include "audio_mem.h"
#include "board.h"
#include "driver/gpio.h"
#include "esp_log.h"
-#include
static const char *TAG = "AI_THINKER_ES8388";
-esp_err_t
-get_i2c_pins (i2c_port_t port, i2c_config_t *i2c_config)
-{
- AUDIO_NULL_CHECK (TAG, i2c_config, return ESP_FAIL);
- if (port == I2C_NUM_0 || port == I2C_NUM_1)
- {
- i2c_config->sda_io_num = GPIO_NUM_33;
- i2c_config->scl_io_num = GPIO_NUM_32;
- }
- else
- {
- i2c_config->sda_io_num = -1;
- i2c_config->scl_io_num = -1;
- ESP_LOGE (TAG, "i2c port %d is not supported", port);
- return ESP_FAIL;
- }
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_33;
+ i2c_config->scl_io_num = GPIO_NUM_32;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
return ESP_OK;
}
-esp_err_t
-get_i2s_pins (i2s_port_t port, i2s_pin_config_t *i2s_config)
-{
- AUDIO_NULL_CHECK (TAG, i2s_config, return ESP_FAIL);
- if (port == I2S_NUM_0 || port == I2S_NUM_1)
- {
- i2s_config->bck_io_num = GPIO_NUM_27;
- i2s_config->ws_io_num = GPIO_NUM_25;
- i2s_config->data_out_num = GPIO_NUM_26;
- i2s_config->data_in_num = GPIO_NUM_35;
- }
- else
- {
- memset (i2s_config, -1, sizeof (i2s_pin_config_t));
- ESP_LOGE (TAG, "i2s port %d is not supported", port);
- return ESP_FAIL;
- }
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0 || port == I2S_NUM_1) {
+ i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->bck_io_num = GPIO_NUM_27;
+ i2s_config->ws_io_num = GPIO_NUM_25;
+ i2s_config->data_out_num = GPIO_NUM_26;
+ i2s_config->data_in_num = GPIO_NUM_35;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
return ESP_OK;
}
-esp_err_t
-get_spi_pins (spi_bus_config_t *spi_config,
- spi_device_interface_config_t *spi_device_interface_config)
-{
- AUDIO_NULL_CHECK (TAG, spi_config, return ESP_FAIL);
- AUDIO_NULL_CHECK (TAG, spi_device_interface_config, return ESP_FAIL);
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
spi_config->mosi_io_num = -1;
spi_config->miso_io_num = -1;
@@ -87,142 +78,40 @@ get_spi_pins (spi_bus_config_t *spi_config,
spi_device_interface_config->spics_io_num = -1;
- ESP_LOGW (TAG, "SPI interface is not supported");
- return ESP_OK;
-}
-
-esp_err_t
-i2s_mclk_gpio_select (i2s_port_t i2s_num, gpio_num_t gpio_num)
-{
- if (i2s_num >= I2S_NUM_MAX)
- {
- ESP_LOGE (TAG, "Does not support i2s number(%d)", i2s_num);
- return ESP_ERR_INVALID_ARG;
- }
- if (gpio_num != GPIO_NUM_0 && gpio_num != GPIO_NUM_1
- && gpio_num != GPIO_NUM_3)
- {
- ESP_LOGE (TAG, "Only support GPIO0/GPIO1/GPIO3, gpio_num:%d", gpio_num);
- return ESP_ERR_INVALID_ARG;
- }
- ESP_LOGI (TAG, "I2S%d, MCLK output by GPIO%d", i2s_num, gpio_num);
- if (i2s_num == I2S_NUM_0)
- {
- if (gpio_num == GPIO_NUM_0)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG (PIN_CTRL, 0xFFF0);
- }
- else if (gpio_num == GPIO_NUM_1)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG (PIN_CTRL, 0xF0F0);
- }
- else
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG (PIN_CTRL, 0xFF00);
- }
- }
- else if (i2s_num == I2S_NUM_1)
- {
- if (gpio_num == GPIO_NUM_0)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG (PIN_CTRL, 0xFFFF);
- }
- else if (gpio_num == GPIO_NUM_1)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG (PIN_CTRL, 0xF0FF);
- }
- else
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG (PIN_CTRL, 0xFF0F);
- }
- }
+ ESP_LOGW(TAG, "SPI interface is not supported");
return ESP_OK;
}
// sdcard
-int8_t
-get_sdcard_intr_gpio (void)
-{
- return SDCARD_INTR_GPIO;
-}
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
-int8_t
-get_sdcard_open_file_num_max (void)
-{
- return SDCARD_OPEN_FILE_NUM_MAX;
-}
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
// input-output pins
-int8_t
-get_auxin_detect_gpio (void)
-{
- return AUXIN_DETECT_GPIO;
-}
+int8_t get_auxin_detect_gpio(void) { return AUXIN_DETECT_GPIO; }
-int8_t
-get_headphone_detect_gpio (void)
-{
- return HEADPHONE_DETECT;
-}
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
-int8_t
-get_pa_enable_gpio (void)
-{
- return PA_ENABLE_GPIO;
-}
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
// button pins
-int8_t
-get_input_rec_id (void)
-{
- return BUTTON_REC_ID;
-}
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
-int8_t
-get_input_mode_id (void)
-{
- return BUTTON_MODE_ID;
-}
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
// touch pins
-int8_t
-get_input_set_id (void)
-{
- return BUTTON_SET_ID;
-}
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
-int8_t
-get_input_play_id (void)
-{
- return BUTTON_PLAY_ID;
-}
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
-int8_t
-get_input_volup_id (void)
-{
- return BUTTON_VOLUP_ID;
-}
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
-int8_t
-get_input_voldown_id (void)
-{
- return BUTTON_VOLDOWN_ID;
-}
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
// led pins
-int8_t
-get_green_led_gpio (void)
-{
- return GREEN_LED_GPIO;
-}
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/component.mk b/components/audio_board/component.mk
index dc97d1b..6441573 100644
--- a/components/audio_board/component.mk
+++ b/components/audio_board/component.mk
@@ -42,6 +42,16 @@ COMPONENT_ADD_INCLUDEDIRS += ./esp32_s2_kaluga_1_v1_2
COMPONENT_SRCDIRS += ./esp32_s2_kaluga_1_v1_2
endif
+ifdef CONFIG_ESP32_S3_KORVO2_V3_BOARD
+COMPONENT_ADD_INCLUDEDIRS += ./esp32_s3_korvo2_v3
+COMPONENT_SRCDIRS += ./esp32_s3_korvo2_v3
+endif
+
+ifdef CONFIG_ESP32_C3_LYRA_V2_BOARD
+COMPONENT_ADD_INCLUDEDIRS += ./esp32_c3_lyra
+COMPONENT_SRCDIRS += ./esp32_c3_lyra
+endif
+
ifdef CONFIG_ESP_AI_THINKER_ES8388_BOARD
COMPONENT_ADD_INCLUDEDIRS += ./ai_thinker_es8388
COMPONENT_SRCDIRS += ./ai_thinker_es8388
diff --git a/components/audio_board/esp32_c3_lyra/C3_lyra_sys_pattern.c b/components/audio_board/esp32_c3_lyra/C3_lyra_sys_pattern.c
new file mode 100644
index 0000000..f05c507
--- /dev/null
+++ b/components/audio_board/esp32_c3_lyra/C3_lyra_sys_pattern.c
@@ -0,0 +1,305 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board_def.h"
+#include "display_service.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "periph_ws2812.h"
+#include "string.h"
+
+const struct periph_ws2812_ctrl_cfg
+ ws2812_display_pattern[DISPLAY_PATTERN_MAX][WS2812_LED_BAR_NUMBERS] = {
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 0
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ } // 1
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 2
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 3
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_RED,
+ .loop = 1,
+ .time_off_ms = 1000,
+ .time_on_ms = 4000,
+ } // 4
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 5,
+ .time_off_ms = 200,
+ .time_on_ms = 1000,
+ } // 5
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 100,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 6
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ } // 7
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ } // 8
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 9
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 10
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 100,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ } // 11
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 12
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 13
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 14
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_YELLOW,
+ .loop = 2000,
+ .time_off_ms = 200,
+ .time_on_ms = 600,
+ } // 15
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 16
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_GREEN,
+ .loop = 1,
+ .time_off_ms = 0,
+ .time_on_ms = 1000,
+ } // 17
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_ORANGE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 18
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 19
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 20
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 21
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 22
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ } // 23
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1000,
+ .time_on_ms = 2000,
+ } // 24
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 25
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ } // 26
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 500,
+ .time_on_ms = 500,
+ } // 27,
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 28,
+ }};
+
+int8_t get_ws2812_gpio_pin(void) { return WS2812_LED_GPIO_PIN; }
+
+int get_ws2812_num(void) { return WS2812_LED_BAR_NUMBERS; }
+
+void ws2812_pattern_copy(struct periph_ws2812_ctrl_cfg *p) {
+ ESP_LOGD("ws2812_pattern_copy", "has been called, %s %d", __FILE__, __LINE__);
+ memcpy(p, ws2812_display_pattern, sizeof(ws2812_display_pattern));
+}
diff --git a/components/audio_board/esp32_c3_lyra/board.c b/components/audio_board/esp32_c3_lyra/board.c
new file mode 100644
index 0000000..aea5d2c
--- /dev/null
+++ b/components/audio_board/esp32_c3_lyra/board.c
@@ -0,0 +1,121 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "display_service.h"
+#include "esp_log.h"
+#include "led_bar_ws2812.h"
+#include "periph_adc_button.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = NULL;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ gpio_config_t io_conf = {0};
+ bool enable = true;
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = BIT64(get_pa_enable_gpio());
+ io_conf.pull_down_en = 0;
+ io_conf.pull_up_en = 0;
+ gpio_config(&io_conf);
+ if (enable) {
+ gpio_set_level(get_pa_enable_gpio(), 1);
+ } else {
+ gpio_set_level(get_pa_enable_gpio(), 0);
+ }
+ return NULL;
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ esp_err_t ret = ESP_FAIL;
+ return ret;
+}
+
+display_service_handle_t audio_board_led_init(void) {
+ led_bar_ws2812_handle_t led =
+ led_bar_ws2812_init(get_ws2812_gpio_pin(), get_ws2812_num());
+ AUDIO_NULL_CHECK(TAG, led, return NULL);
+ display_service_config_t display = {
+ .based_cfg =
+ {
+ .task_stack = 0,
+ .task_prio = 0,
+ .task_core = 0,
+ .task_func = NULL,
+ .service_start = NULL,
+ .service_stop = NULL,
+ .service_destroy = NULL,
+ .service_ioctl = led_bar_ws2812_pattern,
+ .service_name = "DISPLAY_serv",
+ .user_data = NULL,
+ },
+ .instance = led,
+ };
+
+ return display_service_create(&display);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_2;
+ adc_btn_tag.total_steps = 6;
+ int btn_array[7] = {190, 600, 1000, 1375, 1775, 2195, 2700};
+ adc_btn_tag.adc_level_step = (int *)(&btn_array);
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ return esp_periph_start(set, adc_btn_handle);
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_board->audio_hal = NULL;
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_c3_lyra/board.h b/components/audio_board/esp32_c3_lyra/board.h
new file mode 100644
index 0000000..a8b2658
--- /dev/null
+++ b/components/audio_board/esp32_c3_lyra/board.h
@@ -0,0 +1,129 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return ESP_OK success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+/**
+ * @brief Get the ws2812 gpio pin
+ *
+ * @return GPIO pin
+ */
+int8_t get_ws2812_gpio_pin(void);
+
+/**
+ * @brief Get the number of ws2812
+ *
+ * @return number of ws2812
+ */
+int get_ws2812_num(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_c3_lyra/board_def.h b/components/audio_board/esp32_c3_lyra/board_def.h
new file mode 100644
index 0000000..34ea25b
--- /dev/null
+++ b/components/audio_board/esp32_c3_lyra/board_def.h
@@ -0,0 +1,126 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
+
+/**
+ * @brief ADC Function Definition
+ */
+#define MIC_ADC_GPIO GPIO_NUM_0
+#define PA_ENABLE_GPIO GPIO_NUM_1
+#define BUTTON_ADC_GPIO GPIO_NUM_2
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (0)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+
+#define ESP_SD_PIN_CLK -1
+#define ESP_SD_PIN_CMD -1
+#define ESP_SD_PIN_D0 -1
+#define ESP_SD_PIN_D3 -1
+
+/**
+ * @brief PDM TX Function Definition
+ */
+#define PDM_TX_GPIO GPIO_NUM_3
+
+/**
+ * @brief LED Function Definition
+ */
+#define LED_PWM_BLUE_GPIO GPIO_NUM_4
+#define LED_PWM_RED_GPIO GPIO_NUM_5
+#define LED_PWM_GREEN_GPIO GPIO_NUM_6
+#define WS2812_LED_GPIO_PIN GPIO_NUM_10
+#define WS2812_LED_BAR_NUMBERS 1
+#define LED_STRIP_CTRL_GPIO GPIO_NUM_7
+
+/**
+ * @brief IR Function Definition
+ */
+#define ESP_IR_TX_GPIO GPIO_NUM_18
+#define ESP_IR_RX_GPIO GPIO_NUM_19
+
+/**
+ * @brief I2C Function Definition
+ */
+#define I2C_CLK_GPIO GPIO_NUM_8
+#define I2C_DATA_GPIO GPIO_NUM_9
+
+/**
+ * @brief Button Function Definition
+ */
+#define INPUT_KEY_NUM 6
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_COLOR_ID 4
+#define BUTTON_MODE_ID 5
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_COLOR, \
+ .act_id = BUTTON_COLOR_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_c3_lyra/board_pins_config.c b/components/audio_board/esp32_c3_lyra/board_pins_config.c
new file mode 100644
index 0000000..9830137
--- /dev/null
+++ b/components/audio_board/esp32_c3_lyra/board_pins_config.c
@@ -0,0 +1,107 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "ESP32_C3_Lyra";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0) {
+ i2c_config->sda_io_num = GPIO_NUM_9;
+ i2c_config->scl_io_num = GPIO_NUM_8;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = PDM_TX_GPIO;
+ i2s_config->data_in_num = -1;
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button id
+int8_t get_input_rec_id(void) { return -1; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+int8_t get_ws2812_led_gpio(void) { return WS2812_LED_GPIO_PIN; }
+
+int8_t get_es8311_mclk_src(void) { return -1; }
diff --git a/components/audio_board/esp32_c6_devkit/board.c b/components/audio_board/esp32_c6_devkit/board.c
new file mode 100644
index 0000000..587cc92
--- /dev/null
+++ b/components/audio_board/esp32_c6_devkit/board.c
@@ -0,0 +1,109 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "display_service.h"
+#include "esp_log.h"
+#include "led_bar_ws2812.h"
+#include "periph_adc_button.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = NULL;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+
+ board_handle->audio_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8311_DEFAULT_HANDLE);
+ return board_handle;
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ esp_err_t ret = ESP_FAIL;
+ return ret;
+}
+
+display_service_handle_t audio_board_led_init(void) {
+ led_bar_ws2812_handle_t led =
+ led_bar_ws2812_init(get_ws2812_gpio_pin(), get_ws2812_num());
+ AUDIO_NULL_CHECK(TAG, led, return NULL);
+ display_service_config_t display = {
+ .based_cfg =
+ {
+ .task_stack = 0,
+ .task_prio = 0,
+ .task_core = 0,
+ .task_func = NULL,
+ .service_start = NULL,
+ .service_stop = NULL,
+ .service_destroy = NULL,
+ .service_ioctl = led_bar_ws2812_pattern,
+ .service_name = "DISPLAY_serv",
+ .user_data = NULL,
+ },
+ .instance = led,
+ };
+
+ return display_service_create(&display);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ esp_err_t ret = ESP_OK;
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_2;
+ adc_btn_tag.total_steps = 6;
+ int btn_array[7] = {380, 820, 1100, 1650, 1980, 2410, 2700};
+ adc_btn_tag.adc_level_step = (int *)(&btn_array);
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ ret = esp_periph_start(set, adc_btn_handle);
+ return ret;
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_board->audio_hal = NULL;
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_c6_devkit/board.h b/components/audio_board/esp32_c6_devkit/board.h
new file mode 100644
index 0000000..a8b2658
--- /dev/null
+++ b/components/audio_board/esp32_c6_devkit/board.h
@@ -0,0 +1,129 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return ESP_OK success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+/**
+ * @brief Get the ws2812 gpio pin
+ *
+ * @return GPIO pin
+ */
+int8_t get_ws2812_gpio_pin(void);
+
+/**
+ * @brief Get the number of ws2812
+ *
+ * @return number of ws2812
+ */
+int get_ws2812_num(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_c6_devkit/board_def.h b/components/audio_board/esp32_c6_devkit/board_def.h
new file mode 100644
index 0000000..6b5e813
--- /dev/null
+++ b/components/audio_board/esp32_c6_devkit/board_def.h
@@ -0,0 +1,138 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
+
+/**
+ * @brief ADC Function Definition
+ */
+#define MIC_ADC_GPIO -1
+#define PA_ENABLE_GPIO GPIO_NUM_7
+#define BUTTON_ADC_GPIO GPIO_NUM_2
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (0)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+
+#define ESP_SD_PIN_CLK -1
+#define ESP_SD_PIN_CMD -1
+#define ESP_SD_PIN_D0 -1
+#define ESP_SD_PIN_D3 -1
+
+/**
+ * @brief PDM TX Function Definition
+ */
+#define PDM_TX_GPIO GPIO_NUM_3
+
+/**
+ * @brief LED Function Definition
+ */
+#define WS2812_LED_GPIO_PIN GPIO_NUM_8
+#define WS2812_LED_BAR_NUMBERS 1
+
+/**
+ * @brief IR Function Definition
+ */
+#define ESP_IR_TX_GPIO GPIO_NUM_18
+#define ESP_IR_RX_GPIO GPIO_NUM_19
+
+/**
+ * @brief I2C Function Definition
+ */
+#define I2C_CLK_GPIO GPIO_NUM_18
+#define I2C_DATA_GPIO GPIO_NUM_19
+
+/**
+ * @brief Button Function Definition
+ */
+#define INPUT_KEY_NUM 6
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+
+extern audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE;
+
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_c6_devkit/board_pins_config.c b/components/audio_board/esp32_c6_devkit/board_pins_config.c
new file mode 100644
index 0000000..c32714f
--- /dev/null
+++ b/components/audio_board/esp32_c6_devkit/board_pins_config.c
@@ -0,0 +1,106 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+
+static const char *TAG = "ESP32_C6_DevKit";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0) {
+ i2c_config->sda_io_num = GPIO_NUM_19;
+ i2c_config->scl_io_num = GPIO_NUM_18;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ i2s_config->mck_io_num = GPIO_NUM_20;
+ i2s_config->bck_io_num = GPIO_NUM_22;
+ i2s_config->ws_io_num = GPIO_NUM_21;
+ i2s_config->data_out_num = GPIO_NUM_23;
+ i2s_config->data_in_num = GPIO_NUM_15;
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button id
+int8_t get_input_rec_id(void) { return -1; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+int8_t get_ws2812_led_gpio(void) { return WS2812_LED_GPIO_PIN; }
+
+int8_t get_es8311_mclk_src(void) { return -1; }
diff --git a/components/audio_board/esp32_korvo_du1906/board.c b/components/audio_board/esp32_korvo_du1906/board.c
new file mode 100644
index 0000000..1a26f4e
--- /dev/null
+++ b/components/audio_board/esp32_korvo_du1906/board.c
@@ -0,0 +1,160 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+// #include "display_service.h"
+#include "es7243.h"
+#include "esp_log.h"
+// #include "led_bar_ws2812.h"
+// #include "led_indicator.h"
+// #include "periph_adc_button.h"
+// #include "periph_sdcard.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_dac_init();
+ es7243_adc_set_addr(0x24);
+ board_handle->adc_line_in_hal = audio_board_adc_init();
+ es7243_adc_set_addr(0x26);
+ board_handle->adc_ref_pa_hal = audio_board_adc_init();
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_dac_init(void) {
+ audio_hal_handle_t dac_hal = NULL;
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+#ifdef CONFIG_ESP32_KORVO_DU1906_DAC_TAS5805M
+ dac_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE);
+#elif CONFIG_ESP32_KORVO_DU1906_DAC_ES7148
+ dac_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES7148_DEFAULT_HANDLE);
+#endif
+
+ AUDIO_NULL_CHECK(TAG, dac_hal, return NULL);
+ return dac_hal;
+}
+
+audio_hal_handle_t audio_board_adc_init(void) {
+ audio_hal_handle_t adc_hal = NULL;
+#ifdef CONFIG_ESP32_KORVO_DU1906_ADC_ES7243
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ adc_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES7243_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, adc_hal, return NULL);
+#endif
+ return adc_hal;
+}
+
+// display_service_handle_t audio_board_led_init(void) {
+// led_bar_ws2812_handle_t led =
+// led_bar_ws2812_init(get_ws2812_gpio_pin(), get_ws2812_num());
+// AUDIO_NULL_CHECK(TAG, led, return NULL);
+// display_service_config_t display = {
+// .based_cfg =
+// {
+// .task_stack = 0,
+// .task_prio = 0,
+// .task_core = 0,
+// .task_func = NULL,
+// .service_start = NULL,
+// .service_stop = NULL,
+// .service_destroy = NULL,
+// .service_ioctl = led_bar_ws2812_pattern,
+// .service_name = "DISPLAY_serv",
+// .user_data = NULL,
+// },
+// .instance = led,
+// };
+//
+// return display_service_create(&display);
+// }
+//
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+// periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+// adc_btn_cfg.task_cfg.ext_stack = true;
+// adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+// adc_btn_tag.adc_ch = ADC1_CHANNEL_0; // GPIO36
+// adc_btn_tag.total_steps = 4;
+// int btn_array[5] = {200, 900, 1500, 2100, 2930};
+// adc_btn_tag.adc_level_step = btn_array;
+// adc_btn_cfg.arr = &adc_btn_tag;
+// adc_btn_cfg.arr_size = 1;
+// esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+// AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+// return esp_periph_start(set, adc_btn_handle);
+// }
+//
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode) {
+// if (mode != SD_MODE_1_LINE) {
+// ESP_LOGE(TAG, "Current board only support 1-line SD mode!");
+// return ESP_FAIL;
+// }
+// periph_sdcard_cfg_t sdcard_cfg = {
+// .root = "/sdcard",
+// .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34
+// .mode = mode};
+// esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+// esp_err_t ret = esp_periph_start(set, sdcard_handle);
+// int retry_time = 5;
+// bool mount_flag = false;
+// while (retry_time--) {
+// if (periph_sdcard_is_mounted(sdcard_handle)) {
+// mount_flag = true;
+// break;
+// } else {
+// vTaskDelay(500 / portTICK_PERIOD_MS);
+// }
+// }
+// if (mount_flag == false) {
+// ESP_LOGE(TAG, "Sdcard mount failed");
+// return ESP_FAIL;
+// }
+// return ret;
+// }
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret |= audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_korvo_du1906/board.h b/components/audio_board/esp32_korvo_du1906/board.h
new file mode 100644
index 0000000..13b3cb7
--- /dev/null
+++ b/components/audio_board/esp32_korvo_du1906/board.h
@@ -0,0 +1,142 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+// #include "display_service.h"
+// #include "esp_peripherals.h"
+// #include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern audio_hal_func_t AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE;
+extern audio_hal_func_t AUDIO_CODEC_ES7148_DEFAULT_HANDLE;
+extern audio_hal_func_t AUDIO_CODEC_ES7243_DEFAULT_HANDLE;
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< pa hardware abstract layer handle */
+ audio_hal_handle_t adc_line_in_hal; /*!< adc hardware abstract layer handle */
+ audio_hal_handle_t adc_ref_pa_hal; /*!< adc hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize DAC chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_dac_init(void);
+
+/**
+ * @brief Initialize ADC chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_adc_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return ESP_OK, success
+ * others, fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+/**
+ * @brief Get the ws2812 gpio pin
+ *
+ * @return GPIO pin
+ */
+int8_t get_ws2812_gpio_pin(void);
+
+/**
+ * @brief Get the number of ws2812
+ *
+ * @return number of ws2812
+ */
+int get_ws2812_num(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_korvo_du1906/board_def.h b/components/audio_board/esp32_korvo_du1906/board_def.h
new file mode 100644
index 0000000..6744e53
--- /dev/null
+++ b/components/audio_board/esp32_korvo_du1906/board_def.h
@@ -0,0 +1,116 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO GPIO_NUM_39
+
+#define ESP_SD_PIN_CLK GPIO_NUM_14
+#define ESP_SD_PIN_CMD GPIO_NUM_15
+#define ESP_SD_PIN_D0 GPIO_NUM_2
+#define ESP_SD_PIN_D3 -1
+
+/**
+ * @brief LED Function Definition
+ */
+#define FUNC_SYS_LEN_EN (1)
+#define WS2812_LED_GPIO_PIN 3
+#define WS2812_LED_BAR_NUMBERS 2
+
+/**
+ * @brief Battery Detect Function Definition
+ */
+#define FUNC_BATTERY_DET_EN (1)
+#define BATTERY_DETECT_GPIO GPIO_NUM_37
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define CODEC_ADC_I2S_PORT (0)
+#define ES7243_MCLK_GPIO GPIO_NUM_0
+#define PA_ENABLE_GPIO GPIO_NUM_12
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
+
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define ADC_DETECT_GPIO GPIO_NUM_36
+#define INPUT_KEY_NUM 4
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_MUTE_ID 2
+#define BUTTON_SET_ID 3
+#define BUTTON_REC_ID (-1)
+#define BUTTON_MODE_ID (-1)
+#define GREEN_LED_GPIO (-1)
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MUTE, \
+ .act_id = BUTTON_MUTE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_korvo_du1906/board_pins_config.c b/components/audio_board/esp32_korvo_du1906/board_pins_config.c
new file mode 100644
index 0000000..697bda8
--- /dev/null
+++ b/components/audio_board/esp32_korvo_du1906/board_pins_config.c
@@ -0,0 +1,117 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/io_mux_reg.h"
+#include "soc/soc_caps.h"
+#include "string.h"
+
+static const char *TAG = "ESP32_Korvo_DU1906";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_18;
+ i2c_config->scl_io_num = GPIO_NUM_23;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0) {
+ i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->bck_io_num = GPIO_NUM_4;
+ i2s_config->ws_io_num = GPIO_NUM_13;
+ i2s_config->data_out_num = GPIO_NUM_16;
+ i2s_config->data_in_num = GPIO_NUM_39;
+ } else if (port == I2S_NUM_1) {
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = -1;
+ i2s_config->data_in_num = -1;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+// Using "mute" button instead of "play" button as the audio control button,
+// since `ESP32-Korvo-DU1906` board has not "play" button
+int8_t get_input_play_id(void) { return BUTTON_MUTE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+int8_t get_es7243_mclk_gpio(void) { return ES7243_MCLK_GPIO; }
+
+// led pins
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/esp32_korvo_du1906/du1906_bar_pattern.c b/components/audio_board/esp32_korvo_du1906/du1906_bar_pattern.c
new file mode 100644
index 0000000..81ee70a
--- /dev/null
+++ b/components/audio_board/esp32_korvo_du1906/du1906_bar_pattern.c
@@ -0,0 +1,507 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board_def.h"
+#include "display_service.h"
+#include "esp_log.h"
+#include "periph_ws2812.h"
+#include "string.h"
+
+const struct periph_ws2812_ctrl_cfg
+ ws2812_display_pattern[DISPLAY_PATTERN_MAX][WS2812_LED_BAR_NUMBERS] = {
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 0
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ },
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ } // 1
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 2
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 3
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_RED,
+ .loop = 1,
+ .time_off_ms = 1000,
+ .time_on_ms = 4000,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_RED,
+ .loop = 1,
+ .time_off_ms = 1000,
+ .time_on_ms = 4000,
+ } // 4
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 5,
+ .time_off_ms = 200,
+ .time_on_ms = 1000,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 5,
+ .time_off_ms = 200,
+ .time_on_ms = 1000,
+ } // 5
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 100,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 100,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 6
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ } // 7
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 4,
+ .time_off_ms = 100,
+ .time_on_ms = 100,
+ } // 8
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 9
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 10
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 100,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ },
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 100,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ } // 11
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 2,
+ .time_off_ms = 200,
+ .time_on_ms = 400,
+ } // 12
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 13
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 14
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_YELLOW,
+ .loop = 2000,
+ .time_off_ms = 200,
+ .time_on_ms = 600,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_YELLOW,
+ .loop = 2000,
+ .time_off_ms = 200,
+ .time_on_ms = 600,
+ } // 15
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 16
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_GREEN,
+ .loop = 1,
+ .time_off_ms = 0,
+ .time_on_ms = 1000,
+ },
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_GREEN,
+ .loop = 1,
+ .time_off_ms = 0,
+ .time_on_ms = 1000,
+ } // 17
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_ORANGE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_ORANGE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 18
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 19
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_WHITE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 20
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 21
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 1000,
+ .time_off_ms = 200,
+ .time_on_ms = 800,
+ } // 22
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ },
+ {
+ .mode = PERIPH_WS2812_FADE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1500,
+ .time_on_ms = 1500,
+ } // 23
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1000,
+ .time_on_ms = 2000,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 1000,
+ .time_off_ms = 1000,
+ .time_on_ms = 2000,
+ } // 24
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_PURPLE,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 25
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_RED,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 2000,
+ .time_on_ms = 2000,
+ } // 26
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 500,
+ .time_on_ms = 500,
+ },
+ {
+ .mode = PERIPH_WS2812_BLINK,
+ .color = LED2812_COLOR_BLUE,
+ .loop = 0xFFFFFFFF,
+ .time_off_ms = 500,
+ .time_on_ms = 500,
+ } // 27,
+ },
+ {
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ },
+ {
+ .mode = PERIPH_WS2812_ONE,
+ .color = LED2812_COLOR_BLACK,
+ .loop = 0,
+ .time_off_ms = 0,
+ .time_on_ms = 0,
+ } // 28,
+ }};
+
+int8_t get_ws2812_gpio_pin(void) { return WS2812_LED_GPIO_PIN; }
+
+int get_ws2812_num(void) { return WS2812_LED_BAR_NUMBERS; }
+
+void ws2812_pattern_copy(struct periph_ws2812_ctrl_cfg *p) {
+ ESP_LOGD("ws2812_pattern_copy", "has been called, %s %d", __FILE__, __LINE__);
+ memcpy(p, ws2812_display_pattern, sizeof(ws2812_display_pattern));
+}
diff --git a/components/audio_board/esp32_s2_kaluga_1_v1_2/board.c b/components/audio_board/esp32_s2_kaluga_1_v1_2/board.c
new file mode 100644
index 0000000..56f9502
--- /dev/null
+++ b/components/audio_board/esp32_s2_kaluga_1_v1_2/board.c
@@ -0,0 +1,149 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+// #include "periph_adc_button.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = NULL;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8311_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ esp_err_t ret = ESP_FAIL;
+ return ret;
+}
+
+// display_service_handle_t audio_board_led_init(void) {
+// // TODO
+// return NULL;
+// }
+// #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0))
+// esp_err_t _get_lcd_io_bus(void *bus, esp_lcd_panel_io_spi_config_t
+// *io_config,
+// esp_lcd_panel_io_handle_t *out_panel_io) {
+// return esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)bus, io_config,
+// out_panel_io);
+// }
+//
+// void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb) {
+// gpio_config_t bk_gpio_config = {.mode = GPIO_MODE_OUTPUT,
+// .pin_bit_mask = 1ULL << LCD_CTRL_GPIO};
+// // Initialize the GPIO of backlight
+// ESP_ERROR_CHECK(gpio_config(&bk_gpio_config));
+//
+// spi_bus_config_t buscfg = {.sclk_io_num = LCD_CLK_GPIO,
+// .mosi_io_num = LCD_MOSI_GPIO,
+// .miso_io_num = -1,
+// .quadwp_io_num = -1,
+// .quadhd_io_num = -1,
+// .max_transfer_sz = 16 * LCD_H_RES * 2 + 8};
+// ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
+//
+// esp_lcd_panel_io_spi_config_t io_config = {
+// .dc_gpio_num = LCD_DC_GPIO,
+// .cs_gpio_num = LCD_CS_GPIO,
+// .pclk_hz = 60 * 1000 * 1000,
+// .lcd_cmd_bits = 8,
+// .lcd_param_bits = 8,
+// .spi_mode = 0,
+// .trans_queue_depth = 10,
+// .on_color_trans_done = cb,
+// .user_ctx = NULL,
+// };
+// esp_lcd_panel_dev_config_t panel_config = {
+// .reset_gpio_num = LCD_RST_GPIO,
+// .color_space = ESP_LCD_COLOR_SPACE_BGR,
+// .bits_per_pixel = 16,
+// };
+// periph_lcd_cfg_t cfg = {
+// .io_bus = (void *)SPI2_HOST,
+// .new_panel_io = _get_lcd_io_bus,
+// .lcd_io_cfg = &io_config,
+// .new_lcd_panel = esp_lcd_new_panel_st7789,
+// .lcd_dev_cfg = &panel_config,
+// .rest_cb = NULL,
+// .rest_cb_ctx = NULL,
+// .lcd_swap_xy = LCD_SWAP_XY,
+// .lcd_mirror_x = LCD_MIRROR_X,
+// .lcd_mirror_y = LCD_MIRROR_Y,
+// .lcd_color_invert = LCD_COLOR_INV,
+// };
+// esp_periph_handle_t periph_lcd = periph_lcd_init(&cfg);
+// AUDIO_NULL_CHECK(TAG, periph_lcd, return NULL);
+// esp_periph_start(set, periph_lcd);
+// return (void *)periph_lcd_get_panel_handle(periph_lcd);
+// }
+// #endif
+//
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+// periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+// adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+// adc_btn_tag.adc_ch = ADC1_CHANNEL_5;
+// adc_btn_tag.total_steps = 6;
+// int btn_array[7] = {190, 600, 1000, 1375, 1775, 2195, 2610};
+// adc_btn_tag.adc_level_step = btn_array;
+// adc_btn_cfg.arr = &adc_btn_tag;
+// adc_btn_cfg.arr_size = 1;
+// esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+// AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+// return esp_periph_start(set, adc_btn_handle);
+// }
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_board->audio_hal = NULL;
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_s2_kaluga_1_v1_2/board.h b/components/audio_board/esp32_s2_kaluga_1_v1_2/board.h
new file mode 100644
index 0000000..f08adcb
--- /dev/null
+++ b/components/audio_board/esp32_s2_kaluga_1_v1_2/board.h
@@ -0,0 +1,127 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+// #include "display_service.h"
+// #include "esp_peripherals.h"
+// #include "periph_lcd.h"
+// #include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize lcd peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ * @param cb The `on_color_trans_done` callback in
+ * `esp_lcd_panel_io_spi_config_t`
+ *
+ * @return The `esp_lcd_panel_handle_t` handle
+ */
+// void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return ESP_OK success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h
new file mode 100644
index 0000000..c4ba250
--- /dev/null
+++ b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h
@@ -0,0 +1,143 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+#include "driver/touch_pad.h"
+
+/**
+ * @brief LED Function Definition
+ */
+#define FUNC_SYS_LEN_EN (1)
+#define WS2812_LED_GPIO 45
+
+/**
+ * @brief LCD SCREEN Function Definition
+ */
+#define FUNC_LCD_SCREEN_EN (1)
+#define LCD_CTRL_GPIO GPIO_NUM_6
+#define LCD_RST_GPIO GPIO_NUM_16
+#define LCD_CS_GPIO GPIO_NUM_11
+// LCD SPI Pins
+#define LCD_DC_GPIO GPIO_NUM_13
+#define LCD_CLK_GPIO GPIO_NUM_15
+#define LCD_MOSI_GPIO GPIO_NUM_9
+// The LCD pixel number in horizontal and vertical
+#define LCD_H_RES 320
+#define LCD_V_RES 240
+#define LCD_SWAP_XY (true)
+#define LCD_MIRROR_X (true)
+#define LCD_MIRROR_Y (true)
+#define LCD_COLOR_INV (false)
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (0)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+
+#define ESP_SD_PIN_CLK -1
+#define ESP_SD_PIN_CMD -1
+#define ESP_SD_PIN_D0 -1
+#define ESP_SD_PIN_D3 -1
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define PA_ENABLE_GPIO 10
+#define ES8311_MCLK_SOURCE 1 /* 0 From MCLK, 1 From BCLK */
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define BUTTON_ADC 6
+#define INPUT_KEY_NUM 6
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+#define GREEN_LED_GPIO (-1)
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_s2_kaluga_1_v1_2/board_pins_config.c b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_pins_config.c
new file mode 100644
index 0000000..5b61ed7
--- /dev/null
+++ b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_pins_config.c
@@ -0,0 +1,115 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_idf_version.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
+#include "rom/gpio.h"
+#include "soc/gpio_sig_map.h"
+#endif
+static const char *TAG = "KALUGA_V1_2";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0) {
+ i2c_config->sda_io_num = GPIO_NUM_8;
+ i2c_config->scl_io_num = GPIO_NUM_7;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+
+ i2s_config->bck_io_num = GPIO_NUM_18;
+ i2s_config->ws_io_num = GPIO_NUM_17;
+ i2s_config->data_out_num = GPIO_NUM_12;
+ i2s_config->data_in_num = GPIO_NUM_34;
+ i2s_config->mck_io_num = GPIO_NUM_35;
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button id
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+int8_t get_ws2812_led_gpio(void) { return WS2812_LED_GPIO; }
+
+int8_t get_es8311_mclk_src(void) { return ES8311_MCLK_SOURCE; }
+
+// led pins
+
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/esp32_s3_box/board.c b/components/audio_board/esp32_s3_box/board.c
new file mode 100644
index 0000000..d677642
--- /dev/null
+++ b/components/audio_board/esp32_s3_box/board.c
@@ -0,0 +1,187 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_lcd_panel_ops.h"
+#include "esp_log.h"
+#include "periph_adc_button.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+#include "tca9554.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+ board_handle->adc_hal = audio_board_adc_init();
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_adc_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t adc_hal = NULL;
+ adc_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES7210_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, adc_hal, return NULL);
+ return adc_hal;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8311_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+esp_err_t _lcd_rest(esp_periph_handle_t self, void *ctx) {
+ // Reset the LCD
+ vTaskDelay(20 / portTICK_PERIOD_MS);
+ return ESP_OK;
+}
+
+esp_err_t _get_lcd_io_bus(void *bus, esp_lcd_panel_io_spi_config_t *io_config,
+ esp_lcd_panel_io_handle_t *out_panel_io) {
+ return esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)bus, io_config,
+ out_panel_io);
+}
+
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb) {
+ gpio_config_t bk_gpio_config = {
+ .mode = GPIO_MODE_OUTPUT,
+ /*!< Prevent left shift negtive value warning */
+ .pin_bit_mask = LCD_CTRL_GPIO > 0 ? 1ULL << LCD_CTRL_GPIO : 0ULL,
+ };
+ gpio_config(&bk_gpio_config);
+ gpio_set_level(LCD_CTRL_GPIO, true);
+
+ spi_bus_config_t buscfg = {.sclk_io_num = LCD_CLK_GPIO,
+ .mosi_io_num = LCD_MOSI_GPIO,
+ .miso_io_num = -1,
+ .quadwp_io_num = -1,
+ .quadhd_io_num = -1,
+ .max_transfer_sz = LCD_V_RES * LCD_H_RES * 2};
+ ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
+
+ esp_lcd_panel_io_spi_config_t io_config = {
+ .dc_gpio_num = LCD_DC_GPIO,
+ .cs_gpio_num = LCD_CS_GPIO,
+ .pclk_hz = 10 * 1000 * 1000,
+ .lcd_cmd_bits = 8,
+ .lcd_param_bits = 8,
+ .spi_mode = 0,
+ .trans_queue_depth = 10,
+ .on_color_trans_done = cb,
+ .user_ctx = NULL,
+ };
+ esp_lcd_panel_dev_config_t panel_config = {
+ .reset_gpio_num = LCD_RST_GPIO,
+ .color_space = LCD_COLOR_SPACE,
+ .bits_per_pixel = 16,
+ };
+ periph_lcd_cfg_t cfg = {
+ .io_bus = (void *)SPI2_HOST,
+ .new_panel_io = _get_lcd_io_bus,
+ .lcd_io_cfg = &io_config,
+ .new_lcd_panel = esp_lcd_new_panel_st7789,
+ .lcd_dev_cfg = &panel_config,
+ .rest_cb = NULL,
+ .rest_cb_ctx = NULL,
+ .lcd_swap_xy = LCD_SWAP_XY,
+ .lcd_mirror_x = LCD_MIRROR_X,
+ .lcd_mirror_y = LCD_MIRROR_Y,
+ .lcd_color_invert = LCD_COLOR_INV,
+ };
+ esp_periph_handle_t periph_lcd = periph_lcd_init(&cfg);
+ AUDIO_NULL_CHECK(TAG, periph_lcd, return NULL);
+ esp_periph_start(set, periph_lcd);
+
+ return (void *)periph_lcd_get_panel_handle(periph_lcd);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.total_steps = 3;
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_0;
+ int btn_array[4] = {190, 1000, 2195, 3000};
+ adc_btn_tag.adc_level_step = btn_array;
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ return esp_periph_start(set, adc_btn_handle);
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ if (mode != SD_MODE_1_LINE) {
+ ESP_LOGE(TAG, "Current board only support 1-line SD mode!");
+ return ESP_FAIL;
+ }
+ periph_sdcard_cfg_t sdcard_cfg = {.root = "/sdcard",
+ .card_detect_pin = get_sdcard_intr_gpio(),
+ .mode = mode};
+ esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+ esp_err_t ret = esp_periph_start(set, sdcard_handle);
+ int retry_time = 5;
+ bool mount_flag = false;
+ while (retry_time--) {
+ if (periph_sdcard_is_mounted(sdcard_handle)) {
+ mount_flag = true;
+ break;
+ } else {
+ vTaskDelay(500 / portTICK_PERIOD_MS);
+ }
+ }
+ if (mount_flag == false) {
+ ESP_LOGE(TAG, "Sdcard mount failed");
+ return ESP_FAIL;
+ }
+ return ret;
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret |= audio_hal_deinit(audio_board->audio_hal);
+ ret |= audio_hal_deinit(audio_board->adc_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_s3_box/board.h b/components/audio_board/esp32_s3_box/board.h
new file mode 100644
index 0000000..22b701a
--- /dev/null
+++ b/components/audio_board/esp32_s3_box/board.h
@@ -0,0 +1,135 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+ audio_hal_handle_t adc_hal; /*!< adc hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize adc
+ *
+ * @return The adc hal handle
+ */
+audio_hal_handle_t audio_board_adc_init(void);
+
+/**
+ * @brief Initialize lcd peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ * @param cb The `on_color_trans_done` callback in
+ * `esp_lcd_panel_io_spi_config_t`
+ *
+ * @return The `esp_lcd_panel_handle_t` handle
+ */
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_blue_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_s3_box/board_def.h b/components/audio_board/esp32_s3_box/board_def.h
new file mode 100644
index 0000000..68ab422
--- /dev/null
+++ b/components/audio_board/esp32_s3_box/board_def.h
@@ -0,0 +1,136 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief LCD SCREEN Function Definition
+ */
+#define FUNC_LCD_SCREEN_EN (1)
+#define LCD_CTRL_GPIO GPIO_NUM_45
+#define LCD_RST_GPIO GPIO_NUM_48
+#define LCD_DC_GPIO GPIO_NUM_4
+#define LCD_CS_GPIO GPIO_NUM_5
+#define LCD_CLK_GPIO GPIO_NUM_7
+#define LCD_MOSI_GPIO GPIO_NUM_6
+// The LCD pixel number in horizontal and vertical
+#define LCD_H_RES 320
+#define LCD_V_RES 240
+#define LCD_SWAP_XY (false)
+#define LCD_MIRROR_X (true)
+#define LCD_MIRROR_Y (true)
+#define LCD_COLOR_INV (false)
+#define LCD_COLOR_SPACE ESP_LCD_COLOR_SPACE_BGR
+
+/**
+ * @brief SDCARD Function Definition
+ * PMOD2 for one line sdcard
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+#define ESP_SD_PIN_CLK GPIO_NUM_13
+#define ESP_SD_PIN_CMD GPIO_NUM_11
+#define ESP_SD_PIN_D0 GPIO_NUM_14
+#define ESP_SD_PIN_D1 -1
+#define ESP_SD_PIN_D2 -1
+#define ESP_SD_PIN_D3 -1
+#define ESP_SD_PIN_D4 -1
+#define ESP_SD_PIN_D5 -1
+#define ESP_SD_PIN_D6 -1
+#define ESP_SD_PIN_D7 -1
+#define ESP_SD_PIN_CD -1
+#define ESP_SD_PIN_WP -1
+
+/**
+ * @brief LCD TOUCH PANEL Function Definition
+ */
+#define FUNC_LCD_TOUCH_EN (1)
+#define TOUCH_PANEL_SWAP_XY (0)
+#define TOUCH_PANEL_INVERSE_X (1)
+#define TOUCH_PANEL_INVERSE_Y (0)
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define PA_ENABLE_GPIO GPIO_NUM_46
+#define HEADPHONE_DETECT -1
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_32BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (true)
+#define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE;
+extern audio_hal_func_t AUDIO_CODEC_ES7210_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (0)
+#define INPUT_KEY_NUM 3
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_s3_box/board_pins_config.c b/components/audio_board/esp32_s3_box/board_pins_config.c
new file mode 100644
index 0000000..a05865c
--- /dev/null
+++ b/components/audio_board/esp32_s3_box/board_pins_config.c
@@ -0,0 +1,129 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "ESP32_S3_BOX";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_8;
+ i2c_config->scl_io_num = GPIO_NUM_18;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0) {
+ i2s_config->bck_io_num = GPIO_NUM_17;
+ i2s_config->ws_io_num = GPIO_NUM_47;
+ i2s_config->data_out_num = GPIO_NUM_15;
+ i2s_config->data_in_num = GPIO_NUM_16;
+ i2s_config->mck_io_num = GPIO_NUM_2;
+ } else if (port == I2S_NUM_1) {
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = -1;
+ i2s_config->data_in_num = -1;
+ i2s_config->mck_io_num = -1;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+int8_t get_es7243_mclk_gpio(void) { return GPIO_NUM_2; }
+
+// adc button id
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+
+int8_t get_green_led_gpio(void) { return -1; }
+
+int8_t get_blue_led_gpio(void) { return -1; }
+
+int8_t get_es8311_mclk_src(void) { return -1; }
diff --git a/components/audio_board/esp32_s3_box_lite/board.c b/components/audio_board/esp32_s3_box_lite/board.c
new file mode 100644
index 0000000..060214d
--- /dev/null
+++ b/components/audio_board/esp32_s3_box_lite/board.c
@@ -0,0 +1,187 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_lcd_panel_ops.h"
+#include "esp_log.h"
+#include "periph_adc_button.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+#include "tca9554.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+ board_handle->adc_hal = audio_board_adc_init();
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_adc_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t adc_hal = NULL;
+ adc_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES7243E_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, adc_hal, return NULL);
+ return adc_hal;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8156_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+esp_err_t _lcd_rest(esp_periph_handle_t self, void *ctx) {
+ // Reset the LCD
+ vTaskDelay(200 / portTICK_PERIOD_MS);
+ return ESP_OK;
+}
+
+esp_err_t _get_lcd_io_bus(void *bus, esp_lcd_panel_io_spi_config_t *io_config,
+ esp_lcd_panel_io_handle_t *out_panel_io) {
+ return esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)bus, io_config,
+ out_panel_io);
+}
+
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb) {
+ gpio_config_t bk_gpio_config = {
+ .mode = GPIO_MODE_OUTPUT,
+ /*!< Prevent left shift negtive value warning */
+ .pin_bit_mask = LCD_CTRL_GPIO > 0 ? 1ULL << LCD_CTRL_GPIO : 0ULL,
+ };
+ gpio_config(&bk_gpio_config);
+ gpio_set_level(LCD_CTRL_GPIO, false);
+
+ spi_bus_config_t buscfg = {.sclk_io_num = LCD_CLK_GPIO,
+ .mosi_io_num = LCD_MOSI_GPIO,
+ .miso_io_num = -1,
+ .quadwp_io_num = -1,
+ .quadhd_io_num = -1,
+ .max_transfer_sz = 16 * LCD_H_RES * 2 + 8};
+ ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
+
+ esp_lcd_panel_io_spi_config_t io_config = {
+ .dc_gpio_num = LCD_DC_GPIO,
+ .cs_gpio_num = LCD_CS_GPIO,
+ .pclk_hz = 10 * 1000 * 1000,
+ .lcd_cmd_bits = 8,
+ .lcd_param_bits = 8,
+ .spi_mode = 0,
+ .trans_queue_depth = 10,
+ .on_color_trans_done = cb,
+ .user_ctx = NULL,
+ };
+ esp_lcd_panel_dev_config_t panel_config = {
+ .reset_gpio_num = LCD_RST_GPIO,
+ .color_space = LCD_COLOR_SPACE,
+ .bits_per_pixel = 16,
+ };
+ periph_lcd_cfg_t cfg = {
+ .io_bus = (void *)SPI2_HOST,
+ .new_panel_io = _get_lcd_io_bus,
+ .lcd_io_cfg = &io_config,
+ .new_lcd_panel = esp_lcd_new_panel_st7789,
+ .lcd_dev_cfg = &panel_config,
+ .rest_cb = NULL,
+ .rest_cb_ctx = NULL,
+ .lcd_swap_xy = LCD_SWAP_XY,
+ .lcd_mirror_x = LCD_MIRROR_X,
+ .lcd_mirror_y = LCD_MIRROR_Y,
+ .lcd_color_invert = LCD_COLOR_INV,
+ };
+ esp_periph_handle_t periph_lcd = periph_lcd_init(&cfg);
+ AUDIO_NULL_CHECK(TAG, periph_lcd, return NULL);
+ esp_periph_start(set, periph_lcd);
+
+ return (void *)periph_lcd_get_panel_handle(periph_lcd);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.total_steps = 3;
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_0;
+ int btn_array[4] = {190, 1000, 2195, 3000};
+ adc_btn_tag.adc_level_step = btn_array;
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ return esp_periph_start(set, adc_btn_handle);
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ if (mode != SD_MODE_1_LINE) {
+ ESP_LOGE(TAG, "Current board only support 1-line SD mode!");
+ return ESP_FAIL;
+ }
+ periph_sdcard_cfg_t sdcard_cfg = {.root = "/sdcard",
+ .card_detect_pin = get_sdcard_intr_gpio(),
+ .mode = mode};
+ esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+ esp_err_t ret = esp_periph_start(set, sdcard_handle);
+ int retry_time = 5;
+ bool mount_flag = false;
+ while (retry_time--) {
+ if (periph_sdcard_is_mounted(sdcard_handle)) {
+ mount_flag = true;
+ break;
+ } else {
+ vTaskDelay(500 / portTICK_PERIOD_MS);
+ }
+ }
+ if (mount_flag == false) {
+ ESP_LOGE(TAG, "Sdcard mount failed");
+ return ESP_FAIL;
+ }
+ return ret;
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret |= audio_hal_deinit(audio_board->audio_hal);
+ ret |= audio_hal_deinit(audio_board->adc_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_s3_box_lite/board.h b/components/audio_board/esp32_s3_box_lite/board.h
new file mode 100644
index 0000000..22b701a
--- /dev/null
+++ b/components/audio_board/esp32_s3_box_lite/board.h
@@ -0,0 +1,135 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+ audio_hal_handle_t adc_hal; /*!< adc hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize adc
+ *
+ * @return The adc hal handle
+ */
+audio_hal_handle_t audio_board_adc_init(void);
+
+/**
+ * @brief Initialize lcd peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ * @param cb The `on_color_trans_done` callback in
+ * `esp_lcd_panel_io_spi_config_t`
+ *
+ * @return The `esp_lcd_panel_handle_t` handle
+ */
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_blue_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_s3_box_lite/board_def.h b/components/audio_board/esp32_s3_box_lite/board_def.h
new file mode 100644
index 0000000..0c02a55
--- /dev/null
+++ b/components/audio_board/esp32_s3_box_lite/board_def.h
@@ -0,0 +1,127 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief LCD SCREEN Function Definition
+ */
+#define FUNC_LCD_SCREEN_EN (1)
+#define LCD_CTRL_GPIO GPIO_NUM_45
+#define LCD_RST_GPIO GPIO_NUM_48
+#define LCD_DC_GPIO GPIO_NUM_4
+#define LCD_CS_GPIO GPIO_NUM_5
+#define LCD_MOSI_GPIO GPIO_NUM_6
+#define LCD_CLK_GPIO GPIO_NUM_7
+// The LCD pixel number in horizontal and vertical
+#define LCD_H_RES 320
+#define LCD_V_RES 240
+#define LCD_SWAP_XY (true)
+#define LCD_MIRROR_X (false)
+#define LCD_MIRROR_Y (true)
+#define LCD_COLOR_INV (true)
+#define LCD_COLOR_SPACE ESP_LCD_COLOR_SPACE_RGB
+
+/**
+ * @brief SDCARD Function Definition
+ * PMOD2 for one line sdcard
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+#define ESP_SD_PIN_CLK GPIO_NUM_13
+#define ESP_SD_PIN_CMD GPIO_NUM_11
+#define ESP_SD_PIN_D0 GPIO_NUM_14
+#define ESP_SD_PIN_D1 -1
+#define ESP_SD_PIN_D2 -1
+#define ESP_SD_PIN_D3 -1
+#define ESP_SD_PIN_D4 -1
+#define ESP_SD_PIN_D5 -1
+#define ESP_SD_PIN_D6 -1
+#define ESP_SD_PIN_D7 -1
+#define ESP_SD_PIN_CD -1
+#define ESP_SD_PIN_WP -1
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define HEADPHONE_DETECT -1
+#define PA_ENABLE_GPIO GPIO_NUM_46
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_32BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8156_DEFAULT_HANDLE;
+extern audio_hal_func_t AUDIO_CODEC_ES7243E_DEFAULT_HANDLE;
+
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define INPUT_KEY_NUM 3
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_s3_box_lite/board_pins_config.c b/components/audio_board/esp32_s3_box_lite/board_pins_config.c
new file mode 100644
index 0000000..d403a56
--- /dev/null
+++ b/components/audio_board/esp32_s3_box_lite/board_pins_config.c
@@ -0,0 +1,129 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "ESP32_S3_BOX_LITE";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_8;
+ i2c_config->scl_io_num = GPIO_NUM_18;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0) {
+ i2s_config->bck_io_num = GPIO_NUM_17;
+ i2s_config->ws_io_num = GPIO_NUM_47;
+ i2s_config->data_out_num = GPIO_NUM_15;
+ i2s_config->data_in_num = GPIO_NUM_16;
+ i2s_config->mck_io_num = GPIO_NUM_2;
+ } else if (port == I2S_NUM_1) {
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = -1;
+ i2s_config->data_in_num = -1;
+ i2s_config->mck_io_num = -1;
+ } else {
+ memset(i2s_config, -1, sizeof(i2s_pin_config_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+int8_t get_es7243_mclk_gpio(void) { return GPIO_NUM_2; }
+
+// adc button id
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+
+int8_t get_green_led_gpio(void) { return -1; }
+
+int8_t get_blue_led_gpio(void) { return -1; }
+
+int8_t get_es8311_mclk_src(void) { return -1; }
diff --git a/components/audio_board/esp32_s3_korvo2_v3/board.c b/components/audio_board/esp32_s3_korvo2_v3/board.c
new file mode 100644
index 0000000..5c19e20
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2_v3/board.c
@@ -0,0 +1,201 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+#include "periph_adc_button.h"
+#include "periph_sdcard.h"
+#include "tca9554.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+ board_handle->adc_hal = audio_board_adc_init();
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_adc_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_codec_cfg.codec_mode = AUDIO_HAL_CODEC_MODE_ENCODE;
+ audio_hal_handle_t adc_hal = NULL;
+ adc_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES7210_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, adc_hal, return NULL);
+ return adc_hal;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8311_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+esp_err_t _lcd_rest(esp_periph_handle_t self, void *ctx) {
+ // Reset the LCD
+ tca9554_set_output_state(LCD_RST_GPIO, TCA9554_IO_LOW);
+ vTaskDelay(100 / portTICK_PERIOD_MS);
+ tca9554_set_output_state(LCD_RST_GPIO, TCA9554_IO_HIGH);
+ vTaskDelay(200 / portTICK_PERIOD_MS);
+ return ESP_OK;
+}
+
+esp_err_t _get_lcd_io_bus(void *bus, esp_lcd_panel_io_spi_config_t *io_config,
+ esp_lcd_panel_io_handle_t *out_panel_io) {
+ return esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)bus, io_config,
+ out_panel_io);
+}
+
+display_service_handle_t audio_board_led_init(void) { return NULL; }
+
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb) {
+ esp_tca9554_config_t pca_cfg = {
+ .i2c_scl = GPIO_NUM_18,
+ .i2c_sda = GPIO_NUM_17,
+ .interrupt_output = -1,
+ };
+ tca9554_init(&pca_cfg);
+ // Set LCD_BL_CTRL output
+ tca9554_set_io_config(LCD_CTRL_GPIO, TCA9554_IO_OUTPUT);
+ // Set LCD_RST output
+ tca9554_set_io_config(LCD_RST_GPIO, TCA9554_IO_OUTPUT);
+ // Set LCD_CS pin output
+ tca9554_set_io_config(LCD_CS_GPIO, TCA9554_IO_OUTPUT);
+
+ tca9554_set_output_state(LCD_CTRL_GPIO, TCA9554_IO_HIGH);
+ tca9554_set_output_state(LCD_CS_GPIO, TCA9554_IO_HIGH);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+ tca9554_set_output_state(LCD_CS_GPIO, TCA9554_IO_LOW);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+
+ spi_bus_config_t buscfg = {.sclk_io_num = LCD_CLK_GPIO,
+ .mosi_io_num = LCD_MOSI_GPIO,
+ .miso_io_num = -1,
+ .quadwp_io_num = -1,
+ .quadhd_io_num = -1,
+ .max_transfer_sz = LCD_V_RES * LCD_H_RES * 2};
+ ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
+
+ esp_lcd_panel_io_spi_config_t io_config = {
+ .dc_gpio_num = LCD_DC_GPIO,
+ .cs_gpio_num = -1,
+ .pclk_hz = 60 * 1000 * 1000,
+ .lcd_cmd_bits = 8,
+ .lcd_param_bits = 8,
+ .spi_mode = 0,
+ .trans_queue_depth = 10,
+ .on_color_trans_done = cb,
+ .user_ctx = NULL,
+ };
+ esp_lcd_panel_dev_config_t panel_config = {
+ .reset_gpio_num = -1,
+ .color_space = ESP_LCD_COLOR_SPACE_BGR,
+ .bits_per_pixel = 16,
+ };
+ periph_lcd_cfg_t cfg = {
+ .io_bus = (void *)SPI2_HOST,
+ .new_panel_io = _get_lcd_io_bus,
+ .lcd_io_cfg = &io_config,
+ .new_lcd_panel = esp_lcd_new_panel_st7789,
+ .lcd_dev_cfg = &panel_config,
+ .rest_cb = _lcd_rest,
+ .rest_cb_ctx = NULL,
+ .lcd_swap_xy = LCD_SWAP_XY,
+ .lcd_mirror_x = LCD_MIRROR_X,
+ .lcd_mirror_y = LCD_MIRROR_Y,
+ .lcd_color_invert = LCD_COLOR_INV,
+ };
+ esp_periph_handle_t periph_lcd = periph_lcd_init(&cfg);
+ AUDIO_NULL_CHECK(TAG, periph_lcd, return NULL);
+ esp_periph_start(set, periph_lcd);
+ return (void *)periph_lcd_get_panel_handle(periph_lcd);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.total_steps = 6;
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_4;
+ int btn_array[7] = {190, 600, 1000, 1375, 1775, 2195, 3000};
+ adc_btn_tag.adc_level_step = btn_array;
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ return esp_periph_start(set, adc_btn_handle);
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ if (mode != SD_MODE_1_LINE) {
+ ESP_LOGE(TAG, "Current board only support 1-line SD mode!");
+ return ESP_FAIL;
+ }
+ periph_sdcard_cfg_t sdcard_cfg = {.root = "/sdcard",
+ .card_detect_pin = get_sdcard_intr_gpio(),
+ .mode = mode};
+ esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+ esp_err_t ret = esp_periph_start(set, sdcard_handle);
+ int retry_time = 5;
+ bool mount_flag = false;
+ while (retry_time--) {
+ if (periph_sdcard_is_mounted(sdcard_handle)) {
+ mount_flag = true;
+ break;
+ } else {
+ vTaskDelay(500 / portTICK_PERIOD_MS);
+ }
+ }
+ if (mount_flag == false) {
+ ESP_LOGE(TAG, "Sdcard mount failed");
+ return ESP_FAIL;
+ }
+ return ret;
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret |= audio_hal_deinit(audio_board->audio_hal);
+ ret |= audio_hal_deinit(audio_board->adc_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_s3_korvo2_v3/board.h b/components/audio_board/esp32_s3_korvo2_v3/board.h
new file mode 100644
index 0000000..d775791
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2_v3/board.h
@@ -0,0 +1,142 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+ audio_hal_handle_t adc_hal; /*!< adc hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize adc
+ *
+ * @return The adc hal handle
+ */
+audio_hal_handle_t audio_board_adc_init(void);
+
+/**
+ * @brief Initialize lcd peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ * @param cb The `on_color_trans_done` callback in
+ * `esp_lcd_panel_io_spi_config_t`
+ *
+ * @return The `esp_lcd_panel_handle_t` handle
+ */
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_blue_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_s3_korvo2_v3/board_def.h b/components/audio_board/esp32_s3_korvo2_v3/board_def.h
new file mode 100644
index 0000000..76c9853
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2_v3/board_def.h
@@ -0,0 +1,182 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief LED Function Definition
+ */
+#define GREEN_LED_GPIO -1
+#define BLUE_LED_GPIO BIT(7) // TCA9554_GPIO_NUM_7
+#define RED_LED_GPIO BIT(6) // TCA9554_GPIO_NUM_6
+
+/**
+ * @brief LCD SCREEN Function Definition
+ */
+#define FUNC_LCD_SCREEN_EN (1)
+#define LCD_CTRL_GPIO BIT(1) // TCA9554_GPIO_NUM_1
+#define LCD_RST_GPIO BIT(2) // TCA9554_GPIO_NUM_2
+#define LCD_CS_GPIO BIT(3) // TCA9554_GPIO_NUM_3
+// LCD SPI Pins
+#define LCD_DC_GPIO GPIO_NUM_2
+#define LCD_CLK_GPIO GPIO_NUM_1
+#define LCD_MOSI_GPIO GPIO_NUM_0
+// The LCD pixel number in horizontal and vertical
+#define LCD_H_RES 320
+#define LCD_V_RES 240
+#define LCD_SWAP_XY (false)
+#define LCD_MIRROR_X (true)
+#define LCD_MIRROR_Y (true)
+#define LCD_COLOR_INV (false)
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+
+#define ESP_SD_PIN_CLK GPIO_NUM_15
+#define ESP_SD_PIN_CMD GPIO_NUM_7
+#define ESP_SD_PIN_D0 GPIO_NUM_4
+#define ESP_SD_PIN_D1 -1
+#define ESP_SD_PIN_D2 -1
+#define ESP_SD_PIN_D3 -1
+#define ESP_SD_PIN_D4 -1
+#define ESP_SD_PIN_D5 -1
+#define ESP_SD_PIN_D6 -1
+#define ESP_SD_PIN_D7 -1
+#define ESP_SD_PIN_CD -1
+#define ESP_SD_PIN_WP -1
+
+/**
+ * @brief Camera Function Definition
+ */
+#define FUNC_CAMERA_EN (1)
+#define CAM_PIN_PWDN -1
+#define CAM_PIN_RESET -1
+#define CAM_PIN_XCLK GPIO_NUM_40
+#define CAM_PIN_SIOD GPIO_NUM_17
+#define CAM_PIN_SIOC GPIO_NUM_18
+
+#define CAM_PIN_D7 GPIO_NUM_39
+#define CAM_PIN_D6 GPIO_NUM_41
+#define CAM_PIN_D5 GPIO_NUM_42
+#define CAM_PIN_D4 GPIO_NUM_12
+#define CAM_PIN_D3 GPIO_NUM_3
+#define CAM_PIN_D2 GPIO_NUM_14
+#define CAM_PIN_D1 GPIO_NUM_47
+#define CAM_PIN_D0 GPIO_NUM_13
+#define CAM_PIN_VSYNC GPIO_NUM_21
+#define CAM_PIN_HREF GPIO_NUM_38
+#define CAM_PIN_PCLK GPIO_NUM_11
+
+/**
+ * @brief LCD TOUCH PANEL Function Definition
+ */
+#define FUNC_LCD_TOUCH_EN (1)
+#define TOUCH_PANEL_SWAP_XY (0)
+#define TOUCH_PANEL_INVERSE_X (1)
+#define TOUCH_PANEL_INVERSE_Y (0)
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define ES8311_MCLK_SOURCE (0) /* 0 From MCLK of esp32 1 From BCLK */
+#define HEADPHONE_DETECT (-1)
+#define PA_ENABLE_GPIO GPIO_NUM_48
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_32BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (true)
+#define BOARD_PA_GAIN (6) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE;
+extern audio_hal_func_t AUDIO_CODEC_ES7210_DEFAULT_HANDLE;
+
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define INPUT_KEY_NUM 6
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MUTE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_s3_korvo2_v3/board_pins_config.c b/components/audio_board/esp32_s3_korvo2_v3/board_pins_config.c
new file mode 100644
index 0000000..9dd64ed
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2_v3/board_pins_config.c
@@ -0,0 +1,127 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "ESP32_S3_KORVO_2";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_17;
+ i2c_config->scl_io_num = GPIO_NUM_18;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0) {
+ i2s_config->bck_io_num = GPIO_NUM_9;
+ i2s_config->ws_io_num = GPIO_NUM_45;
+ i2s_config->data_out_num = GPIO_NUM_8;
+ i2s_config->data_in_num = GPIO_NUM_10;
+ i2s_config->mck_io_num = GPIO_NUM_16;
+ } else if (port == I2S_NUM_1) {
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = -1;
+ i2s_config->data_in_num = -1;
+ i2s_config->mck_io_num = -1;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button id
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
+
+int8_t get_blue_led_gpio(void) { return BLUE_LED_GPIO; }
+
+int8_t get_es8311_mclk_src(void) { return ES8311_MCLK_SOURCE; }
diff --git a/components/audio_board/esp32_s3_korvo2l_v1/board.c b/components/audio_board/esp32_s3_korvo2l_v1/board.c
new file mode 100644
index 0000000..6094ef6
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2l_v1/board.c
@@ -0,0 +1,206 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+#include "periph_adc_button.h"
+#include "periph_sdcard.h"
+#include "tca9554.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8311_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+esp_err_t audio_board_usb_cam_init(void) {
+ gpio_config_t usb_camera_pins_cfg = {
+ .intr_type = GPIO_INTR_DISABLE,
+ .mode = GPIO_MODE_OUTPUT,
+ .pin_bit_mask = (BIT64(USB_CAM_PIN_PWDN)),
+ .pull_up_en = 0,
+ .pull_down_en = 0,
+ };
+ gpio_config(&usb_camera_pins_cfg);
+ gpio_set_level(USB_CAM_PIN_PWDN, 0);
+
+ return ESP_OK;
+}
+
+esp_err_t _lcd_rest(esp_periph_handle_t self, void *ctx) {
+ // Reset the LCD
+ tca9554_set_output_state(LCD_RST_GPIO, TCA9554_IO_LOW);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+ tca9554_set_output_state(LCD_RST_GPIO, TCA9554_IO_HIGH);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+ return ESP_OK;
+}
+
+esp_err_t _get_lcd_io_bus(void *bus, esp_lcd_panel_io_spi_config_t *io_config,
+ esp_lcd_panel_io_handle_t *out_panel_io) {
+ return esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)bus, io_config,
+ out_panel_io);
+}
+
+display_service_handle_t audio_board_led_init(void) { return NULL; }
+
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb) {
+ esp_tca9554_config_t pca_cfg = {
+ .i2c_scl = GPIO_NUM_18,
+ .i2c_sda = GPIO_NUM_17,
+ .interrupt_output = -1,
+ };
+ tca9554_init(&pca_cfg);
+ // Set LCD_BL_CTRL output
+ tca9554_set_io_config(LCD_CTRL_GPIO, TCA9554_IO_OUTPUT);
+ // Set LCD_RST output
+ tca9554_set_io_config(LCD_RST_GPIO, TCA9554_IO_OUTPUT);
+ // Set LCD_CS pin output
+ tca9554_set_io_config(LCD_CS_GPIO, TCA9554_IO_OUTPUT);
+
+ tca9554_set_output_state(LCD_CTRL_GPIO, TCA9554_IO_HIGH);
+ tca9554_set_output_state(LCD_CS_GPIO, TCA9554_IO_HIGH);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+ tca9554_set_output_state(LCD_CS_GPIO, TCA9554_IO_LOW);
+ vTaskDelay(10 / portTICK_PERIOD_MS);
+
+ spi_bus_config_t buscfg = {.sclk_io_num = LCD_CLK_GPIO,
+ .mosi_io_num = LCD_MOSI_GPIO,
+ .miso_io_num = -1,
+ .quadwp_io_num = -1,
+ .quadhd_io_num = -1,
+ .max_transfer_sz = LCD_V_RES * LCD_H_RES * 2};
+ ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
+
+ esp_lcd_panel_io_spi_config_t io_config = {
+ .dc_gpio_num = LCD_DC_GPIO,
+ .cs_gpio_num = -1,
+ .pclk_hz = 60 * 1000 * 1000,
+ .lcd_cmd_bits = 8,
+ .lcd_param_bits = 8,
+ .spi_mode = 0,
+ .trans_queue_depth = 10,
+ .on_color_trans_done = cb,
+ .user_ctx = NULL,
+ };
+ esp_lcd_panel_dev_config_t panel_config = {
+ .reset_gpio_num = -1,
+ .color_space = ESP_LCD_COLOR_SPACE_BGR,
+ .bits_per_pixel = 16,
+ };
+ periph_lcd_cfg_t cfg = {
+ .io_bus = (void *)SPI2_HOST,
+ .new_panel_io = _get_lcd_io_bus,
+ .lcd_io_cfg = &io_config,
+ .new_lcd_panel = esp_lcd_new_panel_st7789,
+ .lcd_dev_cfg = &panel_config,
+ .rest_cb = _lcd_rest,
+ .rest_cb_ctx = NULL,
+ .lcd_swap_xy = LCD_SWAP_XY,
+ .lcd_mirror_x = LCD_MIRROR_X,
+ .lcd_mirror_y = LCD_MIRROR_Y,
+ .lcd_color_invert = LCD_COLOR_INV,
+ };
+ esp_periph_handle_t periph_lcd = periph_lcd_init(&cfg);
+ AUDIO_NULL_CHECK(TAG, periph_lcd, return NULL);
+
+ esp_periph_start(set, periph_lcd);
+ vTaskDelay(200 / portTICK_PERIOD_MS);
+
+ return (void *)periph_lcd_get_panel_handle(periph_lcd);
+}
+
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+ periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+ adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+ adc_btn_tag.total_steps = 6;
+ adc_btn_tag.adc_ch = ADC1_CHANNEL_4;
+ int btn_array[7] = {190, 600, 1000, 1375, 1775, 2195, 3000};
+ adc_btn_tag.adc_level_step = btn_array;
+ adc_btn_cfg.arr = &adc_btn_tag;
+ adc_btn_cfg.arr_size = 1;
+ esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+ AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+ return esp_periph_start(set, adc_btn_handle);
+}
+
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode) {
+ if (mode != SD_MODE_1_LINE) {
+ ESP_LOGE(TAG, "Current board only support 1-line SD mode!");
+ return ESP_FAIL;
+ }
+ periph_sdcard_cfg_t sdcard_cfg = {.root = "/sdcard",
+ .card_detect_pin = get_sdcard_intr_gpio(),
+ .mode = mode};
+ esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+ esp_err_t ret = esp_periph_start(set, sdcard_handle);
+ int retry_time = 5;
+ bool mount_flag = false;
+ while (retry_time--) {
+ if (periph_sdcard_is_mounted(sdcard_handle)) {
+ mount_flag = true;
+ break;
+ } else {
+ vTaskDelay(500 / portTICK_PERIOD_MS);
+ }
+ }
+ if (mount_flag == false) {
+ ESP_LOGE(TAG, "Sdcard mount failed");
+ return ESP_FAIL;
+ }
+ return ret;
+}
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret |= audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/esp32_s3_korvo2l_v1/board.h b/components/audio_board/esp32_s3_korvo2l_v1/board.h
new file mode 100644
index 0000000..779a8e8
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2l_v1/board.h
@@ -0,0 +1,143 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+#include "display_service.h"
+#include "esp_peripherals.h"
+#include "periph_lcd.h"
+#include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize USB Camera peripheral
+ * @note Just power on the USB camera
+ *
+ * @return
+ * - ESP_OK, success
+ */
+esp_err_t audio_board_usb_cam_init(void);
+
+/**
+ * @brief Initialize lcd peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ * @param cb The `on_color_trans_done` callback in
+ * `esp_lcd_panel_io_spi_config_t`
+ *
+ * @return The `esp_lcd_panel_handle_t` handle
+ */
+void *audio_board_lcd_init(esp_periph_set_handle_t set, void *cb);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+display_service_handle_t audio_board_blue_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+ periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/esp32_s3_korvo2l_v1/board_def.h b/components/audio_board/esp32_s3_korvo2l_v1/board_def.h
new file mode 100644
index 0000000..dda5bc1
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2l_v1/board_def.h
@@ -0,0 +1,186 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief LED Function Definition
+ */
+#define GREEN_LED_GPIO -1
+#define BLUE_LED_GPIO BIT(7) // TCA9554_GPIO_NUM_7
+#define RED_LED_GPIO BIT(6) // TCA9554_GPIO_NUM_6
+
+/**
+ * @brief LCD SCREEN Function Definition
+ */
+#define FUNC_LCD_SCREEN_EN (1)
+#define LCD_CTRL_GPIO BIT(1) // TCA9554_GPIO_NUM_1
+#define LCD_RST_GPIO BIT(2) // TCA9554_GPIO_NUM_2
+#define LCD_CS_GPIO BIT(3) // TCA9554_GPIO_NUM_3
+// LCD SPI Pins
+#define LCD_DC_GPIO GPIO_NUM_2
+#define LCD_CLK_GPIO GPIO_NUM_1
+#define LCD_MOSI_GPIO GPIO_NUM_0
+// The LCD pixel number in horizontal and vertical
+#define LCD_H_RES 320
+#define LCD_V_RES 240
+#define LCD_SWAP_XY (false)
+#define LCD_MIRROR_X (true)
+#define LCD_MIRROR_Y (true)
+#define LCD_COLOR_INV (false)
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO -1
+#define SDCARD_PWR_CTRL -1
+
+#define ESP_SD_PIN_CLK GPIO_NUM_6
+#define ESP_SD_PIN_CMD GPIO_NUM_7
+#define ESP_SD_PIN_D0 GPIO_NUM_4
+#define ESP_SD_PIN_D1 -1
+#define ESP_SD_PIN_D2 -1
+#define ESP_SD_PIN_D3 -1
+#define ESP_SD_PIN_D4 -1
+#define ESP_SD_PIN_D5 -1
+#define ESP_SD_PIN_D6 -1
+#define ESP_SD_PIN_D7 -1
+#define ESP_SD_PIN_CD -1
+#define ESP_SD_PIN_WP -1
+
+/**
+ * @brief Camera Function Definition
+ */
+#define FUNC_CAMERA_EN (1)
+#define CAM_PIN_PWDN -1
+#define CAM_PIN_RESET -1
+#define CAM_PIN_XCLK GPIO_NUM_40
+#define CAM_PIN_SIOD GPIO_NUM_17
+#define CAM_PIN_SIOC GPIO_NUM_18
+
+#define CAM_PIN_D7 GPIO_NUM_39
+#define CAM_PIN_D6 GPIO_NUM_41
+#define CAM_PIN_D5 GPIO_NUM_42
+#define CAM_PIN_D4 GPIO_NUM_12
+#define CAM_PIN_D3 GPIO_NUM_3
+#define CAM_PIN_D2 GPIO_NUM_14
+#define CAM_PIN_D1 GPIO_NUM_47
+#define CAM_PIN_D0 GPIO_NUM_13
+#define CAM_PIN_VSYNC GPIO_NUM_21
+#define CAM_PIN_HREF GPIO_NUM_38
+#define CAM_PIN_PCLK GPIO_NUM_11
+
+#define FUNC_USB_CAMERA_EN (1)
+#define USB_CAM_PIN_PWDN GPIO_NUM_48
+#define USB_CAM_PIN_DP GPIO_NUM_19
+#define USB_CAM_PIN_DM GPIO_NUM_20
+
+/**
+ * @brief LCD TOUCH PANEL Function Definition
+ */
+#define FUNC_LCD_TOUCH_EN (1)
+#define TOUCH_PANEL_SWAP_XY (0)
+#define TOUCH_PANEL_INVERSE_X (1)
+#define TOUCH_PANEL_INVERSE_Y (0)
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define ES8311_MCLK_SOURCE (1) /* 0 From MCLK of esp32 1 From BCLK */
+#define HEADPHONE_DETECT (-1)
+#define PA_ENABLE_GPIO GPIO_NUM_46
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (true)
+#define BOARD_PA_GAIN (6) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE;
+
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define INPUT_KEY_NUM 6
+#define BUTTON_VOLUP_ID 0
+#define BUTTON_VOLDOWN_ID 1
+#define BUTTON_SET_ID 2
+#define BUTTON_PLAY_ID 3
+#define BUTTON_MODE_ID 4
+#define BUTTON_REC_ID 5
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MUTE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/esp32_s3_korvo2l_v1/board_pins_config.c b/components/audio_board/esp32_s3_korvo2l_v1/board_pins_config.c
new file mode 100644
index 0000000..6c48cf2
--- /dev/null
+++ b/components/audio_board/esp32_s3_korvo2l_v1/board_pins_config.c
@@ -0,0 +1,127 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "ESP32_S3_KORVO_2L";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_17;
+ i2c_config->scl_io_num = GPIO_NUM_18;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0) {
+ i2s_config->bck_io_num = GPIO_NUM_9;
+ i2s_config->ws_io_num = GPIO_NUM_45;
+ i2s_config->data_out_num = GPIO_NUM_8;
+ i2s_config->data_in_num = GPIO_NUM_10;
+ i2s_config->mck_io_num = -1;
+ } else if (port == I2S_NUM_1) {
+ i2s_config->bck_io_num = -1;
+ i2s_config->ws_io_num = -1;
+ i2s_config->data_out_num = -1;
+ i2s_config->data_in_num = -1;
+ i2s_config->mck_io_num = -1;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+int8_t get_sdcard_power_ctrl_gpio(void) { return SDCARD_PWR_CTRL; }
+
+// input-output pins
+
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button id
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
+
+int8_t get_blue_led_gpio(void) { return BLUE_LED_GPIO; }
+
+int8_t get_es8311_mclk_src(void) { return ES8311_MCLK_SOURCE; }
diff --git a/components/audio_board/include/board_pins_config.h b/components/audio_board/include/board_pins_config.h
index 1b5ff63..217ebdc 100644
--- a/components/audio_board/include/board_pins_config.h
+++ b/components/audio_board/include/board_pins_config.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -28,207 +28,199 @@
#define _BOARD_PINS_CONFIG_H_
#include "driver/i2c.h"
-#include "driver/i2s.h"
+#include "driver/i2s_std.h"
#include "driver/spi_common.h"
#include "driver/spi_master.h"
#include "driver/spi_slave.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Get i2c pins configuration
- *
- * @param port i2c port number to get configuration
- * @param i2c_config i2c configuration parameters
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t get_i2c_pins (i2c_port_t port, i2c_config_t *i2c_config);
+/**
+ * @brief Board i2s pin definition
+ */
+typedef struct {
+ int mck_io_num; /*!< MCK pin, output */
+ int bck_io_num; /*!< BCK pin, input in slave role, output in master role */
+ int ws_io_num; /*!< WS pin, input in slave role, output in master role */
+ int data_out_num; /*!< DATA pin, output */
+ int data_in_num; /*!< DATA pin, input */
+} board_i2s_pin_t;
- /**
- * @brief Get i2s pins configuration
- *
- * @param port i2s port number to get configuration
- * @param i2s_config i2s configuration parameters
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t get_i2s_pins (i2s_port_t port, i2s_pin_config_t *i2s_config);
+/**
+ * @brief Get i2c pins configuration
+ *
+ * @param port i2c port number to get configuration
+ * @param i2c_config i2c configuration parameters
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config);
- /**
- * @brief Get spi pins configuration
- *
- * @param spi_config spi bus configuration parameters
- * @param spi_device_interface_config spi device configuration
- * parameters
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t
- get_spi_pins (spi_bus_config_t *spi_config,
- spi_device_interface_config_t *spi_device_interface_config);
+/**
+ * @brief Get i2s pins configuration
+ *
+ * @param port i2s port number to get configuration
+ * @param i2s_config i2s configuration parameters
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config);
- /**
- * @brief Set i2s mclk output pin
- *
- * @note GPIO1 and GPIO3 default are UART pins.
- *
- * @param i2s_num i2s port index
- * @param gpio_num gpio number index, only support GPIO0, GPIO1 and
- GPIO3.
+/**
+ * @brief Get spi pins configuration
+ *
+ * @param spi_config spi bus configuration parameters
+ * @param spi_device_interface_config spi device configuration parameters
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config);
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- * - ESP_ERR_INVALID_STATE Driver state error
- * - ESP_ERR_ADF_NOT_SUPPORT Not support
- */
- esp_err_t i2s_mclk_gpio_select (i2s_port_t i2s_num, gpio_num_t gpio_num);
+/**
+ * @brief Get the gpio number for sdcard interrupt
+ *
+ * @return -1 non-existent
+ * Others sdcard interrupt gpio number
+ */
+int8_t get_sdcard_intr_gpio(void);
- /**
- * @brief Get the gpio number for sdcard interrupt
- *
- * @return -1 non-existent
- * Others sdcard interrupt gpio number
- */
- int8_t get_sdcard_intr_gpio (void);
+/**
+ * @brief Get sdcard maximum number of open files
+ *
+ * @return -1 error
+ * Others max num
+ */
+int8_t get_sdcard_open_file_num_max(void);
- /**
- * @brief Get sdcard maximum number of open files
- *
- * @return -1 error
- * Others max num
- */
- int8_t get_sdcard_open_file_num_max (void);
+/**
+ * @brief Get the gpio number for auxin detection
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_auxin_detect_gpio(void);
- /**
- * @brief Get the gpio number for auxin detection
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_auxin_detect_gpio (void);
+/**
+ * @brief Get the gpio number for headphone detection
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_headphone_detect_gpio(void);
- /**
- * @brief Get the gpio number for headphone detection
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_headphone_detect_gpio (void);
+/**
+ * @brief Get the gpio number for PA enable
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_pa_enable_gpio(void);
- /**
- * @brief Get the gpio number for PA enable
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_pa_enable_gpio (void);
+/**
+ * @brief Get the gpio number for adc detection
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_adc_detect_gpio(void);
- /**
- * @brief Get the gpio number for adc detection
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_adc_detect_gpio (void);
+/**
+ * @brief Get the mclk gpio number of es7243
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_es7243_mclk_gpio(void);
- /**
- * @brief Get the mclk gpio number of es7243
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_es7243_mclk_gpio (void);
+/**
+ * @brief Get the record-button id for adc-button
+ *
+ * @return -1 non-existent
+ * Others button id
+ */
+int8_t get_input_rec_id(void);
- /**
- * @brief Get the record-button id for adc-button
- *
- * @return -1 non-existent
- * Others button id
- */
- int8_t get_input_rec_id (void);
+/**
+ * @brief Get the number for mode-button
+ *
+ * @return -1 non-existent
+ * Others number
+ */
+int8_t get_input_mode_id(void);
- /**
- * @brief Get the number for mode-button
- *
- * @return -1 non-existent
- * Others number
- */
- int8_t get_input_mode_id (void);
+/**
+ * @brief Get number for set function
+ *
+ * @return -1 non-existent
+ * Others number
+ */
+int8_t get_input_set_id(void);
- /**
- * @brief Get number for set function
- *
- * @return -1 non-existent
- * Others number
- */
- int8_t get_input_set_id (void);
+/**
+ * @brief Get number for play function
+ *
+ * @return -1 non-existent
+ * Others number
+ */
+int8_t get_input_play_id(void);
- /**
- * @brief Get number for play function
- *
- * @return -1 non-existent
- * Others number
- */
- int8_t get_input_play_id (void);
+/**
+ * @brief number for volume up function
+ *
+ * @return -1 non-existent
+ * Others number
+ */
+int8_t get_input_volup_id(void);
- /**
- * @brief number for volume up function
- *
- * @return -1 non-existent
- * Others number
- */
- int8_t get_input_volup_id (void);
+/**
+ * @brief Get number for volume down function
+ *
+ * @return -1 non-existent
+ * Others number
+ */
+int8_t get_input_voldown_id(void);
- /**
- * @brief Get number for volume down function
- *
- * @return -1 non-existent
- * Others number
- */
- int8_t get_input_voldown_id (void);
+/**
+ * @brief Get green led gpio number
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_reset_codec_gpio(void);
- /**
- * @brief Get green led gpio number
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_reset_codec_gpio (void);
+/**
+ * @brief Get DSP reset gpio number
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_reset_board_gpio(void);
- /**
- * @brief Get DSP reset gpio number
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_reset_board_gpio (void);
+/**
+ * @brief Get DSP reset gpio number
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_green_led_gpio(void);
- /**
- * @brief Get DSP reset gpio number
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_green_led_gpio (void);
-
- /**
- * @brief Get green led gpio number
- *
- * @return -1 non-existent
- * Others gpio number
- */
- int8_t get_blue_led_gpio (void);
+/**
+ * @brief Get green led gpio number
+ *
+ * @return -1 non-existent
+ * Others gpio number
+ */
+int8_t get_blue_led_gpio(void);
#ifdef __cplusplus
}
diff --git a/components/audio_board/lyrat_mini_v1_1/board_pins_config.c b/components/audio_board/lyrat_mini_v1_1/board_pins_config.c
index 129daae..be36666 100644
--- a/components/audio_board/lyrat_mini_v1_1/board_pins_config.c
+++ b/components/audio_board/lyrat_mini_v1_1/board_pins_config.c
@@ -50,22 +50,22 @@ esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
return ESP_OK;
}
-esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config) {
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
if (port == I2S_NUM_0) {
- // i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->mck_io_num = GPIO_NUM_0;
i2s_config->bck_io_num = GPIO_NUM_5;
i2s_config->ws_io_num = GPIO_NUM_25;
i2s_config->data_out_num = GPIO_NUM_26;
i2s_config->data_in_num = GPIO_NUM_35;
} else if (port == I2S_NUM_1) {
- // i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->mck_io_num = GPIO_NUM_0;
i2s_config->bck_io_num = GPIO_NUM_32;
i2s_config->ws_io_num = GPIO_NUM_33;
i2s_config->data_out_num = -1;
i2s_config->data_in_num = GPIO_NUM_36;
} else {
- memset(i2s_config, -1, sizeof(i2s_pin_config_t));
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
ESP_LOGE(TAG, "i2s port %d is not supported", port);
return ESP_FAIL;
}
@@ -91,43 +91,6 @@ esp_err_t get_spi_pins(
return ESP_OK;
}
-esp_err_t i2s_mclk_gpio_select(i2s_port_t i2s_num, gpio_num_t gpio_num) {
- if (i2s_num >= I2S_NUM_MAX) {
- ESP_LOGE(TAG, "Does not support i2s number(%d)", i2s_num);
- return ESP_ERR_INVALID_ARG;
- }
- if (gpio_num != GPIO_NUM_0 && gpio_num != GPIO_NUM_1 &&
- gpio_num != GPIO_NUM_3) {
- ESP_LOGE(TAG, "Only support GPIO0/GPIO1/GPIO3, gpio_num:%d", gpio_num);
- return ESP_ERR_INVALID_ARG;
- }
- ESP_LOGI(TAG, "I2S%d, MCLK output by GPIO%d", i2s_num, gpio_num);
- if (i2s_num == I2S_NUM_0) {
- if (gpio_num == GPIO_NUM_0) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG(PIN_CTRL, 0xFFF0);
- } else if (gpio_num == GPIO_NUM_1) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG(PIN_CTRL, 0xF0F0);
- } else {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG(PIN_CTRL, 0xFF00);
- }
- } else if (i2s_num == I2S_NUM_1) {
- if (gpio_num == GPIO_NUM_0) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG(PIN_CTRL, 0xFFFF);
- } else if (gpio_num == GPIO_NUM_1) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG(PIN_CTRL, 0xF0FF);
- } else {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG(PIN_CTRL, 0xFF0F);
- }
- }
- return ESP_OK;
-}
-
// sdcard
int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
diff --git a/components/audio_board/lyrat_v4_2/board.c b/components/audio_board/lyrat_v4_2/board.c
new file mode 100644
index 0000000..a9bfb73
--- /dev/null
+++ b/components/audio_board/lyrat_v4_2/board.c
@@ -0,0 +1,66 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+
+ board_handle->audio_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8388_DEFAULT_HANDLE);
+
+ return board_handle;
+}
+
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode) {
+// esp_err_t ret = ESP_FAIL;
+// return ret;
+// }
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/lyrat_v4_2/board.h b/components/audio_board/lyrat_v4_2/board.h
new file mode 100644
index 0000000..ce0fdfe
--- /dev/null
+++ b/components/audio_board/lyrat_v4_2/board.h
@@ -0,0 +1,115 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+// #include "display_service.h"
+// #include "esp_peripherals.h"
+// #include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/lyrat_v4_2/board_def.h b/components/audio_board/lyrat_v4_2/board_def.h
new file mode 100644
index 0000000..e784ac0
--- /dev/null
+++ b/components/audio_board/lyrat_v4_2/board_def.h
@@ -0,0 +1,123 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+#include "driver/touch_pad.h"
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO GPIO_NUM_34
+
+#define ESP_SD_PIN_CLK GPIO_NUM_14
+#define ESP_SD_PIN_CMD GPIO_NUM_15
+#define ESP_SD_PIN_D0 GPIO_NUM_2
+#define ESP_SD_PIN_D3 -1
+
+/**
+ * @brief LED Function Definition
+ */
+#define FUNC_SYS_LEN_EN (1)
+#define GREEN_LED_GPIO GPIO_NUM_22
+#define RED_LED_GPIO GPIO_NUM_19
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define AUXIN_DETECT_GPIO GPIO_NUM_12
+#define PA_ENABLE_GPIO GPIO_NUM_21
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define INPUT_KEY_NUM 6
+#define BUTTON_REC_ID GPIO_NUM_36
+#define BUTTON_MODE_ID GPIO_NUM_39
+#define BUTTON_SET_ID TOUCH_PAD_NUM9
+#define BUTTON_PLAY_ID TOUCH_PAD_NUM8
+#define BUTTON_VOLUP_ID TOUCH_PAD_NUM7
+#define BUTTON_VOLDOWN_ID TOUCH_PAD_NUM4
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/lyrat_v4_2/board_pins_config.c b/components/audio_board/lyrat_v4_2/board_pins_config.c
new file mode 100644
index 0000000..a262f4c
--- /dev/null
+++ b/components/audio_board/lyrat_v4_2/board_pins_config.c
@@ -0,0 +1,119 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "soc/io_mux_reg.h"
+#include "soc/soc_caps.h"
+
+static const char *TAG = "LYRAT_V4_2";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_18;
+ i2c_config->scl_io_num = GPIO_NUM_23;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0 || port == I2S_NUM_1) {
+ i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->bck_io_num = GPIO_NUM_5;
+ i2s_config->ws_io_num = GPIO_NUM_25;
+ i2s_config->data_out_num = GPIO_NUM_26;
+ i2s_config->data_in_num = GPIO_NUM_35;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
+
+ spi_config->mosi_io_num = -1;
+ spi_config->miso_io_num = -1;
+ spi_config->sclk_io_num = -1;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = -1;
+
+ ESP_LOGW(TAG, "SPI interface is not is not supported");
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+// input-output pins
+
+int8_t get_auxin_detect_gpio(void) { return AUXIN_DETECT_GPIO; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// button pins
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+// touch pins
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// led pins
+
+int8_t get_red_led_gpio(void) { return RED_LED_GPIO; }
+
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/lyrat_v4_3/board.c b/components/audio_board/lyrat_v4_3/board.c
index e59adc0..8a3ec83 100644
--- a/components/audio_board/lyrat_v4_3/board.c
+++ b/components/audio_board/lyrat_v4_3/board.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,138 +18,130 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "board.h"
+
#include "audio_mem.h"
#include "esp_log.h"
-//#include "periph_sdcard.h"
-//#include "led_indicator.h"
-//#include "periph_touch.h"
-//#include "periph_button.h"
+// #include "periph_sdcard.h"
+// #include "led_indicator.h"
+// #include "periph_touch.h"
+// #include "periph_button.h"
static const char *TAG = "AUDIO_BOARD";
static audio_board_handle_t board_handle = 0;
-audio_board_handle_t
-audio_board_init (void)
-{
- if (board_handle)
- {
- ESP_LOGW (TAG, "The board has already been initialized!");
- return board_handle;
- }
- board_handle = (audio_board_handle_t)audio_calloc (
- 1, sizeof (struct audio_board_handle));
- AUDIO_MEM_CHECK (TAG, board_handle, return NULL);
- board_handle->audio_hal = audio_board_codec_init ();
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
return board_handle;
}
-audio_hal_handle_t
-audio_board_codec_init (void)
-{
- audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG ();
- audio_hal_handle_t codec_hal
- = audio_hal_init (&audio_codec_cfg, &AUDIO_CODEC_ES8388_DEFAULT_HANDLE);
- AUDIO_NULL_CHECK (TAG, codec_hal, return NULL);
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ES8388_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
return codec_hal;
}
-/*
-display_service_handle_t audio_board_led_init(void)
-{
- led_indicator_handle_t led =
-led_indicator_init((gpio_num_t)get_green_led_gpio()); display_service_config_t
-display = { .based_cfg = { .task_stack = 0, .task_prio = 0, .task_core = 0,
- .task_func = NULL,
- .service_start = NULL,
- .service_stop = NULL,
- .service_destroy = NULL,
- .service_ioctl = led_indicator_pattern,
- .service_name = "DISPLAY_serv",
- .user_data = NULL,
- },
- .instance = led,
- };
+// display_service_handle_t audio_board_led_init(void)
+//{
+// led_indicator_handle_t led =
+// led_indicator_init((gpio_num_t)get_green_led_gpio());
+// display_service_config_t display = {
+// .based_cfg = {
+// .task_stack = 0,
+// .task_prio = 0,
+// .task_core = 0,
+// .task_func = NULL,
+// .service_start = NULL,
+// .service_stop = NULL,
+// .service_destroy = NULL,
+// .service_ioctl = led_indicator_pattern,
+// .service_name = "DISPLAY_serv",
+// .user_data = NULL,
+// },
+// .instance = led,
+// };
+//
+// return display_service_create(&display);
+// }
+//
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set)
+//{
+// periph_button_cfg_t btn_cfg = {
+// .gpio_mask = (1ULL << get_input_rec_id()) | (1ULL <<
+// get_input_mode_id()), //REC BTN & MODE BTN
+// };
+// esp_periph_handle_t button_handle = periph_button_init(&btn_cfg);
+// AUDIO_NULL_CHECK(TAG, button_handle, return ESP_ERR_ADF_MEMORY_LACK);
+// esp_err_t ret = ESP_OK;
+// ret = esp_periph_start(set, button_handle);
+// if (ret != ESP_OK) {
+// return ret;
+// }
+// periph_touch_cfg_t touch_cfg = {
+// .touch_mask = TOUCH_PAD_SEL4 | TOUCH_PAD_SEL7 | TOUCH_PAD_SEL8 |
+// TOUCH_PAD_SEL9, .tap_threshold_percent = 70,
+// };
+// esp_periph_handle_t touch_periph = periph_touch_init(&touch_cfg);
+// AUDIO_NULL_CHECK(TAG, touch_periph, return ESP_ERR_ADF_MEMORY_LACK);
+// ret = esp_periph_start(set, touch_periph);
+// return ret;
+// }
+//
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode)
+//{
+// if (mode >= SD_MODE_4_LINE) {
+// ESP_LOGE(TAG, "Please select the correct sd mode!, current mode is
+// %d", mode); return ESP_FAIL;
+// }
+// periph_sdcard_cfg_t sdcard_cfg = {
+// .root = "/sdcard",
+// .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34
+// .mode = mode,
+// };
+// esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+// esp_err_t ret = esp_periph_start(set, sdcard_handle);
+// int retry_time = 5;
+// bool mount_flag = false;
+// while (retry_time --) {
+// if (periph_sdcard_is_mounted(sdcard_handle)) {
+// mount_flag = true;
+// break;
+// } else {
+// vTaskDelay(500 / portTICK_PERIOD_MS);
+// }
+// }
+// if (mount_flag == false) {
+// ESP_LOGE(TAG, "Sdcard mount failed");
+// return ESP_FAIL;
+// }
+// return ret;
+// }
- return display_service_create(&display);
-}
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
-esp_err_t audio_board_key_init(esp_periph_set_handle_t set)
-{
- periph_button_cfg_t btn_cfg = {
- .gpio_mask = (1ULL << get_input_rec_id()) | (1ULL <<
-get_input_mode_id()), //REC BTN & MODE BTN
- };
- esp_periph_handle_t button_handle = periph_button_init(&btn_cfg);
- AUDIO_NULL_CHECK(TAG, button_handle, return ESP_ERR_ADF_MEMORY_LACK);
- esp_err_t ret = ESP_OK;
- ret = esp_periph_start(set, button_handle);
- if (ret != ESP_OK) {
- return ret;
- }
- periph_touch_cfg_t touch_cfg = {
- .touch_mask = TOUCH_PAD_SEL4 | TOUCH_PAD_SEL7 | TOUCH_PAD_SEL8 |
-TOUCH_PAD_SEL9, .tap_threshold_percent = 70,
- };
- esp_periph_handle_t touch_periph = periph_touch_init(&touch_cfg);
- AUDIO_NULL_CHECK(TAG, touch_periph, return ESP_ERR_ADF_MEMORY_LACK);
- ret = esp_periph_start(set, touch_periph);
- return ret;
-}
-
-esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
-periph_sdcard_mode_t mode)
-{
- if (mode >= SD_MODE_MAX) {
- ESP_LOGE(TAG, "PLease select the correct sd mode!, current mode is %d",
-mode); return ESP_FAIL;
- }
- periph_sdcard_cfg_t sdcard_cfg = {
- .root = "/sdcard",
- .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34
- .mode = mode,
- };
- esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
- esp_err_t ret = esp_periph_start(set, sdcard_handle);
- int retry_time = 5;
- bool mount_flag = false;
- while (retry_time --) {
- if (periph_sdcard_is_mounted(sdcard_handle)) {
- mount_flag = true;
- break;
- } else {
- vTaskDelay(500 / portTICK_PERIOD_MS);
- }
- }
- if (mount_flag == false) {
- ESP_LOGE(TAG, "Sdcard mount failed");
- return ESP_FAIL;
- }
- return ret;
-}
-*/
-
-audio_board_handle_t
-audio_board_get_handle (void)
-{
- return board_handle;
-}
-
-esp_err_t
-audio_board_deinit (audio_board_handle_t audio_board)
-{
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
esp_err_t ret = ESP_OK;
- ret = audio_hal_deinit (audio_board->audio_hal);
- audio_free (audio_board);
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
board_handle = NULL;
return ret;
}
diff --git a/components/audio_board/lyrat_v4_3/board.h b/components/audio_board/lyrat_v4_3/board.h
index 0dca37c..46b8fd7 100644
--- a/components/audio_board/lyrat_v4_3/board.h
+++ b/components/audio_board/lyrat_v4_3/board.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,85 +30,83 @@
#include "audio_hal.h"
#include "board_def.h"
#include "board_pins_config.h"
-//#include "esp_peripherals.h"
-//#include "display_service.h"
-//#include "periph_sdcard.h"
+// #include "esp_peripherals.h"
+// #include "display_service.h"
+// #include "periph_sdcard.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Audio board handle
- */
- struct audio_board_handle
- {
- audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
- };
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
- typedef struct audio_board_handle *audio_board_handle_t;
+typedef struct audio_board_handle *audio_board_handle_t;
- /**
- * @brief Initialize audio board
- *
- * @return The audio board handle
- */
- audio_board_handle_t audio_board_init (void);
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
- /**
- * @brief Initialize codec chip
- *
- * @return The audio hal handle
- */
- audio_hal_handle_t audio_board_codec_init (void);
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
- ///**
- // * @brief Initialize led peripheral and display service
- // *
- // * @return The audio display service handle
- // */
- // display_service_handle_t audio_board_led_init(void);
- //
- ///**
- // * @brief Initialize key peripheral
- // *
- // * @param set The handle of esp_periph_set_handle_t
- // *
- // * @return
- // * - ESP_OK, success
- // * - Others, fail
- // */
- // esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
- //
- ///**
- // * @brief Initialize sdcard peripheral
- // *
- // * @param set The handle of esp_periph_set_handle_t
- // *
- // * @return
- // * - ESP_OK, success
- // * - Others, fail
- // */
- // esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
- // periph_sdcard_mode_t mode);
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
- /**
- * @brief Query audio_board_handle
- *
- * @return The audio board handle
- */
- audio_board_handle_t audio_board_get_handle (void);
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
- /**
- * @brief Uninitialize the audio board
- *
- * @param audio_board The handle of audio board
- *
- * @return 0 success,
- * others fail
- */
- esp_err_t audio_board_deinit (audio_board_handle_t audio_board);
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
#ifdef __cplusplus
}
diff --git a/components/audio_board/lyrat_v4_3/board_def.h b/components/audio_board/lyrat_v4_3/board_def.h
index 2161188..aa18943 100644
--- a/components/audio_board/lyrat_v4_3/board_def.h
+++ b/components/audio_board/lyrat_v4_3/board_def.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -29,9 +29,59 @@
#include "driver/touch_pad.h"
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
#define SDCARD_OPEN_FILE_NUM_MAX 5
#define SDCARD_INTR_GPIO GPIO_NUM_34
+#define ESP_SD_PIN_CLK GPIO_NUM_14
+#define ESP_SD_PIN_CMD GPIO_NUM_15
+#define ESP_SD_PIN_D0 GPIO_NUM_2
+#define ESP_SD_PIN_D1 GPIO_NUM_4
+#define ESP_SD_PIN_D2 GPIO_NUM_12
+#define ESP_SD_PIN_D3 GPIO_NUM_13
+
+/**
+ * @brief LED Function Definition
+ */
+#define FUNC_SYS_LEN_EN (1)
+#define GREEN_LED_GPIO GPIO_NUM_22
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define AUXIN_DETECT_GPIO GPIO_NUM_12
+#define HEADPHONE_DETECT GPIO_NUM_19
+#define PA_ENABLE_GPIO GPIO_NUM_21
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (48000)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define INPUT_KEY_NUM 6
#define BUTTON_REC_ID GPIO_NUM_36
#define BUTTON_MODE_ID GPIO_NUM_39
#define BUTTON_SET_ID TOUCH_PAD_NUM9
@@ -39,60 +89,37 @@
#define BUTTON_VOLUP_ID TOUCH_PAD_NUM7
#define BUTTON_VOLDOWN_ID TOUCH_PAD_NUM4
-#define AUXIN_DETECT_GPIO GPIO_NUM_12
-#define HEADPHONE_DETECT GPIO_NUM_19
-#define PA_ENABLE_GPIO GPIO_NUM_21
-
-#define GREEN_LED_GPIO GPIO_NUM_22
-
-extern audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE;
-
-#define AUDIO_CODEC_DEFAULT_CONFIG() \
- { \
- .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
- .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
- .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
- .i2s_iface = { \
- .mode = AUDIO_HAL_MODE_SLAVE, \
- .fmt = AUDIO_HAL_I2S_NORMAL, \
- .samples = AUDIO_HAL_48K_SAMPLES, \
- .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
- }, \
-};
-
-#define INPUT_KEY_NUM 6
-
-#define INPUT_KEY_DEFAULT_INFO() \
- { \
- { \
- .type = PERIPH_ID_BUTTON, \
- .user_id = INPUT_KEY_USER_ID_REC, \
- .act_id = BUTTON_REC_ID, \
- }, \
- { \
- .type = PERIPH_ID_BUTTON, \
- .user_id = INPUT_KEY_USER_ID_MODE, \
- .act_id = BUTTON_MODE_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_SET, \
- .act_id = BUTTON_SET_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_PLAY, \
- .act_id = BUTTON_PLAY_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, \
- .user_id = INPUT_KEY_USER_ID_VOLUP, \
- .act_id = BUTTON_VOLUP_ID, \
- }, \
- { \
- .type = PERIPH_ID_TOUCH, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
- .act_id = BUTTON_VOLDOWN_ID, \
- } \
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_BUTTON, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_TOUCH, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
}
#endif
diff --git a/components/audio_board/lyrat_v4_3/board_pins_config.c b/components/audio_board/lyrat_v4_3/board_pins_config.c
index 22b8be6..44863ee 100644
--- a/components/audio_board/lyrat_v4_3/board_pins_config.c
+++ b/components/audio_board/lyrat_v4_3/board_pins_config.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,66 +18,59 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
+#include
+
#include "audio_error.h"
#include "audio_mem.h"
#include "board.h"
#include "driver/gpio.h"
#include "esp_log.h"
-#include
+#include "soc/io_mux_reg.h"
+#include "soc/soc_caps.h"
static const char *TAG = "LYRAT_V4_3";
-esp_err_t
-get_i2c_pins (i2c_port_t port, i2c_config_t *i2c_config)
-{
- AUDIO_NULL_CHECK (TAG, i2c_config, return ESP_FAIL);
- if (port == I2C_NUM_0 || port == I2C_NUM_1)
- {
- i2c_config->sda_io_num = GPIO_NUM_18;
- i2c_config->scl_io_num = GPIO_NUM_23;
- }
- else
- {
- i2c_config->sda_io_num = -1;
- i2c_config->scl_io_num = -1;
- ESP_LOGE (TAG, "i2c port %d is not supported", port);
- return ESP_FAIL;
- }
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_18;
+ i2c_config->scl_io_num = GPIO_NUM_23;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
return ESP_OK;
}
-esp_err_t
-get_i2s_pins (i2s_port_t port, i2s_pin_config_t *i2s_config)
-{
- AUDIO_NULL_CHECK (TAG, i2s_config, return ESP_FAIL);
- if (port == I2S_NUM_0 || port == I2S_NUM_1)
- {
- i2s_config->bck_io_num = GPIO_NUM_5;
- i2s_config->ws_io_num = GPIO_NUM_25;
- i2s_config->data_out_num = GPIO_NUM_26;
- i2s_config->data_in_num = GPIO_NUM_35;
- }
- else
- {
- memset (i2s_config, -1, sizeof (i2s_pin_config_t));
- ESP_LOGE (TAG, "i2s port %d is not supported", port);
- return ESP_FAIL;
- }
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0 || port == I2S_NUM_1) {
+ i2s_config->mck_io_num = GPIO_NUM_0;
+ i2s_config->bck_io_num = GPIO_NUM_5;
+ i2s_config->ws_io_num = GPIO_NUM_25;
+ i2s_config->data_out_num = GPIO_NUM_26;
+ i2s_config->data_in_num = GPIO_NUM_35;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
return ESP_OK;
}
-esp_err_t
-get_spi_pins (spi_bus_config_t *spi_config,
- spi_device_interface_config_t *spi_device_interface_config)
-{
- AUDIO_NULL_CHECK (TAG, spi_config, return ESP_FAIL);
- AUDIO_NULL_CHECK (TAG, spi_device_interface_config, return ESP_FAIL);
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_device_interface_config, return ESP_FAIL);
spi_config->mosi_io_num = -1;
spi_config->miso_io_num = -1;
@@ -87,142 +80,40 @@ get_spi_pins (spi_bus_config_t *spi_config,
spi_device_interface_config->spics_io_num = -1;
- ESP_LOGW (TAG, "SPI interface is not supported");
- return ESP_OK;
-}
-
-esp_err_t
-i2s_mclk_gpio_select (i2s_port_t i2s_num, gpio_num_t gpio_num)
-{
- if (i2s_num >= I2S_NUM_MAX)
- {
- ESP_LOGE (TAG, "Does not support i2s number(%d)", i2s_num);
- return ESP_ERR_INVALID_ARG;
- }
- if (gpio_num != GPIO_NUM_0 && gpio_num != GPIO_NUM_1
- && gpio_num != GPIO_NUM_3)
- {
- ESP_LOGE (TAG, "Only support GPIO0/GPIO1/GPIO3, gpio_num:%d", gpio_num);
- return ESP_ERR_INVALID_ARG;
- }
- ESP_LOGI (TAG, "I2S%d, MCLK output by GPIO%d", i2s_num, gpio_num);
- if (i2s_num == I2S_NUM_0)
- {
- if (gpio_num == GPIO_NUM_0)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG (PIN_CTRL, 0xFFF0);
- }
- else if (gpio_num == GPIO_NUM_1)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG (PIN_CTRL, 0xF0F0);
- }
- else
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG (PIN_CTRL, 0xFF00);
- }
- }
- else if (i2s_num == I2S_NUM_1)
- {
- if (gpio_num == GPIO_NUM_0)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG (PIN_CTRL, 0xFFFF);
- }
- else if (gpio_num == GPIO_NUM_1)
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG (PIN_CTRL, 0xF0FF);
- }
- else
- {
- PIN_FUNC_SELECT (PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG (PIN_CTRL, 0xFF0F);
- }
- }
+ ESP_LOGW(TAG, "SPI interface is not supported");
return ESP_OK;
}
// sdcard
-int8_t
-get_sdcard_intr_gpio (void)
-{
- return SDCARD_INTR_GPIO;
-}
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
-int8_t
-get_sdcard_open_file_num_max (void)
-{
- return SDCARD_OPEN_FILE_NUM_MAX;
-}
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
// input-output pins
-int8_t
-get_auxin_detect_gpio (void)
-{
- return AUXIN_DETECT_GPIO;
-}
+int8_t get_auxin_detect_gpio(void) { return AUXIN_DETECT_GPIO; }
-int8_t
-get_headphone_detect_gpio (void)
-{
- return HEADPHONE_DETECT;
-}
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_DETECT; }
-int8_t
-get_pa_enable_gpio (void)
-{
- return PA_ENABLE_GPIO;
-}
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
// button pins
-int8_t
-get_input_rec_id (void)
-{
- return BUTTON_REC_ID;
-}
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
-int8_t
-get_input_mode_id (void)
-{
- return BUTTON_MODE_ID;
-}
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
// touch pins
-int8_t
-get_input_set_id (void)
-{
- return BUTTON_SET_ID;
-}
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
-int8_t
-get_input_play_id (void)
-{
- return BUTTON_PLAY_ID;
-}
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
-int8_t
-get_input_volup_id (void)
-{
- return BUTTON_VOLUP_ID;
-}
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
-int8_t
-get_input_voldown_id (void)
-{
- return BUTTON_VOLDOWN_ID;
-}
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
// led pins
-int8_t
-get_green_led_gpio (void)
-{
- return GREEN_LED_GPIO;
-}
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/lyratd_msc_v2_1/board.c b/components/audio_board/lyratd_msc_v2_1/board.c
new file mode 100644
index 0000000..a7cd7dc
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_1/board.c
@@ -0,0 +1,131 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+// #include "led_bar_is31x.h"
+// #include "periph_adc_button.h"
+// #include "periph_sdcard.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ZL38063_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+// display_service_handle_t audio_board_led_init(void) {
+// esp_periph_handle_t led = led_bar_is31x_init();
+// AUDIO_NULL_CHECK(TAG, led, return NULL);
+// display_service_config_t display = {
+// .based_cfg =
+// {
+// .task_stack = 0,
+// .task_prio = 0,
+// .task_core = 0,
+// .task_func = NULL,
+// .service_start = NULL,
+// .service_stop = NULL,
+// .service_destroy = NULL,
+// .service_ioctl = led_bar_is31x_pattern,
+// .service_name = "DISPLAY_serv",
+// .user_data = NULL,
+// },
+// .instance = led,
+// };
+//
+// return display_service_create(&display);
+// }
+//
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+// periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+// adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+// adc_btn_cfg.arr = &adc_btn_tag;
+// adc_btn_cfg.arr_size = 1;
+// esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+// AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+// return esp_periph_start(set, adc_btn_handle);
+// }
+//
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode) {
+// if (mode >= SD_MODE_8_LINE) {
+// ESP_LOGE(TAG, "Please select the correct sd mode!, current mode is %d",
+// mode);
+// return ESP_FAIL;
+// }
+// periph_sdcard_cfg_t sdcard_cfg = {
+// .root = "/sdcard",
+// .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34
+// .mode = mode};
+// esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+// esp_err_t ret = esp_periph_start(set, sdcard_handle);
+// int retry_time = 5;
+// bool mount_flag = false;
+// while (retry_time--) {
+// if (periph_sdcard_is_mounted(sdcard_handle)) {
+// mount_flag = true;
+// break;
+// } else {
+// vTaskDelay(500 / portTICK_PERIOD_MS);
+// }
+// }
+// if (mount_flag == false) {
+// ESP_LOGE(TAG, "Sdcard mount failed");
+// return ESP_FAIL;
+// }
+// return ret;
+// }
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/lyratd_msc_v2_1/board.h b/components/audio_board/lyratd_msc_v2_1/board.h
new file mode 100644
index 0000000..ce0fdfe
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_1/board.h
@@ -0,0 +1,115 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+// #include "display_service.h"
+// #include "esp_peripherals.h"
+// #include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/lyratd_msc_v2_1/board_def.h b/components/audio_board/lyratd_msc_v2_1/board_def.h
new file mode 100644
index 0000000..f791e54
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_1/board_def.h
@@ -0,0 +1,119 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO GPIO_NUM_34
+
+#define ESP_SD_PIN_CLK GPIO_NUM_14
+#define ESP_SD_PIN_CMD GPIO_NUM_15
+#define ESP_SD_PIN_D0 GPIO_NUM_2
+#define ESP_SD_PIN_D1 GPIO_NUM_4
+#define ESP_SD_PIN_D2 GPIO_NUM_12
+#define ESP_SD_PIN_D3 GPIO_NUM_13
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define PA_ENABLE_GPIO GPIO_NUM_22
+#define CODEC_RESET_GPIO GPIO_NUM_19
+#define DSP_RESET_GPIO GPIO_NUM_21
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (44100)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (20) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ZL38063_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define ADC_DETECT_GPIO GPIO_NUM_39
+#define INPUT_KEY_NUM 6
+#define BUTTON_SET_ID 0
+#define BUTTON_PLAY_ID 1
+#define BUTTON_REC_ID 2
+#define BUTTON_MODE_ID 3
+#define BUTTON_VOLDOWN_ID 4
+#define BUTTON_VOLUP_ID 5
+#define GREEN_LED_GPIO (-1)
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/lyratd_msc_v2_1/board_pins_config.c b/components/audio_board/lyratd_msc_v2_1/board_pins_config.c
new file mode 100644
index 0000000..a25fb8f
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_1/board_pins_config.c
@@ -0,0 +1,114 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+
+static const char *TAG = "LYRATD_MSC_V2_1";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_18;
+ i2c_config->scl_io_num = GPIO_NUM_23;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0 || port == I2S_NUM_1) {
+ i2s_config->bck_io_num = GPIO_NUM_5;
+ i2s_config->ws_io_num = GPIO_NUM_25;
+ i2s_config->data_out_num = GPIO_NUM_26;
+ i2s_config->data_in_num = GPIO_NUM_35;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ spi_config->mosi_io_num = GPIO_NUM_33;
+ spi_config->miso_io_num = GPIO_NUM_27;
+ spi_config->sclk_io_num = GPIO_NUM_32;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = GPIO_NUM_0;
+
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+// input-output pins
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button
+
+int8_t get_adc_detect_gpio(void) { return ADC_DETECT_GPIO; }
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// board related
+int8_t get_reset_codec_gpio(void) { return CODEC_RESET_GPIO; }
+
+int8_t get_reset_board_gpio(void) { return DSP_RESET_GPIO; }
+
+// led pins
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_board/lyratd_msc_v2_2/board.c b/components/audio_board/lyratd_msc_v2_2/board.c
new file mode 100644
index 0000000..a7cd7dc
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_2/board.c
@@ -0,0 +1,131 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "board.h"
+
+#include "audio_mem.h"
+#include "esp_log.h"
+// #include "led_bar_is31x.h"
+// #include "periph_adc_button.h"
+// #include "periph_sdcard.h"
+
+static const char *TAG = "AUDIO_BOARD";
+
+static audio_board_handle_t board_handle = 0;
+
+audio_board_handle_t audio_board_init(void) {
+ if (board_handle) {
+ ESP_LOGW(TAG, "The board has already been initialized!");
+ return board_handle;
+ }
+ board_handle =
+ (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
+ AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
+ board_handle->audio_hal = audio_board_codec_init();
+
+ return board_handle;
+}
+
+audio_hal_handle_t audio_board_codec_init(void) {
+ audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ audio_hal_handle_t codec_hal =
+ audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_ZL38063_DEFAULT_HANDLE);
+ AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
+ return codec_hal;
+}
+
+// display_service_handle_t audio_board_led_init(void) {
+// esp_periph_handle_t led = led_bar_is31x_init();
+// AUDIO_NULL_CHECK(TAG, led, return NULL);
+// display_service_config_t display = {
+// .based_cfg =
+// {
+// .task_stack = 0,
+// .task_prio = 0,
+// .task_core = 0,
+// .task_func = NULL,
+// .service_start = NULL,
+// .service_stop = NULL,
+// .service_destroy = NULL,
+// .service_ioctl = led_bar_is31x_pattern,
+// .service_name = "DISPLAY_serv",
+// .user_data = NULL,
+// },
+// .instance = led,
+// };
+//
+// return display_service_create(&display);
+// }
+//
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set) {
+// periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG();
+// adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR();
+// adc_btn_cfg.arr = &adc_btn_tag;
+// adc_btn_cfg.arr_size = 1;
+// esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg);
+// AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK);
+// return esp_periph_start(set, adc_btn_handle);
+// }
+//
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode) {
+// if (mode >= SD_MODE_8_LINE) {
+// ESP_LOGE(TAG, "Please select the correct sd mode!, current mode is %d",
+// mode);
+// return ESP_FAIL;
+// }
+// periph_sdcard_cfg_t sdcard_cfg = {
+// .root = "/sdcard",
+// .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34
+// .mode = mode};
+// esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg);
+// esp_err_t ret = esp_periph_start(set, sdcard_handle);
+// int retry_time = 5;
+// bool mount_flag = false;
+// while (retry_time--) {
+// if (periph_sdcard_is_mounted(sdcard_handle)) {
+// mount_flag = true;
+// break;
+// } else {
+// vTaskDelay(500 / portTICK_PERIOD_MS);
+// }
+// }
+// if (mount_flag == false) {
+// ESP_LOGE(TAG, "Sdcard mount failed");
+// return ESP_FAIL;
+// }
+// return ret;
+// }
+
+audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
+
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
+ esp_err_t ret = ESP_OK;
+ ret = audio_hal_deinit(audio_board->audio_hal);
+ audio_free(audio_board);
+ board_handle = NULL;
+ return ret;
+}
diff --git a/components/audio_board/lyratd_msc_v2_2/board.h b/components/audio_board/lyratd_msc_v2_2/board.h
new file mode 100644
index 0000000..ce0fdfe
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_2/board.h
@@ -0,0 +1,115 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_H_
+#define _AUDIO_BOARD_H_
+
+#include "audio_hal.h"
+#include "board_def.h"
+#include "board_pins_config.h"
+// #include "display_service.h"
+// #include "esp_peripherals.h"
+// #include "periph_sdcard.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Audio board handle
+ */
+struct audio_board_handle {
+ audio_hal_handle_t audio_hal; /*!< audio hardware abstract layer handle */
+};
+
+typedef struct audio_board_handle *audio_board_handle_t;
+
+/**
+ * @brief Initialize audio board
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_init(void);
+
+/**
+ * @brief Initialize codec chip
+ *
+ * @return The audio hal handle
+ */
+audio_hal_handle_t audio_board_codec_init(void);
+
+/**
+ * @brief Initialize led peripheral and display service
+ *
+ * @return The audio display service handle
+ */
+// display_service_handle_t audio_board_led_init(void);
+
+/**
+ * @brief Initialize key peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_key_init(esp_periph_set_handle_t set);
+
+/**
+ * @brief Initialize sdcard peripheral
+ *
+ * @param set The handle of esp_periph_set_handle_t
+ *
+ * @return
+ * - ESP_OK, success
+ * - Others, fail
+ */
+// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set,
+// periph_sdcard_mode_t mode);
+
+/**
+ * @brief Query audio_board_handle
+ *
+ * @return The audio board handle
+ */
+audio_board_handle_t audio_board_get_handle(void);
+
+/**
+ * @brief Uninitialize the audio board
+ *
+ * @param audio_board The handle of audio board
+ *
+ * @return 0 success,
+ * others fail
+ */
+esp_err_t audio_board_deinit(audio_board_handle_t audio_board);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_board/lyratd_msc_v2_2/board_def.h b/components/audio_board/lyratd_msc_v2_2/board_def.h
new file mode 100644
index 0000000..850e7a0
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_2/board_def.h
@@ -0,0 +1,120 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_BOARD_DEFINITION_H_
+#define _AUDIO_BOARD_DEFINITION_H_
+
+/**
+ * @brief SDCARD Function Definition
+ */
+#define FUNC_SDCARD_EN (1)
+#define SDCARD_OPEN_FILE_NUM_MAX 5
+#define SDCARD_INTR_GPIO GPIO_NUM_34
+
+#define ESP_SD_PIN_CLK GPIO_NUM_14
+#define ESP_SD_PIN_CMD GPIO_NUM_15
+#define ESP_SD_PIN_D0 GPIO_NUM_2
+#define ESP_SD_PIN_D1 GPIO_NUM_4
+#define ESP_SD_PIN_D2 GPIO_NUM_12
+#define ESP_SD_PIN_D3 GPIO_NUM_13
+
+/**
+ * @brief Audio Codec Chip Function Definition
+ */
+#define FUNC_AUDIO_CODEC_EN (1)
+#define HEADPHONE_GPIO GPIO_NUM_36
+#define PA_ENABLE_GPIO GPIO_NUM_22
+#define CODEC_RESET_GPIO GPIO_NUM_19
+#define DSP_RESET_GPIO GPIO_NUM_21
+#define CODEC_ADC_I2S_PORT (0)
+#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_16BIT
+#define CODEC_ADC_SAMPLE_RATE (44100)
+#define RECORD_HARDWARE_AEC (false)
+#define BOARD_PA_GAIN (20) /* Power amplifier gain defined by board (dB) */
+
+extern audio_hal_func_t AUDIO_CODEC_ZL38063_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_CONFIG() \
+ { \
+ .adc_input = AUDIO_HAL_ADC_INPUT_LINE1, \
+ .dac_output = AUDIO_HAL_DAC_OUTPUT_ALL, \
+ .codec_mode = AUDIO_HAL_CODEC_MODE_BOTH, \
+ .i2s_iface = \
+ { \
+ .mode = AUDIO_HAL_MODE_SLAVE, \
+ .fmt = AUDIO_HAL_I2S_NORMAL, \
+ .samples = AUDIO_HAL_48K_SAMPLES, \
+ .bits = AUDIO_HAL_BIT_LENGTH_16BITS, \
+ }, \
+ };
+
+/**
+ * @brief Button Function Definition
+ */
+#define FUNC_BUTTON_EN (1)
+#define INPUT_KEY_NUM 6
+#define ADC_DETECT_GPIO GPIO_NUM_39
+#define BUTTON_SET_ID 0
+#define BUTTON_PLAY_ID 1
+#define BUTTON_REC_ID 2
+#define BUTTON_MODE_ID 3
+#define BUTTON_VOLDOWN_ID 4
+#define BUTTON_VOLUP_ID 5
+#define GREEN_LED_GPIO (-1)
+
+#define INPUT_KEY_DEFAULT_INFO() \
+ { \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_REC, \
+ .act_id = BUTTON_REC_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_MODE, \
+ .act_id = BUTTON_MODE_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_SET, \
+ .act_id = BUTTON_SET_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_PLAY, \
+ .act_id = BUTTON_PLAY_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, \
+ .user_id = INPUT_KEY_USER_ID_VOLUP, \
+ .act_id = BUTTON_VOLUP_ID, \
+ }, \
+ { \
+ .type = PERIPH_ID_ADC_BTN, .user_id = INPUT_KEY_USER_ID_VOLDOWN, \
+ .act_id = BUTTON_VOLDOWN_ID, \
+ } \
+ }
+
+#endif
diff --git a/components/audio_board/lyratd_msc_v2_2/board_pins_config.c b/components/audio_board/lyratd_msc_v2_2/board_pins_config.c
new file mode 100644
index 0000000..616fdd7
--- /dev/null
+++ b/components/audio_board/lyratd_msc_v2_2/board_pins_config.c
@@ -0,0 +1,116 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2019
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include
+
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+
+static const char *TAG = "LYRATD_MSC_V2_2";
+
+esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
+ AUDIO_NULL_CHECK(TAG, i2c_config, return ESP_FAIL);
+ if (port == I2C_NUM_0 || port == I2C_NUM_1) {
+ i2c_config->sda_io_num = GPIO_NUM_18;
+ i2c_config->scl_io_num = GPIO_NUM_23;
+ } else {
+ i2c_config->sda_io_num = -1;
+ i2c_config->scl_io_num = -1;
+ ESP_LOGE(TAG, "i2c port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
+ AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
+ if (port == I2S_NUM_0 || port == I2S_NUM_1) {
+ i2s_config->bck_io_num = GPIO_NUM_5;
+ i2s_config->ws_io_num = GPIO_NUM_25;
+ i2s_config->data_out_num = GPIO_NUM_26;
+ i2s_config->data_in_num = GPIO_NUM_35;
+ } else {
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
+ ESP_LOGE(TAG, "i2s port %d is not supported", port);
+ return ESP_FAIL;
+ }
+ return ESP_OK;
+}
+
+esp_err_t get_spi_pins(
+ spi_bus_config_t *spi_config,
+ spi_device_interface_config_t *spi_device_interface_config) {
+ AUDIO_NULL_CHECK(TAG, spi_config, return ESP_FAIL);
+ spi_config->mosi_io_num = GPIO_NUM_33;
+ spi_config->miso_io_num = GPIO_NUM_27;
+ spi_config->sclk_io_num = GPIO_NUM_32;
+ spi_config->quadwp_io_num = -1;
+ spi_config->quadhd_io_num = -1;
+
+ spi_device_interface_config->spics_io_num = GPIO_NUM_0;
+
+ return ESP_OK;
+}
+
+// sdcard
+
+int8_t get_sdcard_intr_gpio(void) { return SDCARD_INTR_GPIO; }
+
+int8_t get_sdcard_open_file_num_max(void) { return SDCARD_OPEN_FILE_NUM_MAX; }
+
+// input-output pins
+
+int8_t get_headphone_detect_gpio(void) { return HEADPHONE_GPIO; }
+
+int8_t get_pa_enable_gpio(void) { return PA_ENABLE_GPIO; }
+
+// adc button
+
+int8_t get_adc_detect_gpio(void) { return ADC_DETECT_GPIO; }
+
+int8_t get_input_rec_id(void) { return BUTTON_REC_ID; }
+
+int8_t get_input_mode_id(void) { return BUTTON_MODE_ID; }
+
+int8_t get_input_play_id(void) { return BUTTON_PLAY_ID; }
+
+int8_t get_input_set_id(void) { return BUTTON_SET_ID; }
+
+int8_t get_input_volup_id(void) { return BUTTON_VOLUP_ID; }
+
+int8_t get_input_voldown_id(void) { return BUTTON_VOLDOWN_ID; }
+
+// board related
+
+int8_t get_reset_codec_gpio(void) { return CODEC_RESET_GPIO; }
+
+int8_t get_reset_board_gpio(void) { return DSP_RESET_GPIO; }
+
+// led pins
+int8_t get_green_led_gpio(void) { return GREEN_LED_GPIO; }
diff --git a/components/audio_hal/CMakeLists.txt b/components/audio_hal/CMakeLists.txt
index 2c51156..17c2612 100644
--- a/components/audio_hal/CMakeLists.txt
+++ b/components/audio_hal/CMakeLists.txt
@@ -2,41 +2,54 @@ set(COMPONENT_ADD_INCLUDEDIRS ./include
./driver/es8388
./driver/es8374
./driver/es8311
+ ./driver/es8156
./driver/es7243
./driver/es7148
./driver/es7210
+ ./driver/es7243e
./driver/tas5805m
- #./driver/zl38063
- #./driver/zl38063/api_lib
- #./driver/zl38063/example_apps
- #./driver/zl38063/firmware
- ./driver/include
- )
+ ./driver/include)
+IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL "esp32c6")))
+ list(APPEND COMPONENT_ADD_INCLUDEDIRS
+ ./driver/zl38063
+ ./driver/zl38063/api_lib
+ ./driver/zl38063/example_apps
+ ./driver/zl38063/firmware)
+endif()
# Edit following two lines to set component requirements (see docs)
set(COMPONENT_REQUIRES )
-set(COMPONENT_PRIV_REQUIRES audio_sal audio_board mbedtls esp_peripherals)
+set(COMPONENT_PRIV_REQUIRES audio_sal audio_board mbedtls esp_peripherals custom_board)
set(COMPONENT_SRCS ./audio_hal.c
+ ./audio_volume.c
./driver/es8388/es8388.c
./driver/es8388/headphone_detect.c
./driver/es8374/es8374.c
./driver/es8311/es8311.c
+ ./driver/es8156/es8156.c
./driver/es7243/es7243.c
./driver/es7148/es7148.c
./driver/es7210/es7210.c
+ ./driver/es7243e/es7243e.c
./driver/tas5805m/tas5805m.c
- #./driver/zl38063/zl38063.c
- #./driver/zl38063/api_lib/vprocTwolf_access.c
- #./driver/zl38063/api_lib/vproc_common.c
- #./driver/zl38063/example_apps/tw_hal_verify.c
- #./driver/zl38063/example_apps/tw_ldcfg.c
- #./driver/zl38063/example_apps/tw_ldfw.c
- #./driver/zl38063/example_apps/tw_ldfwcfg.c
- #./driver/zl38063/example_apps/tw_spi_access.c
)
+IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL "esp32c6")))
+ list(APPEND COMPONENT_SRCS
+ ./driver/zl38063/zl38063.c
+ ./driver/zl38063/api_lib/vprocTwolf_access.c
+ ./driver/zl38063/api_lib/vproc_common.c
+ ./driver/zl38063/example_apps/tw_hal_verify.c
+ ./driver/zl38063/example_apps/tw_ldcfg.c
+ ./driver/zl38063/example_apps/tw_ldfw.c
+ ./driver/zl38063/example_apps/tw_ldfwcfg.c
+ ./driver/zl38063/example_apps/tw_spi_access.c)
+endif()
+
register_component()
-#target_link_libraries(${COMPONENT_TARGET} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/driver/zl38063/firmware")
-#target_link_libraries(${COMPONENT_TARGET} INTERFACE firmware)
+IF (NOT ((CONFIG_IDF_TARGET STREQUAL "esp32c3") OR (CONFIG_IDF_TARGET STREQUAL "esp32c6")))
+ target_link_libraries(${COMPONENT_TARGET} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/driver/zl38063/firmware")
+ target_link_libraries(${COMPONENT_TARGET} INTERFACE firmware)
+ENDIF()
diff --git a/components/audio_hal/audio_hal.c b/components/audio_hal/audio_hal.c
index 83c42f5..8ce2b1c 100644
--- a/components/audio_hal/audio_hal.c
+++ b/components/audio_hal/audio_hal.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,140 +18,132 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "audio_hal.h"
-#include "driver/gpio.h"
-#include "esp_log.h"
+
#include
#include "audio_mem.h"
#include "audio_mutex.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
static const char *TAG = "AUDIO_HAL";
-#define AUDIO_HAL_CHECK_NULL(a, format, b, ...) \
- if ((a) == 0) \
- { \
- ESP_LOGE (TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define AUDIO_HAL_CHECK_NULL(a, format, b, ...) \
+ if ((a) == 0) { \
+ ESP_LOGE(TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
-audio_hal_handle_t
-audio_hal_init (audio_hal_codec_config_t *audio_hal_conf,
- audio_hal_func_t *audio_hal_func)
-{
+audio_hal_handle_t audio_hal_init(audio_hal_codec_config_t *audio_hal_conf,
+ audio_hal_func_t *audio_hal_func) {
esp_err_t ret = 0;
- audio_hal_handle_t audio_hal
- = (audio_hal_handle_t)audio_calloc (1, sizeof (audio_hal_func_t));
- AUDIO_MEM_CHECK (TAG, audio_hal, return NULL);
- memcpy (audio_hal, audio_hal_func, sizeof (audio_hal_func_t));
- audio_hal->audio_hal_lock = mutex_create ();
+ audio_hal_handle_t audio_hal =
+ (audio_hal_handle_t)audio_calloc(1, sizeof(audio_hal_func_t));
+ AUDIO_MEM_CHECK(TAG, audio_hal, return NULL);
+ memcpy(audio_hal, audio_hal_func, sizeof(audio_hal_func_t));
+ audio_hal->audio_hal_lock = mutex_create();
- AUDIO_MEM_CHECK (TAG, audio_hal->audio_hal_lock, {
- audio_free (audio_hal);
+ AUDIO_MEM_CHECK(TAG, audio_hal->audio_hal_lock, {
+ audio_free(audio_hal);
return NULL;
});
- mutex_lock (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_initialize (audio_hal_conf);
- if (ret == ESP_FAIL)
- {
- audio_free (audio_hal);
- if (audio_hal_func->handle)
- {
- return audio_hal_func->handle;
- }
- else
- {
- ESP_LOGE (TAG, "codec init failed!");
- return NULL;
- }
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_initialize(audio_hal_conf);
+ if (ret == ESP_FAIL) {
+ audio_free(audio_hal);
+ if (audio_hal_func->handle) {
+ return audio_hal_func->handle;
+ } else {
+ ESP_LOGE(TAG, "codec init failed!");
+ return NULL;
}
- ret |= audio_hal->audio_codec_config_iface (audio_hal_conf->codec_mode,
- &audio_hal_conf->i2s_iface);
- ret |= audio_hal->audio_codec_set_volume (AUDIO_HAL_VOL_DEFAULT);
+ }
+ ret |= audio_hal->audio_codec_config_iface(audio_hal_conf->codec_mode,
+ &audio_hal_conf->i2s_iface);
+ ret |= audio_hal->audio_codec_set_volume(AUDIO_HAL_VOL_DEFAULT);
+ AUDIO_RET_ON_FALSE(TAG, ret, return NULL, "audio_hal_init failed");
audio_hal->handle = audio_hal;
audio_hal_func->handle = audio_hal;
- mutex_unlock (audio_hal->audio_hal_lock);
+ mutex_unlock(audio_hal->audio_hal_lock);
return audio_hal;
}
-esp_err_t
-audio_hal_deinit (audio_hal_handle_t audio_hal)
-{
+esp_err_t audio_hal_deinit(audio_hal_handle_t audio_hal) {
esp_err_t ret;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- mutex_destroy (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_deinitialize ();
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ mutex_destroy(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_deinitialize();
audio_hal->audio_hal_lock = NULL;
audio_hal->handle = NULL;
- audio_free (audio_hal);
+ audio_free(audio_hal);
audio_hal = NULL;
return ret;
}
-esp_err_t
-audio_hal_ctrl_codec (audio_hal_handle_t audio_hal,
- audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t audio_hal_state)
-{
+esp_err_t audio_hal_ctrl_codec(audio_hal_handle_t audio_hal,
+ audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t audio_hal_state) {
esp_err_t ret;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- mutex_lock (audio_hal->audio_hal_lock);
- ESP_LOGI (TAG, "Codec mode is %d, Ctrl:%d", mode, audio_hal_state);
- ret = audio_hal->audio_codec_ctrl (mode, audio_hal_state);
- mutex_unlock (audio_hal->audio_hal_lock);
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ESP_LOGI(TAG, "Codec mode is %d, Ctrl:%d", mode, audio_hal_state);
+ ret = audio_hal->audio_codec_ctrl(mode, audio_hal_state);
+ mutex_unlock(audio_hal->audio_hal_lock);
return ret;
}
-esp_err_t
-audio_hal_codec_iface_config (audio_hal_handle_t audio_hal,
- audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t audio_hal_codec_iface_config(audio_hal_handle_t audio_hal,
+ audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
esp_err_t ret = 0;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- AUDIO_HAL_CHECK_NULL (iface, "Get volume para is null", -1);
- mutex_lock (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_config_iface (mode, iface);
- mutex_unlock (audio_hal->audio_hal_lock);
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ AUDIO_HAL_CHECK_NULL(iface, "Get volume para is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_config_iface(mode, iface);
+ mutex_unlock(audio_hal->audio_hal_lock);
return ret;
}
-esp_err_t
-audio_hal_set_mute (audio_hal_handle_t audio_hal, bool mute)
-{
+esp_err_t audio_hal_set_mute(audio_hal_handle_t audio_hal, bool mute) {
esp_err_t ret;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- mutex_lock (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_set_mute (mute);
- mutex_unlock (audio_hal->audio_hal_lock);
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_set_mute(mute);
+ mutex_unlock(audio_hal->audio_hal_lock);
return ret;
}
-esp_err_t
-audio_hal_set_volume (audio_hal_handle_t audio_hal, int volume)
-{
+esp_err_t audio_hal_enable_pa(audio_hal_handle_t audio_hal, bool enable) {
esp_err_t ret;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- mutex_lock (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_set_volume (volume);
- mutex_unlock (audio_hal->audio_hal_lock);
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_enable_pa(enable);
+ mutex_unlock(audio_hal->audio_hal_lock);
return ret;
}
-esp_err_t
-audio_hal_get_volume (audio_hal_handle_t audio_hal, int *volume)
-{
+esp_err_t audio_hal_set_volume(audio_hal_handle_t audio_hal, int volume) {
esp_err_t ret;
- AUDIO_HAL_CHECK_NULL (audio_hal, "audio_hal handle is null", -1);
- AUDIO_HAL_CHECK_NULL (volume, "Get volume para is null", -1);
- mutex_lock (audio_hal->audio_hal_lock);
- ret = audio_hal->audio_codec_get_volume (volume);
- mutex_unlock (audio_hal->audio_hal_lock);
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_set_volume(volume);
+ mutex_unlock(audio_hal->audio_hal_lock);
+ return ret;
+}
+
+esp_err_t audio_hal_get_volume(audio_hal_handle_t audio_hal, int *volume) {
+ esp_err_t ret;
+ AUDIO_HAL_CHECK_NULL(audio_hal, "audio_hal handle is null", -1);
+ AUDIO_HAL_CHECK_NULL(volume, "Get volume para is null", -1);
+ mutex_lock(audio_hal->audio_hal_lock);
+ ret = audio_hal->audio_codec_get_volume(volume);
+ mutex_unlock(audio_hal->audio_hal_lock);
return ret;
}
diff --git a/components/audio_hal/audio_volume.c b/components/audio_hal/audio_volume.c
new file mode 100644
index 0000000..5b3ae89
--- /dev/null
+++ b/components/audio_hal/audio_volume.c
@@ -0,0 +1,195 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/*
+ * |----------------Digital Gain---------------------|--Analog
+ * Gain-|
+ *
+ * |--------------| |--------------------| |------------------|
+ * |---------| |----------------| | Audio Stream |--->| Audio Process Gain
+ * |--->| Codec DAC Volume |--->| PA Gain |--->| Speaker Output |
+ * |--------------| |--------------------| |------------------|
+ * |---------| |----------------|
+ *
+ * The speaker playback route is shown as the block diagram above. The speaker
+ * loudness is affected by both audio Digital Gain and Analog Gain.
+ *
+ * Digital Gain:
+ * Audio Process Gain: Audio Process, such as ALC, AGC, DRC target MAX Gain.
+ * Codec DAC Volume: The audio codec DAC volume control, such as ES8311
+ * DAC_Volume control register.
+ *
+ * Analog Gain:
+ * PA Gain: The speaker power amplifier Gain, which is determined by the
+ * hardware circuit board.
+ *
+ * User can control the speaker playback volume by adjusting Codec DAC Volume.
+ *
+ * We use volume level (1-100) to represent the volume levels, level 100 is the
+ * MAX volume. We create a volume mapping index table for the user to set the
+ * volume level through Codec DAC volume. The default mapping table maps volume
+ * level(1-100) to Codec DAC Volume (-49.5dB, 0dB). The volume setting has 25
+ * volume levels. Level step is 4, and the corresponding to Codec DAC Volume
+ * Gain is 2 dB step. Normally, Codec DAC volume -50 dB reproduces a minimal
+ * speaker loudness, and the 2 dB step allows the user to detect the volume
+ * change.
+ *
+ * Gain and Decibel Reference:
+ * https://www.espressif.com/zh-hans/media_overview/blog
+ *
+ */
+
+#include "audio_volume.h"
+
+#include
+#include
+
+#include "audio_mem.h"
+
+/**
+ * The speaker playback route gain (Audio Process Gain + Codec DAC Volume + PA
+ * Gain) needs to ensure that the speaker PA output is not saturated and exceeds
+ * the speaker rated power. We define the maximum route gain as MAX_GAIN. To
+ * ensure the speaker PA output is not saturated, MAX_GAIN can be calculated
+ * simply by the formula. MAX_GAIN = 20 * log(Vpa/Vdac) Vpa: PA power supply
+ * Vdac: Codec DAC power supply
+ * e.g., Vpa = 5V, Vdac = 3.3V, then MAX_GAIN = 20 * log(5/3.3) = 3.6 dB.
+ * If the speaker rated power is lower than the speaker PA MAX power, MAX_GAIN
+ * should be defined according to the speaker rated power.
+ *
+ */
+#define VPA (5.0)
+#define VDAC (3.3)
+#define MAX_GAIN (20.0 * log10(VPA / VDAC))
+
+/*
+ * User can customize the volume setting by modifying the mapping table and
+ * adjust the volume step according to the speaker playback system, and the
+ * other volume levels shift the value accordingly. Integers are used instead of
+ * floating-point variables to reduce storage space. -80 means -40 dB, 0 means 0
+ * dB.
+ */
+static const int8_t dac_volume_offset[] = {
+ -99, -98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -86, -85,
+ -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73, -72, -71, -70,
+ -69, -68, -67, -66, -65, -64, -63, -62, -61, -60, -59, -58, -57, -56, -55,
+ -54, -53, -52, -51, -50, -49, -48, -47, -46, -45, -44, -43, -42, -41, -40,
+ -39, -38, -37, -36, -35, -34, -33, -32, -31, -30, -29, -28, -27, -26, -25,
+ -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10,
+ -9, -8, -7, -6, -5, -4, -3, -2, -1, 0};
+
+/**
+ * @brief Get DAC volume offset from user set volume, you can use an array or
+ * function to finish this map
+ *
+ * @note The max DAC volume is 0 dB when the user volume is 100. 0 dB means
+ * there is no attenuation of the sound source, and it is the original sound
+ * source. It can not exceed 0 dB. Otherwise, there is a risk of clipping noise.
+ * @note For better audio dynamic range, we'd better use 0dB full scale digital
+ * gain and lower analog gain.
+ * @note DAC volume offset is positively correlated with the user volume.
+ *
+ * @param volume User set volume (1-100)
+ *
+ * @return
+ * - Codec DAC volume offset. The max value must be 0 dB.
+ */
+static inline float codec_get_dac_volume_offset(int volume) {
+ float offset = dac_volume_offset[volume - 1] / 2.0;
+ return offset;
+}
+
+/**
+ * @brief The register value is linear to the dac_volume
+ */
+static inline uint8_t audio_codec_calculate_reg(volume_handle_t vol_handle,
+ float dac_volume) {
+ codec_dac_volume_config_t *handle = (codec_dac_volume_config_t *)vol_handle;
+ uint8_t reg = (uint8_t)(dac_volume / (handle->dac_vol_symbol *
+ handle->volume_accuracy) +
+ handle->zero_volume_reg);
+ return reg;
+}
+
+volume_handle_t audio_codec_volume_init(codec_dac_volume_config_t *config) {
+ codec_dac_volume_config_t *handle = (codec_dac_volume_config_t *)audio_calloc(
+ 1, sizeof(codec_dac_volume_config_t));
+ memcpy(handle, config, sizeof(codec_dac_volume_config_t));
+ if (!handle->offset_conv_volume) {
+ handle->offset_conv_volume = codec_get_dac_volume_offset;
+ }
+ return (volume_handle_t)handle;
+}
+
+/**
+ * @brief Take zero dac_volume as the origin and calculate the volume offset
+ * according to the register value
+ */
+float audio_codec_cal_dac_volume(volume_handle_t vol_handle) {
+ codec_dac_volume_config_t *handle = (codec_dac_volume_config_t *)vol_handle;
+ float dac_volume = handle->dac_vol_symbol * handle->volume_accuracy *
+ (handle->reg_value - handle->zero_volume_reg);
+ return dac_volume;
+}
+
+uint8_t audio_codec_get_dac_reg_value(volume_handle_t vol_handle, int volume) {
+ float dac_volume = 0;
+ int user_volume = volume;
+ codec_dac_volume_config_t *handle = (codec_dac_volume_config_t *)vol_handle;
+
+ if (user_volume < 0) {
+ user_volume = 0;
+ } else if (user_volume > 100) {
+ user_volume = 100;
+ }
+
+ if (user_volume == 0) {
+ dac_volume =
+ handle->min_dac_volume; // Make sure the speaker voice is near silent
+ } else {
+ /*
+ * For better audio performance, at the max volume, we need to ensure:
+ * Audio Process Gain + Codec DAC Volume + PA Gain <= MAX_GAIN.
+ * The PA Gain and Audio Process Gain are known when the board design is
+ * fixed, so max Codec DAC Volume = MAX_GAIN - PA Gain - Audio Process
+ * Gain,then the volume mapping table shift accordingly.
+ */
+ dac_volume = handle->offset_conv_volume(user_volume) + MAX_GAIN -
+ handle->board_pa_gain;
+ dac_volume = dac_volume < handle->max_dac_volume ? dac_volume
+ : handle->max_dac_volume;
+ }
+ handle->reg_value = audio_codec_calculate_reg(handle, dac_volume);
+ handle->user_volume = user_volume;
+ return handle->reg_value;
+}
+
+void audio_codec_volume_deinit(volume_handle_t vol_handle) {
+ if (vol_handle) {
+ audio_free(vol_handle);
+ vol_handle = NULL;
+ }
+}
diff --git a/components/audio_hal/component.mk b/components/audio_hal/component.mk
index 4d41c99..d794d0e 100644
--- a/components/audio_hal/component.mk
+++ b/components/audio_hal/component.mk
@@ -20,5 +20,5 @@ COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/driver/zl38063/firmware -lfirmware
COMPONENT_ADD_INCLUDEDIRS += ./driver/tas5805m ./driver/es7148
COMPONENT_SRCDIRS += ./driver/tas5805m ./driver/es7148
-COMPONENT_ADD_INCLUDEDIRS += ./driver/es7210
-COMPONENT_SRCDIRS += ./driver/es7210
+COMPONENT_ADD_INCLUDEDIRS += ./driver/es7210 ./driver/es8156 ./driver/es7243e
+COMPONENT_SRCDIRS += ./driver/es7210 ./driver/es8156 ./driver/es7243e
diff --git a/components/audio_hal/driver/es7148/es7148.c b/components/audio_hal/driver/es7148/es7148.c
index d25f212..88430f3 100644
--- a/components/audio_hal/driver/es7148/es7148.c
+++ b/components/audio_hal/driver/es7148/es7148.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,13 +18,14 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es7148.h"
+
#include "board.h"
#include "driver/gpio.h"
#include "esp_log.h"
@@ -34,72 +35,52 @@ static const char *TAG = "es7148";
static bool codec_init_flag = 0;
audio_hal_func_t AUDIO_CODEC_ES7148_DEFAULT_HANDLE = {
- .audio_codec_initialize = es7148_codec_init,
- .audio_codec_deinitialize = es7148_codec_deinit,
- .audio_codec_ctrl = es7148_codec_ctrl_state,
- .audio_codec_config_iface = es7148_codec_config_i2s,
- .audio_codec_set_mute = es7148_codec_set_voice_mute,
- .audio_codec_set_volume = es7148_codec_set_voice_volume,
- .audio_codec_get_volume = es7148_codec_get_voice_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es7148_codec_init,
+ .audio_codec_deinitialize = es7148_codec_deinit,
+ .audio_codec_ctrl = es7148_codec_ctrl_state,
+ .audio_codec_config_iface = es7148_codec_config_i2s,
+ .audio_codec_set_mute = es7148_codec_set_voice_mute,
+ .audio_codec_set_volume = es7148_codec_set_voice_volume,
+ .audio_codec_get_volume = es7148_codec_get_voice_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
-static bool
-es7148_codec_initialized ()
-{
- return codec_init_flag;
-}
+static bool es7148_codec_initialized() { return codec_init_flag; }
-esp_err_t
-es7148_codec_init (audio_hal_codec_config_t *cfg)
-{
- if (es7148_codec_initialized ())
- {
- ESP_LOGW (TAG, "The es7148 codec has been already initialized");
- return ESP_OK;
- }
+esp_err_t es7148_codec_init(audio_hal_codec_config_t *cfg) {
+ if (es7148_codec_initialized()) {
+ ESP_LOGW(TAG, "The es7148 codec has been already initialized");
+ return ESP_OK;
+ }
codec_init_flag = true;
return ESP_OK;
}
-esp_err_t
-es7148_codec_deinit (void)
-{
+esp_err_t es7148_codec_deinit(void) {
codec_init_flag = false;
return ESP_OK;
}
-esp_err_t
-es7148_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state)
-{
+esp_err_t es7148_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
return ESP_OK;
}
-esp_err_t
-es7148_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es7148_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
return ESP_OK;
}
-esp_err_t
-es7148_codec_set_voice_mute (bool mute)
-{
- return ESP_OK;
-}
+esp_err_t es7148_codec_set_voice_mute(bool mute) { return ESP_OK; }
-esp_err_t
-es7148_codec_set_voice_volume (int volume)
-{
+esp_err_t es7148_codec_set_voice_volume(int volume) {
int ret = 0;
return ret;
}
-esp_err_t
-es7148_codec_get_voice_volume (int *volume)
-{
+esp_err_t es7148_codec_get_voice_volume(int *volume) {
int ret = 0;
return ret;
}
diff --git a/components/audio_hal/driver/es7148/es7148.h b/components/audio_hal/driver/es7148/es7148.h
index 6a7f768..2f387e9 100644
--- a/components/audio_hal/driver/es7148/es7148.h
+++ b/components/audio_hal/driver/es7148/es7148.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,92 +30,91 @@
#include "audio_hal.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Initialize es7148 chip
- *
- * @param cfg configuration of es7148
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7148_codec_init (audio_hal_codec_config_t *cfg);
- /**
- * @brief Deinitialize es7148 chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7148_codec_deinit (void);
- /**
- * The functions es7148_ctrl_state and es7148_config_i2s are not used by this
- * driver. They are kept here to maintain the uniformity and convenience of
- * the interface of the ADF project. These settings for es7148 are burned in
- * firmware and configuration files. Default i2s configuration: 48000Hz,
- * 16bit, Left-Right channels. Use resampling to be compatible with different
- * file types.
- *
- * @brief Control es7148 chip
- *
- * @param mode codec mode
- * @param ctrl_state start or stop decode or encode progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7148_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Configure es7148 codec mode and I2S interface
- *
- * @param mode codec mode
- * @param iface I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7148_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Initialize es7148 chip
+ *
+ * @param cfg configuration of es7148
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7148_codec_init(audio_hal_codec_config_t *cfg);
+/**
+ * @brief Deinitialize es7148 chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7148_codec_deinit(void);
+/**
+ * The functions es7148_ctrl_state and es7148_config_i2s are not used by this
+ * driver. They are kept here to maintain the uniformity and convenience of the
+ * interface of the ADF project. These settings for es7148 are burned in
+ * firmware and configuration files. Default i2s configuration: 48000Hz, 16bit,
+ * Left-Right channels. Use resampling to be compatible with different file
+ * types.
+ *
+ * @brief Control es7148 chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7148_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Configure es7148 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7148_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief mute or unmute the codec
- *
- * @param mute: true, false
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7148_codec_set_voice_mute (bool mute);
+/**
+ * @brief mute or unmute the codec
+ *
+ * @param mute: true, false
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7148_codec_set_voice_mute(bool mute);
- /**
- * @brief Set voice volume
- *
- * @param volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7148_codec_set_voice_volume (int volume);
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7148_codec_set_voice_volume(int volume);
- /**
- * @brief Get voice volume
- *
- * @param[out] *volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7148_codec_get_voice_volume (int *volume);
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7148_codec_get_voice_volume(int *volume);
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/es7210/es7210.c b/components/audio_hal/driver/es7210/es7210.c
index 84139d7..ba79884 100644
--- a/components/audio_hal/driver/es7210/es7210.c
+++ b/components/audio_hal/driver/es7210/es7210.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,22 +18,24 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es7210.h"
+
+#include
+
#include "board.h"
#include "esp_log.h"
#include "i2c_bus.h"
-#include
#define I2S_DSP_MODE 0
#define MCLK_DIV_FRE 256
-/* ES7210 address*/
+/* ES7210 address */
#define ES7210_ADDR ES7210_AD1_AD0_00
#define ES7210_MCLK_SOURCE \
FROM_CLOCK_DOUBLE_PIN /* In master mode, 0 : MCLK from pad 1 : MCLK from \
@@ -41,25 +43,42 @@
#define FROM_PAD_PIN 0
#define FROM_CLOCK_DOUBLE_PIN 1
+/* ES7210 mic select */
+#if CONFIG_ESP32_S3_KORVO2_V3_BOARD
+#define ES7210_MIC_SELECT \
+ ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2 | ES7210_INPUT_MIC3
+#else
+#define ES7210_MIC_SELECT ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2
+#endif
+#define ENABLE_TDM_MAX_NUM 3
+
+static char *TAG = "ES7210";
+
+static struct {
+ i2c_bus_handle_t i2c_handle;
+ es7210_input_mics_t mic_select;
+ es7210_gain_value_t gain;
+} es7210_handle;
+
/*
* Operate function of ADC
*/
audio_hal_func_t AUDIO_CODEC_ES7210_DEFAULT_HANDLE = {
- .audio_codec_initialize = es7210_adc_init,
- .audio_codec_deinitialize = es7210_adc_deinit,
- .audio_codec_ctrl = es7210_adc_ctrl_state,
- .audio_codec_config_iface = es7210_adc_config_i2s,
- .audio_codec_set_mute = es7210_set_mute,
- .audio_codec_set_volume = es7210_adc_set_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es7210_adc_init,
+ .audio_codec_deinitialize = es7210_adc_deinit,
+ .audio_codec_ctrl = es7210_adc_ctrl_state,
+ .audio_codec_config_iface = es7210_adc_config_i2s,
+ .audio_codec_set_mute = es7210_set_mute,
+ .audio_codec_set_volume = es7210_adc_set_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
/*
* Clock coefficient structer
*/
-struct _coeff_div
-{
+struct _coeff_div {
uint32_t mclk; /* mclk frequency */
uint32_t lrck; /* lrck */
uint8_t ss_ds;
@@ -72,11 +91,6 @@ struct _coeff_div
uint32_t lrck_l; /* The low 8 bits of lrck */
};
-static char *TAG = "ES7210";
-static i2c_bus_handle_t i2c_handle;
-static es7210_input_mics_t mic_select
- = ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2; /* Number of microphones */
-
/* Codec hifi mclk clock divider coefficients
* MEMBER REG
* mclk: 0x03
@@ -91,125 +105,106 @@ static es7210_input_mics_t mic_select
* lrckl: 0x05
*/
static const struct _coeff_div coeff_div[] = {
- // mclk lrck ss_ds adc_div dll doubler osr mclk_src lrckh lrckl
- /* 8k */
- { 12288000, 8000, 0x00, 0x03, 0x01, 0x00, 0x20, 0x00, 0x06, 0x00 },
- { 16384000, 8000, 0x00, 0x04, 0x01, 0x00, 0x20, 0x00, 0x08, 0x00 },
- { 19200000, 8000, 0x00, 0x1e, 0x00, 0x01, 0x28, 0x00, 0x09, 0x60 },
- { 4096000, 8000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00 },
+ // mclk lrck ss_ds adc_div dll doubler osr mclk_src lrckh lrckl
+ /* 8k */
+ {12288000, 8000, 0x00, 0x03, 0x01, 0x00, 0x20, 0x00, 0x06, 0x00},
+ {16384000, 8000, 0x00, 0x04, 0x01, 0x00, 0x20, 0x00, 0x08, 0x00},
+ {19200000, 8000, 0x00, 0x1e, 0x00, 0x01, 0x28, 0x00, 0x09, 0x60},
+ {4096000, 8000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00},
- /* 11.025k */
- { 11289600, 11025, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00 },
+ /* 11.025k */
+ {11289600, 11025, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00},
- /* 12k */
- { 12288000, 12000, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x04, 0x00 },
- { 19200000, 12000, 0x00, 0x14, 0x00, 0x01, 0x28, 0x00, 0x06, 0x40 },
+ /* 12k */
+ {12288000, 12000, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x04, 0x00},
+ {19200000, 12000, 0x00, 0x14, 0x00, 0x01, 0x28, 0x00, 0x06, 0x40},
- /* 16k */
- { 4096000, 16000, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00 },
- { 19200000, 16000, 0x00, 0x0a, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x80 },
- { 16384000, 16000, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x04, 0x00 },
- { 12288000, 16000, 0x00, 0x03, 0x01, 0x01, 0x20, 0x00, 0x03, 0x00 },
+ /* 16k */
+ {4096000, 16000, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00},
+ {19200000, 16000, 0x00, 0x0a, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x80},
+ {16384000, 16000, 0x00, 0x02, 0x01, 0x00, 0x20, 0x00, 0x04, 0x00},
+ {12288000, 16000, 0x00, 0x03, 0x01, 0x01, 0x20, 0x00, 0x03, 0x00},
- /* 22.05k */
- { 11289600, 22050, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00 },
+ /* 22.05k */
+ {11289600, 22050, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00},
- /* 24k */
- { 12288000, 24000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00 },
- { 19200000, 24000, 0x00, 0x0a, 0x00, 0x01, 0x28, 0x00, 0x03, 0x20 },
+ /* 24k */
+ {12288000, 24000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00},
+ {19200000, 24000, 0x00, 0x0a, 0x00, 0x01, 0x28, 0x00, 0x03, 0x20},
- /* 32k */
- { 12288000, 32000, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x01, 0x80 },
- { 16384000, 32000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00 },
- { 19200000, 32000, 0x00, 0x05, 0x00, 0x00, 0x1e, 0x00, 0x02, 0x58 },
+ /* 32k */
+ {12288000, 32000, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x01, 0x80},
+ {16384000, 32000, 0x00, 0x01, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00},
+ {19200000, 32000, 0x00, 0x05, 0x00, 0x00, 0x1e, 0x00, 0x02, 0x58},
- /* 44.1k */
- { 11289600, 44100, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00 },
+ /* 44.1k */
+ {11289600, 44100, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00},
- /* 48k */
- { 12288000, 48000, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00 },
- { 19200000, 48000, 0x00, 0x05, 0x00, 0x01, 0x28, 0x00, 0x01, 0x90 },
+ /* 48k */
+ {12288000, 48000, 0x00, 0x01, 0x01, 0x01, 0x20, 0x00, 0x01, 0x00},
+ {19200000, 48000, 0x00, 0x05, 0x00, 0x01, 0x28, 0x00, 0x01, 0x90},
- /* 64k */
- { 16384000, 64000, 0x01, 0x01, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00 },
- { 19200000, 64000, 0x00, 0x05, 0x00, 0x01, 0x1e, 0x00, 0x01, 0x2c },
+ /* 64k */
+ {16384000, 64000, 0x01, 0x01, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00},
+ {19200000, 64000, 0x00, 0x05, 0x00, 0x01, 0x1e, 0x00, 0x01, 0x2c},
- /* 88.2k */
- { 11289600, 88200, 0x01, 0x01, 0x01, 0x01, 0x20, 0x00, 0x00, 0x80 },
+ /* 88.2k */
+ {11289600, 88200, 0x01, 0x01, 0x01, 0x01, 0x20, 0x00, 0x00, 0x80},
- /* 96k */
- { 12288000, 96000, 0x01, 0x01, 0x01, 0x01, 0x20, 0x00, 0x00, 0x80 },
- { 19200000, 96000, 0x01, 0x05, 0x00, 0x01, 0x28, 0x00, 0x00, 0xc8 },
+ /* 96k */
+ {12288000, 96000, 0x01, 0x01, 0x01, 0x01, 0x20, 0x00, 0x00, 0x80},
+ {19200000, 96000, 0x01, 0x05, 0x00, 0x01, 0x28, 0x00, 0x00, 0xc8},
};
-static esp_err_t
-es7210_write_reg (uint8_t reg_addr, uint8_t data)
-{
- return i2c_bus_write_bytes (i2c_handle, ES7210_ADDR, ®_addr,
- sizeof (reg_addr), &data, sizeof (data));
+static esp_err_t es7210_write_reg(uint8_t reg_addr, uint8_t data) {
+ return i2c_bus_write_bytes(es7210_handle.i2c_handle, ES7210_ADDR, ®_addr,
+ sizeof(reg_addr), &data, sizeof(data));
}
-static esp_err_t
-es7210_update_reg_bit (uint8_t reg_addr, uint8_t update_bits, uint8_t data)
-{
+static esp_err_t es7210_update_reg_bit(uint8_t reg_addr, uint8_t update_bits,
+ uint8_t data) {
uint8_t regv;
- regv = es7210_read_reg (reg_addr);
+ regv = es7210_read_reg(reg_addr);
regv = (regv & (~update_bits)) | (update_bits & data);
- return es7210_write_reg (reg_addr, regv);
+ return es7210_write_reg(reg_addr, regv);
}
-static int
-i2c_init ()
-{
+static int i2c_init() {
int ret = 0;
i2c_config_t es_i2c_cfg = {
- .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000,
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
};
- ret = get_i2c_pins (I2C_NUM_0, &es_i2c_cfg);
- AUDIO_CHECK (TAG, !ret, return ESP_FAIL;, "getting i2c pins error");
- i2c_handle = i2c_bus_create (I2C_NUM_0, &es_i2c_cfg);
+ ret = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ AUDIO_RET_ON_FALSE(TAG, ret, return ESP_FAIL, "getting i2c pins error");
+ es7210_handle.i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
return ret;
}
-static int
-get_coeff (uint32_t mclk, uint32_t lrck)
-{
- for (int i = 0; i < (sizeof (coeff_div) / sizeof (coeff_div[0])); i++)
- {
- if (coeff_div[i].lrck == lrck && coeff_div[i].mclk == mclk)
- return i;
- }
+static int get_coeff(uint32_t mclk, uint32_t lrck) {
+ for (int i = 0; i < (sizeof(coeff_div) / sizeof(coeff_div[0])); i++) {
+ if (coeff_div[i].lrck == lrck && coeff_div[i].mclk == mclk) return i;
+ }
return -1;
}
-int8_t
-get_es7210_mclk_src (void)
-{
- return ES7210_MCLK_SOURCE;
-}
+int8_t get_es7210_mclk_src(void) { return ES7210_MCLK_SOURCE; }
-int
-es7210_read_reg (uint8_t reg_addr)
-{
+int es7210_read_reg(uint8_t reg_addr) {
uint8_t data;
- i2c_bus_read_bytes (i2c_handle, ES7210_ADDR, ®_addr, sizeof (reg_addr),
- &data, sizeof (data));
+ i2c_bus_read_bytes(es7210_handle.i2c_handle, ES7210_ADDR, ®_addr,
+ sizeof(reg_addr), &data, sizeof(data));
return (int)data;
}
-esp_err_t
-es7210_config_sample (audio_hal_iface_samples_t sample)
-{
- uint8_t regv;
+esp_err_t es7210_config_sample(audio_hal_iface_samples_t sample) {
int coeff;
int sample_fre = 0;
int mclk_fre = 0;
esp_err_t ret = ESP_OK;
- switch (sample)
- {
+ switch (sample) {
case AUDIO_HAL_08K_SAMPLES:
sample_fre = 8000;
break;
@@ -235,205 +230,202 @@ es7210_config_sample (audio_hal_iface_samples_t sample)
sample_fre = 48000;
break;
default:
- ESP_LOGE (TAG, "Unable to configure sample rate %dHz", sample_fre);
+ ESP_LOGE(TAG, "Unable to configure sample rate %dHz", sample_fre);
break;
- }
+ }
mclk_fre = sample_fre * MCLK_DIV_FRE;
- coeff = get_coeff (mclk_fre, sample_fre);
- if (coeff < 0)
- {
- ESP_LOGE (TAG, "Unable to configure sample rate %dHz with %dHz MCLK",
- sample_fre, mclk_fre);
- return ESP_FAIL;
- }
+ coeff = get_coeff(mclk_fre, sample_fre);
+ if (coeff < 0) {
+ ESP_LOGE(TAG, "Unable to configure sample rate %dHz with %dHz MCLK",
+ sample_fre, mclk_fre);
+ return ESP_FAIL;
+ }
/* Set clock parammeters */
- if (coeff >= 0)
- {
- /* Set adc_div & doubler & dll */
- regv = es7210_read_reg (ES7210_MAINCLK_REG02) & 0x00;
- regv |= coeff_div[coeff].adc_div;
- regv |= coeff_div[coeff].doubler << 6;
- regv |= coeff_div[coeff].dll << 7;
- ret |= es7210_write_reg (ES7210_MAINCLK_REG02, regv);
- /* Set osr */
- regv = coeff_div[coeff].osr;
- ret |= es7210_write_reg (ES7210_OSR_REG07, regv);
- /* Set lrck */
- regv = coeff_div[coeff].lrck_h;
- ret |= es7210_write_reg (ES7210_LRCK_DIVH_REG04, regv);
- regv = coeff_div[coeff].lrck_l;
- ret |= es7210_write_reg (ES7210_LRCK_DIVL_REG05, regv);
- }
+ if (coeff >= 0) {
+ /* Set adc_div & doubler & dll */
+ uint8_t regv;
+ regv = es7210_read_reg(ES7210_MAINCLK_REG02) & 0x00;
+ regv |= coeff_div[coeff].adc_div;
+ regv |= coeff_div[coeff].doubler << 6;
+ regv |= coeff_div[coeff].dll << 7;
+ ret |= es7210_write_reg(ES7210_MAINCLK_REG02, regv);
+ /* Set osr */
+ regv = coeff_div[coeff].osr;
+ ret |= es7210_write_reg(ES7210_OSR_REG07, regv);
+ /* Set lrck */
+ regv = coeff_div[coeff].lrck_h;
+ ret |= es7210_write_reg(ES7210_LRCK_DIVH_REG04, regv);
+ regv = coeff_div[coeff].lrck_l;
+ ret |= es7210_write_reg(ES7210_LRCK_DIVL_REG05, regv);
+ }
return ret;
}
-esp_err_t
-es7210_mic_select (es7210_input_mics_t mic)
-{
+esp_err_t es7210_mic_select(es7210_input_mics_t mic) {
esp_err_t ret = ESP_OK;
- mic_select = mic;
- if (mic_select
- & (ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2 | ES7210_INPUT_MIC3
- | ES7210_INPUT_MIC4))
- {
- for (int i = 0; i < 4; i++)
- {
- ret |= es7210_update_reg_bit (ES7210_MIC1_GAIN_REG43 + i, 0x10,
- 0x00);
- }
- ret |= es7210_write_reg (ES7210_MIC12_POWER_REG4B, 0xff);
- ret |= es7210_write_reg (ES7210_MIC34_POWER_REG4C, 0xff);
- if (mic_select & ES7210_INPUT_MIC1)
- {
- ESP_LOGI (TAG, "Enable ES7210_INPUT_MIC1");
- ret |= es7210_update_reg_bit (ES7210_CLOCK_OFF_REG01, 0x0b, 0x00);
- ret |= es7210_write_reg (ES7210_MIC12_POWER_REG4B, 0x00);
- ret |= es7210_update_reg_bit (ES7210_MIC1_GAIN_REG43, 0x10, 0x10);
- }
- if (mic_select & ES7210_INPUT_MIC2)
- {
- ESP_LOGI (TAG, "Enable ES7210_INPUT_MIC2");
- ret |= es7210_update_reg_bit (ES7210_CLOCK_OFF_REG01, 0x0b, 0x00);
- ret |= es7210_write_reg (ES7210_MIC12_POWER_REG4B, 0x00);
- ret |= es7210_update_reg_bit (ES7210_MIC2_GAIN_REG44, 0x10, 0x10);
- }
- if (mic_select & ES7210_INPUT_MIC3)
- {
- ESP_LOGI (TAG, "Enable ES7210_INPUT_MIC3");
- ret |= es7210_update_reg_bit (ES7210_CLOCK_OFF_REG01, 0x15, 0x00);
- ret |= es7210_write_reg (ES7210_MIC34_POWER_REG4C, 0x00);
- ret |= es7210_update_reg_bit (ES7210_MIC3_GAIN_REG45, 0x10, 0x10);
- }
- if (mic_select & ES7210_INPUT_MIC4)
- {
- ESP_LOGI (TAG, "Enable ES7210_INPUT_MIC4");
- ret |= es7210_update_reg_bit (ES7210_CLOCK_OFF_REG01, 0x15, 0x00);
- ret |= es7210_write_reg (ES7210_MIC34_POWER_REG4C, 0x00);
- ret |= es7210_update_reg_bit (ES7210_MIC4_GAIN_REG46, 0x10, 0x10);
- }
+ uint16_t mic_num = 0;
+ es7210_handle.mic_select = mic;
+ if (es7210_handle.mic_select & (ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2 |
+ ES7210_INPUT_MIC3 | ES7210_INPUT_MIC4)) {
+ for (int i = 0; i < 4; i++) {
+ ret |= es7210_update_reg_bit(ES7210_MIC1_GAIN_REG43 + i, 0x10, 0x00);
}
- else
- {
- ESP_LOGE (TAG, "Microphone selection error");
- return ESP_FAIL;
+ ret |= es7210_write_reg(ES7210_MIC12_POWER_REG4B, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC34_POWER_REG4C, 0xff);
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC1) {
+ ESP_LOGI(TAG, "Enable ES7210_INPUT_MIC1");
+ ret |= es7210_update_reg_bit(ES7210_CLOCK_OFF_REG01, 0x0b, 0x00);
+ ret |= es7210_write_reg(ES7210_MIC12_POWER_REG4B, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MIC1_GAIN_REG43, 0x10, 0x10);
+ ret |= es7210_update_reg_bit(ES7210_MIC1_GAIN_REG43, 0x0f,
+ es7210_handle.gain);
}
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC2) {
+ ESP_LOGI(TAG, "Enable ES7210_INPUT_MIC2");
+ ret |= es7210_update_reg_bit(ES7210_CLOCK_OFF_REG01, 0x0b, 0x00);
+ ret |= es7210_write_reg(ES7210_MIC12_POWER_REG4B, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MIC2_GAIN_REG44, 0x10, 0x10);
+ ret |= es7210_update_reg_bit(ES7210_MIC2_GAIN_REG44, 0x0f,
+ es7210_handle.gain);
+ }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC3) {
+ ESP_LOGI(TAG, "Enable ES7210_INPUT_MIC3");
+ ret |= es7210_update_reg_bit(ES7210_CLOCK_OFF_REG01, 0x15, 0x00);
+ ret |= es7210_write_reg(ES7210_MIC34_POWER_REG4C, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MIC3_GAIN_REG45, 0x10, 0x10);
+ ret |= es7210_update_reg_bit(ES7210_MIC3_GAIN_REG45, 0x0f,
+ es7210_handle.gain);
+ }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC4) {
+ ESP_LOGI(TAG, "Enable ES7210_INPUT_MIC4");
+ ret |= es7210_update_reg_bit(ES7210_CLOCK_OFF_REG01, 0x15, 0x00);
+ ret |= es7210_write_reg(ES7210_MIC34_POWER_REG4C, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MIC4_GAIN_REG46, 0x10, 0x10);
+ ret |= es7210_update_reg_bit(ES7210_MIC4_GAIN_REG46, 0x0f,
+ es7210_handle.gain);
+ }
+ } else {
+ ESP_LOGE(TAG, "Microphone selection error");
+ return ESP_FAIL;
+ }
+
+ for (int i = ES7210_INPUT_MIC1; i <= ES7210_INPUT_MIC4; i = i << 1) {
+ if (es7210_handle.mic_select & i) {
+ mic_num++;
+ }
+ }
+ if (mic_num >= ENABLE_TDM_MAX_NUM) {
+ ret |= es7210_write_reg(ES7210_SDP_INTERFACE2_REG12, 0x02);
+ ESP_LOGW(TAG, "Enable TDM mode. ES7210_SDP_INTERFACE2_REG12: %X",
+ es7210_read_reg(ES7210_SDP_INTERFACE2_REG12));
+ } else {
+ ret |= es7210_write_reg(ES7210_SDP_INTERFACE2_REG12, 0x00);
+ ESP_LOGW(TAG, "Disable TDM mode. ES7210_SDP_INTERFACE2_REG12: %X",
+ es7210_read_reg(ES7210_SDP_INTERFACE2_REG12));
+ }
return ret;
}
-esp_err_t
-es7210_adc_init (audio_hal_codec_config_t *codec_cfg)
-{
+esp_err_t es7210_adc_init(audio_hal_codec_config_t *codec_cfg) {
esp_err_t ret = ESP_OK;
- i2c_init ();
- ret |= es7210_write_reg (ES7210_RESET_REG00, 0xff);
- ret |= es7210_write_reg (ES7210_RESET_REG00, 0x41);
- ret |= es7210_write_reg (ES7210_CLOCK_OFF_REG01, 0x1f);
- ret |= es7210_write_reg (ES7210_TIME_CONTROL0_REG09,
- 0x30); /* Set chip state cycle */
- ret |= es7210_write_reg (ES7210_TIME_CONTROL1_REG0A,
- 0x30); /* Set power on state cycle */
- ret |= es7210_write_reg (ES7210_ADC12_HPF2_REG23, 0x2a); /* Quick setup */
- ret |= es7210_write_reg (ES7210_ADC12_HPF1_REG22, 0x0a);
- ret |= es7210_write_reg (ES7210_ADC34_HPF2_REG20, 0x0a);
- ret |= es7210_write_reg (ES7210_ADC34_HPF1_REG21, 0x2a);
+ i2c_init();
+ ret |= es7210_write_reg(ES7210_RESET_REG00, 0xff);
+ ret |= es7210_write_reg(ES7210_RESET_REG00, 0x41);
+ ret |= es7210_write_reg(ES7210_CLOCK_OFF_REG01, 0x3f);
+ ret |= es7210_write_reg(ES7210_TIME_CONTROL0_REG09,
+ 0x30); /* Set chip state cycle */
+ ret |= es7210_write_reg(ES7210_TIME_CONTROL1_REG0A,
+ 0x30); /* Set power on state cycle */
+ ret |= es7210_write_reg(ES7210_ADC12_HPF2_REG23, 0x2a); /* Quick setup */
+ ret |= es7210_write_reg(ES7210_ADC12_HPF1_REG22, 0x0a);
+ ret |= es7210_write_reg(ES7210_ADC34_HPF2_REG20, 0x0a);
+ ret |= es7210_write_reg(ES7210_ADC34_HPF1_REG21, 0x2a);
/* Set master/slave audio interface */
audio_hal_codec_i2s_iface_t *i2s_cfg = &(codec_cfg->i2s_iface);
- switch (i2s_cfg->mode)
- {
+ switch (i2s_cfg->mode) {
case AUDIO_HAL_MODE_MASTER: /* MASTER MODE */
- ESP_LOGI (TAG, "ES7210 in Master mode");
- ret |= es7210_update_reg_bit (ES7210_MODE_CONFIG_REG08, 0x01, 0x01);
+ ESP_LOGI(TAG, "ES7210 in Master mode");
+ ret |= es7210_update_reg_bit(ES7210_MODE_CONFIG_REG08, 0x01, 0x01);
/* Select clock source for internal mclk */
- switch (get_es7210_mclk_src ())
- {
+ switch (get_es7210_mclk_src()) {
case FROM_PAD_PIN:
- ret |= es7210_update_reg_bit (ES7210_MASTER_CLK_REG03, 0x80, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MASTER_CLK_REG03, 0x80, 0x00);
break;
case FROM_CLOCK_DOUBLE_PIN:
- ret |= es7210_update_reg_bit (ES7210_MASTER_CLK_REG03, 0x80, 0x80);
+ ret |= es7210_update_reg_bit(ES7210_MASTER_CLK_REG03, 0x80, 0x80);
break;
default:
- ret |= es7210_update_reg_bit (ES7210_MASTER_CLK_REG03, 0x80, 0x00);
+ ret |= es7210_update_reg_bit(ES7210_MASTER_CLK_REG03, 0x80, 0x00);
break;
- }
+ }
break;
case AUDIO_HAL_MODE_SLAVE: /* SLAVE MODE */
- ESP_LOGI (TAG, "ES7210 in Slave mode");
- ret |= es7210_update_reg_bit (ES7210_MODE_CONFIG_REG08, 0x01, 0x00);
+ ESP_LOGI(TAG, "ES7210 in Slave mode");
+ ret |= es7210_update_reg_bit(ES7210_MODE_CONFIG_REG08, 0x01, 0x00);
break;
default:
- ret |= es7210_update_reg_bit (ES7210_MODE_CONFIG_REG08, 0x01, 0x00);
- }
- ret |= es7210_write_reg (ES7210_ANALOG_REG40,
- 0x43); /* Select power off analog, vdda = 3.3V,
- close vx20ff, VMID select 5KΩ start */
- ret |= es7210_write_reg (ES7210_MIC12_BIAS_REG41, 0x70); /* Select 2.87v */
- ret |= es7210_write_reg (ES7210_MIC34_BIAS_REG42, 0x70); /* Select 2.87v */
- ret |= es7210_write_reg (ES7210_OSR_REG07, 0x20);
- ret |= es7210_write_reg (
+ ret |= es7210_update_reg_bit(ES7210_MODE_CONFIG_REG08, 0x01, 0x00);
+ }
+ ret |= es7210_write_reg(ES7210_ANALOG_REG40,
+ 0x43); /* Select power off analog, vdda = 3.3V, close
+ vx20ff, VMID select 5KΩ start */
+ ret |= es7210_write_reg(ES7210_MIC12_BIAS_REG41, 0x70); /* Select 2.87v */
+ ret |= es7210_write_reg(ES7210_MIC34_BIAS_REG42, 0x70); /* Select 2.87v */
+ ret |= es7210_write_reg(ES7210_OSR_REG07, 0x20);
+ ret |= es7210_write_reg(
ES7210_MAINCLK_REG02,
0xc1); /* Set the frequency division coefficient and use dll except clock
doubler, and need to set 0xc1 to clear the state */
- ret |= es7210_config_sample (i2s_cfg->samples);
- ret |= es7210_mic_select (mic_select);
- ret |= es7210_adc_set_gain (GAIN_30DB);
+ ret |= es7210_config_sample(i2s_cfg->samples);
+ ret |= es7210_mic_select(ES7210_MIC_SELECT);
+ ret |= es7210_adc_set_gain(GAIN_24DB);
return ESP_OK;
}
-esp_err_t
-es7210_adc_deinit ()
-{
- i2c_bus_delete (i2c_handle);
+esp_err_t es7210_adc_deinit() {
+ i2c_bus_delete(es7210_handle.i2c_handle);
return ESP_OK;
}
-esp_err_t
-es7210_config_fmt (audio_hal_iface_format_t fmt)
-{
+esp_err_t es7210_config_fmt(audio_hal_iface_format_t fmt) {
esp_err_t ret = ESP_OK;
uint8_t adc_iface = 0;
- adc_iface = es7210_read_reg (ES7210_SDP_INTERFACE1_REG11);
+ adc_iface = es7210_read_reg(ES7210_SDP_INTERFACE1_REG11);
adc_iface &= 0xfc;
- switch (fmt)
- {
+ switch (fmt) {
case AUDIO_HAL_I2S_NORMAL:
- ESP_LOGD (TAG, "ES7210 in I2S Format");
+ ESP_LOGD(TAG, "ES7210 in I2S Format");
adc_iface |= 0x00;
break;
case AUDIO_HAL_I2S_LEFT:
case AUDIO_HAL_I2S_RIGHT:
- ESP_LOGD (TAG, "ES7210 in LJ Format");
+ ESP_LOGD(TAG, "ES7210 in LJ Format");
adc_iface |= 0x01;
break;
case AUDIO_HAL_I2S_DSP:
- if (I2S_DSP_MODE)
- {
- ESP_LOGD (TAG, "ES7210 in DSP-A Format");
- adc_iface |= 0x13;
- }
- else
- {
- ESP_LOGD (TAG, "ES7210 in DSP-B Format");
- adc_iface |= 0x03;
- }
+ if (I2S_DSP_MODE) {
+ ESP_LOGD(TAG, "ES7210 in DSP-A Format");
+ adc_iface |= 0x13;
+ } else {
+ ESP_LOGD(TAG, "ES7210 in DSP-B Format");
+ adc_iface |= 0x03;
+ }
break;
default:
adc_iface &= 0xfc;
break;
- }
- ret |= es7210_write_reg (ES7210_SDP_INTERFACE1_REG11, adc_iface);
+ }
+ ret |= es7210_write_reg(ES7210_SDP_INTERFACE1_REG11, adc_iface);
+ ESP_LOGI(TAG, "config fmt %X", adc_iface);
return ret;
}
-esp_err_t
-es7210_set_bits (audio_hal_iface_bits_t bits)
-{
+esp_err_t es7210_set_bits(audio_hal_iface_bits_t bits) {
esp_err_t ret = ESP_OK;
uint8_t adc_iface = 0;
- adc_iface = es7210_read_reg (ES7210_SDP_INTERFACE1_REG11);
+ adc_iface = es7210_read_reg(ES7210_SDP_INTERFACE1_REG11);
adc_iface &= 0x1f;
- switch (bits)
- {
+ switch (bits) {
case AUDIO_HAL_BIT_LENGTH_16BITS:
adc_iface |= 0x60;
break;
@@ -446,169 +438,132 @@ es7210_set_bits (audio_hal_iface_bits_t bits)
default:
adc_iface |= 0x60;
break;
- }
- ret |= es7210_write_reg (ES7210_SDP_INTERFACE1_REG11, adc_iface);
+ }
+ ret |= es7210_write_reg(ES7210_SDP_INTERFACE1_REG11, adc_iface);
return ret;
}
-esp_err_t
-es7210_adc_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es7210_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
esp_err_t ret = ESP_OK;
- ret |= es7210_set_bits (iface->bits);
- ret |= es7210_config_fmt (iface->fmt);
- ret |= es7210_config_sample (iface->samples);
+ ret |= es7210_set_bits(iface->bits);
+ ret |= es7210_config_fmt(iface->fmt);
+ ret |= es7210_config_sample(iface->samples);
return ret;
}
-esp_err_t
-es7210_start (uint8_t clock_reg_value)
-{
+esp_err_t es7210_start(uint8_t clock_reg_value) {
esp_err_t ret = ESP_OK;
- ret |= es7210_write_reg (ES7210_CLOCK_OFF_REG01, clock_reg_value);
- ret |= es7210_write_reg (ES7210_POWER_DOWN_REG06, 0x00);
- ret |= es7210_write_reg (ES7210_ANALOG_REG40, 0x43);
- ret |= es7210_write_reg (ES7210_MIC1_POWER_REG47, 0x00);
- ret |= es7210_write_reg (ES7210_MIC2_POWER_REG48, 0x00);
- ret |= es7210_write_reg (ES7210_MIC3_POWER_REG49, 0x00);
- ret |= es7210_write_reg (ES7210_MIC4_POWER_REG4A, 0x00);
- ret |= es7210_mic_select (mic_select);
+ ret |= es7210_write_reg(ES7210_CLOCK_OFF_REG01, clock_reg_value);
+ ret |= es7210_write_reg(ES7210_POWER_DOWN_REG06, 0x00);
+ ret |= es7210_write_reg(ES7210_ANALOG_REG40, 0x43);
+ ret |= es7210_write_reg(ES7210_MIC1_POWER_REG47, 0x08);
+ ret |= es7210_write_reg(ES7210_MIC2_POWER_REG48, 0x08);
+ ret |= es7210_write_reg(ES7210_MIC3_POWER_REG49, 0x08);
+ ret |= es7210_write_reg(ES7210_MIC4_POWER_REG4A, 0x08);
+ ret |= es7210_mic_select(es7210_handle.mic_select);
return ret;
}
-esp_err_t
-es7210_stop (void)
-{
+esp_err_t es7210_stop(void) {
esp_err_t ret = ESP_OK;
- ret |= es7210_write_reg (ES7210_MIC1_POWER_REG47, 0xff);
- ret |= es7210_write_reg (ES7210_MIC2_POWER_REG48, 0xff);
- ret |= es7210_write_reg (ES7210_MIC3_POWER_REG49, 0xff);
- ret |= es7210_write_reg (ES7210_MIC4_POWER_REG4A, 0xff);
- ret |= es7210_write_reg (ES7210_MIC12_POWER_REG4B, 0xff);
- ret |= es7210_write_reg (ES7210_MIC34_POWER_REG4C, 0xff);
- ret |= es7210_write_reg (ES7210_ANALOG_REG40, 0xc0);
- ret |= es7210_write_reg (ES7210_CLOCK_OFF_REG01, 0x7f);
- ret |= es7210_write_reg (ES7210_POWER_DOWN_REG06, 0x07);
+ ret |= es7210_write_reg(ES7210_MIC1_POWER_REG47, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC2_POWER_REG48, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC3_POWER_REG49, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC4_POWER_REG4A, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC12_POWER_REG4B, 0xff);
+ ret |= es7210_write_reg(ES7210_MIC34_POWER_REG4C, 0xff);
+ ret |= es7210_write_reg(ES7210_ANALOG_REG40, 0xc0);
+ ret |= es7210_write_reg(ES7210_CLOCK_OFF_REG01, 0x7f);
+ ret |= es7210_write_reg(ES7210_POWER_DOWN_REG06, 0x07);
return ret;
}
-esp_err_t
-es7210_adc_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state)
-{
+esp_err_t es7210_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
static uint8_t regv;
esp_err_t ret = ESP_OK;
- ESP_LOGW (TAG, "ES7210 only supports ADC mode");
- ret = es7210_read_reg (ES7210_CLOCK_OFF_REG01);
- if ((ret != 0x7f) && (ret != 0xff))
- {
- regv = es7210_read_reg (ES7210_CLOCK_OFF_REG01);
- }
- if (ctrl_state == AUDIO_HAL_CTRL_START)
- {
- ESP_LOGI (TAG, "The ES7210_CLOCK_OFF_REG01 value before stop is %x",
- regv);
- ret |= es7210_start (regv);
- }
- else
- {
- ESP_LOGW (TAG, "The codec is about to stop");
- regv = es7210_read_reg (ES7210_CLOCK_OFF_REG01);
- ret |= es7210_stop ();
- }
+ ESP_LOGW(TAG, "ES7210 only supports ADC mode");
+ ret = es7210_read_reg(ES7210_CLOCK_OFF_REG01);
+ if ((ret != 0x7f) && (ret != 0xff)) {
+ regv = es7210_read_reg(ES7210_CLOCK_OFF_REG01);
+ }
+ if (ctrl_state == AUDIO_HAL_CTRL_START) {
+ ESP_LOGI(TAG, "The ES7210_CLOCK_OFF_REG01 value before stop is %x", regv);
+ ret |= es7210_start(regv);
+ } else {
+ ESP_LOGW(TAG, "The codec is about to stop");
+ regv = es7210_read_reg(ES7210_CLOCK_OFF_REG01);
+ ret |= es7210_stop();
+ }
return ret;
}
-esp_err_t
-es7210_adc_set_gain (es7210_gain_value_t gain)
-{
+esp_err_t es7210_adc_set_gain(es7210_gain_value_t gain) {
esp_err_t ret = ESP_OK;
uint32_t max_gain_vaule = 14;
- if (gain < 0)
- {
- gain = 0;
- }
- else if (gain > max_gain_vaule)
- {
- gain = max_gain_vaule;
- }
- ESP_LOGD (TAG, "SET: gain:%d", gain);
- if (mic_select & ES7210_INPUT_MIC1)
- {
- ret |= es7210_update_reg_bit (ES7210_MIC1_GAIN_REG43, 0x0f, gain);
- }
- if (mic_select & ES7210_INPUT_MIC2)
- {
- ret |= es7210_update_reg_bit (ES7210_MIC2_GAIN_REG44, 0x0f, gain);
- }
- if (mic_select & ES7210_INPUT_MIC3)
- {
- ret |= es7210_update_reg_bit (ES7210_MIC3_GAIN_REG45, 0x0f, gain);
- }
- if (mic_select & ES7210_INPUT_MIC4)
- {
- ret |= es7210_update_reg_bit (ES7210_MIC4_GAIN_REG46, 0x0f, gain);
- }
+ if (gain < 0) {
+ gain = 0;
+ } else if (gain > max_gain_vaule) {
+ gain = max_gain_vaule;
+ }
+ ESP_LOGD(TAG, "SET: gain:%d", gain);
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC1) {
+ ret |= es7210_update_reg_bit(ES7210_MIC1_GAIN_REG43, 0x0f, gain);
+ }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC2) {
+ ret |= es7210_update_reg_bit(ES7210_MIC2_GAIN_REG44, 0x0f, gain);
+ }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC3) {
+ ret |= es7210_update_reg_bit(ES7210_MIC3_GAIN_REG45, 0x0f, gain);
+ }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC4) {
+ ret |= es7210_update_reg_bit(ES7210_MIC4_GAIN_REG46, 0x0f, gain);
+ }
+ es7210_handle.gain = gain;
return ret;
}
-esp_err_t
-es7210_adc_get_gain (void)
-{
+esp_err_t es7210_adc_get_gain(void) {
int regv = 0;
uint8_t gain_value;
- if (mic_select & ES7210_INPUT_MIC1)
- {
- regv = es7210_read_reg (ES7210_MIC1_GAIN_REG43);
- }
- else if (mic_select & ES7210_INPUT_MIC2)
- {
- regv = es7210_read_reg (ES7210_MIC2_GAIN_REG44);
- }
- else if (mic_select & ES7210_INPUT_MIC3)
- {
- regv = es7210_read_reg (ES7210_MIC3_GAIN_REG45);
- }
- else if (mic_select & ES7210_INPUT_MIC4)
- {
- regv = es7210_read_reg (ES7210_MIC4_GAIN_REG46);
- }
- else
- {
- ESP_LOGE (TAG, "No MIC selected");
- return ESP_FAIL;
- }
- if (regv == ESP_FAIL)
- {
- return regv;
- }
+ if (es7210_handle.mic_select & ES7210_INPUT_MIC1) {
+ regv = es7210_read_reg(ES7210_MIC1_GAIN_REG43);
+ } else if (es7210_handle.mic_select & ES7210_INPUT_MIC2) {
+ regv = es7210_read_reg(ES7210_MIC2_GAIN_REG44);
+ } else if (es7210_handle.mic_select & ES7210_INPUT_MIC3) {
+ regv = es7210_read_reg(ES7210_MIC3_GAIN_REG45);
+ } else if (es7210_handle.mic_select & ES7210_INPUT_MIC4) {
+ regv = es7210_read_reg(ES7210_MIC4_GAIN_REG46);
+ } else {
+ ESP_LOGE(TAG, "No MIC selected");
+ return ESP_FAIL;
+ }
+ if (regv == ESP_FAIL) {
+ return regv;
+ }
gain_value = (regv & 0x0f); /* Retain the last four bits for gain */
- ESP_LOGI (TAG, "GET: gain_value:%d", gain_value);
+ ESP_LOGI(TAG, "GET: gain_value:%d", gain_value);
return gain_value;
}
-esp_err_t
-es7210_adc_set_volume (int volume)
-{
- esp_err_t ret = ESP_OK;
- ESP_LOGD (TAG, "ADC can adjust gain");
+esp_err_t es7210_adc_set_volume(int volume) {
+ ESP_LOGD(TAG, "ADC can adjust gain");
+ if (volume > GAIN_37_5DB) {
+ volume = GAIN_37_5DB;
+ }
+ esp_err_t ret = es7210_adc_set_gain(volume);
return ret;
}
-esp_err_t
-es7210_set_mute (bool enable)
-{
- ESP_LOGD (TAG, "ES7210 SetMute :%d", enable);
+esp_err_t es7210_set_mute(bool enable) {
+ ESP_LOGD(TAG, "ES7210 SetMute :%d", enable);
return ESP_OK;
}
-void
-es7210_read_all (void)
-{
- for (int i = 0; i <= 0x4E; i++)
- {
- uint8_t reg = es7210_read_reg (i);
- ets_printf ("REG:%02x, %02x\n", reg, i);
- }
+void es7210_read_all(void) {
+ for (int i = 0; i <= 0x4E; i++) {
+ uint8_t reg = es7210_read_reg(i);
+ ESP_LOGI(TAG, "REG:%02x, %02x", reg, i);
+ }
}
diff --git a/components/audio_hal/driver/es7210/es7210.h b/components/audio_hal/driver/es7210/es7210.h
index 0721429..639785d 100644
--- a/components/audio_hal/driver/es7210/es7210.h
+++ b/components/audio_hal/driver/es7210/es7210.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,8 +30,7 @@
#include "audio_hal.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#define ES7210_RESET_REG00 0x00 /* Reset control */
@@ -67,165 +66,162 @@ extern "C"
#define ES7210_MIC12_POWER_REG4B 0x4B /* MICBias & ADC & PGA Power */
#define ES7210_MIC34_POWER_REG4C 0x4C
- typedef enum
- {
- ES7210_AD1_AD0_00 = 0x80,
- ES7210_AD1_AD0_01 = 0x82,
- ES7210_AD1_AD0_10 = 0x84,
- ES7210_AD1_AD0_11 = 0x86
- } es7210_address_t;
+typedef enum {
+ ES7210_AD1_AD0_00 = 0x80,
+ ES7210_AD1_AD0_01 = 0x82,
+ ES7210_AD1_AD0_10 = 0x84,
+ ES7210_AD1_AD0_11 = 0x86
+} es7210_address_t;
- typedef enum
- {
- ES7210_INPUT_MIC1 = 0x01,
- ES7210_INPUT_MIC2 = 0x02,
- ES7210_INPUT_MIC3 = 0x04,
- ES7210_INPUT_MIC4 = 0x08
- } es7210_input_mics_t;
+typedef enum {
+ ES7210_INPUT_MIC1 = 0x01,
+ ES7210_INPUT_MIC2 = 0x02,
+ ES7210_INPUT_MIC3 = 0x04,
+ ES7210_INPUT_MIC4 = 0x08
+} es7210_input_mics_t;
- typedef enum gain_value
- {
- GAIN_0DB = 0,
- GAIN_3DB,
- GAIN_6DB,
- GAIN_9DB,
- GAIN_12DB,
- GAIN_15DB,
- GAIN_18DB,
- GAIN_21DB,
- GAIN_24DB,
- GAIN_27DB,
- GAIN_30DB,
- GAIN_33DB,
- GAIN_34_5DB,
- GAIN_36DB,
- GAIN_37_5DB,
- } es7210_gain_value_t;
+typedef enum gain_value {
+ GAIN_0DB = 0,
+ GAIN_3DB,
+ GAIN_6DB,
+ GAIN_9DB,
+ GAIN_12DB,
+ GAIN_15DB,
+ GAIN_18DB,
+ GAIN_21DB,
+ GAIN_24DB,
+ GAIN_27DB,
+ GAIN_30DB,
+ GAIN_33DB,
+ GAIN_34_5DB,
+ GAIN_36DB,
+ GAIN_37_5DB,
+} es7210_gain_value_t;
- /*
- * @brief Initialize ES7210 ADC chip
- *
- * @param[in] codec_cfg: configuration of ES7210
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7210_adc_init (audio_hal_codec_config_t *codec_cfg);
+/*
+ * @brief Initialize ES7210 ADC chip
+ *
+ * @param[in] codec_cfg: configuration of ES7210
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7210_adc_init(audio_hal_codec_config_t *codec_cfg);
- /**
- * @brief Deinitialize ES7210 ADC chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7210_adc_deinit ();
+/**
+ * @brief Deinitialize ES7210 ADC chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7210_adc_deinit();
- /**
- * @brief Configure ES7210 ADC mode and I2S interface
- *
- * @param[in] mode: codec mode
- * @param[in] iface: I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7210_adc_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Configure ES7210 ADC mode and I2S interface
+ *
+ * @param[in] mode: codec mode
+ * @param[in] iface: I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7210_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Control ES7210 ADC chip
- *
- * @param[in] mode: codec mode
- * @param[in] ctrl_state: start or stop progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7210_adc_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Control ES7210 ADC chip
+ *
+ * @param[in] mode: codec mode
+ * @param[in] ctrl_state: start or stop progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7210_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Set gain (Note: the enabled microphone sets the same gain)
- *
- * @param[in] gain: gain
- *
- * gain : value
- * GAIN_0DB : 1
- * GAIN_3DB : 2
- * GAIN_6DB : 3
- * ·
- * ·
- * ·
- * GAIN_30DB : 10
- * GAIN_33DB : 11
- * GAIN_34_5DB : 12
- * GAIN_36DB : 13
- * GAIN_37_5DB : 14
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7210_adc_set_gain (es7210_gain_value_t gain);
+/**
+ * @brief Set gain (Note: the enabled microphone sets the same gain)
+ *
+ * @param[in] gain: gain
+ *
+ * gain : value
+ * GAIN_0DB : 1
+ * GAIN_3DB : 2
+ * GAIN_6DB : 3
+ * ·
+ * ·
+ * ·
+ * GAIN_30DB : 10
+ * GAIN_33DB : 11
+ * GAIN_34_5DB : 12
+ * GAIN_36DB : 13
+ * GAIN_37_5DB : 14
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7210_adc_set_gain(es7210_gain_value_t gain);
- /**
- * @brief Get gain
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7210_adc_get_gain (void);
+/**
+ * @brief Get gain
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7210_adc_get_gain(void);
- /**
- * @brief Set volume
- *
- * @param[in] volume: volume
- *
- * @return
- * - ESP_OK
- */
- esp_err_t es7210_adc_set_volume (int volume);
+/**
+ * @brief Set volume
+ *
+ * @param[in] volume: volume
+ *
+ * @return
+ * - ESP_OK
+ */
+esp_err_t es7210_adc_set_volume(int volume);
- /**
- * @brief Set ES7210 ADC mute status
- *
- * @return
- * - ESP_FAIL
- * - ESP_OK
- */
- esp_err_t es7210_set_mute (bool enable);
+/**
+ * @brief Set ES7210 ADC mute status
+ *
+ * @return
+ * - ESP_FAIL
+ * - ESP_OK
+ */
+esp_err_t es7210_set_mute(bool enable);
- /**
- * @brief Select ES7210 mic
- *
- * @param[in] mic: mics
- *
- * @return
- * - ESP_FAIL
- * - ESP_OK
- */
- esp_err_t es7210_mic_select (es7210_input_mics_t mic);
+/**
+ * @brief Select ES7210 mic
+ *
+ * @param[in] mic: mics
+ *
+ * @return
+ * - ESP_FAIL
+ * - ESP_OK
+ */
+esp_err_t es7210_mic_select(es7210_input_mics_t mic);
- /**
- * @brief Read regs of ES7210
- *
- * @param[in] reg_addr: reg_addr
- *
- * @return
- * - ESP_FAIL
- * - ESP_OK
- */
- int es7210_read_reg (uint8_t reg_addr);
+/**
+ * @brief Read regs of ES7210
+ *
+ * @param[in] reg_addr: reg_addr
+ *
+ * @return
+ * - ESP_FAIL
+ * - ESP_OK
+ */
+int es7210_read_reg(uint8_t reg_addr);
- /**
- * @brief Read all regs of ES7210
- */
- void es7210_read_all (void);
+/**
+ * @brief Read all regs of ES7210
+ */
+void es7210_read_all(void);
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/es7243/es7243.c b/components/audio_hal/driver/es7243/es7243.c
index e51f2a0..6e59ece 100644
--- a/components/audio_hal/driver/es7243/es7243.c
+++ b/components/audio_hal/driver/es7243/es7243.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,193 +18,165 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es7243.h"
+
+#include
+
#include "board.h"
#include "esp_log.h"
#include "i2c_bus.h"
-#include
#define MCLK_PULSES_NUMBER (20)
-#define ES_ASSERT(a, format, b, ...) \
- if ((a) != 0) \
- { \
- ESP_LOGE (TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define ES_ASSERT(a, format, b, ...) \
+ if ((a) != 0) { \
+ ESP_LOGE(TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
static char *TAG = "DRV7243";
static i2c_bus_handle_t i2c_handle;
static int es7243_addr = 0x26;
audio_hal_func_t AUDIO_CODEC_ES7243_DEFAULT_HANDLE = {
- .audio_codec_initialize = es7243_adc_init,
- .audio_codec_deinitialize = es7243_adc_deinit,
- .audio_codec_ctrl = es7243_adc_ctrl_state,
- .audio_codec_config_iface = es7243_adc_config_i2s,
- .audio_codec_set_mute = es7243_adc_set_voice_mute,
- .audio_codec_set_volume = es7243_adc_set_voice_volume,
- .audio_codec_get_volume = es7243_adc_get_voice_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es7243_adc_init,
+ .audio_codec_deinitialize = es7243_adc_deinit,
+ .audio_codec_ctrl = es7243_adc_ctrl_state,
+ .audio_codec_config_iface = es7243_adc_config_i2s,
+ .audio_codec_set_mute = es7243_adc_set_voice_mute,
+ .audio_codec_set_volume = es7243_adc_set_voice_volume,
+ .audio_codec_get_volume = es7243_adc_get_voice_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
-static esp_err_t
-es7243_write_reg (uint8_t reg_add, uint8_t data)
-{
- return i2c_bus_write_bytes (i2c_handle, es7243_addr, ®_add,
- sizeof (reg_add), &data, sizeof (data));
+static esp_err_t es7243_write_reg(uint8_t reg_add, uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, es7243_addr, ®_add, sizeof(reg_add),
+ &data, sizeof(data));
}
-static int
-i2c_init ()
-{
+static int i2c_init() {
int res = 0;
i2c_config_t es_i2c_cfg = {
- .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000,
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
};
- res = get_i2c_pins (I2C_NUM_0, &es_i2c_cfg);
- ES_ASSERT (res, "getting i2c pins error", -1);
- i2c_handle = i2c_bus_create (I2C_NUM_0, &es_i2c_cfg);
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ ES_ASSERT(res, "getting i2c pins error", -1);
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
return res;
}
-esp_err_t
-es7243_adc_set_addr (int addr)
-{
+esp_err_t es7243_adc_set_addr(int addr) {
es7243_addr = addr;
return ESP_OK;
}
-static esp_err_t
-es7243_mclk_active (uint8_t mclk_gpio)
-{
- gpio_pad_select_gpio (mclk_gpio);
- gpio_set_direction (mclk_gpio, GPIO_MODE_OUTPUT);
+static esp_err_t es7243_mclk_active(uint8_t mclk_gpio) {
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
+ esp_rom_gpio_pad_select_gpio(mclk_gpio);
+#else
+ gpio_pad_select_gpio(mclk_gpio);
+#endif
+ gpio_set_direction(mclk_gpio, GPIO_MODE_OUTPUT);
/*
Before initializing es7243, it is necessary to output
mclk to es7243 to activate the I2C configuration.
So give some clocks to active es7243.
*/
- for (int i = 0; i < MCLK_PULSES_NUMBER; ++i)
- {
- gpio_set_level (mclk_gpio, 0);
- vTaskDelay (1 / portTICK_PERIOD_MS);
- gpio_set_level (mclk_gpio, 1);
- vTaskDelay (1 / portTICK_PERIOD_MS);
- }
+ for (int i = 0; i < MCLK_PULSES_NUMBER; ++i) {
+ gpio_set_level(mclk_gpio, 0);
+ vTaskDelay(1 / portTICK_PERIOD_MS);
+ gpio_set_level(mclk_gpio, 1);
+ vTaskDelay(1 / portTICK_PERIOD_MS);
+ }
return ESP_OK;
}
-esp_err_t
-es7243_adc_init (audio_hal_codec_config_t *codec_cfg)
-{
+esp_err_t es7243_adc_init(audio_hal_codec_config_t *codec_cfg) {
esp_err_t ret = ESP_OK;
- es7243_mclk_active (get_es7243_mclk_gpio ());
- i2c_init ();
- ret |= es7243_write_reg (0x00, 0x01);
- ret |= es7243_write_reg (0x06, 0x00);
- ret |= es7243_write_reg (0x05, 0x1B);
- ret |= es7243_write_reg (0x01, 0x0C);
- ret |= es7243_write_reg (0x08, 0x43);
- ret |= es7243_write_reg (0x05, 0x13);
- if (ret)
- {
- ESP_LOGE (TAG, "Es7243 initialize failed!");
- return ESP_FAIL;
- }
+ es7243_mclk_active(get_es7243_mclk_gpio());
+ i2c_init();
+ ret |= es7243_write_reg(0x00, 0x01);
+ ret |= es7243_write_reg(0x06, 0x00);
+ ret |= es7243_write_reg(0x05, 0x1B);
+ ret |= es7243_write_reg(0x01, 0x0C);
+ ret |= es7243_write_reg(0x08, 0x43);
+ ret |= es7243_write_reg(0x05, 0x13);
+ if (ret) {
+ ESP_LOGE(TAG, "Es7243 initialize failed!");
+ return ESP_FAIL;
+ }
return ret;
}
-esp_err_t
-es7243_adc_deinit (void)
-{
+esp_err_t es7243_adc_deinit(void) { return ESP_OK; }
+
+esp_err_t es7243_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
return ESP_OK;
}
-esp_err_t
-es7243_adc_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state)
-{
+esp_err_t es7243_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
return ESP_OK;
}
-esp_err_t
-es7243_adc_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es7243_adc_set_voice_mute(bool mute) {
+ ESP_LOGI(TAG, "Enter into es7243_mute(), mute = %d\n", mute);
+ if (mute) {
+ es7243_write_reg(0x05, 0x1B);
+ } else {
+ es7243_write_reg(0x05, 0x13);
+ }
return ESP_OK;
}
-esp_err_t
-es7243_adc_set_voice_mute (bool mute)
-{
- ESP_LOGI (TAG, "Enter into es7243_mute(), mute = %d\n", mute);
- if (mute)
- {
- es7243_write_reg (0x05, 0x1B);
- }
- else
- {
- es7243_write_reg (0x05, 0x13);
- }
- return ESP_OK;
-}
-
-esp_err_t
-es7243_adc_set_voice_volume (int volume)
-{
+esp_err_t es7243_adc_set_voice_volume(int volume) {
esp_err_t ret = ESP_OK;
- if (volume > 100)
- {
- volume = 100;
- }
- if (volume < 0)
- {
- volume = 0;
- }
- switch (volume)
- {
+ if (volume > 100) {
+ volume = 100;
+ }
+ if (volume < 0) {
+ volume = 0;
+ }
+ switch (volume) {
case 0 ... 12:
- ret |= es7243_write_reg (0x08, 0x11); // 1db
+ ret |= es7243_write_reg(0x08, 0x11); // 1db
break;
case 13 ... 25:
- ret |= es7243_write_reg (0x08, 0x13); // 3.5db
+ ret |= es7243_write_reg(0x08, 0x13); // 3.5db
break;
case 26 ... 38:
- ret |= es7243_write_reg (0x08, 0x21); // 18db
+ ret |= es7243_write_reg(0x08, 0x21); // 18db
break;
case 39 ... 51:
- ret |= es7243_write_reg (0x08, 0x23); // 20.5db
+ ret |= es7243_write_reg(0x08, 0x23); // 20.5db
break;
case 52 ... 65:
- ret |= es7243_write_reg (0x08, 0x06); // 22.5db
+ ret |= es7243_write_reg(0x08, 0x06); // 22.5db
break;
case 66 ... 80:
- ret |= es7243_write_reg (0x08, 0x41); // 24.5db
+ ret |= es7243_write_reg(0x08, 0x41); // 24.5db
break;
case 81 ... 90:
- ret |= es7243_write_reg (0x08, 0x07); // 25db
+ ret |= es7243_write_reg(0x08, 0x07); // 25db
break;
case 91 ... 100:
- ret |= es7243_write_reg (0x08, 0x43); // 27db
+ ret |= es7243_write_reg(0x08, 0x43); // 27db
break;
default:
break;
- }
+ }
return ESP_OK;
}
-esp_err_t
-es7243_adc_get_voice_volume (int *volume)
-{
- return ESP_OK;
-}
+esp_err_t es7243_adc_get_voice_volume(int *volume) { return ESP_OK; }
diff --git a/components/audio_hal/driver/es7243/es7243.h b/components/audio_hal/driver/es7243/es7243.h
index 14b820b..f52fd7f 100644
--- a/components/audio_hal/driver/es7243/es7243.h
+++ b/components/audio_hal/driver/es7243/es7243.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -31,99 +31,98 @@
#include "esp_err.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Initialize ES7243 adc chip
- *
- * @param codec_cfg configuration of ES7243
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_init (audio_hal_codec_config_t *codec_cfg);
+/**
+ * @brief Initialize ES7243 adc chip
+ *
+ * @param codec_cfg configuration of ES7243
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_init(audio_hal_codec_config_t *codec_cfg);
- /**
- * @brief Deinitialize ES7243 adc chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_deinit (void);
+/**
+ * @brief Deinitialize ES7243 adc chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_deinit(void);
- /**
- * @brief Control ES7243 adc chip
- *
- * @param mode adc mode
- * @param ctrl_state start or stop decode or encode progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7243_adc_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Control ES7243 adc chip
+ *
+ * @param mode adc mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7243_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Configure ES7243 adc mode and I2S interface
- *
- * @param mode codec mode
- * @param iface I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es7243_adc_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Configure ES7243 adc mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7243_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Set mute
- *
- * @param mute true, false
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_set_voice_mute (bool mute);
+/**
+ * @brief Set mute
+ *
+ * @param mute true, false
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_set_voice_mute(bool mute);
- /**
- * @brief Set adc gain
- *
- * @param volume value of gain (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_set_voice_volume (int volume);
+/**
+ * @brief Set adc gain
+ *
+ * @param volume value of gain (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_set_voice_volume(int volume);
- /**
- * @brief Get adc gain
- *
- * @param[out] *volume: value of gain (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_get_voice_volume (int *volume);
+/**
+ * @brief Get adc gain
+ *
+ * @param[out] *volume: value of gain (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_get_voice_volume(int *volume);
- /**
- * @brief Set adc I2C address
- *
- * @param[in] addr: value of I2C address
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es7243_adc_set_addr (int addr);
+/**
+ * @brief Set adc I2C address
+ *
+ * @param[in] addr: value of I2C address
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243_adc_set_addr(int addr);
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/es7243e/es7243e.c b/components/audio_hal/driver/es7243e/es7243e.c
new file mode 100644
index 0000000..ca83fbb
--- /dev/null
+++ b/components/audio_hal/driver/es7243e/es7243e.c
@@ -0,0 +1,167 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "es7243e.h"
+
+#include "board.h"
+#include "esp_log.h"
+#include "i2c_bus.h"
+
+static char *TAG = "DRV7243E";
+static i2c_bus_handle_t i2c_handle;
+static int es7243e_addr = 0x20;
+
+audio_hal_func_t AUDIO_CODEC_ES7243E_DEFAULT_HANDLE = {
+ .audio_codec_initialize = es7243e_adc_init,
+ .audio_codec_deinitialize = es7243e_adc_deinit,
+ .audio_codec_ctrl = es7243e_adc_ctrl_state,
+ .audio_codec_config_iface = es7243e_adc_config_i2s,
+ .audio_codec_set_mute = NULL,
+ .audio_codec_set_volume = es7243e_adc_set_voice_volume,
+ .audio_codec_get_volume = es7243e_adc_get_voice_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
+};
+
+static esp_err_t es7243e_write_reg(uint8_t reg_add, uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, es7243e_addr, ®_add,
+ sizeof(reg_add), &data, sizeof(data));
+}
+
+static int i2c_init() {
+ int res = 0;
+ i2c_config_t es_i2c_cfg = {
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
+ };
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ if (res != ESP_OK) {
+ ESP_LOGE(TAG, "getting i2c pins error");
+ }
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
+ return res;
+}
+
+esp_err_t es7243e_adc_set_addr(int addr) {
+ es7243e_addr = addr;
+ return ESP_OK;
+}
+
+esp_err_t es7243e_adc_init(audio_hal_codec_config_t *codec_cfg) {
+ esp_err_t ret = ESP_OK;
+ i2c_init();
+ ret |= es7243e_write_reg(0x01, 0x3A);
+ ret |= es7243e_write_reg(0x00, 0x80);
+ ret |= es7243e_write_reg(0xF9, 0x00);
+ ret |= es7243e_write_reg(0x04, 0x02);
+ ret |= es7243e_write_reg(0x04, 0x01);
+ ret |= es7243e_write_reg(0xF9, 0x01);
+ ret |= es7243e_write_reg(0x00, 0x1E);
+ ret |= es7243e_write_reg(0x01, 0x00);
+
+ ret |= es7243e_write_reg(0x02, 0x00);
+ ret |= es7243e_write_reg(0x03, 0x20);
+ ret |= es7243e_write_reg(0x04, 0x01);
+ ret |= es7243e_write_reg(0x0D, 0x00);
+ ret |= es7243e_write_reg(0x05, 0x00);
+ ret |= es7243e_write_reg(0x06, 0x03); // SCLK=MCLK/4
+ ret |= es7243e_write_reg(0x07, 0x00); // LRCK=MCLK/256
+ ret |= es7243e_write_reg(0x08, 0xFF); // LRCK=MCLK/256
+
+ ret |= es7243e_write_reg(0x09, 0xCA);
+ ret |= es7243e_write_reg(0x0A, 0x85);
+ ret |= es7243e_write_reg(0x0B, 0x00);
+ ret |= es7243e_write_reg(0x0E, 0xBF);
+ ret |= es7243e_write_reg(0x0F, 0x80);
+ ret |= es7243e_write_reg(0x14, 0x0C);
+ ret |= es7243e_write_reg(0x15, 0x0C);
+ ret |= es7243e_write_reg(0x17, 0x02);
+ ret |= es7243e_write_reg(0x18, 0x26);
+ ret |= es7243e_write_reg(0x19, 0x77);
+ ret |= es7243e_write_reg(0x1A, 0xF4);
+ ret |= es7243e_write_reg(0x1B, 0x66);
+ ret |= es7243e_write_reg(0x1C, 0x44);
+ ret |= es7243e_write_reg(0x1E, 0x00);
+ ret |= es7243e_write_reg(0x1F, 0x0C);
+ ret |= es7243e_write_reg(0x20, 0x1A); // PGA gain +30dB
+ ret |= es7243e_write_reg(0x21, 0x1A); // PGA gain +30dB
+
+ ret |= es7243e_write_reg(0x00, 0x80); // Slave Mode
+ ret |= es7243e_write_reg(0x01, 0x3A);
+ ret |= es7243e_write_reg(0x16, 0x3F);
+ ret |= es7243e_write_reg(0x16, 0x00);
+ if (ret) {
+ ESP_LOGE(TAG, "Es7243e initialize failed!");
+ return ESP_FAIL;
+ }
+ return ret;
+}
+
+esp_err_t es7243e_adc_deinit(void) { return ESP_OK; }
+
+esp_err_t es7243e_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
+ esp_err_t ret = ESP_OK;
+ if (ctrl_state == AUDIO_HAL_CTRL_START) {
+ ret |= es7243e_write_reg(0xF9, 0x00);
+ ret |= es7243e_write_reg(0x04, 0x01);
+ ret |= es7243e_write_reg(0x17, 0x01);
+ ret |= es7243e_write_reg(0x20, 0x10);
+ ret |= es7243e_write_reg(0x21, 0x10);
+ ret |= es7243e_write_reg(0x00, 0x80);
+ ret |= es7243e_write_reg(0x01, 0x3A);
+ ret |= es7243e_write_reg(0x16, 0x3F);
+ ret |= es7243e_write_reg(0x16, 0x00);
+ } else {
+ ESP_LOGW(TAG, "The codec going to stop");
+ ret |= es7243e_write_reg(0x04, 0x02);
+ ret |= es7243e_write_reg(0x04, 0x01);
+ ret |= es7243e_write_reg(0xF7, 0x30);
+ ret |= es7243e_write_reg(0xF9, 0x01);
+ ret |= es7243e_write_reg(0x16, 0xFF);
+ ret |= es7243e_write_reg(0x17, 0x00);
+ ret |= es7243e_write_reg(0x01, 0x38);
+ ret |= es7243e_write_reg(0x20, 0x00);
+ ret |= es7243e_write_reg(0x21, 0x00);
+ ret |= es7243e_write_reg(0x00, 0x00);
+ ret |= es7243e_write_reg(0x00, 0x1E);
+ ret |= es7243e_write_reg(0x01, 0x30);
+ ret |= es7243e_write_reg(0x01, 0x00);
+ }
+ return ret;
+}
+
+esp_err_t es7243e_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
+ return ESP_OK;
+}
+
+esp_err_t es7243e_adc_set_voice_volume(int volume) { return ESP_OK; }
+
+esp_err_t es7243e_adc_get_voice_volume(int *volume) { return ESP_OK; }
diff --git a/components/audio_hal/driver/es7243e/es7243e.h b/components/audio_hal/driver/es7243e/es7243e.h
new file mode 100644
index 0000000..b40aadf
--- /dev/null
+++ b/components/audio_hal/driver/es7243e/es7243e.h
@@ -0,0 +1,120 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _ES7243E_H_
+#define _ES7243E_H_
+
+#include "audio_hal.h"
+#include "esp_err.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize ES7243E adc chip
+ *
+ * @param codec_cfg configuration of ES7243E
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243e_adc_init(audio_hal_codec_config_t *codec_cfg);
+
+/**
+ * @brief Deinitialize ES7243E adc chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243e_adc_deinit(void);
+
+/**
+ * @brief Control ES7243E adc chip
+ *
+ * @param mode adc mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7243e_adc_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+
+/**
+ * @brief Configure ES7243E adc mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es7243e_adc_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+
+/**
+ * @brief Set adc gain
+ *
+ * @param volume value of gain (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243e_adc_set_voice_volume(int volume);
+
+/**
+ * @brief Get adc gain
+ *
+ * @param[out] *volume: value of gain (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243e_adc_get_voice_volume(int *volume);
+
+/**
+ * @brief Set adc I2C address
+ *
+ * @param[in] addr: value of I2C address
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es7243e_adc_set_addr(int addr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_hal/driver/es8156/es8156.c b/components/audio_hal/driver/es8156/es8156.c
new file mode 100644
index 0000000..f13fe40
--- /dev/null
+++ b/components/audio_hal/driver/es8156/es8156.c
@@ -0,0 +1,248 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "es8156.h"
+
+#include "audio_volume.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "esp_log.h"
+#include "i2c_bus.h"
+#include "string.h"
+
+#define ES8156_ADDR 0x10
+
+static const char *TAG = "DRV8156";
+static bool codec_init_flag = 0;
+static i2c_bus_handle_t i2c_handle;
+static codec_dac_volume_config_t *dac_vol_handle;
+
+#define ES8156_DAC_VOL_CFG_DEFAULT() \
+ { \
+ .max_dac_volume = 32, .min_dac_volume = -95.5, \
+ .board_pa_gain = BOARD_PA_GAIN, .volume_accuracy = 0.5, \
+ .dac_vol_symbol = 1, .zero_volume_reg = 0xBF, .reg_value = 0, \
+ .user_volume = 0, .offset_conv_volume = NULL, \
+ }
+
+audio_hal_func_t AUDIO_CODEC_ES8156_DEFAULT_HANDLE = {
+ .audio_codec_initialize = es8156_codec_init,
+ .audio_codec_deinitialize = es8156_codec_deinit,
+ .audio_codec_ctrl = es8156_codec_ctrl_state,
+ .audio_codec_config_iface = es8156_codec_config_i2s,
+ .audio_codec_set_mute = es8156_codec_set_voice_mute,
+ .audio_codec_set_volume = es8156_codec_set_voice_volume,
+ .audio_codec_get_volume = es8156_codec_get_voice_volume,
+ .audio_codec_enable_pa = es8156_pa_power,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
+};
+
+static bool es8156_codec_initialized() { return codec_init_flag; }
+
+static esp_err_t es8156_write_reg(uint8_t reg_addr, uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, ES8156_ADDR, ®_addr,
+ sizeof(reg_addr), &data, sizeof(data));
+}
+
+static int es8156_read_reg(uint8_t reg_addr) {
+ uint8_t data;
+ i2c_bus_read_bytes(i2c_handle, ES8156_ADDR, ®_addr, sizeof(reg_addr),
+ &data, sizeof(data));
+ return (int)data;
+}
+
+static int i2c_init() {
+ int res = 0;
+ i2c_config_t es_i2c_cfg = {
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
+ };
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ if (res != ESP_OK) {
+ ESP_LOGE(TAG, "getting i2c pins error");
+ }
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
+ return res;
+}
+
+static esp_err_t es8156_standby(void) {
+ esp_err_t ret = 0;
+ ret = es8156_write_reg(0x14, 0x00);
+ ret |= es8156_write_reg(0x19, 0x02);
+ ret |= es8156_write_reg(0x21, 0x1F);
+ ret |= es8156_write_reg(0x22, 0x02);
+ ret |= es8156_write_reg(0x25, 0x21);
+ ret |= es8156_write_reg(0x25, 0xA1);
+ ret |= es8156_write_reg(0x18, 0x01);
+ ret |= es8156_write_reg(0x09, 0x02);
+ ret |= es8156_write_reg(0x09, 0x01);
+ ret |= es8156_write_reg(0x08, 0x00);
+ return ret;
+}
+
+static esp_err_t es8156_resume(void) {
+ esp_err_t ret = 0;
+ ret |= es8156_write_reg(0x08, 0x3F);
+ ret |= es8156_write_reg(0x09, 0x00);
+ ret |= es8156_write_reg(0x18, 0x00);
+
+ ret |= es8156_write_reg(0x25, 0x20);
+ ret |= es8156_write_reg(0x22, 0x00);
+ ret |= es8156_write_reg(0x21, 0x3C);
+ ret |= es8156_write_reg(0x19, 0x20);
+ ret |= es8156_write_reg(0x14, 179);
+ return ret;
+}
+
+esp_err_t es8156_pa_power(bool enable) {
+ esp_err_t ret = ESP_OK;
+ if (enable) {
+ ret = gpio_set_level(get_pa_enable_gpio(), 1);
+ } else {
+ ret = gpio_set_level(get_pa_enable_gpio(), 0);
+ }
+ return ret;
+}
+
+esp_err_t es8156_codec_init(audio_hal_codec_config_t *cfg) {
+ if (es8156_codec_initialized()) {
+ ESP_LOGW(TAG, "The es8156 DAC has been already initialized");
+ return ESP_OK;
+ }
+ codec_init_flag = true;
+
+ i2c_init();
+ es8156_write_reg(0x02, 0x04);
+ es8156_write_reg(0x20, 0x2A);
+ es8156_write_reg(0x21, 0x3C);
+ es8156_write_reg(0x22, 0x00);
+ es8156_write_reg(0x24, 0x07);
+ es8156_write_reg(0x23, 0x00);
+
+ es8156_write_reg(0x0A, 0x01);
+ es8156_write_reg(0x0B, 0x01);
+ es8156_write_reg(0x11, 0x00);
+ es8156_write_reg(0x14, 179); // volume 70%
+
+ es8156_write_reg(0x0D, 0x14);
+ es8156_write_reg(0x18, 0x00);
+ es8156_write_reg(0x08, 0x3F);
+ es8156_write_reg(0x00, 0x02);
+ es8156_write_reg(0x00, 0x03);
+ es8156_write_reg(0x25, 0x20);
+
+ gpio_config_t io_conf;
+ memset(&io_conf, 0, sizeof(io_conf));
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = BIT64(get_pa_enable_gpio());
+ io_conf.pull_down_en = 0;
+ io_conf.pull_up_en = 0;
+ gpio_config(&io_conf);
+ es8156_pa_power(true);
+
+ codec_dac_volume_config_t vol_cfg = ES8156_DAC_VOL_CFG_DEFAULT();
+ dac_vol_handle = audio_codec_volume_init(&vol_cfg);
+ return ESP_OK;
+}
+
+esp_err_t es8156_codec_deinit(void) {
+ codec_init_flag = false;
+ audio_codec_volume_deinit(dac_vol_handle);
+ return ESP_OK;
+}
+
+esp_err_t es8156_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
+ esp_err_t ret = ESP_OK;
+ if (ctrl_state == AUDIO_HAL_CTRL_START) {
+ ret = es8156_resume();
+ } else {
+ ESP_LOGW(TAG, "The codec going to stop");
+ ret = es8156_standby();
+ }
+ return ret;
+}
+
+esp_err_t es8156_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
+ return ESP_OK;
+}
+
+esp_err_t es8156_codec_set_voice_mute(bool enable) {
+ int regv = es8156_read_reg(ES8156_DAC_MUTE_REG13);
+ if (enable) {
+ regv = regv | BIT(1) | BIT(2);
+ } else {
+ regv = regv & (~(BIT(1) | BIT(2)));
+ }
+ es8156_write_reg(ES8156_DAC_MUTE_REG13, regv);
+ return ESP_OK;
+}
+
+/**
+ * @brief Set voice volume
+ *
+ * @note Register values. 0x00: -95.5 dB, 0x5B: -50 dB, 0xBF: 0 dB, 0xFF: 32 dB
+ * @note Accuracy of gain is 0.5 dB
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8156_codec_set_voice_volume(int volume) {
+ int ret = 0;
+ uint8_t reg = 0;
+ reg = audio_codec_get_dac_reg_value(dac_vol_handle, volume);
+ ret = es8156_write_reg(ES8156_VOLUME_CONTROL_REG14, reg);
+ ESP_LOGD(TAG, "Set volume:%.2d reg_value:0x%.2x dB:%.1f",
+ dac_vol_handle->user_volume, reg,
+ audio_codec_cal_dac_volume(dac_vol_handle));
+ return ret;
+}
+
+esp_err_t es8156_codec_get_voice_volume(int *volume) {
+ int ret = 0;
+ int regv = 0;
+ *volume = 0;
+ regv = es8156_read_reg(ES8156_VOLUME_CONTROL_REG14);
+ if (regv == ESP_FAIL) {
+ ret = ESP_FAIL;
+ } else {
+ if (regv == dac_vol_handle->reg_value) {
+ *volume = dac_vol_handle->user_volume;
+ } else {
+ *volume = 0;
+ ret = ESP_FAIL;
+ }
+ }
+ ESP_LOGD(TAG, "Get volume:%.2d reg_value:0x%.2x", *volume, regv);
+ return ret;
+}
diff --git a/components/audio_hal/driver/es8156/es8156.h b/components/audio_hal/driver/es8156/es8156.h
new file mode 100644
index 0000000..dfd61de
--- /dev/null
+++ b/components/audio_hal/driver/es8156/es8156.h
@@ -0,0 +1,190 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _ES8156_H
+#define _ES8156_H
+
+#include "audio_hal.h"
+#include "esp_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ES8156 register space */
+/*
+ * RESET Control
+ */
+#define ES8156_RESET_REG00 0x00
+/*
+ * Clock Managerment
+ */
+#define ES8156_MAINCLOCK_CTL_REG01 0x01
+#define ES8156_SCLK_MODE_REG02 0x02
+#define ES8156_LRCLK_DIV_H_REG03 0x03
+#define ES8156_LRCLK_DIV_L_REG04 0x04
+#define ES8156_SCLK_DIV_REG05 0x05
+#define ES8156_NFS_CONFIG_REG06 0x06
+#define ES8156_MISC_CONTROL1_REG07 0x07
+#define ES8156_CLOCK_ON_OFF_REG08 0x08
+#define ES8156_MISC_CONTROL2_REG09 0x09
+#define ES8156_TIME_CONTROL1_REG0A 0x0a
+#define ES8156_TIME_CONTROL2_REG0B 0x0b
+/*
+ * System Control
+ */
+#define ES8156_CHIP_STATUS_REG0C 0x0c
+#define ES8156_P2S_CONTROL_REG0D 0x0d
+#define ES8156_DAC_OSR_COUNTER_REG10 0x10
+/*
+ * SDP Control
+ */
+#define ES8156_DAC_SDP_REG11 0x11
+#define ES8156_AUTOMUTE_SET_REG12 0x12
+#define ES8156_DAC_MUTE_REG13 0x13
+#define ES8156_VOLUME_CONTROL_REG14 0x14
+
+/*
+ * ALC Control
+ */
+#define ES8156_ALC_CONFIG1_REG15 0x15
+#define ES8156_ALC_CONFIG2_REG16 0x16
+#define ES8156_ALC_CONFIG3_REG17 0x17
+#define ES8156_MISC_CONTROL3_REG18 0x18
+#define ES8156_EQ_CONTROL1_REG19 0x19
+#define ES8156_EQ_CONTROL2_REG1A 0x1a
+/*
+ * Analog System Control
+ */
+#define ES8156_ANALOG_SYS1_REG20 0x20
+#define ES8156_ANALOG_SYS2_REG21 0x21
+#define ES8156_ANALOG_SYS3_REG22 0x22
+#define ES8156_ANALOG_SYS4_REG23 0x23
+#define ES8156_ANALOG_LP_REG24 0x24
+#define ES8156_ANALOG_SYS5_REG25 0x25
+/*
+ * Chip Information
+ */
+#define ES8156_I2C_PAGESEL_REGFC 0xFC
+#define ES8156_CHIPID1_REGFD 0xFD
+#define ES8156_CHIPID0_REGFE 0xFE
+#define ES8156_CHIP_VERSION_REGFF 0xFF
+
+/*
+ * @brief Enables or disables PA
+ *
+ * @param enable true/false
+ *
+ * @return
+ * - ESP_ERR_INVALID_ARG
+ * - ESP_OK
+ */
+esp_err_t es8156_pa_power(bool enable);
+
+/*
+ * @brief Initialize ES8156 codec chip
+ *
+ * @param codec_cfg configuration of ES8156
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8156_codec_init(audio_hal_codec_config_t *codec_cfg);
+
+/**
+ * @brief Deinitialize ES8156 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8156_codec_deinit(void);
+
+/**
+ * @brief Control ES8156 codec chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8156_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+
+/**
+ * @brief Configure ES8156 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8156_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+
+/**
+ * @brief Configure ES8156 DAC mute or not. Basically you can use this function
+ * to mute the output or unmute
+ *
+ * @param enable enable(1) or disable(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8156_codec_set_voice_mute(bool enable);
+
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8156_codec_set_voice_volume(int volume);
+
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8156_codec_get_voice_volume(int *volume);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/components/audio_hal/driver/es8311/es8311.c b/components/audio_hal/driver/es8311/es8311.c
index c543e9e..8219509 100644
--- a/components/audio_hal/driver/es8311/es8311.c
+++ b/components/audio_hal/driver/es8311/es8311.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,17 +18,20 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es8311.h"
+
+#include
+
+#include "audio_volume.h"
#include "board.h"
#include "esp_log.h"
#include "i2c_bus.h"
-#include
/* ES8311 address
* 0x32:CE=1;0x30:CE=0
@@ -44,35 +47,44 @@
/*
* to define whether to reverse the clock
*/
-#define INVERT_MCLK 0 // do not invert
+#define INVERT_MCLK 0 // do not invert
#define INVERT_SCLK 0
-#define IS_DMIC 0 // Is it a digital microphone
+#define IS_DMIC 0 // Is it a digital microphone
#define MCLK_DIV_FRE 256
static i2c_bus_handle_t i2c_handle;
+static codec_dac_volume_config_t *dac_vol_handle;
+
+#define ES8311_DAC_VOL_CFG_DEFAULT() \
+ { \
+ .max_dac_volume = 32, .min_dac_volume = -95.5, \
+ .board_pa_gain = BOARD_PA_GAIN, .volume_accuracy = 0.5, \
+ .dac_vol_symbol = 1, .zero_volume_reg = 0xBF, .reg_value = 0, \
+ .user_volume = 0, .offset_conv_volume = NULL, \
+ }
/*
* operate function of codec
*/
audio_hal_func_t AUDIO_CODEC_ES8311_DEFAULT_HANDLE = {
- .audio_codec_initialize = es8311_codec_init,
- .audio_codec_deinitialize = es8311_codec_deinit,
- .audio_codec_ctrl = es8311_codec_ctrl_state,
- .audio_codec_config_iface = es8311_codec_config_i2s,
- .audio_codec_set_mute = es8311_set_voice_mute,
- .audio_codec_set_volume = es8311_codec_set_voice_volume,
- .audio_codec_get_volume = es8311_codec_get_voice_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es8311_codec_init,
+ .audio_codec_deinitialize = es8311_codec_deinit,
+ .audio_codec_ctrl = es8311_codec_ctrl_state,
+ .audio_codec_config_iface = es8311_codec_config_i2s,
+ .audio_codec_set_mute = es8311_set_voice_mute,
+ .audio_codec_set_volume = es8311_codec_set_voice_volume,
+ .audio_codec_get_volume = es8311_codec_get_voice_volume,
+ .audio_codec_enable_pa = es8311_pa_power,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
/*
* Clock coefficient structer
*/
-struct _coeff_div
-{
+struct _coeff_div {
uint32_t mclk; /* mclk frequency */
uint32_t rate; /* sample rate */
uint8_t pre_div; /* the pre divider with range from 1 to 8 */
@@ -89,237 +101,219 @@ struct _coeff_div
/* codec hifi mclk clock divider coefficients */
static const struct _coeff_div coeff_div[] = {
- // mclk rate pre_div mult adc_div dac_div fs_mode lrch lrcl bckdiv
- // osr
- /* 8k */
- { 12288000, 8000, 0x06, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 8000, 0x03, 0x02, 0x03, 0x03, 0x00, 0x05, 0xff, 0x18, 0x10,
- 0x10 },
- { 16384000, 8000, 0x08, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 8192000, 8000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 8000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 4096000, 8000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 8000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2048000, 8000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 8000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1024000, 8000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ // mclk rate pre_div mult adc_div dac_div fs_mode lrch lrcl bckdiv
+ // osr
+ /* 8k */
+ {12288000, 8000, 0x06, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {18432000, 8000, 0x03, 0x02, 0x03, 0x03, 0x00, 0x05, 0xff, 0x18, 0x10,
+ 0x20},
+ {16384000, 8000, 0x08, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {8192000, 8000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {6144000, 8000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {4096000, 8000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {3072000, 8000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {2048000, 8000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {1536000, 8000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
+ {1024000, 8000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10, 0x20},
- /* 11.025k */
- { 11289600, 11025, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 5644800, 11025, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2822400, 11025, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1411200, 11025, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 11.025k */
+ {11289600, 11025, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {5644800, 11025, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {2822400, 11025, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {1411200, 11025, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
- /* 12k */
- { 12288000, 12000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 12000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 12000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 12000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 12k */
+ {12288000, 12000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {6144000, 12000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {3072000, 12000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {1536000, 12000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
- /* 16k */
- { 12288000, 16000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 16000, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, 0xff, 0x0c, 0x10,
- 0x10 },
- { 16384000, 16000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 8192000, 16000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 16000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 4096000, 16000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 16000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2048000, 16000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 16000, 0x03, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1024000, 16000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 16k */
+ {12288000, 16000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {18432000, 16000, 0x03, 0x02, 0x03, 0x03, 0x00, 0x02, 0xff, 0x0c, 0x10,
+ 0x20},
+ {16384000, 16000, 0x04, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {8192000, 16000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {6144000, 16000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {4096000, 16000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {3072000, 16000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {2048000, 16000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {1536000, 16000, 0x03, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
+ {1024000, 16000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x20},
- /* 22.05k */
- { 11289600, 22050, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 5644800, 22050, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2822400, 22050, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1411200, 22050, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 22.05k */
+ {11289600, 22050, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {5644800, 22050, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {2822400, 22050, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1411200, 22050, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
- /* 24k */
- { 12288000, 24000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 24000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 24000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 24000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 24000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 24k */
+ {12288000, 24000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {18432000, 24000, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {6144000, 24000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {3072000, 24000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1536000, 24000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
- /* 32k */
- { 12288000, 32000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 32000, 0x03, 0x04, 0x03, 0x03, 0x00, 0x02, 0xff, 0x0c, 0x10,
- 0x10 },
- { 16384000, 32000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 8192000, 32000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 32000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 4096000, 32000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 32000, 0x03, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2048000, 32000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 32000, 0x03, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
- 0x10 },
- { 1024000, 32000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 32k */
+ {12288000, 32000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {18432000, 32000, 0x03, 0x04, 0x03, 0x03, 0x00, 0x02, 0xff, 0x0c, 0x10,
+ 0x10},
+ {16384000, 32000, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {8192000, 32000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {6144000, 32000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {4096000, 32000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {3072000, 32000, 0x03, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {2048000, 32000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1536000, 32000, 0x03, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
+ 0x10},
+ {1024000, 32000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
- /* 44.1k */
- { 11289600, 44100, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 5644800, 44100, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2822400, 44100, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1411200, 44100, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 44.1k */
+ {11289600, 44100, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {5644800, 44100, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {2822400, 44100, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1411200, 44100, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
- /* 48k */
- { 12288000, 48000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 48000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 48000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 48000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 48000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
+ /* 48k */
+ {12288000, 48000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {18432000, 48000, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {6144000, 48000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {3072000, 48000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1536000, 48000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
- /* 64k */
- { 12288000, 64000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 64000, 0x03, 0x04, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
- 0x10 },
- { 16384000, 64000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 8192000, 64000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 64000, 0x01, 0x04, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
- 0x10 },
- { 4096000, 64000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 64000, 0x01, 0x08, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
- 0x10 },
- { 2048000, 64000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 64000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0xbf, 0x03, 0x18,
- 0x18 },
- { 1024000, 64000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
- 0x10 },
+ /* 64k */
+ {12288000, 64000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {18432000, 64000, 0x03, 0x04, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
+ 0x10},
+ {16384000, 64000, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {8192000, 64000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {6144000, 64000, 0x01, 0x04, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
+ 0x10},
+ {4096000, 64000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {3072000, 64000, 0x01, 0x08, 0x03, 0x03, 0x01, 0x01, 0x7f, 0x06, 0x10,
+ 0x10},
+ {2048000, 64000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1536000, 64000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0xbf, 0x03, 0x18,
+ 0x18},
+ {1024000, 64000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
+ 0x10},
- /* 88.2k */
- { 11289600, 88200, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 5644800, 88200, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 2822400, 88200, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1411200, 88200, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
- 0x10 },
+ /* 88.2k */
+ {11289600, 88200, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {5644800, 88200, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {2822400, 88200, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1411200, 88200, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
+ 0x10},
- /* 96k */
- { 12288000, 96000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 18432000, 96000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 6144000, 96000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 3072000, 96000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
- 0x10 },
- { 1536000, 96000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
- 0x10 },
+ /* 96k */
+ {12288000, 96000, 0x01, 0x02, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {18432000, 96000, 0x03, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {6144000, 96000, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {3072000, 96000, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0xff, 0x04, 0x10,
+ 0x10},
+ {1536000, 96000, 0x01, 0x08, 0x01, 0x01, 0x01, 0x00, 0x7f, 0x02, 0x10,
+ 0x10},
};
static char *TAG = "DRV8311";
-#define ES_ASSERT(a, format, b, ...) \
- if ((a) != 0) \
- { \
- ESP_LOGE (TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define ES_ASSERT(a, format, b, ...) \
+ if ((a) != 0) { \
+ ESP_LOGE(TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
-int8_t get_es8311_mclk_src (void);
+int8_t get_es8311_mclk_src(void);
-static esp_err_t
-es8311_write_reg (uint8_t reg_addr, uint8_t data)
-{
- return i2c_bus_write_bytes (i2c_handle, ES8311_ADDR, ®_addr,
- sizeof (reg_addr), &data, sizeof (data));
+static esp_err_t es8311_write_reg(uint8_t reg_addr, uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, ES8311_ADDR, ®_addr,
+ sizeof(reg_addr), &data, sizeof(data));
}
-static int
-es8311_read_reg (uint8_t reg_addr)
-{
+static int es8311_read_reg(uint8_t reg_addr) {
uint8_t data;
- i2c_bus_read_bytes (i2c_handle, ES8311_ADDR, ®_addr, sizeof (reg_addr),
- &data, sizeof (data));
+ i2c_bus_read_bytes(i2c_handle, ES8311_ADDR, ®_addr, sizeof(reg_addr),
+ &data, sizeof(data));
return (int)data;
}
-static int
-i2c_init ()
-{
+static int i2c_init() {
int res = 0;
i2c_config_t es_i2c_cfg = {
- .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000,
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
};
- res = get_i2c_pins (I2C_NUM_0, &es_i2c_cfg);
- ES_ASSERT (res, "getting i2c pins error", -1);
- i2c_handle = i2c_bus_create (I2C_NUM_0, &es_i2c_cfg);
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ ES_ASSERT(res, "getting i2c pins error", -1);
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
return res;
}
/*
* look for the coefficient in coeff_div[] table
*/
-static int
-get_coeff (uint32_t mclk, uint32_t rate)
-{
- for (int i = 0; i < (sizeof (coeff_div) / sizeof (coeff_div[0])); i++)
- {
- if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk)
- return i;
- }
+static int get_coeff(uint32_t mclk, uint32_t rate) {
+ for (int i = 0; i < (sizeof(coeff_div) / sizeof(coeff_div[0])); i++) {
+ if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk) return i;
+ }
return -1;
}
@@ -328,135 +322,112 @@ get_coeff (uint32_t mclk, uint32_t rate)
* if mute = 0, dac un-mute
* if mute = 1, dac mute
*/
-static void
-es8311_mute (int mute)
-{
+static void es8311_mute(int mute) {
uint8_t regv;
- ESP_LOGI (TAG, "Enter into es8311_mute(), mute = %d\n", mute);
- regv = es8311_read_reg (ES8311_DAC_REG31) & 0x9f;
- if (mute)
- {
- es8311_write_reg (ES8311_SYSTEM_REG12, 0x02);
- es8311_write_reg (ES8311_DAC_REG31, regv | 0x60);
- es8311_write_reg (ES8311_DAC_REG32, 0x00);
- es8311_write_reg (ES8311_DAC_REG37, 0x08);
- }
- else
- {
- es8311_write_reg (ES8311_DAC_REG31, regv);
- es8311_write_reg (ES8311_SYSTEM_REG12, 0x00);
- }
+ ESP_LOGI(TAG, "Enter into es8311_mute(), mute = %d\n", mute);
+ regv = es8311_read_reg(ES8311_DAC_REG31) & 0x9f;
+ if (mute) {
+ es8311_write_reg(ES8311_SYSTEM_REG12, 0x02);
+ es8311_write_reg(ES8311_DAC_REG31, regv | 0x60);
+ es8311_write_reg(ES8311_DAC_REG32, 0x00);
+ es8311_write_reg(ES8311_DAC_REG37, 0x08);
+ } else {
+ es8311_write_reg(ES8311_DAC_REG31, regv);
+ es8311_write_reg(ES8311_SYSTEM_REG12, 0x00);
+ }
}
/*
* set es8311 into suspend mode
*/
-static void
-es8311_suspend (void)
-{
- ESP_LOGI (TAG, "Enter into es8311_suspend()");
- es8311_write_reg (ES8311_DAC_REG32, 0x00);
- es8311_write_reg (ES8311_ADC_REG17, 0x00);
- es8311_write_reg (ES8311_SYSTEM_REG0E, 0xFF);
- es8311_write_reg (ES8311_SYSTEM_REG12, 0x02);
- es8311_write_reg (ES8311_SYSTEM_REG14, 0x00);
- es8311_write_reg (ES8311_SYSTEM_REG0D, 0xFA);
- es8311_write_reg (ES8311_ADC_REG15, 0x00);
- es8311_write_reg (ES8311_DAC_REG37, 0x08);
- es8311_write_reg (ES8311_GP_REG45, 0x01);
+static void es8311_suspend(void) {
+ ESP_LOGI(TAG, "Enter into es8311_suspend()");
+ es8311_write_reg(ES8311_DAC_REG32, 0x00);
+ es8311_write_reg(ES8311_ADC_REG17, 0x00);
+ es8311_write_reg(ES8311_SYSTEM_REG0E, 0xFF);
+ es8311_write_reg(ES8311_SYSTEM_REG12, 0x02);
+ es8311_write_reg(ES8311_SYSTEM_REG14, 0x00);
+ es8311_write_reg(ES8311_SYSTEM_REG0D, 0xFA);
+ es8311_write_reg(ES8311_ADC_REG15, 0x00);
+ es8311_write_reg(ES8311_DAC_REG37, 0x08);
+ es8311_write_reg(ES8311_GP_REG45, 0x01);
}
/*
* enable pa power
*/
-void
-es8311_pa_power (bool enable)
-{
- gpio_config_t io_conf;
- memset (&io_conf, 0, sizeof (io_conf));
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
- io_conf.mode = GPIO_MODE_OUTPUT;
- io_conf.pin_bit_mask = BIT64 (get_pa_enable_gpio ());
- io_conf.pull_down_en = 0;
- io_conf.pull_up_en = 0;
- gpio_config (&io_conf);
- if (enable)
- {
- gpio_set_level (get_pa_enable_gpio (), 1);
- }
- else
- {
- gpio_set_level (get_pa_enable_gpio (), 0);
- }
+esp_err_t es8311_pa_power(bool enable) {
+ esp_err_t ret = ESP_OK;
+ if (enable) {
+ ret = gpio_set_level(get_pa_enable_gpio(), 1);
+ } else {
+ ret = gpio_set_level(get_pa_enable_gpio(), 0);
+ }
+ return ret;
}
-esp_err_t
-es8311_codec_init (audio_hal_codec_config_t *codec_cfg)
-{
+esp_err_t es8311_codec_init(audio_hal_codec_config_t *codec_cfg) {
uint8_t datmp, regv;
int coeff;
esp_err_t ret = ESP_OK;
- i2c_init (); // ESP32 in master mode
+ i2c_init(); // ESP32 in master mode
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, 0x30);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG02, 0x00);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG03, 0x10);
- ret |= es8311_write_reg (ES8311_ADC_REG16, 0x24);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG04, 0x10);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG05, 0x00);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG0B, 0x00);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG0C, 0x00);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG10, 0x1F);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG11, 0x7F);
- ret |= es8311_write_reg (ES8311_RESET_REG00, 0x80);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, 0x30);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG02, 0x00);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG03, 0x10);
+ ret |= es8311_write_reg(ES8311_ADC_REG16, 0x24);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG04, 0x10);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG05, 0x00);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG0B, 0x00);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG0C, 0x00);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG10, 0x1F);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG11, 0x7F);
+ ret |= es8311_write_reg(ES8311_RESET_REG00, 0x80);
/*
* Set Codec into Master or Slave mode
*/
- regv = es8311_read_reg (ES8311_RESET_REG00);
+ regv = es8311_read_reg(ES8311_RESET_REG00);
/*
* Set master/slave audio interface
*/
audio_hal_codec_i2s_iface_t *i2s_cfg = &(codec_cfg->i2s_iface);
- switch (i2s_cfg->mode)
- {
+ switch (i2s_cfg->mode) {
case AUDIO_HAL_MODE_MASTER: /* MASTER MODE */
- ESP_LOGI (TAG, "ES8311 in Master mode");
+ ESP_LOGI(TAG, "ES8311 in Master mode");
regv |= 0x40;
break;
case AUDIO_HAL_MODE_SLAVE: /* SLAVE MODE */
- ESP_LOGI (TAG, "ES8311 in Slave mode");
+ ESP_LOGI(TAG, "ES8311 in Slave mode");
regv &= 0xBF;
break;
default:
regv &= 0xBF;
- }
- ret |= es8311_write_reg (ES8311_RESET_REG00, regv);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, 0x3F);
+ }
+ ret |= es8311_write_reg(ES8311_RESET_REG00, regv);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, 0x3F);
/*
* Select clock source for internal mclk
*/
- switch (get_es8311_mclk_src ())
- {
+ switch (get_es8311_mclk_src()) {
case FROM_MCLK_PIN:
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG01);
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG01);
regv &= 0x7F;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, regv);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, regv);
break;
case FROM_SCLK_PIN:
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG01);
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG01);
regv |= 0x80;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, regv);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, regv);
break;
default:
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG01);
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG01);
regv &= 0x7F;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, regv);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, regv);
break;
- }
+ }
int sample_fre = 0;
int mclk_fre = 0;
- switch (i2s_cfg->samples)
- {
+ switch (i2s_cfg->samples) {
case AUDIO_HAL_08K_SAMPLES:
sample_fre = 8000;
break;
@@ -482,154 +453,150 @@ es8311_codec_init (audio_hal_codec_config_t *codec_cfg)
sample_fre = 48000;
break;
default:
- ESP_LOGE (TAG, "Unable to configure sample rate %dHz", sample_fre);
+ ESP_LOGE(TAG, "Unable to configure sample rate %dHz", sample_fre);
break;
- }
+ }
mclk_fre = sample_fre * MCLK_DIV_FRE;
- coeff = get_coeff (mclk_fre, sample_fre);
- if (coeff < 0)
- {
- ESP_LOGE (TAG, "Unable to configure sample rate %dHz with %dHz MCLK",
- sample_fre, mclk_fre);
- return ESP_FAIL;
- }
+ coeff = get_coeff(mclk_fre, sample_fre);
+ if (coeff < 0) {
+ ESP_LOGE(TAG, "Unable to configure sample rate %dHz with %dHz MCLK",
+ sample_fre, mclk_fre);
+ return ESP_FAIL;
+ }
/*
* Set clock parammeters
*/
- if (coeff >= 0)
- {
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG02) & 0x07;
- regv |= (coeff_div[coeff].pre_div - 1) << 5;
- datmp = 0;
- switch (coeff_div[coeff].pre_multi)
- {
- case 1:
- datmp = 0;
- break;
- case 2:
- datmp = 1;
- break;
- case 4:
- datmp = 2;
- break;
- case 8:
- datmp = 3;
- break;
- default:
- break;
- }
-
- if (get_es8311_mclk_src () == FROM_SCLK_PIN)
- {
- datmp = 3; /* DIG_MCLK = LRCK * 256 = BCLK * 8 */
- }
- regv |= (datmp) << 3;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG02, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG05) & 0x00;
- regv |= (coeff_div[coeff].adc_div - 1) << 4;
- regv |= (coeff_div[coeff].dac_div - 1) << 0;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG05, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG03) & 0x80;
- regv |= coeff_div[coeff].fs_mode << 6;
- regv |= coeff_div[coeff].adc_osr << 0;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG03, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG04) & 0x80;
- regv |= coeff_div[coeff].dac_osr << 0;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG04, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG07) & 0xC0;
- regv |= coeff_div[coeff].lrck_h << 0;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG07, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG08) & 0x00;
- regv |= coeff_div[coeff].lrck_l << 0;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG08, regv);
-
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG06) & 0xE0;
- if (coeff_div[coeff].bclk_div < 19)
- {
- regv |= (coeff_div[coeff].bclk_div - 1) << 0;
- }
- else
- {
- regv |= (coeff_div[coeff].bclk_div) << 0;
- }
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG06, regv);
+ if (coeff >= 0) {
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG02) & 0x07;
+ regv |= (coeff_div[coeff].pre_div - 1) << 5;
+ datmp = 0;
+ switch (coeff_div[coeff].pre_multi) {
+ case 1:
+ datmp = 0;
+ break;
+ case 2:
+ datmp = 1;
+ break;
+ case 4:
+ datmp = 2;
+ break;
+ case 8:
+ datmp = 3;
+ break;
+ default:
+ break;
}
+ if (get_es8311_mclk_src() == FROM_SCLK_PIN) {
+ datmp = 3; /* DIG_MCLK = LRCK * 256 = BCLK * 8 */
+ }
+ regv |= (datmp) << 3;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG02, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG05) & 0x00;
+ regv |= (coeff_div[coeff].adc_div - 1) << 4;
+ regv |= (coeff_div[coeff].dac_div - 1) << 0;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG05, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG03) & 0x80;
+ regv |= coeff_div[coeff].fs_mode << 6;
+ regv |= coeff_div[coeff].adc_osr << 0;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG03, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG04) & 0x80;
+ regv |= coeff_div[coeff].dac_osr << 0;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG04, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG07) & 0xC0;
+ regv |= coeff_div[coeff].lrck_h << 0;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG07, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG08) & 0x00;
+ regv |= coeff_div[coeff].lrck_l << 0;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG08, regv);
+
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG06) & 0xE0;
+ if (coeff_div[coeff].bclk_div < 19) {
+ regv |= (coeff_div[coeff].bclk_div - 1) << 0;
+ } else {
+ regv |= (coeff_div[coeff].bclk_div) << 0;
+ }
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG06, regv);
+ }
+
/*
* mclk inverted or not
*/
- if (INVERT_MCLK)
- {
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG01);
- regv |= 0x40;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, regv);
- }
- else
- {
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG01);
- regv &= ~(0x40);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG01, regv);
- }
+ if (INVERT_MCLK) {
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG01);
+ regv |= 0x40;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, regv);
+ } else {
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG01);
+ regv &= ~(0x40);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG01, regv);
+ }
/*
* sclk inverted or not
*/
- if (INVERT_SCLK)
- {
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG06);
- regv |= 0x20;
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG06, regv);
- }
- else
- {
- regv = es8311_read_reg (ES8311_CLK_MANAGER_REG06);
- regv &= ~(0x20);
- ret |= es8311_write_reg (ES8311_CLK_MANAGER_REG06, regv);
- }
+ if (INVERT_SCLK) {
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG06);
+ regv |= 0x20;
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG06, regv);
+ } else {
+ regv = es8311_read_reg(ES8311_CLK_MANAGER_REG06);
+ regv &= ~(0x20);
+ ret |= es8311_write_reg(ES8311_CLK_MANAGER_REG06, regv);
+ }
- ret |= es8311_write_reg (ES8311_SYSTEM_REG13, 0x10);
- ret |= es8311_write_reg (ES8311_ADC_REG1B, 0x0A);
- ret |= es8311_write_reg (ES8311_ADC_REG1C, 0x6A);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG13, 0x10);
+ ret |= es8311_write_reg(ES8311_ADC_REG1B, 0x0A);
+ ret |= es8311_write_reg(ES8311_ADC_REG1C, 0x6A);
+ AUDIO_RET_ON_FALSE(TAG, ret, return ret, "es8311 initialize failed");
- es8311_pa_power (true);
+ /* pa power gpio init */
+ gpio_config_t io_conf;
+ memset(&io_conf, 0, sizeof(io_conf));
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = BIT64(get_pa_enable_gpio());
+ io_conf.pull_down_en = 0;
+ io_conf.pull_up_en = 0;
+ gpio_config(&io_conf);
+ /* enable pa power */
+ es8311_pa_power(true);
+
+ codec_dac_volume_config_t vol_cfg = ES8311_DAC_VOL_CFG_DEFAULT();
+ dac_vol_handle = audio_codec_volume_init(&vol_cfg);
return ESP_OK;
}
-esp_err_t
-es8311_codec_deinit ()
-{
- i2c_bus_delete (i2c_handle);
+esp_err_t es8311_codec_deinit() {
+ i2c_bus_delete(i2c_handle);
+ audio_codec_volume_deinit(dac_vol_handle);
return ESP_OK;
}
-esp_err_t
-es8311_config_fmt (es_i2s_fmt_t fmt)
-{
+esp_err_t es8311_config_fmt(es_i2s_fmt_t fmt) {
esp_err_t ret = ESP_OK;
uint8_t adc_iface = 0, dac_iface = 0;
- dac_iface = es8311_read_reg (ES8311_SDPIN_REG09);
- adc_iface = es8311_read_reg (ES8311_SDPOUT_REG0A);
- switch (fmt)
- {
+ dac_iface = es8311_read_reg(ES8311_SDPIN_REG09);
+ adc_iface = es8311_read_reg(ES8311_SDPOUT_REG0A);
+ switch (fmt) {
case AUDIO_HAL_I2S_NORMAL:
- ESP_LOGD (TAG, "ES8311 in I2S Format");
+ ESP_LOGD(TAG, "ES8311 in I2S Format");
dac_iface &= 0xFC;
adc_iface &= 0xFC;
break;
case AUDIO_HAL_I2S_LEFT:
case AUDIO_HAL_I2S_RIGHT:
- ESP_LOGD (TAG, "ES8311 in LJ Format");
+ ESP_LOGD(TAG, "ES8311 in LJ Format");
adc_iface &= 0xFC;
dac_iface &= 0xFC;
adc_iface |= 0x01;
dac_iface |= 0x01;
break;
case AUDIO_HAL_I2S_DSP:
- ESP_LOGD (TAG, "ES8311 in DSP-A Format");
+ ESP_LOGD(TAG, "ES8311 in DSP-A Format");
adc_iface &= 0xDC;
dac_iface &= 0xDC;
adc_iface |= 0x03;
@@ -639,22 +606,19 @@ es8311_config_fmt (es_i2s_fmt_t fmt)
dac_iface &= 0xFC;
adc_iface &= 0xFC;
break;
- }
- ret |= es8311_write_reg (ES8311_SDPIN_REG09, dac_iface);
- ret |= es8311_write_reg (ES8311_SDPOUT_REG0A, adc_iface);
+ }
+ ret |= es8311_write_reg(ES8311_SDPIN_REG09, dac_iface);
+ ret |= es8311_write_reg(ES8311_SDPOUT_REG0A, adc_iface);
return ret;
}
-esp_err_t
-es8311_set_bits_per_sample (audio_hal_iface_bits_t bits)
-{
+esp_err_t es8311_set_bits_per_sample(audio_hal_iface_bits_t bits) {
esp_err_t ret = ESP_OK;
uint8_t adc_iface = 0, dac_iface = 0;
- dac_iface = es8311_read_reg (ES8311_SDPIN_REG09);
- adc_iface = es8311_read_reg (ES8311_SDPOUT_REG0A);
- switch (bits)
- {
+ dac_iface = es8311_read_reg(ES8311_SDPIN_REG09);
+ adc_iface = es8311_read_reg(ES8311_SDPOUT_REG0A);
+ switch (bits) {
case AUDIO_HAL_BIT_LENGTH_16BITS:
dac_iface |= 0x0c;
adc_iface |= 0x0c;
@@ -669,32 +633,27 @@ es8311_set_bits_per_sample (audio_hal_iface_bits_t bits)
dac_iface |= 0x0c;
adc_iface |= 0x0c;
break;
- }
- ret |= es8311_write_reg (ES8311_SDPIN_REG09, dac_iface);
- ret |= es8311_write_reg (ES8311_SDPOUT_REG0A, adc_iface);
+ }
+ ret |= es8311_write_reg(ES8311_SDPIN_REG09, dac_iface);
+ ret |= es8311_write_reg(ES8311_SDPOUT_REG0A, adc_iface);
return ret;
}
-esp_err_t
-es8311_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es8311_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
int ret = ESP_OK;
- ret |= es8311_set_bits_per_sample (iface->bits);
- ret |= es8311_config_fmt (iface->fmt);
+ ret |= es8311_set_bits_per_sample(iface->bits);
+ ret |= es8311_config_fmt(iface->fmt);
return ret;
}
-esp_err_t
-es8311_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state)
-{
+esp_err_t es8311_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
esp_err_t ret = ESP_OK;
es_module_t es_mode = ES_MODULE_MIN;
- switch (mode)
- {
+ switch (mode) {
case AUDIO_HAL_CODEC_MODE_ENCODE:
es_mode = ES_MODULE_ADC;
break;
@@ -709,162 +668,147 @@ es8311_codec_ctrl_state (audio_hal_codec_mode_t mode,
break;
default:
es_mode = ES_MODULE_DAC;
- ESP_LOGW (TAG, "Codec mode not support, default is decode mode");
+ ESP_LOGW(TAG, "Codec mode not support, default is decode mode");
break;
- }
+ }
- if (ctrl_state == AUDIO_HAL_CTRL_START)
- {
- ret |= es8311_start (es_mode);
- }
- else
- {
- ESP_LOGW (TAG, "The codec is about to stop");
- ret |= es8311_stop (es_mode);
- }
+ if (ctrl_state == AUDIO_HAL_CTRL_START) {
+ ret |= es8311_start(es_mode);
+ } else {
+ ESP_LOGW(TAG, "The codec is about to stop");
+ ret |= es8311_stop(es_mode);
+ }
return ret;
}
-esp_err_t
-es8311_start (es_module_t mode)
-{
+esp_err_t es8311_start(es_module_t mode) {
esp_err_t ret = ESP_OK;
uint8_t adc_iface = 0, dac_iface = 0;
- dac_iface = es8311_read_reg (ES8311_SDPIN_REG09) & 0xBF;
- adc_iface = es8311_read_reg (ES8311_SDPOUT_REG0A) & 0xBF;
- adc_iface |= BIT (6);
- dac_iface |= BIT (6);
+ dac_iface = es8311_read_reg(ES8311_SDPIN_REG09) & 0xBF;
+ adc_iface = es8311_read_reg(ES8311_SDPOUT_REG0A) & 0xBF;
+ adc_iface |= BIT(6);
+ dac_iface |= BIT(6);
- if (mode == ES_MODULE_LINE)
- {
- ESP_LOGE (TAG, "The codec es8311 doesn't support ES_MODULE_LINE mode");
- return ESP_FAIL;
- }
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- adc_iface &= ~(BIT (6));
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- dac_iface &= ~(BIT (6));
- }
+ if (mode == ES_MODULE_LINE) {
+ ESP_LOGE(TAG, "The codec es8311 doesn't support ES_MODULE_LINE mode");
+ return ESP_FAIL;
+ }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ adc_iface &= ~(BIT(6));
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ dac_iface &= ~(BIT(6));
+ }
- ret |= es8311_write_reg (ES8311_SDPIN_REG09, dac_iface);
- ret |= es8311_write_reg (ES8311_SDPOUT_REG0A, adc_iface);
+ ret |= es8311_write_reg(ES8311_SDPIN_REG09, dac_iface);
+ ret |= es8311_write_reg(ES8311_SDPOUT_REG0A, adc_iface);
- ret |= es8311_write_reg (ES8311_ADC_REG17, 0xBF);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG0E, 0x02);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG12, 0x00);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG14, 0x1A);
+ ret |= es8311_write_reg(ES8311_ADC_REG17, 0xBF);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG0E, 0x02);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG12, 0x00);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG14, 0x1A);
/*
* pdm dmic enable or disable
*/
int regv = 0;
- if (IS_DMIC)
- {
- regv = es8311_read_reg (ES8311_SYSTEM_REG14);
- regv |= 0x40;
- ret |= es8311_write_reg (ES8311_SYSTEM_REG14, regv);
- }
- else
- {
- regv = es8311_read_reg (ES8311_SYSTEM_REG14);
- regv &= ~(0x40);
- ret |= es8311_write_reg (ES8311_SYSTEM_REG14, regv);
- }
+ if (IS_DMIC) {
+ regv = es8311_read_reg(ES8311_SYSTEM_REG14);
+ regv |= 0x40;
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG14, regv);
+ } else {
+ regv = es8311_read_reg(ES8311_SYSTEM_REG14);
+ regv &= ~(0x40);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG14, regv);
+ }
- ret |= es8311_write_reg (ES8311_SYSTEM_REG0D, 0x01);
- ret |= es8311_write_reg (ES8311_ADC_REG15, 0x40);
- ret |= es8311_write_reg (ES8311_DAC_REG37, 0x48);
- ret |= es8311_write_reg (ES8311_GP_REG45, 0x00);
+ ret |= es8311_write_reg(ES8311_SYSTEM_REG0D, 0x01);
+ ret |= es8311_write_reg(ES8311_ADC_REG15, 0x40);
+ ret |= es8311_write_reg(ES8311_DAC_REG37, 0x48);
+ ret |= es8311_write_reg(ES8311_GP_REG45, 0x00);
+
+ /* set internal reference signal (ADCL + DACR) */
+ ret |= es8311_write_reg(ES8311_GPIO_REG44, 0x50);
return ret;
}
-esp_err_t
-es8311_stop (es_module_t mode)
-{
+esp_err_t es8311_stop(es_module_t mode) {
esp_err_t ret = ESP_OK;
- es8311_suspend ();
+ es8311_suspend();
return ret;
}
-esp_err_t
-es8311_codec_set_voice_volume (int volume)
-{
+/**
+ * @brief Set voice volume
+ *
+ * @note Register values. 0x00: -95.5 dB, 0x5B: -50 dB, 0xBF: 0 dB, 0xFF: 32 dB
+ * @note Accuracy of gain is 0.5 dB
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_codec_set_voice_volume(int volume) {
esp_err_t res = ESP_OK;
- if (volume < 0)
- {
- volume = 0;
- }
- else if (volume > 100)
- {
- volume = 100;
- }
- int vol = (volume)*2550 / 1000;
- ESP_LOGD (TAG, "SET: volume:%d", vol);
- es8311_write_reg (ES8311_DAC_REG32, vol);
+ uint8_t reg = 0;
+ reg = audio_codec_get_dac_reg_value(dac_vol_handle, volume);
+ res = es8311_write_reg(ES8311_DAC_REG32, reg);
+ ESP_LOGD(TAG, "Set volume:%.2d reg_value:0x%.2x dB:%.1f",
+ dac_vol_handle->user_volume, reg,
+ audio_codec_cal_dac_volume(dac_vol_handle));
return res;
}
-esp_err_t
-es8311_codec_get_voice_volume (int *volume)
-{
+esp_err_t es8311_codec_get_voice_volume(int *volume) {
esp_err_t res = ESP_OK;
int regv = 0;
- regv = es8311_read_reg (ES8311_DAC_REG32);
- if (regv == ESP_FAIL)
- {
+ regv = es8311_read_reg(ES8311_DAC_REG32);
+ if (regv == ESP_FAIL) {
+ *volume = 0;
+ res = ESP_FAIL;
+ } else {
+ if (regv == dac_vol_handle->reg_value) {
+ *volume = dac_vol_handle->user_volume;
+ } else {
*volume = 0;
res = ESP_FAIL;
}
- else
- {
- *volume = regv * 100 / 256;
- }
- ESP_LOGD (TAG, "GET: res:%d, volume:%d", regv, *volume);
+ }
+ ESP_LOGD(TAG, "Get volume:%.2d reg_value:0x%.2x", *volume, regv);
return res;
}
-esp_err_t
-es8311_set_voice_mute (bool enable)
-{
- ESP_LOGD (TAG, "Es8311SetVoiceMute volume:%d", enable);
- es8311_mute (enable);
+esp_err_t es8311_set_voice_mute(bool enable) {
+ ESP_LOGD(TAG, "Es8311SetVoiceMute volume:%d", enable);
+ es8311_mute(enable);
return ESP_OK;
}
-esp_err_t
-es8311_get_voice_mute (int *mute)
-{
+esp_err_t es8311_get_voice_mute(int *mute) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res = es8311_read_reg (ES8311_DAC_REG31);
- if (res != ESP_FAIL)
- {
- reg = (res & 0x20) >> 5;
- }
+ res = es8311_read_reg(ES8311_DAC_REG31);
+ if (res != ESP_FAIL) {
+ reg = (res & 0x20) >> 5;
+ }
*mute = reg;
return res;
}
-esp_err_t
-es8311_set_mic_gain (es8311_mic_gain_t gain_db)
-{
+esp_err_t es8311_set_mic_gain(es8311_mic_gain_t gain_db) {
esp_err_t res = ESP_OK;
- res = es8311_write_reg (ES8311_ADC_REG16, gain_db); // MIC gain scale
+ res = es8311_write_reg(ES8311_ADC_REG16, gain_db); // MIC gain scale
return res;
}
-void
-es8311_read_all ()
-{
- for (int i = 0; i < 0x4A; i++)
- {
- uint8_t reg = es8311_read_reg (i);
- ets_printf ("REG:%02x, %02x\n", reg, i);
- }
+void es8311_read_all() {
+ for (int i = 0; i < 0x4A; i++) {
+ uint8_t reg = es8311_read_reg(i);
+ ESP_LOGI(TAG, "REG:%02x, %02x", reg, i);
+ }
}
diff --git a/components/audio_hal/driver/es8311/es8311.h b/components/audio_hal/driver/es8311/es8311.h
index 55dce69..076dc70 100644
--- a/components/audio_hal/driver/es8311/es8311.h
+++ b/components/audio_hal/driver/es8311/es8311.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -32,8 +32,7 @@
#include "esxxx_common.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
/*
@@ -44,7 +43,7 @@ extern "C"
/*
* Clock Scheme Register definition
*/
-#define ES8311_CLK_MANAGER_REG01 \
+#define ES8311_CLK_MANAGER_REG01 \
0x01 /* select clk src for mclk, enable clock for codec */
#define ES8311_CLK_MANAGER_REG02 0x02 /* clk divider and clk multiplier */
#define ES8311_CLK_MANAGER_REG03 0x03 /* adc fsmode and osr */
@@ -70,7 +69,7 @@ extern "C"
#define ES8311_SYSTEM_REG11 0x11 /* system */
#define ES8311_SYSTEM_REG12 0x12 /* system, Enable DAC */
#define ES8311_SYSTEM_REG13 0x13 /* system */
-#define ES8311_SYSTEM_REG14 \
+#define ES8311_SYSTEM_REG14 \
0x14 /* system, select DMIC, select analog pga gain */
/*
* ADC
@@ -107,173 +106,183 @@ extern "C"
#define ES8311_MAX_REGISTER 0xFF
- typedef enum
- {
- ES8311_MIC_GAIN_MIN = -1,
- ES8311_MIC_GAIN_0DB,
- ES8311_MIC_GAIN_6DB,
- ES8311_MIC_GAIN_12DB,
- ES8311_MIC_GAIN_18DB,
- ES8311_MIC_GAIN_24DB,
- ES8311_MIC_GAIN_30DB,
- ES8311_MIC_GAIN_36DB,
- ES8311_MIC_GAIN_42DB,
- ES8311_MIC_GAIN_MAX
- } es8311_mic_gain_t;
+typedef enum {
+ ES8311_MIC_GAIN_MIN = -1,
+ ES8311_MIC_GAIN_0DB,
+ ES8311_MIC_GAIN_6DB,
+ ES8311_MIC_GAIN_12DB,
+ ES8311_MIC_GAIN_18DB,
+ ES8311_MIC_GAIN_24DB,
+ ES8311_MIC_GAIN_30DB,
+ ES8311_MIC_GAIN_36DB,
+ ES8311_MIC_GAIN_42DB,
+ ES8311_MIC_GAIN_MAX
+} es8311_mic_gain_t;
- /*
- * @brief Initialize ES8311 codec chip
- *
- * @param codec_cfg configuration of ES8311
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_codec_init (audio_hal_codec_config_t *codec_cfg);
+/*
+ * @brief Enables or disables PA
+ *
+ * @param enable true/false
+ *
+ * @return
+ * - ESP_ERR_INVALID_ARG
+ * - ESP_OK
+ */
+esp_err_t es8311_pa_power(bool enable);
- /**
- * @brief Deinitialize ES8311 codec chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_codec_deinit (void);
+/*
+ * @brief Initialize ES8311 codec chip
+ *
+ * @param codec_cfg configuration of ES8311
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_codec_init(audio_hal_codec_config_t *codec_cfg);
- /**
- * @brief Control ES8311 codec chip
- *
- * @param mode codec mode
- * @param ctrl_state start or stop decode or encode progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8311_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Deinitialize ES8311 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_codec_deinit(void);
- /**
- * @brief Configure ES8311 codec mode and I2S interface
- *
- * @param mode codec mode
- * @param iface I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8311_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Control ES8311 codec chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8311_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Configure ES8311 DAC mute or not. Basically you can use this
- * function to mute the output or unmute
- *
- * @param enable enable(1) or disable(0)
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8311_set_voice_mute (bool enable);
+/**
+ * @brief Configure ES8311 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8311_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Set voice volume
- *
- * @param volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_codec_set_voice_volume (int volume);
+/**
+ * @brief Configure ES8311 DAC mute or not. Basically you can use this function
+ * to mute the output or unmute
+ *
+ * @param enable enable(1) or disable(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8311_set_voice_mute(bool enable);
- /**
- * @brief Get voice volume
- *
- * @param[out] *volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_codec_get_voice_volume (int *volume);
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_codec_set_voice_volume(int volume);
- /**
- * @brief Configure ES8311 I2S format
- *
- * @param mod: set ADC or DAC or both
- * @param cfg: ES8388 I2S format
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_config_fmt (es_i2s_fmt_t fmt);
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_codec_get_voice_volume(int *volume);
- /**
- * @brief Configure ES8311 data sample bits
- *
- * @param mode: set ADC or DAC or both
- * @param bit_per_sample: bit number of per sample
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_set_bits_per_sample (audio_hal_iface_bits_t bits);
+/**
+ * @brief Configure ES8311 I2S format
+ *
+ * @param mod: set ADC or DAC or both
+ * @param cfg: ES8388 I2S format
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_config_fmt(es_i2s_fmt_t fmt);
- /**
- * @brief Start ES8311 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_start (es_module_t mode);
+/**
+ * @brief Configure ES8311 data sample bits
+ *
+ * @param mode: set ADC or DAC or both
+ * @param bit_per_sample: bit number of per sample
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_set_bits_per_sample(audio_hal_iface_bits_t bits);
- /**
- * @brief Stop ES8311 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8311_stop (es_module_t mode);
+/**
+ * @brief Start ES8311 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_start(es_module_t mode);
- /**
- * @brief Get ES8311 DAC mute status
- *
- * @return
- * - ESP_FAIL
- * - ESP_OK
- */
- esp_err_t es8311_get_voice_mute (int *mute);
+/**
+ * @brief Stop ES8311 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8311_stop(es_module_t mode);
- /**
- * @brief Set ES8311 mic gain
- *
- * @param gain db of mic gain
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8311_set_mic_gain (es8311_mic_gain_t gain_db);
+/**
+ * @brief Get ES8311 DAC mute status
+ *
+ * @return
+ * - ESP_FAIL
+ * - ESP_OK
+ */
+esp_err_t es8311_get_voice_mute(int *mute);
- /**
- * @brief Print all ES8311 registers
- *
- * @return
- * - void
- */
- void es8311_read_all ();
+/**
+ * @brief Set ES8311 mic gain
+ *
+ * @param gain db of mic gain
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8311_set_mic_gain(es8311_mic_gain_t gain_db);
+
+/**
+ * @brief Print all ES8311 registers
+ *
+ * @return
+ * - void
+ */
+void es8311_read_all();
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/es8374/es8374.c b/components/audio_hal/driver/es8374/es8374.c
index 82566ab..1817fb7 100644
--- a/components/audio_hal/driver/es8374/es8374.c
+++ b/components/audio_hal/driver/es8374/es8374.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,431 +18,382 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es8374.h"
+
+#include
+
#include "board_pins_config.h"
#include "esp_log.h"
#include "esp_system.h"
#include "i2c_bus.h"
-#include
#define ES8374_TAG "ES8374_DRIVER"
-#define ES_ASSERT(a, format, b, ...) \
- if ((a) != 0) \
- { \
- ESP_LOGE (ES8374_TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define ES_ASSERT(a, format, b, ...) \
+ if ((a) != 0) { \
+ ESP_LOGE(ES8374_TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
-#define LOG_8374(fmt, ...) ESP_LOGW (ES8374_TAG, fmt, ##__VA_ARGS__)
+#define LOG_8374(fmt, ...) ESP_LOGW(ES8374_TAG, fmt, ##__VA_ARGS__)
static int codec_init_flag = 0;
static i2c_bus_handle_t i2c_handle;
audio_hal_func_t AUDIO_CODEC_ES8374_DEFAULT_HANDLE = {
- .audio_codec_initialize = es8374_codec_init,
- .audio_codec_deinitialize = es8374_codec_deinit,
- .audio_codec_ctrl = es8374_codec_ctrl_state,
- .audio_codec_config_iface = es8374_codec_config_i2s,
- .audio_codec_set_mute = es8374_set_voice_mute,
- .audio_codec_set_volume = es8374_codec_set_voice_volume,
- .audio_codec_get_volume = es8374_codec_get_voice_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es8374_codec_init,
+ .audio_codec_deinitialize = es8374_codec_deinit,
+ .audio_codec_ctrl = es8374_codec_ctrl_state,
+ .audio_codec_config_iface = es8374_codec_config_i2s,
+ .audio_codec_set_mute = es8374_set_voice_mute,
+ .audio_codec_set_volume = es8374_codec_set_voice_volume,
+ .audio_codec_get_volume = es8374_codec_get_voice_volume,
+ .audio_codec_enable_pa = es8374_pa_power,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
-static bool
-es8374_codec_initialized ()
-{
- return codec_init_flag;
+static bool es8374_codec_initialized() { return codec_init_flag; }
+
+static esp_err_t es_write_reg(uint8_t slave_addr, uint8_t reg_add,
+ uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, slave_addr, ®_add, sizeof(reg_add),
+ &data, sizeof(data));
}
-static esp_err_t
-es_write_reg (uint8_t slave_addr, uint8_t reg_add, uint8_t data)
-{
- return i2c_bus_write_bytes (i2c_handle, slave_addr, ®_add,
- sizeof (reg_add), &data, sizeof (data));
+static esp_err_t es_read_reg(uint8_t slave_addr, uint8_t reg_add,
+ uint8_t *p_data) {
+ return i2c_bus_read_bytes(i2c_handle, slave_addr, ®_add, sizeof(reg_add),
+ p_data, 1);
}
-static esp_err_t
-es_read_reg (uint8_t slave_addr, uint8_t reg_add, uint8_t *p_data)
-{
- return i2c_bus_read_bytes (i2c_handle, slave_addr, ®_add,
- sizeof (reg_add), p_data, 1);
-}
-
-static int
-i2c_init ()
-{
+static int i2c_init() {
int res;
- i2c_config_t es_i2c_cfg = { .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000 };
- res = get_i2c_pins (I2C_NUM_0, &es_i2c_cfg);
- ES_ASSERT (res, "getting i2c pins error", -1);
- i2c_handle = i2c_bus_create (I2C_NUM_0, &es_i2c_cfg);
+ i2c_config_t es_i2c_cfg = {.mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000};
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ ES_ASSERT(res, "getting i2c pins error", -1);
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
return res;
}
-esp_err_t
-es8374_write_reg (uint8_t reg_add, uint8_t data)
-{
- return es_write_reg (ES8374_ADDR, reg_add, data);
+esp_err_t es8374_write_reg(uint8_t reg_add, uint8_t data) {
+ return es_write_reg(ES8374_ADDR, reg_add, data);
}
-int
-es8374_read_reg (uint8_t reg_add, uint8_t *regv)
-{
+int es8374_read_reg(uint8_t reg_add, uint8_t *regv) {
uint8_t regdata = 0xFF;
uint8_t res = 0;
- if (es_read_reg (ES8374_ADDR, reg_add, ®data) == 0)
- {
- *regv = regdata;
- return res;
- }
- else
- {
- LOG_8374 ("Read Audio Codec Register Failed!");
- res = -1;
- return res;
- }
+ if (es_read_reg(ES8374_ADDR, reg_add, ®data) == 0) {
+ *regv = regdata;
+ return res;
+ } else {
+ LOG_8374("Read Audio Codec Register Failed!");
+ res = -1;
+ return res;
+ }
}
-void
-es8374_read_all ()
-{
- for (int i = 0; i < 50; i++)
- {
- uint8_t reg = 0;
- es8374_read_reg (i, ®);
- ESP_LOGI (ES8374_TAG, "%x: %x", i, reg);
- }
+void es8374_read_all() {
+ for (int i = 0; i < 50; i++) {
+ uint8_t reg = 0;
+ es8374_read_reg(i, ®);
+ ESP_LOGI(ES8374_TAG, "%x: %x", i, reg);
+ }
}
-esp_err_t
-es8374_set_voice_mute (bool enable)
-{
+esp_err_t es8374_set_voice_mute(bool enable) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res |= es8374_read_reg (0x36, ®);
- if (res == 0)
- {
- reg = reg & 0xdf;
- res |= es8374_write_reg (0x36, reg | (((int)enable) << 5));
- }
+ res |= es8374_read_reg(0x36, ®);
+ if (res == 0) {
+ reg = reg & 0xdf;
+ res |= es8374_write_reg(0x36, reg | (((int)enable) << 5));
+ }
return res;
}
-esp_err_t
-es8374_get_voice_mute (void)
-{
+esp_err_t es8374_get_voice_mute(void) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res |= es8374_read_reg (0x36, ®);
- if (res == ESP_OK)
- {
- reg = reg & 0x40;
- }
+ res |= es8374_read_reg(0x36, ®);
+ if (res == ESP_OK) {
+ reg = reg & 0x40;
+ }
return res == ESP_OK ? reg : res;
}
-esp_err_t
-es8374_set_bits_per_sample (es_module_t mode, es_bits_length_t bit_per_sample)
-{
+esp_err_t es8374_set_bits_per_sample(es_module_t mode,
+ es_bits_length_t bit_per_sample) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
int bits = (int)bit_per_sample & 0x0f;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_read_reg (0x10, ®);
- if (res == 0)
- {
- reg = reg & 0xe3;
- res |= es8374_write_reg (0x10, reg | (bits << 2));
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_read_reg(0x10, ®);
+ if (res == 0) {
+ reg = reg & 0xe3;
+ res |= es8374_write_reg(0x10, reg | (bits << 2));
}
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_read_reg (0x11, ®);
- if (res == 0)
- {
- reg = reg & 0xe3;
- res |= es8374_write_reg (0x11, reg | (bits << 2));
- }
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_read_reg(0x11, ®);
+ if (res == 0) {
+ reg = reg & 0xe3;
+ res |= es8374_write_reg(0x11, reg | (bits << 2));
}
+ }
return res;
}
-esp_err_t
-es8374_config_fmt (es_module_t mode, es_i2s_fmt_t fmt)
-{
+esp_err_t es8374_config_fmt(es_module_t mode, es_i2s_fmt_t fmt) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
int fmt_tmp, fmt_i2s;
fmt_tmp = ((fmt & 0xf0) >> 4);
fmt_i2s = fmt & 0x0f;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_read_reg (0x10, ®);
- if (res == 0)
- {
- reg = reg & 0xfc;
- res |= es8374_write_reg (0x10, reg | fmt_i2s);
- res |= es8374_set_bits_per_sample (mode, fmt_tmp);
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_read_reg(0x10, ®);
+ if (res == 0) {
+ reg = reg & 0xfc;
+ res |= es8374_write_reg(0x10, reg | fmt_i2s);
+ res |= es8374_set_bits_per_sample(mode, fmt_tmp);
}
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_read_reg (0x11, ®);
- if (res == 0)
- {
- reg = reg & 0xfc;
- res |= es8374_write_reg (0x11, reg | (fmt_i2s));
- res |= es8374_set_bits_per_sample (mode, fmt_tmp);
- }
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_read_reg(0x11, ®);
+ if (res == 0) {
+ reg = reg & 0xfc;
+ res |= es8374_write_reg(0x11, reg | (fmt_i2s));
+ res |= es8374_set_bits_per_sample(mode, fmt_tmp);
}
+ }
return res;
}
-esp_err_t
-es8374_start (es_module_t mode)
-{
+esp_err_t es8374_start(es_module_t mode) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- if (mode == ES_MODULE_LINE)
- {
- res |= es8374_read_reg (0x1a, ®); // set monomixer
- reg |= 0x60;
- reg |= 0x20;
- reg &= 0xf7;
- res |= es8374_write_reg (0x1a, reg);
- res |= es8374_read_reg (0x1c, ®); // set spk mixer
- reg |= 0x40;
- res |= es8374_write_reg (0x1c, reg);
- res |= es8374_write_reg (0x1D, 0x02); // spk set
- res |= es8374_write_reg (0x1F, 0x00); // spk set
- res |= es8374_write_reg (0x1E, 0xA0); // spk on
- }
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC
- || mode == ES_MODULE_LINE)
- {
- res |= es8374_read_reg (0x21, ®); // power up adc and input
- reg &= 0x3f;
- res |= es8374_write_reg (0x21, reg);
- res |= es8374_read_reg (0x10, ®); // power up adc and input
- reg &= 0x3f;
- res |= es8374_write_reg (0x10, reg);
- }
+ if (mode == ES_MODULE_LINE) {
+ res |= es8374_read_reg(0x1a, ®); // set monomixer
+ reg |= 0x60;
+ reg |= 0x20;
+ reg &= 0xf7;
+ res |= es8374_write_reg(0x1a, reg);
+ res |= es8374_read_reg(0x1c, ®); // set spk mixer
+ reg |= 0x40;
+ res |= es8374_write_reg(0x1c, reg);
+ res |= es8374_write_reg(0x1D, 0x02); // spk set
+ res |= es8374_write_reg(0x1F, 0x00); // spk set
+ res |= es8374_write_reg(0x1E, 0xA0); // spk on
+ }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC ||
+ mode == ES_MODULE_LINE) {
+ res |= es8374_read_reg(0x21, ®); // power up adc and input
+ reg &= 0x3f;
+ res |= es8374_write_reg(0x21, reg);
+ res |= es8374_read_reg(0x10, ®); // power up adc and input
+ reg &= 0x3f;
+ res |= es8374_write_reg(0x10, reg);
+ }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC
- || mode == ES_MODULE_LINE)
- {
- res |= es8374_read_reg (0x1a, ®); // disable lout
- reg |= 0x08;
- res |= es8374_write_reg (0x1a, reg);
- reg &= 0xdf;
- res |= es8374_write_reg (0x1a, reg);
- res |= es8374_write_reg (0x1D, 0x12); // mute speaker
- res |= es8374_write_reg (0x1E, 0x20); // disable class d
- res |= es8374_read_reg (0x15, ®); // power up dac
- reg &= 0xdf;
- res |= es8374_write_reg (0x15, reg);
- res |= es8374_read_reg (0x1a, ®); // disable lout
- reg |= 0x20;
- res |= es8374_write_reg (0x1a, reg);
- reg &= 0xf7;
- res |= es8374_write_reg (0x1a, reg);
- res |= es8374_write_reg (0x1D, 0x02); // mute speaker
- res |= es8374_write_reg (0x1E, 0xa0); // disable class d
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC ||
+ mode == ES_MODULE_LINE) {
+ res |= es8374_read_reg(0x1a, ®); // disable lout
+ reg |= 0x08;
+ res |= es8374_write_reg(0x1a, reg);
+ reg &= 0xdf;
+ res |= es8374_write_reg(0x1a, reg);
+ res |= es8374_write_reg(0x1D, 0x12); // mute speaker
+ res |= es8374_write_reg(0x1E, 0x20); // disable class d
+ res |= es8374_read_reg(0x15, ®); // power up dac
+ reg &= 0xdf;
+ res |= es8374_write_reg(0x15, reg);
+ res |= es8374_read_reg(0x1a, ®); // disable lout
+ reg |= 0x20;
+ res |= es8374_write_reg(0x1a, reg);
+ reg &= 0xf7;
+ res |= es8374_write_reg(0x1a, reg);
+ res |= es8374_write_reg(0x1D, 0x02); // mute speaker
+ res |= es8374_write_reg(0x1E, 0xa0); // disable class d
- res |= es8374_set_voice_mute (false);
- }
+ res |= es8374_set_voice_mute(false);
+ }
return res;
}
-esp_err_t
-es8374_stop (es_module_t mode)
-{
+esp_err_t es8374_stop(es_module_t mode) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- if (mode == ES_MODULE_LINE)
- {
- res |= es8374_read_reg (0x1a, ®); // disable lout
- reg |= 0x08;
- res |= es8374_write_reg (0x1a, reg);
- reg &= 0x9f;
- res |= es8374_write_reg (0x1a, reg);
- res |= es8374_write_reg (0x1D, 0x12); // mute speaker
- res |= es8374_write_reg (0x1E, 0x20); // disable class d
- res |= es8374_read_reg (0x1c, ®); // disable spkmixer
- reg &= 0xbf;
- res |= es8374_write_reg (0x1c, reg);
- res |= es8374_write_reg (0x1F, 0x00); // spk set
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_set_voice_mute (true);
+ if (mode == ES_MODULE_LINE) {
+ res |= es8374_read_reg(0x1a, ®); // disable lout
+ reg |= 0x08;
+ res |= es8374_write_reg(0x1a, reg);
+ reg &= 0x9f;
+ res |= es8374_write_reg(0x1a, reg);
+ res |= es8374_write_reg(0x1D, 0x12); // mute speaker
+ res |= es8374_write_reg(0x1E, 0x20); // disable class d
+ res |= es8374_read_reg(0x1c, ®); // disable spkmixer
+ reg &= 0xbf;
+ res |= es8374_write_reg(0x1c, reg);
+ res |= es8374_write_reg(0x1F, 0x00); // spk set
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_set_voice_mute(true);
- res |= es8374_read_reg (0x1a, ®); // disable lout
- reg |= 0x08;
- res |= es8374_write_reg (0x1a, reg);
- reg &= 0xdf;
- res |= es8374_write_reg (0x1a, reg);
- res |= es8374_write_reg (0x1D, 0x12); // mute speaker
- res |= es8374_write_reg (0x1E, 0x20); // disable class d
- res |= es8374_read_reg (0x15, ®); // power up dac
- reg |= 0x20;
- res |= es8374_write_reg (0x15, reg);
- }
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
-
- res |= es8374_read_reg (0x10, ®); // power up adc and input
- reg |= 0xc0;
- res |= es8374_write_reg (0x10, reg);
- res |= es8374_read_reg (0x21, ®); // power up adc and input
- reg |= 0xc0;
- res |= es8374_write_reg (0x21, reg);
- }
+ res |= es8374_read_reg(0x1a, ®); // disable lout
+ reg |= 0x08;
+ res |= es8374_write_reg(0x1a, reg);
+ reg &= 0xdf;
+ res |= es8374_write_reg(0x1a, reg);
+ res |= es8374_write_reg(0x1D, 0x12); // mute speaker
+ res |= es8374_write_reg(0x1E, 0x20); // disable class d
+ res |= es8374_read_reg(0x15, ®); // power up dac
+ reg |= 0x20;
+ res |= es8374_write_reg(0x15, reg);
+ }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_read_reg(0x10, ®); // power up adc and input
+ reg |= 0xc0;
+ res |= es8374_write_reg(0x10, reg);
+ res |= es8374_read_reg(0x21, ®); // power up adc and input
+ reg |= 0xc0;
+ res |= es8374_write_reg(0x21, reg);
+ }
return res;
}
-esp_err_t
-es8374_i2s_config_clock (es_i2s_clock_t cfg)
-{
-
+esp_err_t es8374_i2s_config_clock(es_i2s_clock_t cfg) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res |= es8374_read_reg (0x0f, ®); // power up adc and input
+ res |= es8374_read_reg(0x0f, ®); // power up adc and input
reg &= 0xe0;
int divratio = 0;
- switch (cfg.sclk_div)
- {
+ switch (cfg.sclk_div) {
case MCLK_DIV_1:
divratio = 1;
break;
- case MCLK_DIV_2: // = 2,
+ case MCLK_DIV_2: // = 2,
divratio = 2;
break;
- case MCLK_DIV_3: // = 3,
+ case MCLK_DIV_3: // = 3,
divratio = 3;
break;
- case MCLK_DIV_4: // = 4,
+ case MCLK_DIV_4: // = 4,
divratio = 4;
break;
- case MCLK_DIV_5: // = 20,
+ case MCLK_DIV_5: // = 20,
divratio = 5;
break;
- case MCLK_DIV_6: // = 5,
+ case MCLK_DIV_6: // = 5,
divratio = 6;
break;
- case MCLK_DIV_7: // = 29,
+ case MCLK_DIV_7: // = 29,
divratio = 7;
break;
- case MCLK_DIV_8: // = 6,
+ case MCLK_DIV_8: // = 6,
divratio = 8;
break;
- case MCLK_DIV_9: // = 7,
+ case MCLK_DIV_9: // = 7,
divratio = 9;
break;
- case MCLK_DIV_10: // = 21,
+ case MCLK_DIV_10: // = 21,
divratio = 10;
break;
- case MCLK_DIV_11: // = 8,
+ case MCLK_DIV_11: // = 8,
divratio = 11;
break;
- case MCLK_DIV_12: // = 9,
+ case MCLK_DIV_12: // = 9,
divratio = 12;
break;
- case MCLK_DIV_13: // = 30,
+ case MCLK_DIV_13: // = 30,
divratio = 13;
break;
- case MCLK_DIV_14: // = 31
+ case MCLK_DIV_14: // = 31
divratio = 14;
break;
- case MCLK_DIV_15: // = 22,
+ case MCLK_DIV_15: // = 22,
divratio = 15;
break;
- case MCLK_DIV_16: // = 10,
+ case MCLK_DIV_16: // = 10,
divratio = 16;
break;
- case MCLK_DIV_17: // = 23,
+ case MCLK_DIV_17: // = 23,
divratio = 17;
break;
- case MCLK_DIV_18: // = 11,
+ case MCLK_DIV_18: // = 11,
divratio = 18;
break;
- case MCLK_DIV_20: // = 24,
+ case MCLK_DIV_20: // = 24,
divratio = 19;
break;
- case MCLK_DIV_22: // = 12,
+ case MCLK_DIV_22: // = 12,
divratio = 20;
break;
- case MCLK_DIV_24: // = 13,
+ case MCLK_DIV_24: // = 13,
divratio = 21;
break;
- case MCLK_DIV_25: // = 25,
+ case MCLK_DIV_25: // = 25,
divratio = 22;
break;
- case MCLK_DIV_30: // = 26,
+ case MCLK_DIV_30: // = 26,
divratio = 23;
break;
- case MCLK_DIV_32: // = 27,
+ case MCLK_DIV_32: // = 27,
divratio = 24;
break;
- case MCLK_DIV_33: // = 14,
+ case MCLK_DIV_33: // = 14,
divratio = 25;
break;
- case MCLK_DIV_34: // = 28,
+ case MCLK_DIV_34: // = 28,
divratio = 26;
break;
- case MCLK_DIV_36: // = 15,
+ case MCLK_DIV_36: // = 15,
divratio = 27;
break;
- case MCLK_DIV_44: // = 16,
+ case MCLK_DIV_44: // = 16,
divratio = 28;
break;
- case MCLK_DIV_48: // = 17,
+ case MCLK_DIV_48: // = 17,
divratio = 29;
break;
- case MCLK_DIV_66: // = 18,
+ case MCLK_DIV_66: // = 18,
divratio = 30;
break;
- case MCLK_DIV_72: // = 19,
+ case MCLK_DIV_72: // = 19,
divratio = 31;
break;
default:
break;
- }
+ }
reg |= divratio;
- res |= es8374_write_reg (0x0f, reg);
+ res |= es8374_write_reg(0x0f, reg);
int dacratio_l = 0;
int dacratio_h = 0;
- switch (cfg.lclk_div)
- {
+ switch (cfg.lclk_div) {
case LCLK_DIV_128:
dacratio_l = 128 % 256;
dacratio_h = 128 / 256;
@@ -545,314 +496,268 @@ es8374_i2s_config_clock (es_i2s_clock_t cfg)
break;
default:
break;
- }
- res |= es8374_write_reg (0x06,
- dacratio_h); // ADCFsMode,singel SPEED,RATIO=256
- res |= es8374_write_reg (0x07,
- dacratio_l); // ADCFsMode,singel SPEED,RATIO=256
+ }
+ res |= es8374_write_reg(0x06, dacratio_h); // ADCFsMode,singel
+ // SPEED,RATIO=256
+ res |= es8374_write_reg(0x07, dacratio_l); // ADCFsMode,singel
+ // SPEED,RATIO=256
return res;
}
-esp_err_t
-es8374_config_dac_output (es_dac_output_t output)
-{
+esp_err_t es8374_config_dac_output(es_dac_output_t output) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
reg = 0x1d;
- res = es8374_write_reg (reg, 0x02);
- res |= es8374_read_reg (0x1c, ®); // set spk mixer
+ res = es8374_write_reg(reg, 0x02);
+ res |= es8374_read_reg(0x1c, ®); // set spk mixer
reg |= 0x80;
- res |= es8374_write_reg (0x1c, reg);
- res |= es8374_write_reg (0x1D, 0x02); // spk set
- res |= es8374_write_reg (0x1F, 0x00); // spk set
- res |= es8374_write_reg (0x1E, 0xA0); // spk on
+ res |= es8374_write_reg(0x1c, reg);
+ res |= es8374_write_reg(0x1D, 0x02); // spk set
+ res |= es8374_write_reg(0x1F, 0x00); // spk set
+ res |= es8374_write_reg(0x1E, 0xA0); // spk on
return res;
}
-esp_err_t
-es8374_config_adc_input (es_adc_input_t input)
-{
+esp_err_t es8374_config_adc_input(es_adc_input_t input) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res |= es8374_read_reg (0x21, ®);
- if (res == 0)
- {
- reg = (reg & 0xcf) | 0x14;
- res |= es8374_write_reg (0x21, reg);
- }
+ res |= es8374_read_reg(0x21, ®);
+ if (res == 0) {
+ reg = (reg & 0xcf) | 0x14;
+ res |= es8374_write_reg(0x21, reg);
+ }
return res;
}
-esp_err_t
-es8374_set_mic_gain (es_mic_gain_t gain)
-{
+esp_err_t es8374_set_mic_gain(es_mic_gain_t gain) {
esp_err_t res = ESP_OK;
- if (gain > MIC_GAIN_MIN && gain < MIC_GAIN_24DB)
- {
- int gain_n = 0;
- gain_n = (int)gain / 3;
- res = es8374_write_reg (0x22, gain_n | (gain_n << 4)); // MIC PGA
- }
- else
- {
- res = -1;
- LOG_8374 ("invalid microphone gain!");
- }
+ if (gain > MIC_GAIN_MIN && gain < MIC_GAIN_24DB) {
+ int gain_n = 0;
+ gain_n = (int)gain / 3;
+ res = es8374_write_reg(0x22, gain_n | (gain_n << 4)); // MIC PGA
+ } else {
+ res = -1;
+ LOG_8374("invalid microphone gain!");
+ }
return res;
}
-esp_err_t
-es8374_codec_set_voice_volume (int volume)
-{
+esp_err_t es8374_codec_set_voice_volume(int volume) {
esp_err_t res = ESP_OK;
- if (volume < 0)
- {
- volume = 192;
- }
- else if (volume > 96)
- {
- volume = 0;
- }
- else
- {
- volume = 192 - volume * 2;
- }
+ if (volume < 0) {
+ volume = 192;
+ } else if (volume > 96) {
+ volume = 0;
+ } else {
+ volume = 192 - volume * 2;
+ }
- res = es8374_write_reg (0x38, volume);
+ res = es8374_write_reg(0x38, volume);
return res;
}
-esp_err_t
-es8374_codec_get_voice_volume (int *volume)
-{
+esp_err_t es8374_codec_get_voice_volume(int *volume) {
esp_err_t res = 0;
uint8_t reg = 0;
- res = es8374_read_reg (0x38, ®);
+ res = es8374_read_reg(0x38, ®);
- if (res == ESP_FAIL)
- {
- *volume = 0;
- }
- else
- {
- *volume = (192 - reg) / 2;
- if (*volume > 96)
- {
- *volume = 100;
- }
+ if (res == ESP_FAIL) {
+ *volume = 0;
+ } else {
+ *volume = (192 - reg) / 2;
+ if (*volume > 96) {
+ *volume = 100;
}
+ }
return res;
}
-static int
-es8374_set_adc_dac_volume (int mode, int volume, int dot)
-{
+static int es8374_set_adc_dac_volume(int mode, int volume, int dot) {
int res = 0;
- if (volume < -96 || volume > 0)
- {
- LOG_8374 ("Warning: volume < -96! or > 0!");
- if (volume < -96)
- {
- volume = -96;
- }
- else
- {
- volume = 0;
- }
+ if (volume < -96 || volume > 0) {
+ LOG_8374("Warning: volume < -96! or > 0!");
+ if (volume < -96) {
+ volume = -96;
+ } else {
+ volume = 0;
}
+ }
dot = (dot >= 5 ? 1 : 0);
volume = (-volume << 1) + dot;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_write_reg (0x25, volume);
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es8374_write_reg (0x38, volume);
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_write_reg(0x25, volume);
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es8374_write_reg(0x38, volume);
+ }
return res;
}
-static int
-es8374_set_d2se_pga (es_d2se_pga_t gain)
-{
+static int es8374_set_d2se_pga(es_d2se_pga_t gain) {
int res = 0;
uint8_t reg = 0;
- if (gain > D2SE_PGA_GAIN_MIN && gain < D2SE_PGA_GAIN_MAX)
- {
- res = es8374_read_reg (0x21, ®);
- reg &= 0xfb;
- reg |= gain << 2;
- res = es8374_write_reg (0x21, reg); // MIC PGA
- }
- else
- {
- res = 0xff;
- LOG_8374 ("invalid microphone gain!");
- }
+ if (gain > D2SE_PGA_GAIN_MIN && gain < D2SE_PGA_GAIN_MAX) {
+ res = es8374_read_reg(0x21, ®);
+ reg &= 0xfb;
+ reg |= gain << 2;
+ res |= es8374_write_reg(0x21, reg); // MIC PGA
+ } else {
+ res = 0xff;
+ LOG_8374("invalid microphone gain!");
+ }
return res;
}
-static int
-es8374_init_reg (audio_hal_codec_mode_t ms_mode, es_i2s_fmt_t fmt,
- es_i2s_clock_t cfg, es_dac_output_t out_channel,
- es_adc_input_t in_channel)
-{
+static int es8374_init_reg(audio_hal_codec_mode_t ms_mode, es_i2s_fmt_t fmt,
+ es_i2s_clock_t cfg, es_dac_output_t out_channel,
+ es_adc_input_t in_channel) {
int res = 0;
uint8_t reg;
- res |= es8374_write_reg (0x00, 0x3F); // IC Rst start
- res |= es8374_write_reg (0x00, 0x03); // IC Rst stop
- res |= es8374_write_reg (0x01, 0x7F); // IC clk on
+ res |= es8374_write_reg(0x00, 0x3F); // IC Rst start
+ res |= es8374_write_reg(0x00, 0x03); // IC Rst stop
+ res |= es8374_write_reg(0x01, 0x7F); // IC clk on
- res |= es8374_read_reg (0x0F, ®);
+ res |= es8374_read_reg(0x0F, ®);
reg &= 0x7f;
reg |= (ms_mode << 7);
- res |= es8374_write_reg (0x0f, reg); // CODEC IN I2S SLAVE MODE
+ res |= es8374_write_reg(0x0f, reg); // CODEC IN I2S SLAVE MODE
- res |= es8374_write_reg (0x6F, 0xA0); // pll set:mode enable
- res |= es8374_write_reg (0x72, 0x41); // pll set:mode set
- res |= es8374_write_reg (0x09, 0x01); // pll set:reset on ,set start
- res |= es8374_write_reg (0x0C, 0x22); // pll set:k
- res |= es8374_write_reg (0x0D, 0x2E); // pll set:k
- res |= es8374_write_reg (0x0E, 0xC6); // pll set:k
- res |= es8374_write_reg (0x0A, 0x3A); // pll set:
- res |= es8374_write_reg (0x0B, 0x07); // pll set:n
- res |= es8374_write_reg (0x09, 0x41); // pll set:reset off ,set stop
+ res |= es8374_write_reg(0x6F, 0xA0); // pll set:mode enable
+ res |= es8374_write_reg(0x72, 0x41); // pll set:mode set
+ res |= es8374_write_reg(0x09, 0x01); // pll set:reset on ,set start
+ res |= es8374_write_reg(0x0C, 0x22); // pll set:k
+ res |= es8374_write_reg(0x0D, 0x2E); // pll set:k
+ res |= es8374_write_reg(0x0E, 0xC6); // pll set:k
+ res |= es8374_write_reg(0x0A, 0x3A); // pll set:
+ res |= es8374_write_reg(0x0B, 0x07); // pll set:n
+ res |= es8374_write_reg(0x09, 0x41); // pll set:reset off ,set stop
- res |= es8374_i2s_config_clock (cfg);
+ res |= es8374_i2s_config_clock(cfg);
- res |= es8374_write_reg (0x24, 0x08); // adc set
- res |= es8374_write_reg (0x36, 0x00); // dac set
- res |= es8374_write_reg (0x12, 0x30); // timming set
- res |= es8374_write_reg (0x13, 0x20); // timming set
+ res |= es8374_write_reg(0x24, 0x08); // adc set
+ res |= es8374_write_reg(0x36, 0x00); // dac set
+ res |= es8374_write_reg(0x12, 0x30); // timming set
+ res |= es8374_write_reg(0x13, 0x20); // timming set
- res |= es8374_config_fmt (ES_MODULE_ADC, fmt);
- res |= es8374_config_fmt (ES_MODULE_DAC, fmt);
+ res |= es8374_config_fmt(ES_MODULE_ADC, fmt);
+ res |= es8374_config_fmt(ES_MODULE_DAC, fmt);
- res |= es8374_write_reg (0x21, 0x50); // adc set: SEL LIN1 CH+PGAGAIN=0DB
- res |= es8374_write_reg (0x22, 0xFF); // adc set: PGA GAIN=0DB
- res |= es8374_write_reg (0x21, 0x14); // adc set: SEL LIN1 CH+PGAGAIN=18DB
- res |= es8374_write_reg (0x22, 0x55); // pga = +15db
- res |= es8374_write_reg (0x08,
- 0x21); // set class d divider = 33, to avoid the
- // high frequency tone on laudspeaker
- res |= es8374_write_reg (0x00, 0x80); // IC START
+ res |= es8374_write_reg(0x21, 0x50); // adc set: SEL LIN1 CH+PGAGAIN=0DB
+ res |= es8374_write_reg(0x22, 0xFF); // adc set: PGA GAIN=0DB
+ res |= es8374_write_reg(0x21, 0x14); // adc set: SEL LIN1 CH+PGAGAIN=18DB
+ res |= es8374_write_reg(0x22, 0x55); // pga = +15db
+ res |=
+ es8374_write_reg(0x08, 0x21); // set class d divider = 33, to avoid the
+ // high frequency tone on laudspeaker
+ res |= es8374_write_reg(0x00, 0x80); // IC START
- res |= es8374_set_adc_dac_volume (ES_MODULE_ADC, 0, 0); // 0db
- res |= es8374_set_adc_dac_volume (ES_MODULE_DAC, 0, 0); // 0db
+ res |= es8374_set_adc_dac_volume(ES_MODULE_ADC, 0, 0); // 0db
+ res |= es8374_set_adc_dac_volume(ES_MODULE_DAC, 0, 0); // 0db
- res |= es8374_write_reg (0x14, 0x8A); // IC START
- res |= es8374_write_reg (0x15, 0x40); // IC START
- res |= es8374_write_reg (0x1A, 0xA0); // monoout set
- res |= es8374_write_reg (0x1B, 0x19); // monoout set
- res |= es8374_write_reg (0x1C, 0x90); // spk set
- res |= es8374_write_reg (0x1D, 0x01); // spk set
- res |= es8374_write_reg (0x1F, 0x00); // spk set
- res |= es8374_write_reg (0x1E, 0x20); // spk on
- res |= es8374_write_reg (0x28, 0x00); // alc set
- res |= es8374_write_reg (0x25, 0x00); // ADCVOLUME on
- res |= es8374_write_reg (0x38, 0x00); // DACVOLUME on
- res |= es8374_write_reg (0x37, 0x30); // dac set
- res |= es8374_write_reg (
- 0x6D, 0x60); // SEL:GPIO1=DMIC CLK OUT+SEL:GPIO2=PLL CLK OUT
- res |= es8374_write_reg (0x71, 0x05); // for automute setting
- res |= es8374_write_reg (0x73, 0x70);
+ res |= es8374_write_reg(0x14, 0x8A); // IC START
+ res |= es8374_write_reg(0x15, 0x40); // IC START
+ res |= es8374_write_reg(0x1A, 0xA0); // monoout set
+ res |= es8374_write_reg(0x1B, 0x19); // monoout set
+ res |= es8374_write_reg(0x1C, 0x90); // spk set
+ res |= es8374_write_reg(0x1D, 0x01); // spk set
+ res |= es8374_write_reg(0x1F, 0x00); // spk set
+ res |= es8374_write_reg(0x1E, 0x20); // spk on
+ res |= es8374_write_reg(0x28, 0x00); // alc set
+ res |= es8374_write_reg(0x25, 0x00); // ADCVOLUME on
+ res |= es8374_write_reg(0x38, 0x00); // DACVOLUME on
+ res |= es8374_write_reg(0x37, 0x30); // dac set
+ res |= es8374_write_reg(
+ 0x6D, 0x60); // SEL:GPIO1=DMIC CLK OUT+SEL:GPIO2=PLL CLK OUT
+ res |= es8374_write_reg(0x71, 0x05); // for automute setting
+ res |= es8374_write_reg(0x73, 0x70);
- res |= es8374_config_dac_output (
- out_channel); // 0x3c Enable DAC and Enable Lout/Rout/1/2
- res |= es8374_config_adc_input (
- in_channel); // 0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input; DSSEL,use
- // one DS Reg11; DSR, LINPUT1-RINPUT1
- res |= es8374_codec_set_voice_volume (0);
+ res |= es8374_config_dac_output(
+ out_channel); // 0x3c Enable DAC and Enable Lout/Rout/1/2
+ res |= es8374_config_adc_input(
+ in_channel); // 0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input; DSSEL,use
+ // one DS Reg11; DSR, LINPUT1-RINPUT1
+ res |= es8374_codec_set_voice_volume(0);
- res |= es8374_write_reg (0x37, 0x00); // dac set
+ res |= es8374_write_reg(0x37, 0x00); // dac set
return res;
}
-esp_err_t
-es8374_codec_init (audio_hal_codec_config_t *cfg)
-{
- if (es8374_codec_initialized ())
- {
- ESP_LOGW (ES8374_TAG, "The es8374 codec has already been initialized!");
- return ESP_FAIL;
- }
+esp_err_t es8374_codec_init(audio_hal_codec_config_t *cfg) {
+ if (es8374_codec_initialized()) {
+ ESP_LOGW(ES8374_TAG, "The es8374 codec has already been initialized!");
+ return ESP_FAIL;
+ }
esp_err_t res = ESP_OK;
es_i2s_clock_t clkdiv;
clkdiv.lclk_div = LCLK_DIV_256;
clkdiv.sclk_div = MCLK_DIV_4;
- i2c_init (); // ESP32 in master mode
+ i2c_init(); // ESP32 in master mode
- res |= es8374_stop (cfg->codec_mode);
- res |= es8374_init_reg (cfg->i2s_iface.mode,
- (BIT_LENGTH_16BITS << 4) | cfg->i2s_iface.fmt,
- clkdiv, cfg->dac_output, cfg->adc_input);
- res |= es8374_set_mic_gain (MIC_GAIN_15DB);
- res |= es8374_set_d2se_pga (D2SE_PGA_GAIN_EN);
- res |= es8374_config_fmt (cfg->codec_mode, cfg->i2s_iface.fmt);
- res |= es8374_codec_config_i2s (cfg->codec_mode, &(cfg->i2s_iface));
+ res |= es8374_stop(cfg->codec_mode);
+ res |= es8374_init_reg(cfg->i2s_iface.mode,
+ (BIT_LENGTH_16BITS << 4) | cfg->i2s_iface.fmt, clkdiv,
+ cfg->dac_output, cfg->adc_input);
+ res |= es8374_set_mic_gain(MIC_GAIN_15DB);
+ res |= es8374_set_d2se_pga(D2SE_PGA_GAIN_EN);
+ res |= es8374_config_fmt(cfg->codec_mode, cfg->i2s_iface.fmt);
+ res |= es8374_codec_config_i2s(cfg->codec_mode, &(cfg->i2s_iface));
codec_init_flag = 1;
return res;
}
-esp_err_t
-es8374_codec_deinit (void)
-{
- codec_init_flag = 0;
- i2c_bus_delete (i2c_handle);
- return es8374_write_reg (0x00, 0x7F); // IC Reset and STOP
-}
-esp_err_t
-es8374_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es8374_codec_deinit(void) {
+ if (!es8374_codec_initialized()) {
+ ESP_LOGW(ES8374_TAG, "The es8374 codec has already been deinit!");
+ return ESP_FAIL;
+ }
esp_err_t res = ESP_OK;
- int tmp = 0;
- res |= es8374_config_fmt (ES_MODULE_ADC_DAC, iface->fmt);
- if (iface->bits == AUDIO_HAL_BIT_LENGTH_16BITS)
- {
- tmp = BIT_LENGTH_16BITS;
- }
- else if (iface->bits == AUDIO_HAL_BIT_LENGTH_24BITS)
- {
- tmp = BIT_LENGTH_24BITS;
- }
- else
- {
- tmp = BIT_LENGTH_32BITS;
- }
- res |= es8374_set_bits_per_sample (ES_MODULE_ADC_DAC, tmp);
+ codec_init_flag = 0;
+ res = es8374_write_reg(0x00, 0x7F); // IC Reset and STOP
+ res |= i2c_bus_delete(i2c_handle);
return res;
}
-esp_err_t
-es8374_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state)
-{
+esp_err_t es8374_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
+ esp_err_t res = ESP_OK;
+ int tmp = 0;
+ res |= es8374_config_fmt(ES_MODULE_ADC_DAC, iface->fmt);
+ if (iface->bits == AUDIO_HAL_BIT_LENGTH_16BITS) {
+ tmp = BIT_LENGTH_16BITS;
+ } else if (iface->bits == AUDIO_HAL_BIT_LENGTH_24BITS) {
+ tmp = BIT_LENGTH_24BITS;
+ } else {
+ tmp = BIT_LENGTH_32BITS;
+ }
+ res |= es8374_set_bits_per_sample(ES_MODULE_ADC_DAC, tmp);
+ return res;
+}
+
+esp_err_t es8374_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
esp_err_t res = ESP_OK;
int es_mode_t = 0;
- switch (mode)
- {
+ switch (mode) {
case AUDIO_HAL_CODEC_MODE_ENCODE:
es_mode_t = ES_MODULE_ADC;
break;
@@ -867,38 +772,31 @@ es8374_codec_ctrl_state (audio_hal_codec_mode_t mode,
break;
default:
es_mode_t = ES_MODULE_DAC;
- ESP_LOGW (ES8374_TAG, "Codec mode not support, default is decode mode");
+ ESP_LOGW(ES8374_TAG, "Codec mode not support, default is decode mode");
break;
- }
- if (AUDIO_HAL_CTRL_STOP == ctrl_state)
- {
- res = es8374_stop (es_mode_t);
- }
- else
- {
- res = es8374_start (es_mode_t);
- ESP_LOGD (ES8374_TAG, "start default is decode mode:%d", es_mode_t);
- }
+ }
+ if (AUDIO_HAL_CTRL_STOP == ctrl_state) {
+ res = es8374_stop(es_mode_t);
+ } else {
+ res = es8374_start(es_mode_t);
+ ESP_LOGD(ES8374_TAG, "start default is decode mode:%d", es_mode_t);
+ }
return res;
}
-void
-es8374_pa_power (bool enable)
-{
+esp_err_t es8374_pa_power(bool enable) {
+ esp_err_t ret = ESP_OK;
gpio_config_t io_conf;
- memset (&io_conf, 0, sizeof (io_conf));
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
+ memset(&io_conf, 0, sizeof(io_conf));
io_conf.mode = GPIO_MODE_OUTPUT;
- io_conf.pin_bit_mask = BIT64 (get_pa_enable_gpio ());
+ io_conf.pin_bit_mask = BIT64(get_pa_enable_gpio());
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
- gpio_config (&io_conf);
- if (enable)
- {
- gpio_set_level (get_pa_enable_gpio (), 1);
- }
- else
- {
- gpio_set_level (get_pa_enable_gpio (), 0);
- }
+ gpio_config(&io_conf);
+ if (enable) {
+ ret = gpio_set_level(get_pa_enable_gpio(), 1);
+ } else {
+ ret = gpio_set_level(get_pa_enable_gpio(), 0);
+ }
+ return ret;
}
diff --git a/components/audio_hal/driver/es8374/es8374.h b/components/audio_hal/driver/es8374/es8374.h
index 76f9a8a..f8d245b 100644
--- a/components/audio_hal/driver/es8374/es8374.h
+++ b/components/audio_hal/driver/es8374/es8374.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -32,225 +32,225 @@
#include "esxxx_common.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
/* ES8374 address */
-#define ES8374_ADDR 0x20 // 0x22:CE=1;0x20:CE=0
+#define ES8374_ADDR 0x20 // 0x22:CE=1;0x20:CE=0
- /**
- * @brief Initialize ES8374 codec chip
- *
- * @param cfg configuration of ES8374
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_codec_init (audio_hal_codec_config_t *cfg);
+/**
+ * @brief Initialize ES8374 codec chip
+ *
+ * @param cfg configuration of ES8374
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_codec_init(audio_hal_codec_config_t *cfg);
- /**
- * @brief Deinitialize ES8374 codec chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_codec_deinit (void);
+/**
+ * @brief Deinitialize ES8374 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_codec_deinit(void);
- /**
- * @brief Configure ES8374 I2S format
- *
- * @param mode: set ADC or DAC or both
- * @param fmt: ES8374 I2S format
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_config_fmt (es_module_t mode, es_i2s_fmt_t fmt);
+/**
+ * @brief Configure ES8374 I2S format
+ *
+ * @param mode: set ADC or DAC or both
+ * @param fmt: ES8374 I2S format
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_config_fmt(es_module_t mode, es_i2s_fmt_t fmt);
- /**
- * @brief Configure I2S clock in MSATER mode
- *
- * @param cfg: set bits clock and WS clock
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_i2s_config_clock (es_i2s_clock_t cfg);
+/**
+ * @brief Configure I2S clock in MSATER mode
+ *
+ * @param cfg: set bits clock and WS clock
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_i2s_config_clock(es_i2s_clock_t cfg);
- /**
- * @brief Configure ES8374 data sample bits
- *
- * @param mode: set ADC or DAC or both
- * @param bit_per_sample: bit number of per sample
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_set_bits_per_sample (es_module_t mode,
- es_bits_length_t bit_per_sample);
+/**
+ * @brief Configure ES8374 data sample bits
+ *
+ * @param mode: set ADC or DAC or both
+ * @param bit_per_sample: bit number of per sample
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_set_bits_per_sample(es_module_t mode,
+ es_bits_length_t bit_per_sample);
- /**
- * @brief Start ES8374 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_start (es_module_t mode);
+/**
+ * @brief Start ES8374 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_start(es_module_t mode);
- /**
- * @brief Stop ES8374 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_stop (es_module_t mode);
+/**
+ * @brief Stop ES8374 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_stop(es_module_t mode);
- /**
- * @brief Set voice volume
- *
- * @param volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_codec_set_voice_volume (int volume);
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_codec_set_voice_volume(int volume);
- /**
- * @brief Get voice volume
- *
- * @param[out] *volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8374_codec_get_voice_volume (int *volume);
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8374_codec_get_voice_volume(int *volume);
- /**
- * @brief Mute or unmute ES8374 DAC. Basically you can use this function to
- * mute or unmute the output
- *
- * @param enable mute(1) or unmute(0)
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_set_voice_mute (bool enable);
+/**
+ * @brief Mute or unmute ES8374 DAC. Basically you can use this function to mute
+ * or unmute the output
+ *
+ * @param enable mute(1) or unmute(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_set_voice_mute(bool enable);
- /**
- * @brief Get ES8374 DAC mute status
- *
- * @return
- * - ESP_FAIL
- * - ESP_OK
- */
- esp_err_t es8374_get_voice_mute (void);
+/**
+ * @brief Get ES8374 DAC mute status
+ *
+ * @return
+ * - ESP_FAIL
+ * - ESP_OK
+ */
+esp_err_t es8374_get_voice_mute(void);
- /**
- * @brief Set ES8374 mic gain
- *
- * @param gain db of mic gain
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_set_mic_gain (es_mic_gain_t gain);
+/**
+ * @brief Set ES8374 mic gain
+ *
+ * @param gain db of mic gain
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_set_mic_gain(es_mic_gain_t gain);
- /**
- * @brief Set ES8374 ADC input mode
- *
- * @param input adc input mode
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_config_adc_input (es_adc_input_t input);
+/**
+ * @brief Set ES8374 ADC input mode
+ *
+ * @param input adc input mode
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_config_adc_input(es_adc_input_t input);
- /**
- * @brief Set ES8374 DAC output mode
- *
- * @param output dac output mode
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_config_dac_output (es_dac_output_t output);
+/**
+ * @brief Set ES8374 DAC output mode
+ *
+ * @param output dac output mode
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_config_dac_output(es_dac_output_t output);
- /**
- * @brief Write ES8374 register
- *
- * @param reg_add address of register
- * @param data data of register
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_write_reg (uint8_t reg_add, uint8_t data);
+/**
+ * @brief Write ES8374 register
+ *
+ * @param reg_add address of register
+ * @param data data of register
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_write_reg(uint8_t reg_add, uint8_t data);
- /**
- * @brief Print all ES8374 registers
- *
- * @return
- * - void
- */
- void es8374_read_all ();
+/**
+ * @brief Print all ES8374 registers
+ *
+ * @return
+ * - void
+ */
+void es8374_read_all();
- /**
- * @brief Configure ES8374 codec mode and I2S interface
- *
- * @param mode codec mode
- * @param iface I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_codec_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Configure ES8374 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Control ES8374 codec chip
- *
- * @param mode codec mode
- * @param ctrl_state start or stop decode or encode progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8374_codec_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Control ES8374 codec chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8374_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Set ES8374 PA power
- *
- * @param enable true for enable PA power, false for disable PA power
- *
- * @return
- * - void
- */
- void es8374_pa_power (bool enable);
+/**
+ * @brief Set ES8374 PA power
+ *
+ * @param enable true for enable PA power, false for disable PA power
+ *
+ * @return
+ * - ESP_ERR_INVALID_ARG
+ * - ESP_OK
+ */
+esp_err_t es8374_pa_power(bool enable);
#ifdef __cplusplus
}
#endif
-#endif //__ES8374_H__
+#endif //__ES8374_H__
diff --git a/components/audio_hal/driver/es8388/es8388.c b/components/audio_hal/driver/es8388/es8388.c
index 1e234d1..2795142 100644
--- a/components/audio_hal/driver/es8388/es8388.c
+++ b/components/audio_hal/driver/es8388/es8388.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,87 +18,90 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "es8388.h"
-#include "board_pins_config.h"
-#include "esp_log.h"
-#include "i2c_bus.h"
+
#include
-#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
+#include "audio_volume.h"
+#include "board.h"
+#include "esp_log.h"
+#include "i2c_bus.h"
+
+#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || \
+ defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
#include "headphone_detect.h"
#endif
static const char *ES_TAG = "ES8388_DRIVER";
static i2c_bus_handle_t i2c_handle;
+static codec_dac_volume_config_t *dac_vol_handle;
-#define ES_ASSERT(a, format, b, ...) \
- if ((a) != 0) \
- { \
- ESP_LOGE (ES_TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define ES8388_DAC_VOL_CFG_DEFAULT() \
+ { \
+ .max_dac_volume = 0, .min_dac_volume = -96, \
+ .board_pa_gain = BOARD_PA_GAIN, .volume_accuracy = 0.5, \
+ .dac_vol_symbol = -1, .zero_volume_reg = 0, .reg_value = 0, \
+ .user_volume = 0, .offset_conv_volume = NULL, \
+ }
+
+#define ES_ASSERT(a, format, b, ...) \
+ if ((a) != 0) { \
+ ESP_LOGE(ES_TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
audio_hal_func_t AUDIO_CODEC_ES8388_DEFAULT_HANDLE = {
- .audio_codec_initialize = es8388_init,
- .audio_codec_deinitialize = es8388_deinit,
- .audio_codec_ctrl = es8388_ctrl_state,
- .audio_codec_config_iface = es8388_config_i2s,
- .audio_codec_set_mute = es8388_set_voice_mute,
- .audio_codec_set_volume = es8388_set_voice_volume,
- .audio_codec_get_volume = es8388_get_voice_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = es8388_init,
+ .audio_codec_deinitialize = es8388_deinit,
+ .audio_codec_ctrl = es8388_ctrl_state,
+ .audio_codec_config_iface = es8388_config_i2s,
+ .audio_codec_set_mute = es8388_set_voice_mute,
+ .audio_codec_set_volume = es8388_set_voice_volume,
+ .audio_codec_get_volume = es8388_get_voice_volume,
+ .audio_codec_enable_pa = es8388_pa_power,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
-static esp_err_t
-es_write_reg (uint8_t slave_addr, uint8_t reg_add, uint8_t data)
-{
- return i2c_bus_write_bytes (i2c_handle, slave_addr, ®_add,
- sizeof (reg_add), &data, sizeof (data));
+static esp_err_t es_write_reg(uint8_t slave_addr, uint8_t reg_add,
+ uint8_t data) {
+ return i2c_bus_write_bytes(i2c_handle, slave_addr, ®_add, sizeof(reg_add),
+ &data, sizeof(data));
}
-static esp_err_t
-es_read_reg (uint8_t reg_add, uint8_t *p_data)
-{
- return i2c_bus_read_bytes (i2c_handle, ES8388_ADDR, ®_add,
- sizeof (reg_add), p_data, 1);
+static esp_err_t es_read_reg(uint8_t reg_add, uint8_t *p_data) {
+ return i2c_bus_read_bytes(i2c_handle, ES8388_ADDR, ®_add, sizeof(reg_add),
+ p_data, 1);
}
-static int
-i2c_init ()
-{
+static int i2c_init() {
int res;
- i2c_config_t es_i2c_cfg = { .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000 };
- res = get_i2c_pins (I2C_NUM_0, &es_i2c_cfg);
- ES_ASSERT (res, "getting i2c pins error", -1);
- i2c_handle = i2c_bus_create (I2C_NUM_0, &es_i2c_cfg);
+ i2c_config_t es_i2c_cfg = {.mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000};
+ res = get_i2c_pins(I2C_NUM_0, &es_i2c_cfg);
+ ES_ASSERT(res, "getting i2c pins error", -1);
+ i2c_handle = i2c_bus_create(I2C_NUM_0, &es_i2c_cfg);
return res;
}
-void
-es8388_read_all ()
-{
- for (int i = 0; i < 50; i++)
- {
- uint8_t reg = 0;
- es_read_reg (i, ®);
- ets_printf ("%x: %x\n", i, reg);
- }
+void es8388_read_all() {
+ for (int i = 0; i < 50; i++) {
+ uint8_t reg = 0;
+ es_read_reg(i, ®);
+ ESP_LOGI(ES_TAG, "%x: %x", i, reg);
+ }
}
-esp_err_t
-es8388_write_reg (uint8_t reg_add, uint8_t data)
-{
- return es_write_reg (ES8388_ADDR, reg_add, data);
+esp_err_t es8388_write_reg(uint8_t reg_add, uint8_t data) {
+ return es_write_reg(ES8388_ADDR, reg_add, data);
}
/**
@@ -115,31 +118,26 @@ es8388_write_reg (uint8_t reg_add, uint8_t data)
* - (-1) Parameter error
* - (0) Success
*/
-static int
-es8388_set_adc_dac_volume (int mode, int volume, int dot)
-{
+static int es8388_set_adc_dac_volume(int mode, int volume, int dot) {
int res = 0;
- if (volume < -96 || volume > 0)
- {
- ESP_LOGW (ES_TAG, "Warning: volume < -96! or > 0!\n");
- if (volume < -96)
- volume = -96;
- else
- volume = 0;
- }
+ if (volume < -96 || volume > 0) {
+ ESP_LOGW(ES_TAG, "Warning: volume < -96! or > 0!\n");
+ if (volume < -96)
+ volume = -96;
+ else
+ volume = 0;
+ }
dot = (dot >= 5 ? 1 : 0);
volume = (-volume << 1) + dot;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL8, volume);
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL9,
- volume); // ADC Right Volume=0db
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL5, volume);
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL4, volume);
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL8, volume);
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL9,
+ volume); // ADC Right Volume=0db
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL5, volume);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL4, volume);
+ }
return res;
}
@@ -154,57 +152,47 @@ es8388_set_adc_dac_volume (int mode, int volume, int dot)
* - (-1) Error
* - (0) Success
*/
-esp_err_t
-es8388_start (es_module_t mode)
-{
+esp_err_t es8388_start(es_module_t mode) {
esp_err_t res = ESP_OK;
uint8_t prev_data = 0, data = 0;
- es_read_reg (ES8388_DACCONTROL21, &prev_data);
- if (mode == ES_MODULE_LINE)
- {
- res |= es_write_reg (
- ES8388_ADDR, ES8388_DACCONTROL16,
- 0x09); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2 by pass enable
- res |= es_write_reg (
- ES8388_ADDR, ES8388_DACCONTROL17,
- 0x50); // left DAC to left mixer enable and LIN signal to left
- // mixer enable 0db : bupass enable
- res |= es_write_reg (
- ES8388_ADDR, ES8388_DACCONTROL20,
- 0x50); // right DAC to right mixer enable and LIN signal to right
- // mixer enable 0db : bupass enable
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL21,
- 0xC0); // enable adc
- }
- else
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL21,
- 0x80); // enable dac
- }
- es_read_reg (ES8388_DACCONTROL21, &data);
- if (prev_data != data)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_CHIPPOWER,
- 0xF0); // start state machine
- // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL1, 0x16);
- // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0x50);
- res |= es_write_reg (ES8388_ADDR, ES8388_CHIPPOWER,
- 0x00); // start state machine
- }
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC
- || mode == ES_MODULE_LINE)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCPOWER,
- 0x00); // power up adc and line in
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC
- || mode == ES_MODULE_LINE)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACPOWER,
- 0x3c); // power up dac and line out
- res |= es8388_set_voice_mute (false);
- ESP_LOGD (ES_TAG, "es8388_start default is mode:%d", mode);
- }
+ es_read_reg(ES8388_DACCONTROL21, &prev_data);
+ if (mode == ES_MODULE_LINE) {
+ res |= es_write_reg(
+ ES8388_ADDR, ES8388_DACCONTROL16,
+ 0x09); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2 by pass enable
+ res |=
+ es_write_reg(ES8388_ADDR, ES8388_DACCONTROL17,
+ 0x50); // left DAC to left mixer enable and LIN signal
+ // to left mixer enable 0db : bupass enable
+ res |=
+ es_write_reg(ES8388_ADDR, ES8388_DACCONTROL20,
+ 0x50); // right DAC to right mixer enable and LIN signal
+ // to right mixer enable 0db : bupass enable
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL21, 0xC0); // enable adc
+ } else {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL21, 0x80); // enable dac
+ }
+ es_read_reg(ES8388_DACCONTROL21, &data);
+ if (prev_data != data) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER,
+ 0xF0); // start state machine
+ // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL1, 0x16);
+ // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0x50);
+ res |= es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER,
+ 0x00); // start state machine
+ }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC ||
+ mode == ES_MODULE_LINE) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCPOWER,
+ 0x00); // power up adc and line in
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC ||
+ mode == ES_MODULE_LINE) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER,
+ 0x3c); // power up dac and line out
+ res |= es8388_set_voice_mute(false);
+ ESP_LOGD(ES_TAG, "es8388_start default is mode:%d", mode);
+ }
return res;
}
@@ -220,45 +208,39 @@ es8388_start (es_module_t mode)
* - (-1) Error
* - (0) Success
*/
-esp_err_t
-es8388_stop (es_module_t mode)
-{
+esp_err_t es8388_stop(es_module_t mode) {
esp_err_t res = ESP_OK;
- if (mode == ES_MODULE_LINE)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL21,
- 0x80); // enable dac
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL16,
- 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL17,
- 0x90); // only left DAC to left mixer enable 0db
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL20,
- 0x90); // only right DAC to right mixer enable 0db
- return res;
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACPOWER, 0x00);
- res |= es8388_set_voice_mute (
- true); // res |= Es8388SetAdcDacVolume(ES_MODULE_DAC, -96, 5); // 0db
- // res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER, 0xC0); //power down
- // dac and line out
- }
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- // res |= Es8388SetAdcDacVolume(ES_MODULE_ADC, -96, 5); // 0db
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCPOWER,
- 0xFF); // power down adc and line in
- }
- if (mode == ES_MODULE_ADC_DAC)
- {
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL21,
- 0x9C); // disable mclk
- // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL1, 0x00);
- // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0x58);
- // res |= es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER, 0xF3);
- // //stop state machine
- }
+ if (mode == ES_MODULE_LINE) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL21, 0x80); // enable dac
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL16,
+ 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL17,
+ 0x90); // only left DAC to left mixer enable 0db
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL20,
+ 0x90); // only right DAC to right mixer enable 0db
+ return res;
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER, 0x00);
+ res |= es8388_set_voice_mute(
+ true); // res |= Es8388SetAdcDacVolume(ES_MODULE_DAC, -96, 5); //
+ // 0db
+ // res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER, 0xC0); //power down
+ // dac and line out
+ }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ // res |= Es8388SetAdcDacVolume(ES_MODULE_ADC, -96, 5); // 0db
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCPOWER,
+ 0xFF); // power down adc and line in
+ }
+ if (mode == ES_MODULE_ADC_DAC) {
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL21, 0x9C); // disable
+ // mclk
+ // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL1, 0x00);
+ // res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0x58);
+ // res |= es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER, 0xF3); //stop
+ // state machine
+ }
return res;
}
@@ -273,29 +255,31 @@ es8388_stop (es_module_t mode)
* - (-1) Error
* - (0) Success
*/
-esp_err_t
-es8388_i2s_config_clock (es_i2s_clock_t cfg)
-{
+esp_err_t es8388_i2s_config_clock(es_i2s_clock_t cfg) {
esp_err_t res = ESP_OK;
- res |= es_write_reg (ES8388_ADDR, ES8388_MASTERMODE, cfg.sclk_div);
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL5,
- cfg.lclk_div); // ADCFsMode,singel SPEED,RATIO=256
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL2,
- cfg.lclk_div); // ADCFsMode,singel SPEED,RATIO=256
+ res |= es_write_reg(ES8388_ADDR, ES8388_MASTERMODE, cfg.sclk_div);
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL5,
+ cfg.lclk_div); // ADCFsMode,singel SPEED,RATIO=256
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL2,
+ cfg.lclk_div); // ADCFsMode,singel SPEED,RATIO=256
return res;
}
-esp_err_t
-es8388_deinit (void)
-{
+esp_err_t es8388_deinit(void) {
int res = 0;
- res = es_write_reg (ES8388_ADDR, ES8388_CHIPPOWER,
- 0xFF); // reset and stop es8388
- i2c_bus_delete (i2c_handle);
-#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
- headphone_detect_deinit ();
+
+ res = es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER,
+ 0xFF); // reset and stop es8388
+ i2c_bus_delete(i2c_handle);
+#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || \
+ defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
+ headphone_detect_deinit();
+ res = es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER,
+ 0xFF); // reset and stop es8388
+ i2c_bus_delete(i2c_handle);
#endif
+ audio_codec_volume_deinit(dac_vol_handle);
return res;
}
@@ -304,103 +288,112 @@ es8388_deinit (void)
* - (-1) Error
* - (0) Success
*/
-esp_err_t
-es8388_init (audio_hal_codec_config_t *cfg)
-{
+esp_err_t es8388_init(audio_hal_codec_config_t *cfg) {
int res = 0;
-#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
- headphone_detect_init (get_headphone_detect_gpio ());
+
+#if defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || \
+ defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD)
+ headphone_detect_init(get_headphone_detect_gpio());
#endif
- res = i2c_init (); // ESP32 in master mode
+ res = i2c_init(); // ESP32 in master mode
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL3,
- 0x04); // 0x04 mute/0x00 unmute&ramp;DAC unmute and
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL3,
+ 0x04); // 0x04 mute/0x00 unmute&ramp;DAC unmute and
// disabled digital volume control soft ramp
/* Chip Control and Power Management */
- res |= es_write_reg (ES8388_ADDR, ES8388_CONTROL2, 0x50);
- res |= es_write_reg (ES8388_ADDR, ES8388_CHIPPOWER,
- 0x00); // normal all and power up all
- res |= es_write_reg (ES8388_ADDR, ES8388_MASTERMODE,
- cfg->i2s_iface.mode); // CODEC IN I2S SLAVE MODE
+ res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0x50);
+ res |= es_write_reg(ES8388_ADDR, ES8388_CHIPPOWER,
+ 0x00); // normal all and power up all
+
+ // Disable the internal DLL to improve 8K sample rate
+ res |= es_write_reg(ES8388_ADDR, 0x35, 0xA0);
+ res |= es_write_reg(ES8388_ADDR, 0x37, 0xD0);
+ res |= es_write_reg(ES8388_ADDR, 0x39, 0xD0);
+
+ res |= es_write_reg(ES8388_ADDR, ES8388_MASTERMODE,
+ cfg->i2s_iface.mode); // CODEC IN I2S SLAVE MODE
/* dac */
- res |= es_write_reg (ES8388_ADDR, ES8388_DACPOWER,
- 0xC0); // disable DAC and disable Lout/Rout/1/2
- res |= es_write_reg (
- ES8388_ADDR, ES8388_CONTROL1,
- 0x12); // Enfr=0,Play&Record Mode,(0x17-both of mic&paly)
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER,
+ 0xC0); // disable DAC and disable Lout/Rout/1/2
+ res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL1,
+ 0x12); // Enfr=0,Play&Record Mode,(0x17-both of mic&paly)
// res |= es_write_reg(ES8388_ADDR, ES8388_CONTROL2, 0);
// //LPVrefBuf=0,Pdn_ana=0
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL1,
- 0x18); // 1a 0x18:16bit iis , 0x00:24
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL2,
- 0x02); // DACFsMode,SINGLE SPEED; DACFsRatio,256
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL16,
- 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL17,
- 0x90); // only left DAC to left mixer enable 0db
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL20,
- 0x90); // only right DAC to right mixer enable 0db
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL21,
- 0x80); // set internal ADC and DAC use the same LRCK
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL1,
+ 0x18); // 1a 0x18:16bit iis , 0x00:24
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL2,
+ 0x02); // DACFsMode,SINGLE SPEED; DACFsRatio,256
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL16,
+ 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL17,
+ 0x90); // only left DAC to left mixer enable 0db
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL20,
+ 0x90); // only right DAC to right mixer enable 0db
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL21,
+ 0x80); // set internal ADC and DAC use the same LRCK
// clock, ADC LRCK as internal LRCK
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL23, 0x00); // vroi=0
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL24, 0x1E); // Set L1 R1 L2 R2 volume. 0x00: -30dB, 0x1E: 0dB, 0x21: 3dB
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL25, 0x1E);
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL26, 0x1E);
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL27, 0x1E);
- res |= es8388_set_adc_dac_volume (ES_MODULE_DAC, 0, 0); // 0db
+
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL23, 0x00); // vroi=0
+ res |= es_write_reg(
+ ES8388_ADDR, ES8388_DACCONTROL24,
+ 0x1E); // Set L1 R1 L2 R2 volume. 0x00: -30dB, 0x1E: 0dB, 0x21: 3dB
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL25, 0x1E);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL26, 0x1E);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL27, 0x1E);
+ res |= es8388_set_adc_dac_volume(ES_MODULE_DAC, 0, 0); // 0db
int tmp = 0;
- if (AUDIO_HAL_DAC_OUTPUT_LINE2 == cfg->dac_output)
- {
- tmp = DAC_OUTPUT_LOUT1 | DAC_OUTPUT_ROUT1;
- }
- else if (AUDIO_HAL_DAC_OUTPUT_LINE1 == cfg->dac_output)
- {
- tmp = DAC_OUTPUT_LOUT2 | DAC_OUTPUT_ROUT2;
- }
- else
- {
- tmp = DAC_OUTPUT_LOUT1 | DAC_OUTPUT_LOUT2 | DAC_OUTPUT_ROUT1
- | DAC_OUTPUT_ROUT2;
- }
- res |= es_write_reg (ES8388_ADDR, ES8388_DACPOWER,
- tmp); // 0x3c Enable DAC and Enable Lout/Rout/1/2
+ if (AUDIO_HAL_DAC_OUTPUT_LINE2 == cfg->dac_output) {
+ tmp = DAC_OUTPUT_LOUT1 | DAC_OUTPUT_ROUT1;
+ } else if (AUDIO_HAL_DAC_OUTPUT_LINE1 == cfg->dac_output) {
+ tmp = DAC_OUTPUT_LOUT2 | DAC_OUTPUT_ROUT2;
+ } else {
+ tmp = DAC_OUTPUT_LOUT1 | DAC_OUTPUT_LOUT2 | DAC_OUTPUT_ROUT1 |
+ DAC_OUTPUT_ROUT2;
+ }
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER,
+ tmp); // 0x3c Enable DAC and Enable Lout/Rout/1/2
/* adc */
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCPOWER, 0xFF);
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL1,
- 0xbb); // MIC Left and Right channel PGA gain
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCPOWER, 0xFF);
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL1,
+ 0xbb); // MIC Left and Right channel PGA gain
tmp = 0;
- if (AUDIO_HAL_ADC_INPUT_LINE1 == cfg->adc_input)
- {
- tmp = ADC_INPUT_LINPUT1_RINPUT1;
- }
- else if (AUDIO_HAL_ADC_INPUT_LINE2 == cfg->adc_input)
- {
- tmp = ADC_INPUT_LINPUT2_RINPUT2;
- }
- else
- {
- tmp = ADC_INPUT_DIFFERENCE;
- }
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL2,
- tmp); // 0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input;
+ if (AUDIO_HAL_ADC_INPUT_LINE1 == cfg->adc_input) {
+ tmp = ADC_INPUT_LINPUT1_RINPUT1;
+ } else if (AUDIO_HAL_ADC_INPUT_LINE2 == cfg->adc_input) {
+ tmp = ADC_INPUT_LINPUT2_RINPUT2;
+ } else {
+ tmp = ADC_INPUT_DIFFERENCE;
+ }
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL2,
+ tmp); // 0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input;
// DSSEL,use one DS Reg11; DSR, LINPUT1-RINPUT1
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL3, 0x02);
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL4,
- 0x0d); // Left/Right data, Left/Right justified mode,
- // Bits length, I2S format
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL5,
- 0x02); // ADCFsMode,singel SPEED,RATIO=256
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL3, 0x02);
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL4,
+ 0x0c); // 16 Bits length and I2S serial audio data format
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL5,
+ 0x02); // ADCFsMode,singel SPEED,RATIO=256
// ALC for Microphone
- res |= es8388_set_adc_dac_volume (ES_MODULE_ADC, 0, 0); // 0db
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCPOWER,
- 0x09); // Power on ADC, Enable LIN&RIN, Power off
- // MICBIAS, set int1lp to low power mode
+ res |= es8388_set_adc_dac_volume(ES_MODULE_ADC, 0, 0); // 0db
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCPOWER,
+ 0x09); // Power on ADC, enable LIN&RIN, power off
+ // MICBIAS, and set int1lp to low power mode
+
+ /* es8388 PA gpio_config */
+ gpio_config_t io_conf;
+ memset(&io_conf, 0, sizeof(io_conf));
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = BIT64(get_pa_enable_gpio());
+ io_conf.pull_down_en = 0;
+ io_conf.pull_up_en = 0;
+ gpio_config(&io_conf);
/* enable es8388 PA */
- es8388_pa_power (true);
- ESP_LOGI (ES_TAG, "init,out:%02x, in:%02x", cfg->dac_output, cfg->adc_input);
+ es8388_pa_power(true);
+
+ codec_dac_volume_config_t vol_cfg = ES8388_DAC_VOL_CFG_DEFAULT();
+ dac_vol_handle = audio_codec_volume_init(&vol_cfg);
+ ESP_LOGI(ES_TAG, "init,out:%02x, in:%02x", cfg->dac_output, cfg->adc_input);
return res;
}
@@ -414,41 +407,45 @@ es8388_init (audio_hal_codec_config_t *cfg)
* - (-1) Error
* - (0) Success
*/
-esp_err_t
-es8388_config_fmt (es_module_t mode, es_i2s_fmt_t fmt)
-{
+esp_err_t es8388_config_fmt(es_module_t mode, es_i2s_fmt_t fmt) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res = es_read_reg (ES8388_ADCCONTROL4, ®);
- reg = reg & 0xfc;
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL4, reg | fmt);
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res = es_read_reg (ES8388_DACCONTROL1, ®);
- reg = reg & 0xf9;
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL1, reg | (fmt << 1));
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res = es_read_reg(ES8388_ADCCONTROL4, ®);
+ reg = reg & 0xfc;
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL4, reg | fmt);
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res = es_read_reg(ES8388_DACCONTROL1, ®);
+ reg = reg & 0xf9;
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL1, reg | (fmt << 1));
+ }
return res;
}
/**
- * @param volume: 0 ~ 100
+ * @brief Set voice volume
+ *
+ * @note Register values. 0xC0: -96 dB, 0x64: -50 dB, 0x00: 0 dB
+ * @note Accuracy of gain is 0.5 dB
+ *
+ * @param volume: voice volume (0~100)
*
* @return
- * - (-1) Error
- * - (0) Success
+ * - ESP_OK
+ * - ESP_FAIL
*/
-esp_err_t
-es8388_set_voice_volume (int volume)
-{
+esp_err_t es8388_set_voice_volume(int volume) {
esp_err_t res = ESP_OK;
- if (volume < 0)
- volume = 0;
- else if (volume > 100)
- volume = 100;
+ uint8_t reg = 0;
+
+ reg = audio_codec_get_dac_reg_value(dac_vol_handle, volume);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL5, reg);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL4, reg);
+ ESP_LOGD(ES_TAG, "Set volume:%.2d reg_value:0x%.2x dB:%.1f",
+ (int)dac_vol_handle->user_volume, reg,
+ audio_codec_cal_dac_volume(dac_vol_handle));
+
/* Audio Settings can be checked here:
* https://dl.radxa.com/rock2/docs/hw/ds/ES8388%20user%20Guide.pdf
*
@@ -462,43 +459,46 @@ es8388_set_voice_volume (int volume)
*/
// restrict range from 0-46 instead of 0-192
- int inv_volume = -0.46 * volume + 46;
- if (volume == 0) {
- // if volume is 0, set to -96dB
- inv_volume = 192;
- }
- res = es_write_reg (ES8388_ADDR, ES8388_DACCONTROL5, inv_volume);
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL4, inv_volume);
+ // int inv_volume = -0.46 * volume + 46;
+ // if (volume == 0) {
+ // // if volume is 0, set to -96dB
+ // inv_volume = 192;
+ // }
+ // res = es_write_reg (ES8388_ADDR, ES8388_DACCONTROL5, inv_volume);
+ // res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL4, inv_volume);
return res;
}
-/**
- *
- * @return
- * volume
- */
-esp_err_t
-es8388_get_voice_volume (int *volume)
-{
+esp_err_t es8388_get_voice_volume(int *volume) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res = es_read_reg (ES8388_DACCONTROL4, ®);
- if (res == ESP_FAIL)
- {
+
+ res = es_read_reg(ES8388_DACCONTROL4, ®);
+ if (res == ESP_FAIL) {
+ *volume = 0;
+ } else {
+ if (reg == dac_vol_handle->reg_value) {
+ *volume = dac_vol_handle->user_volume;
+ } else {
*volume = 0;
+ res = ESP_FAIL;
}
- else
- {
- // 0 = 0dB, 192 = -96dB
- // max is 0, min is 46
- // interpolate to 0-100
- if (reg == 192) {
- *volume = 0;
- }
- else {
- *volume = -(50/23) * reg + 100;
- }
- }
+ }
+ ESP_LOGD(ES_TAG, "Get volume:%.2d reg_value:0x%.2x", *volume, reg);
+
+ // else
+ // {
+ // // 0 = 0dB, 192 = -96dB
+ // // max is 0, min is 46
+ // // interpolate to 0-100
+ // if (reg == 192) {
+ // *volume = 0;
+ // }
+ // else {
+ // *volume = -(50/23) * reg + 100;
+ // }
+ // }
+
return res;
}
@@ -512,25 +512,22 @@ es8388_get_voice_volume (int *volume)
* - (-1) Parameter error
* - (0) Success
*/
-esp_err_t
-es8388_set_bits_per_sample (es_module_t mode, es_bits_length_t bits_length)
-{
+esp_err_t es8388_set_bits_per_sample(es_module_t mode,
+ es_bits_length_t bits_length) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
int bits = (int)bits_length;
- if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC)
- {
- res = es_read_reg (ES8388_ADCCONTROL4, ®);
- reg = reg & 0xe3;
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL4, reg | (bits << 2));
- }
- if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC)
- {
- res = es_read_reg (ES8388_DACCONTROL1, ®);
- reg = reg & 0xc7;
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL1, reg | (bits << 3));
- }
+ if (mode == ES_MODULE_ADC || mode == ES_MODULE_ADC_DAC) {
+ res = es_read_reg(ES8388_ADCCONTROL4, ®);
+ reg = reg & 0xe3;
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL4, reg | (bits << 2));
+ }
+ if (mode == ES_MODULE_DAC || mode == ES_MODULE_ADC_DAC) {
+ res = es_read_reg(ES8388_DACCONTROL1, ®);
+ reg = reg & 0xc7;
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACCONTROL1, reg | (bits << 3));
+ }
return res;
}
@@ -544,28 +541,23 @@ es8388_set_bits_per_sample (es_module_t mode, es_bits_length_t bits_length)
* - (-1) Parameter error
* - (0) Success
*/
-esp_err_t
-es8388_set_voice_mute (bool enable)
-{
+esp_err_t es8388_set_voice_mute(bool enable) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res = es_read_reg (ES8388_DACCONTROL3, ®);
+ res = es_read_reg(ES8388_DACCONTROL3, ®);
reg = reg & 0xFB;
- res |= es_write_reg (ES8388_ADDR, ES8388_DACCONTROL3,
- reg | (((int)enable) << 2));
+ res |=
+ es_write_reg(ES8388_ADDR, ES8388_DACCONTROL3, reg | (((int)enable) << 2));
return res;
}
-esp_err_t
-es8388_get_voice_mute (void)
-{
+esp_err_t es8388_get_voice_mute(void) {
esp_err_t res = ESP_OK;
uint8_t reg = 0;
- res = es_read_reg (ES8388_DACCONTROL3, ®);
- if (res == ESP_OK)
- {
- reg = (reg & 0x04) >> 2;
- }
+ res = es_read_reg(ES8388_DACCONTROL3, ®);
+ if (res == ESP_OK) {
+ reg = (reg & 0x04) >> 2;
+ }
return res == ESP_OK ? reg : res;
}
@@ -576,14 +568,12 @@ es8388_get_voice_mute (void)
* - (-1) Parameter error
* - (0) Success
*/
-esp_err_t
-es8388_config_dac_output (int output)
-{
+esp_err_t es8388_config_dac_output(int output) {
esp_err_t res;
uint8_t reg = 0;
- res = es_read_reg (ES8388_DACPOWER, ®);
+ res = es_read_reg(ES8388_DACPOWER, ®);
reg = reg & 0xc3;
- res |= es_write_reg (ES8388_ADDR, ES8388_DACPOWER, reg | output);
+ res |= es_write_reg(ES8388_ADDR, ES8388_DACPOWER, reg | output);
return res;
}
@@ -594,14 +584,12 @@ es8388_config_dac_output (int output)
* - (-1) Parameter error
* - (0) Success
*/
-esp_err_t
-es8388_config_adc_input (es_adc_input_t input)
-{
+esp_err_t es8388_config_adc_input(es_adc_input_t input) {
esp_err_t res;
uint8_t reg = 0;
- res = es_read_reg (ES8388_ADCCONTROL2, ®);
+ res = es_read_reg(ES8388_ADCCONTROL2, ®);
reg = reg & 0x0f;
- res |= es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL2, reg | input);
+ res |= es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL2, reg | input);
return res;
}
@@ -612,23 +600,19 @@ es8388_config_adc_input (es_adc_input_t input)
* - (-1) Parameter error
* - (0) Success
*/
-esp_err_t
-es8388_set_mic_gain (es_mic_gain_t gain)
-{
+esp_err_t es8388_set_mic_gain(es_mic_gain_t gain) {
esp_err_t res, gain_n;
gain_n = (int)gain / 3;
gain_n = (gain_n << 4) + gain_n;
- res = es_write_reg (ES8388_ADDR, ES8388_ADCCONTROL1, gain_n); // MIC PGA
+ res = es_write_reg(ES8388_ADDR, ES8388_ADCCONTROL1, gain_n); // MIC PGA
return res;
}
-int
-es8388_ctrl_state (audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state)
-{
+int es8388_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
int res = 0;
int es_mode_t = 0;
- switch (mode)
- {
+ switch (mode) {
case AUDIO_HAL_CODEC_MODE_ENCODE:
es_mode_t = ES_MODULE_ADC;
break;
@@ -643,61 +627,40 @@ es8388_ctrl_state (audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state)
break;
default:
es_mode_t = ES_MODULE_DAC;
- ESP_LOGW (ES_TAG, "Codec mode not support, default is decode mode");
+ ESP_LOGW(ES_TAG, "Codec mode not support, default is decode mode");
break;
- }
- if (AUDIO_HAL_CTRL_STOP == ctrl_state)
- {
- res = es8388_stop (es_mode_t);
- }
- else
- {
- res = es8388_start (es_mode_t);
- ESP_LOGD (ES_TAG, "start default is decode mode:%d", es_mode_t);
- }
+ }
+ if (AUDIO_HAL_CTRL_STOP == ctrl_state) {
+ res = es8388_stop(es_mode_t);
+ } else {
+ res = es8388_start(es_mode_t);
+ ESP_LOGD(ES_TAG, "start default is decode mode:%d", es_mode_t);
+ }
return res;
}
-esp_err_t
-es8388_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t es8388_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
esp_err_t res = ESP_OK;
int tmp = 0;
- res |= es8388_config_fmt (ES_MODULE_ADC_DAC, iface->fmt);
- if (iface->bits == AUDIO_HAL_BIT_LENGTH_16BITS)
- {
- tmp = BIT_LENGTH_16BITS;
- }
- else if (iface->bits == AUDIO_HAL_BIT_LENGTH_24BITS)
- {
- tmp = BIT_LENGTH_24BITS;
- }
- else
- {
- tmp = BIT_LENGTH_32BITS;
- }
- res |= es8388_set_bits_per_sample (ES_MODULE_ADC_DAC, tmp);
+ res |= es8388_config_fmt(ES_MODULE_ADC_DAC, iface->fmt);
+ if (iface->bits == AUDIO_HAL_BIT_LENGTH_16BITS) {
+ tmp = BIT_LENGTH_16BITS;
+ } else if (iface->bits == AUDIO_HAL_BIT_LENGTH_24BITS) {
+ tmp = BIT_LENGTH_24BITS;
+ } else {
+ tmp = BIT_LENGTH_32BITS;
+ }
+ res |= es8388_set_bits_per_sample(ES_MODULE_ADC_DAC, tmp);
return res;
}
-void
-es8388_pa_power (bool enable)
-{
- gpio_config_t io_conf;
- memset (&io_conf, 0, sizeof (io_conf));
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
- io_conf.mode = GPIO_MODE_OUTPUT;
- io_conf.pin_bit_mask = BIT64 (get_pa_enable_gpio ());
- io_conf.pull_down_en = 0;
- io_conf.pull_up_en = 0;
- gpio_config (&io_conf);
- if (enable)
- {
- gpio_set_level (get_pa_enable_gpio (), 1);
- }
- else
- {
- gpio_set_level (get_pa_enable_gpio (), 0);
- }
+esp_err_t es8388_pa_power(bool enable) {
+ esp_err_t res = ESP_OK;
+ if (enable) {
+ res = gpio_set_level(get_pa_enable_gpio(), 1);
+ } else {
+ res = gpio_set_level(get_pa_enable_gpio(), 0);
+ }
+ return res;
}
diff --git a/components/audio_hal/driver/es8388/es8388.h b/components/audio_hal/driver/es8388/es8388.h
index 1e9e0f1..eaaeb1f 100644
--- a/components/audio_hal/driver/es8388/es8388.h
+++ b/components/audio_hal/driver/es8388/es8388.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -33,8 +33,7 @@
#include "esxxx_common.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
/* ES8388 address */
@@ -102,218 +101,219 @@ extern "C"
#define ES8388_DACCONTROL29 0x33
#define ES8388_DACCONTROL30 0x34
- /**
- * @brief Initialize ES8388 codec chip
- *
- * @param cfg configuration of ES8388
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_init (audio_hal_codec_config_t *cfg);
+/**
+ * @brief Initialize ES8388 codec chip
+ *
+ * @param cfg configuration of ES8388
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_init(audio_hal_codec_config_t *cfg);
- /**
- * @brief Deinitialize ES8388 codec chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_deinit (void);
+/**
+ * @brief Deinitialize ES8388 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_deinit(void);
- /**
- * @brief Configure ES8388 I2S format
- *
- * @param mod: set ADC or DAC or both
- * @param cfg: ES8388 I2S format
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_config_fmt (es_module_t mod, es_i2s_fmt_t cfg);
+/**
+ * @brief Configure ES8388 I2S format
+ *
+ * @param mod: set ADC or DAC or both
+ * @param cfg: ES8388 I2S format
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_config_fmt(es_module_t mod, es_i2s_fmt_t cfg);
- /**
- * @brief Configure I2s clock in MSATER mode
- *
- * @param cfg: set bits clock and WS clock
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_i2s_config_clock (es_i2s_clock_t cfg);
+/**
+ * @brief Configure I2s clock in MSATER mode
+ *
+ * @param cfg: set bits clock and WS clock
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_i2s_config_clock(es_i2s_clock_t cfg);
- /**
- * @brief Configure ES8388 data sample bits
- *
- * @param mode: set ADC or DAC or both
- * @param bit_per_sample: bit number of per sample
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_set_bits_per_sample (es_module_t mode,
- es_bits_length_t bit_per_sample);
+/**
+ * @brief Configure ES8388 data sample bits
+ *
+ * @param mode: set ADC or DAC or both
+ * @param bit_per_sample: bit number of per sample
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_set_bits_per_sample(es_module_t mode,
+ es_bits_length_t bit_per_sample);
- /**
- * @brief Start ES8388 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_start (es_module_t mode);
+/**
+ * @brief Start ES8388 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_start(es_module_t mode);
- /**
- * @brief Stop ES8388 codec chip
- *
- * @param mode: set ADC or DAC or both
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_stop (es_module_t mode);
+/**
+ * @brief Stop ES8388 codec chip
+ *
+ * @param mode: set ADC or DAC or both
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_stop(es_module_t mode);
- /**
- * @brief Set voice volume
- *
- * @param volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_set_voice_volume (int volume);
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_set_voice_volume(int volume);
- /**
- * @brief Get voice volume
- *
- * @param[out] *volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t es8388_get_voice_volume (int *volume);
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t es8388_get_voice_volume(int *volume);
- /**
- * @brief Configure ES8388 DAC mute or not. Basically you can use this
- * function to mute the output or unmute
- *
- * @param enable enable(1) or disable(0)
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_set_voice_mute (bool enable);
+/**
+ * @brief Configure ES8388 DAC mute or not. Basically you can use this function
+ * to mute the output or unmute
+ *
+ * @param enable enable(1) or disable(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_set_voice_mute(bool enable);
- /**
- * @brief Get ES8388 DAC mute status
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_get_voice_mute (void);
+/**
+ * @brief Get ES8388 DAC mute status
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_get_voice_mute(void);
- /**
- * @brief Set ES8388 mic gain
- *
- * @param gain db of mic gain
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_set_mic_gain (es_mic_gain_t gain);
+/**
+ * @brief Set ES8388 mic gain
+ *
+ * @param gain db of mic gain
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_set_mic_gain(es_mic_gain_t gain);
- /**
- * @brief Set ES8388 adc input mode
- *
- * @param input adc input mode
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_config_adc_input (es_adc_input_t input);
+/**
+ * @brief Set ES8388 adc input mode
+ *
+ * @param input adc input mode
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_config_adc_input(es_adc_input_t input);
- /**
- * @brief Set ES8388 dac output mode
- *
- * @param output dac output mode
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_config_dac_output (es_dac_output_t output);
+/**
+ * @brief Set ES8388 dac output mode
+ *
+ * @param output dac output mode
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_config_dac_output(es_dac_output_t output);
- /**
- * @brief Write ES8388 register
- *
- * @param reg_add address of register
- * @param data data of register
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_write_reg (uint8_t reg_add, uint8_t data);
+/**
+ * @brief Write ES8388 register
+ *
+ * @param reg_add address of register
+ * @param data data of register
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_write_reg(uint8_t reg_add, uint8_t data);
- /**
- * @brief Print all ES8388 registers
- *
- * @return
- * - void
- */
- void es8388_read_all ();
+/**
+ * @brief Print all ES8388 registers
+ *
+ * @return
+ * - void
+ */
+void es8388_read_all();
- /**
- * @brief Configure ES8388 codec mode and I2S interface
- *
- * @param mode codec mode
- * @param iface I2S config
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_config_i2s (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Configure ES8388 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Control ES8388 codec chip
- *
- * @param mode codec mode
- * @param ctrl_state start or stop decode or encode progress
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t es8388_ctrl_state (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Control ES8388 codec chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t es8388_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
- /**
- * @brief Set ES8388 PA power
- *
- * @param enable true for enable PA power, false for disable PA power
- *
- * @return
- * - void
- */
- void es8388_pa_power (bool enable);
+/**
+ * @brief Set ES8388 PA power
+ *
+ * @param enable true for enable PA power, false for disable PA power
+ *
+ * @return
+ * - ESP_ERR_INVALID_ARG
+ * - ESP_OK
+ */
+esp_err_t es8388_pa_power(bool enable);
#ifdef __cplusplus
}
#endif
-#endif //__ES8388_H__
+#endif //__ES8388_H__
diff --git a/components/audio_hal/driver/es8388/headphone_detect.c b/components/audio_hal/driver/es8388/headphone_detect.c
index f97927b..3490fce 100644
--- a/components/audio_hal/driver/es8388/headphone_detect.c
+++ b/components/audio_hal/driver/es8388/headphone_detect.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -40,71 +40,56 @@
#define HP_DELAY_TIME_MS 1000
-static char *TAG = "HEADPHONE";
+static const char *TAG = "HEADPHONE";
static xTimerHandle timer_headphone;
-static void
-hp_timer_cb (TimerHandle_t xTimer)
-{
- int num = (int)pvTimerGetTimerID (xTimer);
- int res = gpio_get_level (num);
- es8388_pa_power (res);
- ESP_LOGW (TAG, "Headphone jack %s", res ? "removed" : "inserted");
+static void hp_timer_cb(TimerHandle_t xTimer) {
+ int num = (int)pvTimerGetTimerID(xTimer);
+ int res = gpio_get_level(num);
+ es8388_pa_power(res);
}
-static int
-hp_timer_init (int num)
-{
- timer_headphone
- = xTimerCreate ("hp_timer0", HP_DELAY_TIME_MS / portTICK_RATE_MS,
- pdFALSE, (void *)num, hp_timer_cb);
- if (timer_headphone == NULL)
- {
- ESP_LOGE (TAG, "hp_timer create err");
- return ESP_FAIL;
- }
+static int hp_timer_init(int num) {
+ timer_headphone =
+ xTimerCreate("hp_timer0", HP_DELAY_TIME_MS / portTICK_RATE_MS, pdFALSE,
+ (void *)num, hp_timer_cb);
+ if (timer_headphone == NULL) {
+ ESP_LOGE(TAG, "hp_timer create err");
+ return ESP_FAIL;
+ }
return ESP_OK;
}
-static void IRAM_ATTR
-headphone_gpio_intr_handler (void *arg)
-{
+static void IRAM_ATTR headphone_gpio_intr_handler(void *arg) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
- xTimerResetFromISR (timer_headphone, &xHigherPriorityTaskWoken);
- if (xHigherPriorityTaskWoken != pdFALSE)
- {
- portYIELD_FROM_ISR ();
- }
+ xTimerResetFromISR(timer_headphone, &xHigherPriorityTaskWoken);
+ if (xHigherPriorityTaskWoken != pdFALSE) {
+ portYIELD_FROM_ISR();
+ }
}
-void
-headphone_detect_deinit ()
-{
- xTimerDelete (timer_headphone, HP_DELAY_TIME_MS / portTICK_RATE_MS);
- gpio_uninstall_isr_service ();
+void headphone_detect_deinit() {
+ xTimerDelete(timer_headphone, HP_DELAY_TIME_MS / portTICK_RATE_MS);
+ gpio_uninstall_isr_service();
timer_headphone = NULL;
}
-int
-headphone_status_get ()
-{
- return gpio_get_level (0);
+int headphone_status_get() {
+ return gpio_get_level(get_headphone_detect_gpio());
}
-void
-headphone_detect_init (int num)
-{
- hp_timer_init (num);
+void headphone_detect_init(int num) {
+ hp_timer_init(num);
gpio_config_t io_conf;
- memset (&io_conf, 0, sizeof (io_conf));
+ memset(&io_conf, 0, sizeof(io_conf));
io_conf.intr_type = GPIO_INTR_ANYEDGE;
io_conf.mode = GPIO_MODE_INPUT;
- io_conf.pin_bit_mask = BIT64 (num);
+ io_conf.pin_bit_mask = BIT64(num);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 1;
- gpio_config (&io_conf);
+ gpio_config(&io_conf);
- gpio_install_isr_service (0);
- gpio_isr_handler_add (num, headphone_gpio_intr_handler, (void *)num);
+ gpio_install_isr_service(0);
+ gpio_isr_handler_add(num, headphone_gpio_intr_handler, (void *)num);
}
#endif /* defined(CONFIG_ESP_LYRAT_V4_3_BOARD) || defined(CONFIG_ESP_AI_THINKER_ES8388_BOARD) */
diff --git a/components/audio_hal/driver/es8388/headphone_detect.h b/components/audio_hal/driver/es8388/headphone_detect.h
index 7bbaa0e..4ca4161 100644
--- a/components/audio_hal/driver/es8388/headphone_detect.h
+++ b/components/audio_hal/driver/es8388/headphone_detect.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,46 +18,45 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
-#ifndef _AUDIO_HEADPHONE_DETEC_H_
-#define _AUDIO_HEADPHONE_DETEC_H_
+#ifndef _AUDIO_HEADPHONE_DETECT_H_
+#define _AUDIO_HEADPHONE_DETECT_H_
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Get headphone insertion status
- *
- * @param None.
- *
- * @return int, 0:headphone inserted, 1:headphone not inserted.
- */
- int headphone_status_get ();
+/**
+ * @brief Get headphone insertion status
+ *
+ * @param None.
+ *
+ * @return int, 0:headphone inserted, 1:headphone not inserted.
+ */
+int headphone_status_get();
- /**
- * @brief Initialize headphone detect gpio.
- *
- * @param None.
- *
- * @return None.
- */
- void headphone_detect_init (int num);
+/**
+ * @brief Initialize headphone detect gpio.
+ *
+ * @param None.
+ *
+ * @return None.
+ */
+void headphone_detect_init(int num);
- /**
- * @brief Delete headphone detect timer.
- *
- * @param None.
- *
- * @return None.
- */
- void headphone_detect_deinit ();
+/**
+ * @brief Delete headphone detect timer.
+ *
+ * @param None.
+ *
+ * @return None.
+ */
+void headphone_detect_deinit();
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/include/esxxx_common.h b/components/audio_hal/driver/include/esxxx_common.h
index 5b84e85..badf617 100644
--- a/components/audio_hal/driver/include/esxxx_common.h
+++ b/components/audio_hal/driver/include/esxxx_common.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -28,172 +28,160 @@
#define _ESXXX_COMMON_H_
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- typedef enum
- {
- BIT_LENGTH_MIN = -1,
- BIT_LENGTH_16BITS = 0x03,
- BIT_LENGTH_18BITS = 0x02,
- BIT_LENGTH_20BITS = 0x01,
- BIT_LENGTH_24BITS = 0x00,
- BIT_LENGTH_32BITS = 0x04,
- BIT_LENGTH_MAX,
- } es_bits_length_t;
+typedef enum {
+ BIT_LENGTH_MIN = -1,
+ BIT_LENGTH_16BITS = 0x03,
+ BIT_LENGTH_18BITS = 0x02,
+ BIT_LENGTH_20BITS = 0x01,
+ BIT_LENGTH_24BITS = 0x00,
+ BIT_LENGTH_32BITS = 0x04,
+ BIT_LENGTH_MAX,
+} es_bits_length_t;
- typedef enum
- {
- MCLK_DIV_MIN = -1,
- MCLK_DIV_1 = 1,
- MCLK_DIV_2 = 2,
- MCLK_DIV_3 = 3,
- MCLK_DIV_4 = 4,
- MCLK_DIV_6 = 5,
- MCLK_DIV_8 = 6,
- MCLK_DIV_9 = 7,
- MCLK_DIV_11 = 8,
- MCLK_DIV_12 = 9,
- MCLK_DIV_16 = 10,
- MCLK_DIV_18 = 11,
- MCLK_DIV_22 = 12,
- MCLK_DIV_24 = 13,
- MCLK_DIV_33 = 14,
- MCLK_DIV_36 = 15,
- MCLK_DIV_44 = 16,
- MCLK_DIV_48 = 17,
- MCLK_DIV_66 = 18,
- MCLK_DIV_72 = 19,
- MCLK_DIV_5 = 20,
- MCLK_DIV_10 = 21,
- MCLK_DIV_15 = 22,
- MCLK_DIV_17 = 23,
- MCLK_DIV_20 = 24,
- MCLK_DIV_25 = 25,
- MCLK_DIV_30 = 26,
- MCLK_DIV_32 = 27,
- MCLK_DIV_34 = 28,
- MCLK_DIV_7 = 29,
- MCLK_DIV_13 = 30,
- MCLK_DIV_14 = 31,
- MCLK_DIV_MAX,
- } es_sclk_div_t;
+typedef enum {
+ MCLK_DIV_MIN = -1,
+ MCLK_DIV_1 = 1,
+ MCLK_DIV_2 = 2,
+ MCLK_DIV_3 = 3,
+ MCLK_DIV_4 = 4,
+ MCLK_DIV_6 = 5,
+ MCLK_DIV_8 = 6,
+ MCLK_DIV_9 = 7,
+ MCLK_DIV_11 = 8,
+ MCLK_DIV_12 = 9,
+ MCLK_DIV_16 = 10,
+ MCLK_DIV_18 = 11,
+ MCLK_DIV_22 = 12,
+ MCLK_DIV_24 = 13,
+ MCLK_DIV_33 = 14,
+ MCLK_DIV_36 = 15,
+ MCLK_DIV_44 = 16,
+ MCLK_DIV_48 = 17,
+ MCLK_DIV_66 = 18,
+ MCLK_DIV_72 = 19,
+ MCLK_DIV_5 = 20,
+ MCLK_DIV_10 = 21,
+ MCLK_DIV_15 = 22,
+ MCLK_DIV_17 = 23,
+ MCLK_DIV_20 = 24,
+ MCLK_DIV_25 = 25,
+ MCLK_DIV_30 = 26,
+ MCLK_DIV_32 = 27,
+ MCLK_DIV_34 = 28,
+ MCLK_DIV_7 = 29,
+ MCLK_DIV_13 = 30,
+ MCLK_DIV_14 = 31,
+ MCLK_DIV_MAX,
+} es_sclk_div_t;
- typedef enum
- {
- LCLK_DIV_MIN = -1,
- LCLK_DIV_128 = 0,
- LCLK_DIV_192 = 1,
- LCLK_DIV_256 = 2,
- LCLK_DIV_384 = 3,
- LCLK_DIV_512 = 4,
- LCLK_DIV_576 = 5,
- LCLK_DIV_768 = 6,
- LCLK_DIV_1024 = 7,
- LCLK_DIV_1152 = 8,
- LCLK_DIV_1408 = 9,
- LCLK_DIV_1536 = 10,
- LCLK_DIV_2112 = 11,
- LCLK_DIV_2304 = 12,
+typedef enum {
+ LCLK_DIV_MIN = -1,
+ LCLK_DIV_128 = 0,
+ LCLK_DIV_192 = 1,
+ LCLK_DIV_256 = 2,
+ LCLK_DIV_384 = 3,
+ LCLK_DIV_512 = 4,
+ LCLK_DIV_576 = 5,
+ LCLK_DIV_768 = 6,
+ LCLK_DIV_1024 = 7,
+ LCLK_DIV_1152 = 8,
+ LCLK_DIV_1408 = 9,
+ LCLK_DIV_1536 = 10,
+ LCLK_DIV_2112 = 11,
+ LCLK_DIV_2304 = 12,
- LCLK_DIV_125 = 16,
- LCLK_DIV_136 = 17,
- LCLK_DIV_250 = 18,
- LCLK_DIV_272 = 19,
- LCLK_DIV_375 = 20,
- LCLK_DIV_500 = 21,
- LCLK_DIV_544 = 22,
- LCLK_DIV_750 = 23,
- LCLK_DIV_1000 = 24,
- LCLK_DIV_1088 = 25,
- LCLK_DIV_1496 = 26,
- LCLK_DIV_1500 = 27,
- LCLK_DIV_MAX,
- } es_lclk_div_t;
+ LCLK_DIV_125 = 16,
+ LCLK_DIV_136 = 17,
+ LCLK_DIV_250 = 18,
+ LCLK_DIV_272 = 19,
+ LCLK_DIV_375 = 20,
+ LCLK_DIV_500 = 21,
+ LCLK_DIV_544 = 22,
+ LCLK_DIV_750 = 23,
+ LCLK_DIV_1000 = 24,
+ LCLK_DIV_1088 = 25,
+ LCLK_DIV_1496 = 26,
+ LCLK_DIV_1500 = 27,
+ LCLK_DIV_MAX,
+} es_lclk_div_t;
- typedef enum
- {
- D2SE_PGA_GAIN_MIN = -1,
- D2SE_PGA_GAIN_DIS = 0,
- D2SE_PGA_GAIN_EN = 1,
- D2SE_PGA_GAIN_MAX = 2,
- } es_d2se_pga_t;
+typedef enum {
+ D2SE_PGA_GAIN_MIN = -1,
+ D2SE_PGA_GAIN_DIS = 0,
+ D2SE_PGA_GAIN_EN = 1,
+ D2SE_PGA_GAIN_MAX = 2,
+} es_d2se_pga_t;
- typedef enum
- {
- ADC_INPUT_MIN = -1,
- ADC_INPUT_LINPUT1_RINPUT1 = 0x00,
- ADC_INPUT_MIC1 = 0x05,
- ADC_INPUT_MIC2 = 0x06,
- ADC_INPUT_LINPUT2_RINPUT2 = 0x50,
- ADC_INPUT_DIFFERENCE = 0xf0,
- ADC_INPUT_MAX,
- } es_adc_input_t;
+typedef enum {
+ ADC_INPUT_MIN = -1,
+ ADC_INPUT_LINPUT1_RINPUT1 = 0x00,
+ ADC_INPUT_MIC1 = 0x05,
+ ADC_INPUT_MIC2 = 0x06,
+ ADC_INPUT_LINPUT2_RINPUT2 = 0x50,
+ ADC_INPUT_DIFFERENCE = 0xf0,
+ ADC_INPUT_MAX,
+} es_adc_input_t;
- typedef enum
- {
- DAC_OUTPUT_MIN = -1,
- DAC_OUTPUT_LOUT1 = 0x04,
- DAC_OUTPUT_LOUT2 = 0x08,
- DAC_OUTPUT_SPK = 0x09,
- DAC_OUTPUT_ROUT1 = 0x10,
- DAC_OUTPUT_ROUT2 = 0x20,
- DAC_OUTPUT_ALL = 0x3c,
- DAC_OUTPUT_MAX,
- } es_dac_output_t;
+typedef enum {
+ DAC_OUTPUT_MIN = -1,
+ DAC_OUTPUT_LOUT1 = 0x04,
+ DAC_OUTPUT_LOUT2 = 0x08,
+ DAC_OUTPUT_SPK = 0x09,
+ DAC_OUTPUT_ROUT1 = 0x10,
+ DAC_OUTPUT_ROUT2 = 0x20,
+ DAC_OUTPUT_ALL = 0x3c,
+ DAC_OUTPUT_MAX,
+} es_dac_output_t;
- typedef enum
- {
- MIC_GAIN_MIN = -1,
- MIC_GAIN_0DB = 0,
- MIC_GAIN_3DB = 3,
- MIC_GAIN_6DB = 6,
- MIC_GAIN_9DB = 9,
- MIC_GAIN_12DB = 12,
- MIC_GAIN_15DB = 15,
- MIC_GAIN_18DB = 18,
- MIC_GAIN_21DB = 21,
- MIC_GAIN_24DB = 24,
- MIC_GAIN_MAX,
- } es_mic_gain_t;
+typedef enum {
+ MIC_GAIN_MIN = -1,
+ MIC_GAIN_0DB = 0,
+ MIC_GAIN_3DB = 3,
+ MIC_GAIN_6DB = 6,
+ MIC_GAIN_9DB = 9,
+ MIC_GAIN_12DB = 12,
+ MIC_GAIN_15DB = 15,
+ MIC_GAIN_18DB = 18,
+ MIC_GAIN_21DB = 21,
+ MIC_GAIN_24DB = 24,
+ MIC_GAIN_MAX,
+} es_mic_gain_t;
- typedef enum
- {
- ES_MODULE_MIN = -1,
- ES_MODULE_ADC = 0x01,
- ES_MODULE_DAC = 0x02,
- ES_MODULE_ADC_DAC = 0x03,
- ES_MODULE_LINE = 0x04,
- ES_MODULE_MAX
- } es_module_t;
+typedef enum {
+ ES_MODULE_MIN = -1,
+ ES_MODULE_ADC = 0x01,
+ ES_MODULE_DAC = 0x02,
+ ES_MODULE_ADC_DAC = 0x03,
+ ES_MODULE_LINE = 0x04,
+ ES_MODULE_MAX
+} es_module_t;
- typedef enum
- {
- ES_MODE_MIN = -1,
- ES_MODE_SLAVE = 0x00,
- ES_MODE_MASTER = 0x01,
- ES_MODE_MAX,
- } es_mode_t;
+typedef enum {
+ ES_MODE_MIN = -1,
+ ES_MODE_SLAVE = 0x00,
+ ES_MODE_MASTER = 0x01,
+ ES_MODE_MAX,
+} es_mode_t;
- typedef enum
- {
- ES_I2S_MIN = -1,
- ES_I2S_NORMAL = 0,
- ES_I2S_LEFT = 1,
- ES_I2S_RIGHT = 2,
- ES_I2S_DSP = 3,
- ES_I2S_MAX
- } es_i2s_fmt_t;
+typedef enum {
+ ES_I2S_MIN = -1,
+ ES_I2S_NORMAL = 0,
+ ES_I2S_LEFT = 1,
+ ES_I2S_RIGHT = 2,
+ ES_I2S_DSP = 3,
+ ES_I2S_MAX
+} es_i2s_fmt_t;
- /**
- * @brief Configure ES8388 clock
- */
- typedef struct
- {
- es_sclk_div_t sclk_div; /*!< bits clock divide */
- es_lclk_div_t lclk_div; /*!< WS clock divide */
- } es_i2s_clock_t;
+/**
+ * @brief Configure ES8388 clock
+ */
+typedef struct {
+ es_sclk_div_t sclk_div; /*!< bits clock divide */
+ es_lclk_div_t lclk_div; /*!< WS clock divide */
+} es_i2s_clock_t;
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/tas5805m/tas5805m.c b/components/audio_hal/driver/tas5805m/tas5805m.c
index 0e7ee7e..8059313 100644
--- a/components/audio_hal/driver/tas5805m/tas5805m.c
+++ b/components/audio_hal/driver/tas5805m/tas5805m.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,13 +18,15 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "tas5805m.h"
+
+#include "audio_volume.h"
#include "board.h"
#include "esp_log.h"
#include "i2c_bus.h"
@@ -33,212 +35,205 @@
static const char *TAG = "TAS5805M";
#define TAS5805M_ADDR 0x5c
-#define TAS5805M_RST_GPIO get_pa_enable_gpio ()
-#define TAS5805M_VOLUME_MAX 100
-#define TAS5805M_VOLUME_MIN 0
+#define TAS5805M_RST_GPIO get_pa_enable_gpio()
-#define TAS5805M_ASSERT(a, format, b, ...) \
- if ((a) != 0) \
- { \
- ESP_LOGE (TAG, format, ##__VA_ARGS__); \
- return b; \
- }
+#define TAS5805M_ASSERT(a, format, b, ...) \
+ if ((a) != 0) { \
+ ESP_LOGE(TAG, format, ##__VA_ARGS__); \
+ return b; \
+ }
-esp_err_t tas5805m_ctrl (audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
-esp_err_t tas5805m_conig_iface (audio_hal_codec_mode_t mode,
+esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode,
audio_hal_codec_i2s_iface_t *iface);
+
static i2c_bus_handle_t i2c_handler;
+static codec_dac_volume_config_t *dac_vol_handle;
+
+#define TAS5805M_DAC_VOL_CFG_DEFAULT() \
+ { \
+ .max_dac_volume = 24, .min_dac_volume = -103, \
+ .board_pa_gain = BOARD_PA_GAIN, .volume_accuracy = 0.5, \
+ .dac_vol_symbol = -1, .zero_volume_reg = 0x30, .reg_value = 0, \
+ .user_volume = 0, .offset_conv_volume = NULL, \
+ }
/*
* i2c default configuration
*/
static i2c_config_t i2c_cfg = {
- .mode = I2C_MODE_MASTER,
- .sda_pullup_en = GPIO_PULLUP_ENABLE,
- .scl_pullup_en = GPIO_PULLUP_ENABLE,
- .master.clk_speed = 100000,
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = 100000,
};
/*
* Operate fuction of PA
*/
audio_hal_func_t AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE = {
- .audio_codec_initialize = tas5805m_init,
- .audio_codec_deinitialize = tas5805m_deinit,
- .audio_codec_ctrl = tas5805m_ctrl,
- .audio_codec_config_iface = tas5805m_conig_iface,
- .audio_codec_set_mute = tas5805m_set_mute,
- .audio_codec_set_volume = tas5805m_set_volume,
- .audio_codec_get_volume = tas5805m_get_volume,
- .audio_hal_lock = NULL,
- .handle = NULL,
+ .audio_codec_initialize = tas5805m_init,
+ .audio_codec_deinitialize = tas5805m_deinit,
+ .audio_codec_ctrl = tas5805m_ctrl,
+ .audio_codec_config_iface = tas5805m_config_iface,
+ .audio_codec_set_mute = tas5805m_set_mute,
+ .audio_codec_set_volume = tas5805m_set_volume,
+ .audio_codec_get_volume = tas5805m_get_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
};
-static esp_err_t
-tas5805m_transmit_registers (const tas5805m_cfg_reg_t *conf_buf, int size)
-{
+static esp_err_t tas5805m_transmit_registers(const tas5805m_cfg_reg_t *conf_buf,
+ int size) {
int i = 0;
esp_err_t ret = ESP_OK;
- while (i < size)
- {
- switch (conf_buf[i].offset)
- {
- case CFG_META_SWITCH:
- // Used in legacy applications. Ignored here.
- break;
- case CFG_META_DELAY:
- vTaskDelay (conf_buf[i].value / portTICK_RATE_MS);
- break;
- case CFG_META_BURST:
- ret = i2c_bus_write_bytes (
- i2c_handler, TAS5805M_ADDR,
- (unsigned char *)(&conf_buf[i + 1].offset), 1,
- (unsigned char *)(&conf_buf[i + 1].value), conf_buf[i].value);
- i += (conf_buf[i].value / 2) + 1;
- break;
- case CFG_END_1:
- if (CFG_END_2 == conf_buf[i + 1].offset
- && CFG_END_3 == conf_buf[i + 2].offset)
- {
- ESP_LOGI (TAG, "End of tms5805m reg: %d\n", i);
- }
- break;
- default:
- ret = i2c_bus_write_bytes (i2c_handler, TAS5805M_ADDR,
- (unsigned char *)(&conf_buf[i].offset), 1,
- (unsigned char *)(&conf_buf[i].value), 1);
- break;
+ while (i < size) {
+ switch (conf_buf[i].offset) {
+ case CFG_META_SWITCH:
+ // Used in legacy applications. Ignored here.
+ break;
+ case CFG_META_DELAY:
+ vTaskDelay(conf_buf[i].value / portTICK_RATE_MS);
+ break;
+ case CFG_META_BURST:
+ ret = i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR,
+ (unsigned char *)(&conf_buf[i + 1].offset), 1,
+ (unsigned char *)(&conf_buf[i + 1].value),
+ conf_buf[i].value);
+ i += (conf_buf[i].value / 2) + 1;
+ break;
+ case CFG_END_1:
+ if (CFG_END_2 == conf_buf[i + 1].offset &&
+ CFG_END_3 == conf_buf[i + 2].offset) {
+ ESP_LOGI(TAG, "End of tms5805m reg: %d\n", i);
}
- i++;
- }
- if (ret != ESP_OK)
- {
- ESP_LOGE (TAG, "Fail to load configuration to tas5805m");
- return ESP_FAIL;
- }
- ESP_LOGI (TAG, "%s: write %d reg done", __FUNCTION__, i);
- return ret;
-}
-
-esp_err_t
-tas5805m_init (audio_hal_codec_config_t *codec_cfg)
-{
- esp_err_t ret = ESP_OK;
- ESP_LOGI (TAG, "Power ON CODEC with GPIO %d", TAS5805M_RST_GPIO);
- gpio_config_t io_conf;
- io_conf.pin_bit_mask = BIT64 (TAS5805M_RST_GPIO);
- io_conf.mode = GPIO_MODE_OUTPUT;
- io_conf.intr_type = GPIO_INTR_DISABLE;
- gpio_config (&io_conf);
- gpio_set_level (TAS5805M_RST_GPIO, 0);
- vTaskDelay (20 / portTICK_RATE_MS);
- gpio_set_level (TAS5805M_RST_GPIO, 1);
- vTaskDelay (200 / portTICK_RATE_MS);
-
- ret = get_i2c_pins (I2C_NUM_0, &i2c_cfg);
- i2c_handler = i2c_bus_create (I2C_NUM_0, &i2c_cfg);
- if (i2c_handler == NULL)
- {
- ESP_LOGW (TAG, "failed to create i2c bus handler\n");
- return ESP_FAIL;
- }
-
- ret |= tas5805m_transmit_registers (tas5805m_registers,
- sizeof (tas5805m_registers)
- / sizeof (tas5805m_registers[0]));
-
- TAS5805M_ASSERT (ret, "Fail to iniitialize tas5805m PA", ESP_FAIL);
- return ret;
-}
-
-esp_err_t
-tas5805m_set_volume (int vol)
-{
- int vol_idx = 0;
-
- if (vol < TAS5805M_VOLUME_MIN)
- {
- vol = TAS5805M_VOLUME_MIN;
- }
- if (vol > TAS5805M_VOLUME_MAX)
- {
- vol = TAS5805M_VOLUME_MAX;
- }
- vol_idx = vol / 5;
-
- uint8_t cmd[2] = { 0, 0 };
- esp_err_t ret = ESP_OK;
-
- cmd[0] = MASTER_VOL_REG_ADDR;
- cmd[1] = tas5805m_volume[vol_idx];
- ret = i2c_bus_write_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
- ESP_LOGW (TAG, "volume = 0x%x", cmd[1]);
- return ret;
-}
-
-esp_err_t
-tas5805m_get_volume (int *value)
-{
- /// FIXME: Got the digit volume is not right.
- uint8_t cmd[2] = { MASTER_VOL_REG_ADDR, 0x00 };
- esp_err_t ret = i2c_bus_read_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1,
- &cmd[1], 1);
- TAS5805M_ASSERT (ret, "Fail to get volume", ESP_FAIL);
- int i;
- for (i = 0; i < sizeof (tas5805m_volume); i++)
- {
- if (cmd[1] >= tas5805m_volume[i])
+ break;
+ default:
+ ret = i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR,
+ (unsigned char *)(&conf_buf[i].offset), 1,
+ (unsigned char *)(&conf_buf[i].value), 1);
break;
}
- ESP_LOGI (TAG, "Volume is %d", i * 5);
- *value = 5 * i;
+ i++;
+ }
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Fail to load configuration to tas5805m");
+ return ESP_FAIL;
+ }
+ ESP_LOGI(TAG, "%s: write %d reg done", __FUNCTION__, i);
return ret;
}
-esp_err_t
-tas5805m_set_mute (bool enable)
-{
+esp_err_t tas5805m_init(audio_hal_codec_config_t *codec_cfg) {
esp_err_t ret = ESP_OK;
- uint8_t cmd[2] = { TAS5805M_REG_03, 0x00 };
- ret |= i2c_bus_read_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
+ ESP_LOGI(TAG, "Power ON CODEC with GPIO %d", TAS5805M_RST_GPIO);
+ gpio_config_t io_conf;
+ io_conf.pin_bit_mask = BIT64(TAS5805M_RST_GPIO);
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
+ gpio_config(&io_conf);
+ gpio_set_level(TAS5805M_RST_GPIO, 0);
+ vTaskDelay(20 / portTICK_RATE_MS);
+ gpio_set_level(TAS5805M_RST_GPIO, 1);
+ vTaskDelay(200 / portTICK_RATE_MS);
- if (enable)
- {
- cmd[1] |= 0x8;
- }
- else
- {
- cmd[1] &= (~0x08);
- }
- ret |= i2c_bus_write_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
+ ret = get_i2c_pins(I2C_NUM_0, &i2c_cfg);
+ i2c_handler = i2c_bus_create(I2C_NUM_0, &i2c_cfg);
+ if (i2c_handler == NULL) {
+ ESP_LOGW(TAG, "failed to create i2c bus handler\n");
+ return ESP_FAIL;
+ }
- TAS5805M_ASSERT (ret, "Fail to set mute", ESP_FAIL);
+ ret |= tas5805m_transmit_registers(
+ tas5805m_registers,
+ sizeof(tas5805m_registers) / sizeof(tas5805m_registers[0]));
+
+ TAS5805M_ASSERT(ret, "Fail to iniitialize tas5805m PA", ESP_FAIL);
+
+ codec_dac_volume_config_t vol_cfg = TAS5805M_DAC_VOL_CFG_DEFAULT();
+ dac_vol_handle = audio_codec_volume_init(&vol_cfg);
return ret;
}
-esp_err_t
-tas5805m_get_mute (int *value)
-{
+/**
+ * @brief Set voice volume
+ *
+ * @note Register values. 0xFE: -103 dB, 0x94: -50 dB, 0x30: 0 dB, 0x00: 24 dB
+ * @note Accuracy of gain is 0.5 dB
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t tas5805m_set_volume(int volume) {
+ uint8_t reg = 0;
+ uint8_t cmd[2] = {0, 0};
esp_err_t ret = ESP_OK;
- uint8_t cmd[2] = { TAS5805M_REG_03, 0x00 };
- ret |= i2c_bus_read_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
- TAS5805M_ASSERT (ret, "Fail to get mute", ESP_FAIL);
+ reg = audio_codec_get_dac_reg_value(dac_vol_handle, volume);
+
+ cmd[0] = MASTER_VOL_REG_ADDR;
+ cmd[1] = reg;
+
+ ret = i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+
+ ESP_LOGD(TAG, "Set volume:%.2d reg_value:0x%.2x dB:%.1f",
+ (int)dac_vol_handle->user_volume, reg,
+ audio_codec_cal_dac_volume(dac_vol_handle));
+ return ret;
+}
+
+esp_err_t tas5805m_get_volume(int *volume) {
+ /// FIXME: Got the digit volume is not right.
+ uint8_t cmd[2] = {MASTER_VOL_REG_ADDR, 0x00};
+ esp_err_t ret =
+ i2c_bus_read_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+ TAS5805M_ASSERT(ret, "Fail to get volume", ESP_FAIL);
+ if (cmd[1] == dac_vol_handle->reg_value) {
+ *volume = dac_vol_handle->user_volume;
+ } else {
+ *volume = 0;
+ ret = ESP_FAIL;
+ }
+ ESP_LOGD(TAG, "Get volume:%.2d reg_value:0x%.2x", *volume, cmd[1]);
+ return ret;
+}
+
+esp_err_t tas5805m_set_mute(bool enable) {
+ esp_err_t ret = ESP_OK;
+ uint8_t cmd[2] = {TAS5805M_REG_03, 0x00};
+ ret |= i2c_bus_read_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+
+ if (enable) {
+ cmd[1] |= 0x8;
+ } else {
+ cmd[1] &= (~0x08);
+ }
+ ret |=
+ i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+
+ TAS5805M_ASSERT(ret, "Fail to set mute", ESP_FAIL);
+ return ret;
+}
+
+esp_err_t tas5805m_get_mute(int *value) {
+ esp_err_t ret = ESP_OK;
+ uint8_t cmd[2] = {TAS5805M_REG_03, 0x00};
+ ret |= i2c_bus_read_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+
+ TAS5805M_ASSERT(ret, "Fail to get mute", ESP_FAIL);
*value = (cmd[1] & 0x08) >> 4;
- ESP_LOGI (TAG, "Get mute value: 0x%x", *value);
+ ESP_LOGI(TAG, "Get mute value: 0x%x", *value);
return ret;
}
-esp_err_t
-tas5805m_set_mute_fade (int value)
-{
+esp_err_t tas5805m_set_mute_fade(int value) {
esp_err_t ret = 0;
- unsigned char cmd[2] = { MUTE_TIME_REG_ADDR, 0x00 };
+ unsigned char cmd[2] = {MUTE_TIME_REG_ADDR, 0x00};
/* Time for register value
* 000: 11.5 ms
* 001: 53 ms
@@ -249,75 +244,55 @@ tas5805m_set_mute_fade (int value)
* 110: 2.665 sec
* 111: 5.33 sec
*/
- if (value <= 12)
- {
- cmd[1] = 0;
- }
- else if (value <= 53)
- {
- cmd[1] = 1;
- }
- else if (value <= 107)
- {
- cmd[1] = 2;
- }
- else if (value <= 267)
- {
- cmd[1] = 3;
- }
- else if (value <= 535)
- {
- cmd[1] = 4;
- }
- else if (value <= 1065)
- {
- cmd[1] = 5;
- }
- else if (value <= 2665)
- {
- cmd[1] = 6;
- }
- else
- {
- cmd[1] = 7;
- }
+ if (value <= 12) {
+ cmd[1] = 0;
+ } else if (value <= 53) {
+ cmd[1] = 1;
+ } else if (value <= 107) {
+ cmd[1] = 2;
+ } else if (value <= 267) {
+ cmd[1] = 3;
+ } else if (value <= 535) {
+ cmd[1] = 4;
+ } else if (value <= 1065) {
+ cmd[1] = 5;
+ } else if (value <= 2665) {
+ cmd[1] = 6;
+ } else {
+ cmd[1] = 7;
+ }
cmd[1] |= (cmd[1] << 4);
- ret |= i2c_bus_write_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
- TAS5805M_ASSERT (ret, "Fail to set mute fade", ESP_FAIL);
- ESP_LOGI (TAG, "Set mute fade, value:%d, 0x%x", value, cmd[1]);
+ ret |=
+ i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1], 1);
+ TAS5805M_ASSERT(ret, "Fail to set mute fade", ESP_FAIL);
+ ESP_LOGI(TAG, "Set mute fade, value:%d, 0x%x", value, cmd[1]);
return ret;
}
-esp_err_t
-tas5805m_set_damp_mode (int value)
-{
- unsigned char cmd[2] = { 0 };
+esp_err_t tas5805m_set_damp_mode(int value) {
+ unsigned char cmd[2] = {0};
cmd[0] = TAS5805M_REG_02;
cmd[1] = 0x10 | value;
- return i2c_bus_write_bytes (i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
- 1);
+ return i2c_bus_write_bytes(i2c_handler, TAS5805M_ADDR, &cmd[0], 1, &cmd[1],
+ 1);
}
-esp_err_t
-tas5805m_deinit (void)
-{
+esp_err_t tas5805m_deinit(void) {
+ // TODO
+ i2c_bus_delete(i2c_handler);
+ audio_codec_volume_deinit(dac_vol_handle);
+ return ESP_OK;
+}
+
+esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
// TODO
return ESP_OK;
}
-esp_err_t
-tas5805m_ctrl (audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state)
-{
- // TODO
- return ESP_OK;
-}
-
-esp_err_t
-tas5805m_conig_iface (audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface)
-{
+esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
// TODO
return ESP_OK;
}
diff --git a/components/audio_hal/driver/tas5805m/tas5805m.h b/components/audio_hal/driver/tas5805m/tas5805m.h
index 249721e..3a5ab39 100644
--- a/components/audio_hal/driver/tas5805m/tas5805m.h
+++ b/components/audio_hal/driver/tas5805m/tas5805m.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -31,8 +31,7 @@
#include "esp_err.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#define TAS5805M_REG_00 0x00
@@ -62,91 +61,91 @@ extern "C"
#define TAS5805M_DAMP_MODE_BTL 0x0
#define TAS5805M_DAMP_MODE_PBTL 0x04
- /**
- * @brief Initialize TAS5805 codec chip
- *
- * @param cfg configuration of TAS5805
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t tas5805m_init (audio_hal_codec_config_t *codec_cfg);
+/**
+ * @brief Initialize TAS5805 codec chip
+ *
+ * @param cfg configuration of TAS5805
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t tas5805m_init(audio_hal_codec_config_t *codec_cfg);
- /**
- * @brief Deinitialize TAS5805 codec chip
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t tas5805m_deinit (void);
+/**
+ * @brief Deinitialize TAS5805 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t tas5805m_deinit(void);
- /**
- * @brief Set voice volume
- *
- * @param volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t tas5805m_set_volume (int vol);
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t tas5805m_set_volume(int vol);
- /**
- * @brief Get voice volume
- *
- * @param[out] *volume: voice volume (0~100)
- *
- * @return
- * - ESP_OK
- * - ESP_FAIL
- */
- esp_err_t tas5805m_get_volume (int *value);
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t tas5805m_get_volume(int *value);
- /**
- * @brief Set TAS5805 mute or not
- * Continuously call should have an interval time determined by
- * tas5805m_set_mute_fade()
- *
- * @param enable enable(1) or disable(0)
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t tas5805m_set_mute (bool enable);
+/**
+ * @brief Set TAS5805 mute or not
+ * Continuously call should have an interval time determined by
+ * tas5805m_set_mute_fade()
+ *
+ * @param enable enable(1) or disable(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t tas5805m_set_mute(bool enable);
- /**
- * @brief Mute gradually by (value)ms
- *
- * @param value Time for mute with millisecond.
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- *
- */
- esp_err_t tas5805m_set_mute_fade (int value);
+/**
+ * @brief Mute gradually by (value)ms
+ *
+ * @param value Time for mute with millisecond.
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ *
+ */
+esp_err_t tas5805m_set_mute_fade(int value);
- /**
- * @brief Get TAS5805 mute status
- *
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- */
- esp_err_t tas5805m_get_mute (int *value);
+/**
+ * @brief Get TAS5805 mute status
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t tas5805m_get_mute(int *value);
- /**
- * @brief Set DAMP mode
- *
- * @param value TAS5805M_DAMP_MODE_BTL or TAS5805M_DAMP_MODE_PBTL
- * @return
- * - ESP_FAIL Parameter error
- * - ESP_OK Success
- *
- */
- esp_err_t tas5805m_set_damp_mode (int value);
+/**
+ * @brief Set DAMP mode
+ *
+ * @param value TAS5805M_DAMP_MODE_BTL or TAS5805M_DAMP_MODE_PBTL
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ *
+ */
+esp_err_t tas5805m_set_damp_mode(int value);
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h b/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h
index aeedb3c..dc8235c 100644
--- a/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h
+++ b/components/audio_hal/driver/tas5805m/tas5805m_reg_cfg.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -28,8 +28,7 @@
#define _TAS5805M_REG_CFG_
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#define CFG_META_SWITCH (255)
@@ -39,1708 +38,1707 @@ extern "C"
#define CFG_END_2 (0Xcc)
#define CFG_END_3 (0Xee)
- typedef struct
- {
- uint8_t offset;
- uint8_t value;
- } tas5805m_cfg_reg_t;
+typedef struct {
+ uint8_t offset;
+ uint8_t value;
+} tas5805m_cfg_reg_t;
- static const uint8_t tas5805m_volume[]
- = { 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50,
- 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35 };
+static const uint8_t tas5805m_volume[] = {
+ 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50,
+ 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35};
- static const tas5805m_cfg_reg_t tas5805m_registers[] = {
+static const tas5805m_cfg_reg_t tas5805m_registers[] = {
// RESET
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x03, 0x02 },
- { 0x01, 0x11 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x03, 0x02 },
- { CFG_META_DELAY, 5 },
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x03, 0x00 },
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x46, 0x11 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x03, 0x02},
+ {0x01, 0x11},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x03, 0x02},
+ {CFG_META_DELAY, 5},
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x03, 0x00},
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x46, 0x11},
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x03, 0x02 },
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x78, 0x80 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x03, 0x02},
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x78, 0x80},
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x61, 0x0b },
- { 0x60, 0x01 },
- { 0x7d, 0x11 },
- { 0x7e, 0xff },
- { 0x00, 0x01 },
- { 0x51, 0x05 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x61, 0x0b},
+ {0x60, 0x01},
+ {0x7d, 0x11},
+ {0x7e, 0xff},
+ {0x00, 0x01},
+ {0x51, 0x05},
- { 0x00, 0x00 },
+ {0x00, 0x00},
#if CONFIG_ESP32_KORVO_DU1906_BOARD
- { 0x02, 0x10 },
+ {0x02, 0x10},
#else
- { 0x02, 0x14 },
+ {0x02, 0x14},
#endif
- { 0x53, 0x00 },
- { 0x54, 0x13 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
- { 0x00, 0x00 },
+ {0x53, 0x00},
+ {0x54, 0x13},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x00, 0x00},
+ {0x00, 0x00},
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x66, 0x86 },
- { 0x7f, 0x8c },
- { 0x00, 0x29 },
- { 0x18, 0x00 },
- { 0x19, 0x40 },
- { 0x1a, 0x26 },
- { 0x1b, 0xe7 },
- { 0x1c, 0x00 },
- { 0x1d, 0x40 },
- { 0x1e, 0x26 },
- { 0x1f, 0xe7 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x00, 0x2a },
- { 0x24, 0x00 },
- { 0x25, 0x65 },
- { 0x26, 0xac },
- { 0x27, 0x8c },
- { 0x28, 0x00 },
- { 0x29, 0x65 },
- { 0x2a, 0xac },
- { 0x2b, 0x8c },
- { 0x30, 0x00 },
- { 0x31, 0xe2 },
- { 0x32, 0xc4 },
- { 0x33, 0x6b },
- { 0x00, 0x2c },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x80 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x80 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x80 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x80 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x80 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0xae },
- { 0x5f, 0xc3 },
- { 0x60, 0x00 },
- { 0x61, 0x45 },
- { 0x62, 0xa1 },
- { 0x63, 0xcb },
- { 0x64, 0x04 },
- { 0x65, 0x0c },
- { 0x66, 0x37 },
- { 0x67, 0x14 },
- { 0x68, 0xc0 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x04 },
- { 0x6d, 0xc1 },
- { 0x6e, 0xff },
- { 0x6f, 0x93 },
- { 0x74, 0x00 },
- { 0x75, 0x80 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x00, 0x2d },
- { 0x18, 0x7b },
- { 0x19, 0x3e },
- { 0x1a, 0x00 },
- { 0x1b, 0x6d },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0xae },
- { 0x1f, 0xc3 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x80 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x00, 0x2e },
- { 0x24, 0x20 },
- { 0x25, 0x29 },
- { 0x26, 0x00 },
- { 0x27, 0x94 },
- { 0x00, 0x31 },
- { 0x48, 0x40 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x00 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x00 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x32 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x00 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x00 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x33 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x00 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x00 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x34 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x00 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x00 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x35 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x00, 0x00 },
- { 0x7f, 0xaa },
- { 0x00, 0x24 },
- { 0x18, 0x07 },
- { 0x19, 0xf0 },
- { 0x1a, 0xe4 },
- { 0x1b, 0x16 },
- { 0x1c, 0xf0 },
- { 0x1d, 0x1e },
- { 0x1e, 0x37 },
- { 0x1f, 0xd3 },
- { 0x20, 0x07 },
- { 0x21, 0xf0 },
- { 0x22, 0xe4 },
- { 0x23, 0x16 },
- { 0x24, 0x0f },
- { 0x25, 0xe1 },
- { 0x26, 0xab },
- { 0x27, 0xa4 },
- { 0x28, 0xf8 },
- { 0x29, 0x1e },
- { 0x2a, 0x1b },
- { 0x2b, 0x4a },
- { 0x2c, 0x07 },
- { 0x2d, 0xf2 },
- { 0x2e, 0xc6 },
- { 0x2f, 0x03 },
- { 0x30, 0xf0 },
- { 0x31, 0x1a },
- { 0x32, 0x73 },
- { 0x33, 0xfa },
- { 0x34, 0x07 },
- { 0x35, 0xf2 },
- { 0x36, 0xc6 },
- { 0x37, 0x03 },
- { 0x38, 0x0f },
- { 0x39, 0xe5 },
- { 0x3a, 0x76 },
- { 0x3b, 0x28 },
- { 0x3c, 0xf8 },
- { 0x3d, 0x1a },
- { 0x3e, 0x5e },
- { 0x3f, 0x1c },
- { 0x40, 0x08 },
- { 0x41, 0x28 },
- { 0x42, 0x01 },
- { 0x43, 0xe1 },
- { 0x44, 0xf0 },
- { 0x45, 0x35 },
- { 0x46, 0x45 },
- { 0x47, 0x27 },
- { 0x48, 0x07 },
- { 0x49, 0xa3 },
- { 0x4a, 0x11 },
- { 0x4b, 0xa4 },
- { 0x4c, 0x0f },
- { 0x4d, 0xca },
- { 0x4e, 0xba },
- { 0x4f, 0xd9 },
- { 0x50, 0xf8 },
- { 0x51, 0x34 },
- { 0x52, 0xec },
- { 0x53, 0x7b },
- { 0x54, 0x07 },
- { 0x55, 0xfd },
- { 0x56, 0x56 },
- { 0x57, 0xbd },
- { 0x58, 0xf0 },
- { 0x59, 0x0d },
- { 0x5a, 0x69 },
- { 0x5b, 0xed },
- { 0x5c, 0x07 },
- { 0x5d, 0xf7 },
- { 0x5e, 0xfd },
- { 0x5f, 0xbb },
- { 0x60, 0x0f },
- { 0x61, 0xf2 },
- { 0x62, 0x96 },
- { 0x63, 0x13 },
- { 0x64, 0xf8 },
- { 0x65, 0x0a },
- { 0x66, 0xab },
- { 0x67, 0x87 },
- { 0x68, 0x07 },
- { 0x69, 0xe1 },
- { 0x6a, 0xc2 },
- { 0x6b, 0x69 },
- { 0x6c, 0xf0 },
- { 0x6d, 0xac },
- { 0x6e, 0x0d },
- { 0x6f, 0x58 },
- { 0x70, 0x07 },
- { 0x71, 0x94 },
- { 0x72, 0x0c },
- { 0x73, 0x4d },
- { 0x74, 0x0f },
- { 0x75, 0x53 },
- { 0x76, 0xf2 },
- { 0x77, 0xa8 },
- { 0x78, 0xf8 },
- { 0x79, 0x8a },
- { 0x7a, 0x31 },
- { 0x7b, 0x49 },
- { 0x7c, 0x08 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x25 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x08 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0xf1 },
- { 0x1d, 0x79 },
- { 0x1e, 0xcb },
- { 0x1f, 0xec },
- { 0x20, 0x06 },
- { 0x21, 0xa6 },
- { 0x22, 0x49 },
- { 0x23, 0xa5 },
- { 0x24, 0x0e },
- { 0x25, 0x86 },
- { 0x26, 0x34 },
- { 0x27, 0x14 },
- { 0x28, 0xf9 },
- { 0x29, 0x59 },
- { 0x2a, 0xb6 },
- { 0x2b, 0x5b },
- { 0x2c, 0x09 },
- { 0x2d, 0x63 },
- { 0x2e, 0x61 },
- { 0x2f, 0x75 },
- { 0x30, 0xf8 },
- { 0x31, 0x28 },
- { 0x32, 0x33 },
- { 0x33, 0x32 },
- { 0x34, 0x02 },
- { 0x35, 0xcb },
- { 0x36, 0xa2 },
- { 0x37, 0x07 },
- { 0x38, 0x05 },
- { 0x39, 0xc8 },
- { 0x3a, 0x94 },
- { 0x3b, 0x61 },
- { 0x3c, 0xfd },
- { 0x3d, 0xe0 },
- { 0x3e, 0x34 },
- { 0x3f, 0xf0 },
- { 0x40, 0x08 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0xf1 },
- { 0x45, 0x79 },
- { 0x46, 0xcb },
- { 0x47, 0xec },
- { 0x48, 0x06 },
- { 0x49, 0xa6 },
- { 0x4a, 0x49 },
- { 0x4b, 0xa5 },
- { 0x4c, 0x0e },
- { 0x4d, 0x86 },
- { 0x4e, 0x34 },
- { 0x4f, 0x14 },
- { 0x50, 0xf9 },
- { 0x51, 0x59 },
- { 0x52, 0xb6 },
- { 0x53, 0x5b },
- { 0x54, 0x07 },
- { 0x55, 0xd8 },
- { 0x56, 0xc2 },
- { 0x57, 0x5c },
- { 0x58, 0xf1 },
- { 0x59, 0x09 },
- { 0x5a, 0x84 },
- { 0x5b, 0x20 },
- { 0x5c, 0x07 },
- { 0x5d, 0xa4 },
- { 0x5e, 0xd9 },
- { 0x5f, 0x7a },
- { 0x60, 0x0e },
- { 0x61, 0xf6 },
- { 0x62, 0x7b },
- { 0x63, 0xe0 },
- { 0x64, 0xf8 },
- { 0x65, 0x82 },
- { 0x66, 0x64 },
- { 0x67, 0x2a },
- { 0x68, 0x07 },
- { 0x69, 0xc6 },
- { 0x6a, 0x16 },
- { 0x6b, 0x0b },
- { 0x6c, 0xf3 },
- { 0x6d, 0x04 },
- { 0x6e, 0x30 },
- { 0x6f, 0xd8 },
- { 0x70, 0x07 },
- { 0x71, 0x00 },
- { 0x72, 0x0d },
- { 0x73, 0xc1 },
- { 0x74, 0x0c },
- { 0x75, 0xfb },
- { 0x76, 0xcf },
- { 0x77, 0x28 },
- { 0x78, 0xf9 },
- { 0x79, 0x39 },
- { 0x7a, 0xdc },
- { 0x7b, 0x34 },
- { 0x7c, 0x07 },
- { 0x7d, 0xfc },
- { 0x7e, 0x8e },
- { 0x7f, 0xc5 },
- { 0x00, 0x26 },
- { 0x08, 0xf0 },
- { 0x09, 0x91 },
- { 0x0a, 0xb8 },
- { 0x0b, 0xc2 },
- { 0x0c, 0x07 },
- { 0x0d, 0xe1 },
- { 0x0e, 0xf7 },
- { 0x0f, 0xf1 },
- { 0x10, 0x0f },
- { 0x11, 0x6e },
- { 0x12, 0x47 },
- { 0x13, 0x3e },
- { 0x14, 0xf8 },
- { 0x15, 0x21 },
- { 0x16, 0x79 },
- { 0x17, 0x4a },
- { 0x18, 0x08 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x08 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x08 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x08 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x08 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x08 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x27 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x08 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x08 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x08 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x08 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x08 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x08 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x28 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x18, 0x08 },
- { 0x19, 0x00 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x00 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x08 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x30, 0x00 },
- { 0x31, 0x00 },
- { 0x32, 0x00 },
- { 0x33, 0x00 },
- { 0x34, 0x00 },
- { 0x35, 0x00 },
- { 0x36, 0x00 },
- { 0x37, 0x00 },
- { 0x38, 0x00 },
- { 0x39, 0x00 },
- { 0x3a, 0x00 },
- { 0x3b, 0x00 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x08 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x00 },
- { 0x47, 0x00 },
- { 0x48, 0x00 },
- { 0x49, 0x00 },
- { 0x4a, 0x00 },
- { 0x4b, 0x00 },
- { 0x4c, 0x00 },
- { 0x4d, 0x00 },
- { 0x4e, 0x00 },
- { 0x4f, 0x00 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x08 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x00 },
- { 0x5a, 0x00 },
- { 0x5b, 0x00 },
- { 0x5c, 0x00 },
- { 0x5d, 0x00 },
- { 0x5e, 0x00 },
- { 0x5f, 0x00 },
- { 0x60, 0x00 },
- { 0x61, 0x00 },
- { 0x62, 0x00 },
- { 0x63, 0x00 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x08 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0x00 },
- { 0x6d, 0x00 },
- { 0x6e, 0x00 },
- { 0x6f, 0x00 },
- { 0x70, 0x00 },
- { 0x71, 0x00 },
- { 0x72, 0x00 },
- { 0x73, 0x00 },
- { 0x74, 0x00 },
- { 0x75, 0x00 },
- { 0x76, 0x00 },
- { 0x77, 0x00 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x08 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x29 },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x00, 0x2e },
- { 0x7c, 0x08 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x2f },
- { 0x08, 0x00 },
- { 0x09, 0x00 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x00 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x10, 0x00 },
- { 0x11, 0x00 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x14, 0x00 },
- { 0x15, 0x00 },
- { 0x16, 0x00 },
- { 0x17, 0x00 },
- { 0x1c, 0x08 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x00 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
- { 0x24, 0x00 },
- { 0x25, 0x00 },
- { 0x26, 0x00 },
- { 0x27, 0x00 },
- { 0x28, 0x00 },
- { 0x29, 0x00 },
- { 0x2a, 0x00 },
- { 0x2b, 0x00 },
- { 0x2c, 0x00 },
- { 0x2d, 0x00 },
- { 0x2e, 0x00 },
- { 0x2f, 0x00 },
- { 0x00, 0x2a },
- { 0x48, 0x00 },
- { 0x49, 0x15 },
- { 0x4a, 0xa7 },
- { 0x4b, 0x04 },
- { 0x4c, 0x00 },
- { 0x4d, 0x15 },
- { 0x4e, 0xa7 },
- { 0x4f, 0x04 },
- { 0x50, 0x00 },
- { 0x51, 0x15 },
- { 0x52, 0xa7 },
- { 0x53, 0x04 },
- { 0x54, 0x7b },
- { 0x55, 0x43 },
- { 0x56, 0x52 },
- { 0x57, 0x44 },
- { 0x58, 0x89 },
- { 0x59, 0x22 },
- { 0x5a, 0xbf },
- { 0x5b, 0x66 },
- { 0x00, 0x00 },
- { 0x7f, 0x8c },
- { 0x00, 0x2b },
- { 0x34, 0x00 },
- { 0x35, 0x22 },
- { 0x36, 0x1d },
- { 0x37, 0x95 },
- { 0x38, 0x02 },
- { 0x39, 0xa3 },
- { 0x3a, 0x9a },
- { 0x3b, 0xcc },
- { 0x3c, 0x00 },
- { 0x3d, 0x06 },
- { 0x3e, 0xd3 },
- { 0x3f, 0x72 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0x00 },
- { 0x45, 0x00 },
- { 0x46, 0x4e },
- { 0x47, 0xa5 },
- { 0x48, 0xff },
- { 0x49, 0x81 },
- { 0x4a, 0x47 },
- { 0x4b, 0xae },
- { 0x4c, 0xf9 },
- { 0x4d, 0x06 },
- { 0x4e, 0x21 },
- { 0x4f, 0xa9 },
- { 0x50, 0xfc },
- { 0x51, 0xc2 },
- { 0x52, 0xd8 },
- { 0x53, 0xc5 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x58, 0x00 },
- { 0x59, 0x02 },
- { 0x5a, 0x4b },
- { 0x5b, 0xce },
- { 0x00, 0x2d },
- { 0x58, 0x02 },
- { 0x59, 0xa3 },
- { 0x5a, 0x9a },
- { 0x5b, 0xcc },
- { 0x5c, 0x02 },
- { 0x5d, 0xa3 },
- { 0x5e, 0x9a },
- { 0x5f, 0xcc },
- { 0x60, 0x00 },
- { 0x61, 0x44 },
- { 0x62, 0x32 },
- { 0x63, 0x13 },
- { 0x64, 0x00 },
- { 0x65, 0x00 },
- { 0x66, 0x00 },
- { 0x67, 0x00 },
- { 0x68, 0x00 },
- { 0x69, 0x00 },
- { 0x6a, 0x00 },
- { 0x6b, 0x00 },
- { 0x6c, 0xff },
- { 0x6d, 0x81 },
- { 0x6e, 0x47 },
- { 0x6f, 0xae },
- { 0x70, 0xf9 },
- { 0x71, 0x06 },
- { 0x72, 0x21 },
- { 0x73, 0xa9 },
- { 0x74, 0xfc },
- { 0x75, 0xad },
- { 0x76, 0x96 },
- { 0x77, 0x20 },
- { 0x78, 0x00 },
- { 0x79, 0x00 },
- { 0x7a, 0x00 },
- { 0x7b, 0x00 },
- { 0x7c, 0x00 },
- { 0x7d, 0x00 },
- { 0x7e, 0x00 },
- { 0x7f, 0x00 },
- { 0x00, 0x00 },
- { 0x7f, 0xaa },
- { 0x00, 0x2e },
- { 0x40, 0x58 },
- { 0x41, 0x3b },
- { 0x42, 0x2f },
- { 0x43, 0x3d },
- { 0x44, 0x58 },
- { 0x45, 0x3b },
- { 0x46, 0x2f },
- { 0x47, 0x3d },
- { 0x48, 0x58 },
- { 0x49, 0x3b },
- { 0x4a, 0x2f },
- { 0x4b, 0x3d },
- { 0x4c, 0xae },
- { 0x4d, 0x1a },
- { 0x4e, 0x80 },
- { 0x4f, 0x9b },
- { 0x50, 0xc2 },
- { 0x51, 0xde },
- { 0x52, 0x41 },
- { 0x53, 0xd5 },
- { 0x00, 0x2b },
- { 0x20, 0x06 },
- { 0x21, 0x55 },
- { 0x22, 0xaf },
- { 0x23, 0xd8 },
- { 0x24, 0xf9 },
- { 0x25, 0xaa },
- { 0x26, 0x50 },
- { 0x27, 0x28 },
- { 0x28, 0x06 },
- { 0x29, 0x55 },
- { 0x2a, 0xaf },
- { 0x2b, 0xd8 },
- { 0x2c, 0xae },
- { 0x2d, 0x1a },
- { 0x2e, 0x80 },
- { 0x2f, 0x9b },
- { 0x30, 0xc2 },
- { 0x31, 0xde },
- { 0x32, 0x41 },
- { 0x33, 0xd5 },
- { 0x0c, 0x06 },
- { 0x0d, 0x55 },
- { 0x0e, 0xaf },
- { 0x0f, 0xd8 },
- { 0x10, 0xf9 },
- { 0x11, 0xaa },
- { 0x12, 0x50 },
- { 0x13, 0x28 },
- { 0x14, 0x06 },
- { 0x15, 0x55 },
- { 0x16, 0xaf },
- { 0x17, 0xd8 },
- { 0x18, 0xae },
- { 0x19, 0x1a },
- { 0x1a, 0x80 },
- { 0x1b, 0x9b },
- { 0x1c, 0xc2 },
- { 0x1d, 0xde },
- { 0x1e, 0x41 },
- { 0x1f, 0xd5 },
- { 0x00, 0x2a },
- { 0x34, 0x00 },
- { 0x35, 0x15 },
- { 0x36, 0xa7 },
- { 0x37, 0x04 },
- { 0x38, 0x00 },
- { 0x39, 0x15 },
- { 0x3a, 0xa7 },
- { 0x3b, 0x04 },
- { 0x3c, 0x00 },
- { 0x3d, 0x15 },
- { 0x3e, 0xa7 },
- { 0x3f, 0x04 },
- { 0x40, 0x7b },
- { 0x41, 0x43 },
- { 0x42, 0x52 },
- { 0x43, 0x44 },
- { 0x44, 0x89 },
- { 0x45, 0x22 },
- { 0x46, 0xbf },
- { 0x47, 0x66 },
- { 0x00, 0x00 },
- { 0x7f, 0x8c },
- { 0x00, 0x2d },
- { 0x30, 0x02 },
- { 0x31, 0xa3 },
- { 0x32, 0x9a },
- { 0x33, 0xcc },
- { 0x34, 0x02 },
- { 0x35, 0xa3 },
- { 0x36, 0x9a },
- { 0x37, 0xcc },
- { 0x38, 0x00 },
- { 0x39, 0x06 },
- { 0x3a, 0xd3 },
- { 0x3b, 0x72 },
- { 0x3c, 0x00 },
- { 0x3d, 0x00 },
- { 0x3e, 0x00 },
- { 0x3f, 0x00 },
- { 0x40, 0x00 },
- { 0x41, 0x00 },
- { 0x42, 0x00 },
- { 0x43, 0x00 },
- { 0x44, 0xff },
- { 0x45, 0x81 },
- { 0x46, 0x47 },
- { 0x47, 0xae },
- { 0x48, 0xf9 },
- { 0x49, 0x06 },
- { 0x4a, 0x21 },
- { 0x4b, 0xa9 },
- { 0x4c, 0xfc },
- { 0x4d, 0xc2 },
- { 0x4e, 0xd8 },
- { 0x4f, 0xc5 },
- { 0x50, 0x00 },
- { 0x51, 0x00 },
- { 0x52, 0x00 },
- { 0x53, 0x00 },
- { 0x54, 0x00 },
- { 0x55, 0x00 },
- { 0x56, 0x00 },
- { 0x57, 0x00 },
- { 0x00, 0x00 },
- { 0x7f, 0xaa },
- { 0x00, 0x2a },
- { 0x5c, 0x7b },
- { 0x5d, 0x58 },
- { 0x5e, 0xf9 },
- { 0x5f, 0x48 },
- { 0x60, 0x84 },
- { 0x61, 0xa7 },
- { 0x62, 0x06 },
- { 0x63, 0xb8 },
- { 0x64, 0x7b },
- { 0x65, 0x58 },
- { 0x66, 0xf9 },
- { 0x67, 0x48 },
- { 0x68, 0x7b },
- { 0x69, 0x43 },
- { 0x6a, 0x52 },
- { 0x6b, 0x44 },
- { 0x6c, 0x89 },
- { 0x6d, 0x22 },
- { 0x6e, 0xbf },
- { 0x6f, 0x66 },
- { 0x70, 0x7b },
- { 0x71, 0x58 },
- { 0x72, 0xf9 },
- { 0x73, 0x48 },
- { 0x74, 0x84 },
- { 0x75, 0xa7 },
- { 0x76, 0x06 },
- { 0x77, 0xb8 },
- { 0x78, 0x7b },
- { 0x79, 0x58 },
- { 0x7a, 0xf9 },
- { 0x7b, 0x48 },
- { 0x7c, 0x7b },
- { 0x7d, 0x43 },
- { 0x7e, 0x52 },
- { 0x7f, 0x44 },
- { 0x00, 0x2b },
- { 0x08, 0x89 },
- { 0x09, 0x22 },
- { 0x0a, 0xbf },
- { 0x0b, 0x66 },
- { 0x00, 0x2e },
- { 0x54, 0x58 },
- { 0x55, 0x3b },
- { 0x56, 0x2f },
- { 0x57, 0x3d },
- { 0x58, 0x58 },
- { 0x59, 0x3b },
- { 0x5a, 0x2f },
- { 0x5b, 0x3d },
- { 0x5c, 0x58 },
- { 0x5d, 0x3b },
- { 0x5e, 0x2f },
- { 0x5f, 0x3d },
- { 0x60, 0xae },
- { 0x61, 0x1a },
- { 0x62, 0x80 },
- { 0x63, 0x9b },
- { 0x64, 0xc2 },
- { 0x65, 0xde },
- { 0x66, 0x41 },
- { 0x67, 0xd5 },
- { 0x00, 0x00 },
- { 0x7f, 0x8c },
- { 0x00, 0x2e },
- { 0x10, 0x00 },
- { 0x11, 0x80 },
- { 0x12, 0x00 },
- { 0x13, 0x00 },
- { 0x0c, 0x00 },
- { 0x0d, 0x80 },
- { 0x0e, 0x00 },
- { 0x0f, 0x00 },
- { 0x08, 0x00 },
- { 0x09, 0x80 },
- { 0x0a, 0x00 },
- { 0x0b, 0x00 },
- { 0x18, 0x00 },
- { 0x19, 0x80 },
- { 0x1a, 0x00 },
- { 0x1b, 0x00 },
- { 0x1c, 0x40 },
- { 0x1d, 0x00 },
- { 0x1e, 0x00 },
- { 0x1f, 0x00 },
- { 0x20, 0x40 },
- { 0x21, 0x00 },
- { 0x22, 0x00 },
- { 0x23, 0x00 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x66, 0x86},
+ {0x7f, 0x8c},
+ {0x00, 0x29},
+ {0x18, 0x00},
+ {0x19, 0x40},
+ {0x1a, 0x26},
+ {0x1b, 0xe7},
+ {0x1c, 0x00},
+ {0x1d, 0x40},
+ {0x1e, 0x26},
+ {0x1f, 0xe7},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x00, 0x2a},
+ {0x24, 0x00},
+ {0x25, 0x65},
+ {0x26, 0xac},
+ {0x27, 0x8c},
+ {0x28, 0x00},
+ {0x29, 0x65},
+ {0x2a, 0xac},
+ {0x2b, 0x8c},
+ {0x30, 0x00},
+ {0x31, 0xe2},
+ {0x32, 0xc4},
+ {0x33, 0x6b},
+ {0x00, 0x2c},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x80},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x80},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x80},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x80},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x80},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0xae},
+ {0x5f, 0xc3},
+ {0x60, 0x00},
+ {0x61, 0x45},
+ {0x62, 0xa1},
+ {0x63, 0xcb},
+ {0x64, 0x04},
+ {0x65, 0x0c},
+ {0x66, 0x37},
+ {0x67, 0x14},
+ {0x68, 0xc0},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x04},
+ {0x6d, 0xc1},
+ {0x6e, 0xff},
+ {0x6f, 0x93},
+ {0x74, 0x00},
+ {0x75, 0x80},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x00, 0x2d},
+ {0x18, 0x7b},
+ {0x19, 0x3e},
+ {0x1a, 0x00},
+ {0x1b, 0x6d},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0xae},
+ {0x1f, 0xc3},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x80},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x00, 0x2e},
+ {0x24, 0x20},
+ {0x25, 0x29},
+ {0x26, 0x00},
+ {0x27, 0x94},
+ {0x00, 0x31},
+ {0x48, 0x40},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x00},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x00},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x32},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x00},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x00},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x33},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x00},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x00},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x34},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x00},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x00},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x35},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x00, 0x00},
+ {0x7f, 0xaa},
+ {0x00, 0x24},
+ {0x18, 0x07},
+ {0x19, 0xf0},
+ {0x1a, 0xe4},
+ {0x1b, 0x16},
+ {0x1c, 0xf0},
+ {0x1d, 0x1e},
+ {0x1e, 0x37},
+ {0x1f, 0xd3},
+ {0x20, 0x07},
+ {0x21, 0xf0},
+ {0x22, 0xe4},
+ {0x23, 0x16},
+ {0x24, 0x0f},
+ {0x25, 0xe1},
+ {0x26, 0xab},
+ {0x27, 0xa4},
+ {0x28, 0xf8},
+ {0x29, 0x1e},
+ {0x2a, 0x1b},
+ {0x2b, 0x4a},
+ {0x2c, 0x07},
+ {0x2d, 0xf2},
+ {0x2e, 0xc6},
+ {0x2f, 0x03},
+ {0x30, 0xf0},
+ {0x31, 0x1a},
+ {0x32, 0x73},
+ {0x33, 0xfa},
+ {0x34, 0x07},
+ {0x35, 0xf2},
+ {0x36, 0xc6},
+ {0x37, 0x03},
+ {0x38, 0x0f},
+ {0x39, 0xe5},
+ {0x3a, 0x76},
+ {0x3b, 0x28},
+ {0x3c, 0xf8},
+ {0x3d, 0x1a},
+ {0x3e, 0x5e},
+ {0x3f, 0x1c},
+ {0x40, 0x08},
+ {0x41, 0x28},
+ {0x42, 0x01},
+ {0x43, 0xe1},
+ {0x44, 0xf0},
+ {0x45, 0x35},
+ {0x46, 0x45},
+ {0x47, 0x27},
+ {0x48, 0x07},
+ {0x49, 0xa3},
+ {0x4a, 0x11},
+ {0x4b, 0xa4},
+ {0x4c, 0x0f},
+ {0x4d, 0xca},
+ {0x4e, 0xba},
+ {0x4f, 0xd9},
+ {0x50, 0xf8},
+ {0x51, 0x34},
+ {0x52, 0xec},
+ {0x53, 0x7b},
+ {0x54, 0x07},
+ {0x55, 0xfd},
+ {0x56, 0x56},
+ {0x57, 0xbd},
+ {0x58, 0xf0},
+ {0x59, 0x0d},
+ {0x5a, 0x69},
+ {0x5b, 0xed},
+ {0x5c, 0x07},
+ {0x5d, 0xf7},
+ {0x5e, 0xfd},
+ {0x5f, 0xbb},
+ {0x60, 0x0f},
+ {0x61, 0xf2},
+ {0x62, 0x96},
+ {0x63, 0x13},
+ {0x64, 0xf8},
+ {0x65, 0x0a},
+ {0x66, 0xab},
+ {0x67, 0x87},
+ {0x68, 0x07},
+ {0x69, 0xe1},
+ {0x6a, 0xc2},
+ {0x6b, 0x69},
+ {0x6c, 0xf0},
+ {0x6d, 0xac},
+ {0x6e, 0x0d},
+ {0x6f, 0x58},
+ {0x70, 0x07},
+ {0x71, 0x94},
+ {0x72, 0x0c},
+ {0x73, 0x4d},
+ {0x74, 0x0f},
+ {0x75, 0x53},
+ {0x76, 0xf2},
+ {0x77, 0xa8},
+ {0x78, 0xf8},
+ {0x79, 0x8a},
+ {0x7a, 0x31},
+ {0x7b, 0x49},
+ {0x7c, 0x08},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x25},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x08},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0xf1},
+ {0x1d, 0x79},
+ {0x1e, 0xcb},
+ {0x1f, 0xec},
+ {0x20, 0x06},
+ {0x21, 0xa6},
+ {0x22, 0x49},
+ {0x23, 0xa5},
+ {0x24, 0x0e},
+ {0x25, 0x86},
+ {0x26, 0x34},
+ {0x27, 0x14},
+ {0x28, 0xf9},
+ {0x29, 0x59},
+ {0x2a, 0xb6},
+ {0x2b, 0x5b},
+ {0x2c, 0x09},
+ {0x2d, 0x63},
+ {0x2e, 0x61},
+ {0x2f, 0x75},
+ {0x30, 0xf8},
+ {0x31, 0x28},
+ {0x32, 0x33},
+ {0x33, 0x32},
+ {0x34, 0x02},
+ {0x35, 0xcb},
+ {0x36, 0xa2},
+ {0x37, 0x07},
+ {0x38, 0x05},
+ {0x39, 0xc8},
+ {0x3a, 0x94},
+ {0x3b, 0x61},
+ {0x3c, 0xfd},
+ {0x3d, 0xe0},
+ {0x3e, 0x34},
+ {0x3f, 0xf0},
+ {0x40, 0x08},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0xf1},
+ {0x45, 0x79},
+ {0x46, 0xcb},
+ {0x47, 0xec},
+ {0x48, 0x06},
+ {0x49, 0xa6},
+ {0x4a, 0x49},
+ {0x4b, 0xa5},
+ {0x4c, 0x0e},
+ {0x4d, 0x86},
+ {0x4e, 0x34},
+ {0x4f, 0x14},
+ {0x50, 0xf9},
+ {0x51, 0x59},
+ {0x52, 0xb6},
+ {0x53, 0x5b},
+ {0x54, 0x07},
+ {0x55, 0xd8},
+ {0x56, 0xc2},
+ {0x57, 0x5c},
+ {0x58, 0xf1},
+ {0x59, 0x09},
+ {0x5a, 0x84},
+ {0x5b, 0x20},
+ {0x5c, 0x07},
+ {0x5d, 0xa4},
+ {0x5e, 0xd9},
+ {0x5f, 0x7a},
+ {0x60, 0x0e},
+ {0x61, 0xf6},
+ {0x62, 0x7b},
+ {0x63, 0xe0},
+ {0x64, 0xf8},
+ {0x65, 0x82},
+ {0x66, 0x64},
+ {0x67, 0x2a},
+ {0x68, 0x07},
+ {0x69, 0xc6},
+ {0x6a, 0x16},
+ {0x6b, 0x0b},
+ {0x6c, 0xf3},
+ {0x6d, 0x04},
+ {0x6e, 0x30},
+ {0x6f, 0xd8},
+ {0x70, 0x07},
+ {0x71, 0x00},
+ {0x72, 0x0d},
+ {0x73, 0xc1},
+ {0x74, 0x0c},
+ {0x75, 0xfb},
+ {0x76, 0xcf},
+ {0x77, 0x28},
+ {0x78, 0xf9},
+ {0x79, 0x39},
+ {0x7a, 0xdc},
+ {0x7b, 0x34},
+ {0x7c, 0x07},
+ {0x7d, 0xfc},
+ {0x7e, 0x8e},
+ {0x7f, 0xc5},
+ {0x00, 0x26},
+ {0x08, 0xf0},
+ {0x09, 0x91},
+ {0x0a, 0xb8},
+ {0x0b, 0xc2},
+ {0x0c, 0x07},
+ {0x0d, 0xe1},
+ {0x0e, 0xf7},
+ {0x0f, 0xf1},
+ {0x10, 0x0f},
+ {0x11, 0x6e},
+ {0x12, 0x47},
+ {0x13, 0x3e},
+ {0x14, 0xf8},
+ {0x15, 0x21},
+ {0x16, 0x79},
+ {0x17, 0x4a},
+ {0x18, 0x08},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x08},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x08},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x08},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x08},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x08},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x27},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x08},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x08},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x08},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x08},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x08},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x08},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x28},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x18, 0x08},
+ {0x19, 0x00},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x00},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x08},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x30, 0x00},
+ {0x31, 0x00},
+ {0x32, 0x00},
+ {0x33, 0x00},
+ {0x34, 0x00},
+ {0x35, 0x00},
+ {0x36, 0x00},
+ {0x37, 0x00},
+ {0x38, 0x00},
+ {0x39, 0x00},
+ {0x3a, 0x00},
+ {0x3b, 0x00},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x08},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x00},
+ {0x47, 0x00},
+ {0x48, 0x00},
+ {0x49, 0x00},
+ {0x4a, 0x00},
+ {0x4b, 0x00},
+ {0x4c, 0x00},
+ {0x4d, 0x00},
+ {0x4e, 0x00},
+ {0x4f, 0x00},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x08},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x00},
+ {0x5a, 0x00},
+ {0x5b, 0x00},
+ {0x5c, 0x00},
+ {0x5d, 0x00},
+ {0x5e, 0x00},
+ {0x5f, 0x00},
+ {0x60, 0x00},
+ {0x61, 0x00},
+ {0x62, 0x00},
+ {0x63, 0x00},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x08},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0x00},
+ {0x6d, 0x00},
+ {0x6e, 0x00},
+ {0x6f, 0x00},
+ {0x70, 0x00},
+ {0x71, 0x00},
+ {0x72, 0x00},
+ {0x73, 0x00},
+ {0x74, 0x00},
+ {0x75, 0x00},
+ {0x76, 0x00},
+ {0x77, 0x00},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x08},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x29},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x00, 0x2e},
+ {0x7c, 0x08},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x2f},
+ {0x08, 0x00},
+ {0x09, 0x00},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x00},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x10, 0x00},
+ {0x11, 0x00},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x14, 0x00},
+ {0x15, 0x00},
+ {0x16, 0x00},
+ {0x17, 0x00},
+ {0x1c, 0x08},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x00},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
+ {0x24, 0x00},
+ {0x25, 0x00},
+ {0x26, 0x00},
+ {0x27, 0x00},
+ {0x28, 0x00},
+ {0x29, 0x00},
+ {0x2a, 0x00},
+ {0x2b, 0x00},
+ {0x2c, 0x00},
+ {0x2d, 0x00},
+ {0x2e, 0x00},
+ {0x2f, 0x00},
+ {0x00, 0x2a},
+ {0x48, 0x00},
+ {0x49, 0x15},
+ {0x4a, 0xa7},
+ {0x4b, 0x04},
+ {0x4c, 0x00},
+ {0x4d, 0x15},
+ {0x4e, 0xa7},
+ {0x4f, 0x04},
+ {0x50, 0x00},
+ {0x51, 0x15},
+ {0x52, 0xa7},
+ {0x53, 0x04},
+ {0x54, 0x7b},
+ {0x55, 0x43},
+ {0x56, 0x52},
+ {0x57, 0x44},
+ {0x58, 0x89},
+ {0x59, 0x22},
+ {0x5a, 0xbf},
+ {0x5b, 0x66},
+ {0x00, 0x00},
+ {0x7f, 0x8c},
+ {0x00, 0x2b},
+ {0x34, 0x00},
+ {0x35, 0x22},
+ {0x36, 0x1d},
+ {0x37, 0x95},
+ {0x38, 0x02},
+ {0x39, 0xa3},
+ {0x3a, 0x9a},
+ {0x3b, 0xcc},
+ {0x3c, 0x00},
+ {0x3d, 0x06},
+ {0x3e, 0xd3},
+ {0x3f, 0x72},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0x00},
+ {0x45, 0x00},
+ {0x46, 0x4e},
+ {0x47, 0xa5},
+ {0x48, 0xff},
+ {0x49, 0x81},
+ {0x4a, 0x47},
+ {0x4b, 0xae},
+ {0x4c, 0xf9},
+ {0x4d, 0x06},
+ {0x4e, 0x21},
+ {0x4f, 0xa9},
+ {0x50, 0xfc},
+ {0x51, 0xc2},
+ {0x52, 0xd8},
+ {0x53, 0xc5},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x58, 0x00},
+ {0x59, 0x02},
+ {0x5a, 0x4b},
+ {0x5b, 0xce},
+ {0x00, 0x2d},
+ {0x58, 0x02},
+ {0x59, 0xa3},
+ {0x5a, 0x9a},
+ {0x5b, 0xcc},
+ {0x5c, 0x02},
+ {0x5d, 0xa3},
+ {0x5e, 0x9a},
+ {0x5f, 0xcc},
+ {0x60, 0x00},
+ {0x61, 0x44},
+ {0x62, 0x32},
+ {0x63, 0x13},
+ {0x64, 0x00},
+ {0x65, 0x00},
+ {0x66, 0x00},
+ {0x67, 0x00},
+ {0x68, 0x00},
+ {0x69, 0x00},
+ {0x6a, 0x00},
+ {0x6b, 0x00},
+ {0x6c, 0xff},
+ {0x6d, 0x81},
+ {0x6e, 0x47},
+ {0x6f, 0xae},
+ {0x70, 0xf9},
+ {0x71, 0x06},
+ {0x72, 0x21},
+ {0x73, 0xa9},
+ {0x74, 0xfc},
+ {0x75, 0xad},
+ {0x76, 0x96},
+ {0x77, 0x20},
+ {0x78, 0x00},
+ {0x79, 0x00},
+ {0x7a, 0x00},
+ {0x7b, 0x00},
+ {0x7c, 0x00},
+ {0x7d, 0x00},
+ {0x7e, 0x00},
+ {0x7f, 0x00},
+ {0x00, 0x00},
+ {0x7f, 0xaa},
+ {0x00, 0x2e},
+ {0x40, 0x58},
+ {0x41, 0x3b},
+ {0x42, 0x2f},
+ {0x43, 0x3d},
+ {0x44, 0x58},
+ {0x45, 0x3b},
+ {0x46, 0x2f},
+ {0x47, 0x3d},
+ {0x48, 0x58},
+ {0x49, 0x3b},
+ {0x4a, 0x2f},
+ {0x4b, 0x3d},
+ {0x4c, 0xae},
+ {0x4d, 0x1a},
+ {0x4e, 0x80},
+ {0x4f, 0x9b},
+ {0x50, 0xc2},
+ {0x51, 0xde},
+ {0x52, 0x41},
+ {0x53, 0xd5},
+ {0x00, 0x2b},
+ {0x20, 0x06},
+ {0x21, 0x55},
+ {0x22, 0xaf},
+ {0x23, 0xd8},
+ {0x24, 0xf9},
+ {0x25, 0xaa},
+ {0x26, 0x50},
+ {0x27, 0x28},
+ {0x28, 0x06},
+ {0x29, 0x55},
+ {0x2a, 0xaf},
+ {0x2b, 0xd8},
+ {0x2c, 0xae},
+ {0x2d, 0x1a},
+ {0x2e, 0x80},
+ {0x2f, 0x9b},
+ {0x30, 0xc2},
+ {0x31, 0xde},
+ {0x32, 0x41},
+ {0x33, 0xd5},
+ {0x0c, 0x06},
+ {0x0d, 0x55},
+ {0x0e, 0xaf},
+ {0x0f, 0xd8},
+ {0x10, 0xf9},
+ {0x11, 0xaa},
+ {0x12, 0x50},
+ {0x13, 0x28},
+ {0x14, 0x06},
+ {0x15, 0x55},
+ {0x16, 0xaf},
+ {0x17, 0xd8},
+ {0x18, 0xae},
+ {0x19, 0x1a},
+ {0x1a, 0x80},
+ {0x1b, 0x9b},
+ {0x1c, 0xc2},
+ {0x1d, 0xde},
+ {0x1e, 0x41},
+ {0x1f, 0xd5},
+ {0x00, 0x2a},
+ {0x34, 0x00},
+ {0x35, 0x15},
+ {0x36, 0xa7},
+ {0x37, 0x04},
+ {0x38, 0x00},
+ {0x39, 0x15},
+ {0x3a, 0xa7},
+ {0x3b, 0x04},
+ {0x3c, 0x00},
+ {0x3d, 0x15},
+ {0x3e, 0xa7},
+ {0x3f, 0x04},
+ {0x40, 0x7b},
+ {0x41, 0x43},
+ {0x42, 0x52},
+ {0x43, 0x44},
+ {0x44, 0x89},
+ {0x45, 0x22},
+ {0x46, 0xbf},
+ {0x47, 0x66},
+ {0x00, 0x00},
+ {0x7f, 0x8c},
+ {0x00, 0x2d},
+ {0x30, 0x02},
+ {0x31, 0xa3},
+ {0x32, 0x9a},
+ {0x33, 0xcc},
+ {0x34, 0x02},
+ {0x35, 0xa3},
+ {0x36, 0x9a},
+ {0x37, 0xcc},
+ {0x38, 0x00},
+ {0x39, 0x06},
+ {0x3a, 0xd3},
+ {0x3b, 0x72},
+ {0x3c, 0x00},
+ {0x3d, 0x00},
+ {0x3e, 0x00},
+ {0x3f, 0x00},
+ {0x40, 0x00},
+ {0x41, 0x00},
+ {0x42, 0x00},
+ {0x43, 0x00},
+ {0x44, 0xff},
+ {0x45, 0x81},
+ {0x46, 0x47},
+ {0x47, 0xae},
+ {0x48, 0xf9},
+ {0x49, 0x06},
+ {0x4a, 0x21},
+ {0x4b, 0xa9},
+ {0x4c, 0xfc},
+ {0x4d, 0xc2},
+ {0x4e, 0xd8},
+ {0x4f, 0xc5},
+ {0x50, 0x00},
+ {0x51, 0x00},
+ {0x52, 0x00},
+ {0x53, 0x00},
+ {0x54, 0x00},
+ {0x55, 0x00},
+ {0x56, 0x00},
+ {0x57, 0x00},
+ {0x00, 0x00},
+ {0x7f, 0xaa},
+ {0x00, 0x2a},
+ {0x5c, 0x7b},
+ {0x5d, 0x58},
+ {0x5e, 0xf9},
+ {0x5f, 0x48},
+ {0x60, 0x84},
+ {0x61, 0xa7},
+ {0x62, 0x06},
+ {0x63, 0xb8},
+ {0x64, 0x7b},
+ {0x65, 0x58},
+ {0x66, 0xf9},
+ {0x67, 0x48},
+ {0x68, 0x7b},
+ {0x69, 0x43},
+ {0x6a, 0x52},
+ {0x6b, 0x44},
+ {0x6c, 0x89},
+ {0x6d, 0x22},
+ {0x6e, 0xbf},
+ {0x6f, 0x66},
+ {0x70, 0x7b},
+ {0x71, 0x58},
+ {0x72, 0xf9},
+ {0x73, 0x48},
+ {0x74, 0x84},
+ {0x75, 0xa7},
+ {0x76, 0x06},
+ {0x77, 0xb8},
+ {0x78, 0x7b},
+ {0x79, 0x58},
+ {0x7a, 0xf9},
+ {0x7b, 0x48},
+ {0x7c, 0x7b},
+ {0x7d, 0x43},
+ {0x7e, 0x52},
+ {0x7f, 0x44},
+ {0x00, 0x2b},
+ {0x08, 0x89},
+ {0x09, 0x22},
+ {0x0a, 0xbf},
+ {0x0b, 0x66},
+ {0x00, 0x2e},
+ {0x54, 0x58},
+ {0x55, 0x3b},
+ {0x56, 0x2f},
+ {0x57, 0x3d},
+ {0x58, 0x58},
+ {0x59, 0x3b},
+ {0x5a, 0x2f},
+ {0x5b, 0x3d},
+ {0x5c, 0x58},
+ {0x5d, 0x3b},
+ {0x5e, 0x2f},
+ {0x5f, 0x3d},
+ {0x60, 0xae},
+ {0x61, 0x1a},
+ {0x62, 0x80},
+ {0x63, 0x9b},
+ {0x64, 0xc2},
+ {0x65, 0xde},
+ {0x66, 0x41},
+ {0x67, 0xd5},
+ {0x00, 0x00},
+ {0x7f, 0x8c},
+ {0x00, 0x2e},
+ {0x10, 0x00},
+ {0x11, 0x80},
+ {0x12, 0x00},
+ {0x13, 0x00},
+ {0x0c, 0x00},
+ {0x0d, 0x80},
+ {0x0e, 0x00},
+ {0x0f, 0x00},
+ {0x08, 0x00},
+ {0x09, 0x80},
+ {0x0a, 0x00},
+ {0x0b, 0x00},
+ {0x18, 0x00},
+ {0x19, 0x80},
+ {0x1a, 0x00},
+ {0x1b, 0x00},
+ {0x1c, 0x40},
+ {0x1d, 0x00},
+ {0x1e, 0x00},
+ {0x1f, 0x00},
+ {0x20, 0x40},
+ {0x21, 0x00},
+ {0x22, 0x00},
+ {0x23, 0x00},
// Register Tuning
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x30, 0x00 },
- { 0x4c, 0x30 },
- { 0x03, 0x03 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x30, 0x00},
+ {0x4c, 0x30},
+ {0x03, 0x03},
- { 0x00, 0x00 },
- { 0x7f, 0x00 },
- { 0x78, 0x80 },
+ {0x00, 0x00},
+ {0x7f, 0x00},
+ {0x78, 0x80},
- };
+};
#ifdef __cplusplus
}
diff --git a/components/audio_hal/driver/zl38063/LICENSE.txt b/components/audio_hal/driver/zl38063/LICENSE.txt
new file mode 100644
index 0000000..f92379e
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/LICENSE.txt
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright 2018 Microsemi Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/components/audio_hal/driver/zl38063/Readme_twolf.txt b/components/audio_hal/driver/zl38063/Readme_twolf.txt
new file mode 100644
index 0000000..9dbabd4
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/Readme_twolf.txt
@@ -0,0 +1,36 @@
+The Source code for the Timberwolf device driver is partitioned into 4 folders.
+
+\api_lib\
+There are 5 files in this folder
+The VprocTwolf_access.c/h -
+is the user's space OS independent API to read/write specific register of the device to
+reset the device into one of the 5 supported reset modes and to boot load a firmware/configuration record into the device.
+The API must be used in conjunction with a low level device driver such as microsemi_spis_tw.c/h, VprocGal_HAL.c/h
+
+vproc_common.c/h -
+includes functions and variable declarations that are common to all Microsemi Voice processing devices.
+These functions include the Vproc_msDelay(), VprocWait(). The Variables declarations include
+the device status codes, and device reset modes enums. As well as multiple macros to enable debug mode.
+
+the specific user_space hardware abstraction layer code for the ZL38040/05x/06x/08x Timberwolf devices.
+
+\firmware\
+This folder contains the firmware image , configuration record files and header file.
+
+NOTE: The firmware of the development board and its corresponding configuration have been encapsulated into a static library.
+
+\example_apps\
+This folder contains example host applications for the zl38040/050/060/080 Microsemi devices.
+
+zl38063.c/h -
+a series of operations for zl38063, such as initialize, adjust the volume, and so on.
+
+
+NOTE: You can get the latest firmware and related technical support by registering SDS account.
+ http://sds.microsemi.com/software.php.
+
+ ZLS38063 GUI software(MiTuner Lite GUI Software), ZLS38063 and ZLS38508LITE
+ http://sds.microsemi.com/software.php?view_type=listrev&id=103386.
+
+ firmware of ZL38063
+ http://sds.microsemi.com/software.php?view_type=listrev&id=104598.
diff --git a/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.c b/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.c
new file mode 100644
index 0000000..ad1676d
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.c
@@ -0,0 +1,1061 @@
+/****************************************************************************
+ * vprocTwolf_access.c - Voice Processor devices high level access module
+ *function definitions
+ *
+ * NOTE: The registers of the device are 16-bit wide. A 32-bit access
+ * is not required. However, the 32-bit access functions are provided
+ * only if the host wants to access two consecutives 16-bit registers
+ * in one single access.
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include "vprocTwolf_access.h"
+
+/*------------------------------------------------------*/
+/*TWOLF MACROS-------------------------------*/
+#define HBI_PAGED_READ(offset, length) \
+ ((uint16)(((uint16)(offset) << 8) | (length)))
+#define HBI_DIRECT_READ(offset, length) \
+ ((uint16)(0x8000 | ((uint16)(offset) << 8) | (length)))
+#define HBI_PAGED_WRITE(offset, length) \
+ ((uint16)(HBI_PAGED_READ(offset, length) | 0x0080))
+#define HBI_DIRECT_WRITE(offset, length) \
+ ((uint16)(HBI_DIRECT_READ(offset, length) | 0x0080))
+#define HBI_GLOBAL_DIRECT_WRITE(offset, length) \
+ ((uint16)(0xFC00 | ((offset) << 4) | (length)))
+#define HBI_CONFIGURE(pinConfig) ((uint16)(0xFD00 | (pinConfig)))
+#define HBI_SELECT_PAGE(page) ((uint16)(0xFE00 | (page)))
+#define HBI_SELECT_CL_PAGE() \
+ ((uint16)(0xFE80)
+#define HBI_CL_BROADCAST ((uint16)0xFEFF)
+#define HBI_NO_OP ((uint16)0xFFFF)
+
+#ifndef USING_MICROSEMI_LINUX_KERNEL_DRIVER
+/*TWOLF REGisters*/
+#define HOST_CMD_REG 0x0032 /*Host Command register*/
+#define HOST_CMD_IDLE 0x0000 /*idle/ operation complete*/
+#define HOST_CMD_NO_OP 0x0001 /*no-op*/
+#define HOST_CMD_IMG_CFG_LOAD 0x0002 /*load firmware and CR from flash*/
+#define HOST_CMD_IMG_LOAD 0x0003 /*load firmware only from flash*/
+#define HOST_CMD_IMG_CFG_SAVE 0x0004 /*save a firmware and CR to flash*/
+#define HOST_CMD_IMG_CFG_ERASE 0x0005 /*erase a firmware and CR in flash*/
+#define HOST_CMD_CFG_LOAD 0x0006 /*Load CR from flash*/
+#define HOST_CMD_CFG_SAVE 0x0007 /*save CR to flash*/
+#define HOST_CMD_FWR_GO 0x0008 /*start/restart firmware (GO)*/
+#define HOST_CMD_HOST_LOAD_CMP 0x000D /*Host Application Load Complete*/
+#define HOST_CMD_HOST_FLASH_INIT 0x000B /*Host Application flash discovery*/
+#define HOST_CMD_FWR_STOP 0x8000 /*stop firmware */
+#define HOST_CMD_CMD_IN_PROGRESS 0xFFFF /*wait command is in progress */
+
+#define PAGE_255_CHKSUM_LO_REG 0x000A
+#define PAGE_255_CHKSUM_HI_REG 0x0008
+#define CLK_STATUS_REG 0x014 /*Clock status register*/
+#define PAGE_255_BASE_LO_REG 0x000E
+#define PAGE_255_BASE_HI_REG 0x000C
+#define HOST_SW_FLAGS_REG 0x0006
+#define HOST_SW_FLAGS_CMD 0x0001
+#define HOST_SW_FLAGS_CMD_NORST 0x0004
+
+#define TWOLF_CLK_STATUS_HBI_BOOT 0x0001
+
+#define HBI_CONFIG_REG 0xFD00
+#define HBI_CONFIG_ENDIANNESS 0x0000
+#define HBI_CONFIG_DIVEMODE 0x0000
+#define HBI_CONFIG_WAKE 0x0080
+#define HBI_CONFIG_VAL \
+ (HBI_CONFIG_ENDIANNESS | HBI_CONFIG_DIVEMODE | HBI_CONFIG_WAKE)
+
+#define HOST_CMD_PARAM_RESULT_REG 0x034 /*Host Command Param/Result register*/
+#endif /*USING_MICROSEMI_LINUX_KERNEL_DRIVER*/
+
+#define TOTAL_FWR_DATA_WORD_PER_LINE 24
+#define TOTAL_FWR_DATA_BYTE_PER_LINE 128
+#define TWOLF_STATUS_NEED_MORE_DATA 22
+#define TWOLF_STATUS_BOOT_COMPLETE 23
+
+#define TWOLF_MBCMDREG_SPINWAIT 10000
+#define TWOLF_MAILBOX_SPINWAIT 1000
+
+/*--------------------------------------------------------------------*/
+/* VprocTwolfMailboxAcquire(): use this function to
+ * check for the availability of the mailbox
+ *
+ * Input Argument: None
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+static VprocStatusType VprocTwolfMailboxAcquire(uint16 flag, uint16 timeout) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ /*Check whether the host owns the command register*/
+ uint16 i = 0, temp = 0x0BAD;
+ for (i = 0; i < timeout; i++) {
+ status = VprocTwolfHbiRead(HOST_SW_FLAGS_REG, 1, &temp);
+ if ((status != VPROC_STATUS_SUCCESS)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ if (!(temp & flag)) {
+ break;
+ }
+ Vproc_msDelay(10); /*wait for reset to complete*/
+ }
+ DEBUG_LOGD(TAG_SPI, "timeout count = %d: \n", i);
+ if ((i >= timeout) && (temp & flag)) {
+ return VPROC_STATUS_MAILBOX_BUSY;
+ }
+ /*read the Host Command register*/
+ return VPROC_STATUS_SUCCESS;
+}
+
+/* VprocTwolfcmdRegAcquire(): use this function to
+ * check whether the last command completed sucsesfully
+ *
+ * Input Argument: None
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+static VprocStatusType VprocTwolfcmdRegAcquire(uint16 flag, uint16 timeout) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ /*Check whether the host owns the command register*/
+ uint16 i = 0, temp = 0x0BAD;
+ for (i = 0; i < timeout; i++) {
+ status = VprocTwolfHbiRead(HOST_CMD_REG, 1, &temp);
+ if ((status != VPROC_STATUS_SUCCESS)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ if (temp == flag) {
+ break;
+ }
+ Vproc_msDelay(10); /*wait*/
+ }
+ DEBUG_LOGD(TAG_SPI, "timeout count = %d, cmdReg = 0x%04x: \n", i, temp);
+ if ((i >= timeout) && (temp != flag)) {
+ return VPROC_STATUS_CMDREG_BUSY;
+ }
+ /*read the Host Command register*/
+ return VPROC_STATUS_SUCCESS;
+}
+
+/* VprocTwolfcmdRegWr(): use this function to
+ * access the host command register
+ *
+ * Input Argument: cmd - the command to send
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+static VprocStatusType VprocTwolfcmdRegWr(unsigned short cmd) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short flag = 0x0BAD;
+ /*Check whether the host owns the command register*/
+
+ status = VprocTwolfMailboxAcquire(HOST_SW_FLAGS_CMD, TWOLF_MAILBOX_SPINWAIT);
+ if ((status != VPROC_STATUS_SUCCESS)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ /*write the command into the Host Command register*/
+ status = VprocTwolfHbiWrite(HOST_CMD_REG, 1, &cmd);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ /*Release the command reg*/
+ /*read the Host Command register*/
+ flag = HOST_SW_FLAGS_CMD;
+ status = VprocTwolfHbiWrite(HOST_SW_FLAGS_REG, 1, &flag);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ /*Wait for the command to complete*/
+ status = VprocTwolfcmdRegAcquire(HOST_CMD_IDLE, TWOLF_MAILBOX_SPINWAIT);
+ if ((status != VPROC_STATUS_SUCCESS)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: CMD_REG - Operation is not complete\n",
+ status);
+ return status;
+ }
+ return VPROC_STATUS_SUCCESS;
+}
+
+static VprocStatusType VprocTwolfCheckCmdResult(void) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf;
+ status = VprocTwolfHbiRead(HOST_CMD_PARAM_RESULT_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ if (buf != 0) {
+ DEBUG_LOGE(TAG_SPI, "Command failed...Resultcode = 0x%04x\n", buf);
+ return VPROC_STATUS_ERR_VERIFY;
+ }
+ return VPROC_STATUS_SUCCESS;
+}
+
+/* spis_tw_hbi_rd16()- Decode the 16-bit T-WOLF Regs Host address into
+ * page, offset and build the 16-bit command acordingly to the access type.
+ * then read the 16-bit word data and store it in pdata
+ * \param[in]
+ * .addr the 16-bit HBI address
+ *
+ * return ::status
+ */
+static int spis_tw_hbi_rd16(uint16* pdata) {
+ /*perform the HBI access*/
+ if (VprocHALRead(pdata) != 0) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ return 0;
+}
+
+/* spis_tw_hbi_wr16_cmd()- this function is used for single word access
+ * It decodes the 16-bit T-WOLF Regs Host address into
+ * page, offset and build the 16-bit command acordingly to the access type.
+ * then write the command to the device
+ * \param[in]
+ * .addr the 16-bit HBI address
+ *
+ * return ::status
+ */
+static int spis_tw_hbi_wr16_cmd(uint16 addr, uint8 numwords) {
+ uint16 cmd;
+ int status = 0;
+ uint8 page;
+ uint8 offset;
+
+ page = addr >> 8;
+ offset = (addr & 0xFF) / 2;
+
+ if (page == 0) { /*Direct page access*/
+ cmd = HBI_DIRECT_WRITE(offset, numwords - 1); /*build the cmd*/
+ } else {
+ /*indirect page access*/
+ if (page != 0xFF) {
+ page -= 1;
+ }
+ cmd = HBI_SELECT_PAGE(page);
+ /*select the page*/
+ if (VprocHALWrite(cmd) != 0) {
+ return status;
+ }
+ cmd = HBI_PAGED_WRITE(offset, numwords - 1); /*build the cmd*/
+ }
+ /*perform the HBI access*/
+ if (VprocHALWrite(cmd) != 0) { /*write the register address*/
+ return status;
+ }
+ return 0;
+}
+
+/* spis_tw_hbi_rd16()- Decode the 16-bit T-WOLF Regs Host address into
+ * page, offset and build the 16-bit command acordingly to the access type.
+ * then read the 16-bit word data and store it in pdata
+ * \param[in]
+ * .addr the 16-bit HBI address
+ *
+ * return ::status
+ */
+static int spis_tw_hbi_rd16_cmd(uint16 addr, uint8 numwords) {
+ uint16 cmd;
+ int status = 0;
+ uint8 page;
+ uint8 offset;
+
+ page = addr >> 8;
+ offset = (addr & 0xFF) / 2;
+
+ if (page == 0) {
+ /*Direct page access*/
+ cmd = HBI_DIRECT_READ(offset, numwords - 1); /*build the cmd*/
+ } else {
+ /*Indirect page access*/
+ if (page != 0xFF) {
+ page -= 1;
+ }
+ cmd = HBI_SELECT_PAGE(page);
+ /*select the page*/
+ if (VprocHALWrite(cmd) != 0) {
+ return status;
+ }
+ cmd = HBI_PAGED_READ(offset, numwords - 1); /*build the cmd*/
+ }
+
+ /*perform the HBI access*/
+ if (VprocHALWrite(cmd) != 0) { /*write the register address*/
+ return status;
+ }
+ return 0;
+}
+
+/* spis_tw_hbi_wr16()- this function is used for single word access by the
+ * ioctl read. It decodes the 16-bit T-WOLF Regs Host address into
+ * page, offset and build the 16-bit command acordingly to the access type.
+ * then write the command and data to the device
+ * \param[in]
+ * .addr the 16-bit HBI address
+ *
+ * return ::status
+ */
+static int spis_tw_hbi_wr16_data(uint16 data) {
+ if (VprocHALWrite(data) != 0) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ return 0;
+}
+
+/******************************************************************************
+ * TwolfPagedWrite()
+ * This function selects the specified page, writes the number of specified
+ * words, starting at the specified offset from a source buffer.
+ *
+ * \param[in] page Page to select
+ * \param[in] offset Offset of the requested Page to read from
+ * \param[in] numWords Number of words to read starting from the offset
+ * \param[in] pSrc Pointer to the date to write
+ *
+ * \retval ::VP_STATUS_SUCCESS
+ * \retval ::VP_STATUS_ERR_HBI
+ ******************************************************************************/
+static VprocStatusType TwolfHbiPage255Write(unsigned char page,
+ unsigned char offset,
+ unsigned char numWords,
+ unsigned short* pDdata) {
+ uint16 cmdWrd = (uint16)(page << 8) | (uint16)offset;
+ if (VprocTwolfHbiWrite(cmdWrd, numWords, pDdata) != VPROC_STATUS_SUCCESS) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ return VPROC_STATUS_SUCCESS;
+} /* TwolfHbiPagedWrite() */
+
+/*------------------------------------------------------
+ * Higher level functions - Can be called by a host application
+ *------------------------------------------------------*/
+/*VprocTwolfHbiInit - use this function to initialize the device HBI
+ * This function can be called at startup during the system init
+ * Configure the HBI_CONFIG_VAL as per the host system. But default
+ * config is good for most cases. See HBI section in device datasheet for
+ * details
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+
+VprocStatusType VprocTwolfHbiInit(void) {
+ unsigned short buf = HBI_CONFIG_REG | HBI_CONFIG_VAL;
+ if (VprocHALInit() != 0) {
+ return VPROC_STATUS_INIT_FAILED;
+ }
+ return VprocHALWrite(buf);
+}
+
+/*VprocTwolfHbiCleanup - To close any open communication path to
+ * to the device
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfHbiCleanup(void) {
+ VprocHALcleanup();
+ return VPROC_STATUS_SUCCESS;
+}
+/*VprocTwolfHbiRead - use this function to read up to 254 words from the device
+ * \param[in] cmd of the requested device register to read from
+ * \param[in] numWords Number of words to read starting from the offset
+ * \param[in] pData Pointer to the data read
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfHbiRead(unsigned short cmd, /*register to read from*/
+ unsigned char numwords,
+ unsigned short* pData) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short tempBuf = 0x0BAD;
+ unsigned char i = 0;
+
+ // DEBUG_LOGE(TAG_SPI, "cmd = 0x%04x\n", cmd);
+ status = spis_tw_hbi_rd16_cmd(cmd, numwords);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: VPROC_STATUS_RD_FAILED,CMD:0x%04x\n", cmd);
+ return VPROC_STATUS_WR_FAILED;
+ }
+
+ for (i = 0; i < numwords; i++) {
+ status = spis_tw_hbi_rd16(&tempBuf);
+ pData[i] = tempBuf;
+ // DEBUG_LOGE(TAG_SPI, "pData[%d] = 0x%04x\n", i, pData[i]);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: VPROC_STATUS_RD_FAILED,CMD:0x%04x\n", cmd);
+ return VPROC_STATUS_RD_FAILED;
+ }
+ }
+ return status;
+}
+
+/*VprocTwolfHbiWrite - use this function to write up to 252 words to the device
+ * \param[in] cmd of the requested device register to write to
+ * \param[in] numWords Number of words to write starting from the offset
+ * \param[in] pData Pointer to the data to write
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfHbiWrite(unsigned short cmd, /*register to read from*/
+ unsigned char numwords,
+ unsigned short* pData) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned char i = 0;
+
+ if ((numwords == 0) || (numwords > 126)) {
+ DEBUG_LOGE(TAG_SPI, "number of words is out of range. Maximum is 126\n");
+ return VPROC_STATUS_INVALID_ARG;
+ }
+ /*16-bit SPI access mode - Send only 1 word within the same CS*/
+ status = spis_tw_hbi_wr16_cmd(cmd, numwords);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: VPROC_STATUS_WR_FAILED\n");
+ return VPROC_STATUS_WR_FAILED;
+ }
+ for (i = 0; i < numwords; i++) {
+ status = spis_tw_hbi_wr16_data(pData[i]);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: VPROC_STATUS_WR_FAILED\n");
+ return VPROC_STATUS_WR_FAILED;
+ }
+ }
+ return VPROC_STATUS_SUCCESS;
+}
+
+/*VprocTwolfLoadConfig() - use this function to load a custom or new config
+ * record into the device RAM to override the default config
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfLoadConfig(dataArr* pCr2Buf,
+ unsigned short numElements) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short i, buf;
+ /*stop the current firmware but do not reset the device and do not go to boot
+ * mode*/
+
+ /*send the config to the device RAM*/
+ for (i = 0; i < numElements; i++) {
+ buf = pCr2Buf[i].value;
+ status = VprocTwolfHbiWrite(pCr2Buf[i].reg, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ }
+
+ return status;
+}
+
+/* HbiSrecBoot_alt() Use this alternate method to load the st_twFirmware.c
+ *(converted *.s3 to c code) to the device
+ */
+static VprocStatusType HbiSrecBoot_alt(twFirmware* st_firmware) {
+ uint16 index = 0;
+ uint16 gTargetAddr[2] = {0, 0};
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ while (index < st_firmware->twFirmwareStreamLen) {
+ /* put the address into our global target addr */
+ gTargetAddr[0] =
+ (uint16)((st_firmware->st_Fwr[index].targetAddr & 0xFFFF0000) >> 16);
+ gTargetAddr[1] =
+ (uint16)(st_firmware->st_Fwr[index].targetAddr & 0x0000FFFF);
+
+ // DEBUG_LOGE(TAG_SPI, "gTargetAddr[0] = 0x%04x, gTargetAddr[1] = 0x%04x:
+ // \n",
+ // gTargetAddr[0], gTargetAddr[1]);
+
+ // DEBUG_LOGE(TAG_SPI, "numWords = %d: \n",
+ // st_firmware->st_Fwr[index].numWords);
+
+ /* write the data to the device */
+ if (st_firmware->st_Fwr[index].numWords != 0) {
+ if (st_firmware->st_Fwr[index].useTargetAddr) {
+ status = VprocTwolfHbiWrite(PAGE_255_BASE_HI_REG, 2, gTargetAddr);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI,
+ "Unable to set gTargetAddr[0] = 0x%04x,"
+ " gTargetAddr[1] = 0x%04x: \n",
+ gTargetAddr[0], gTargetAddr[1]);
+ return VPROC_STATUS_ERR_HBI;
+ }
+ }
+ status = TwolfHbiPage255Write(0xFF, (uint8)((gTargetAddr[1] & 0x00FF)),
+ st_firmware->st_Fwr[index].numWords,
+ st_firmware->st_Fwr[index].buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "status = %d, numWords = %d: \n", status,
+ st_firmware->st_Fwr[index].numWords);
+ return status;
+ }
+ }
+ // DEBUG_LOGE(TAG_SPI, "index %d\n", index);
+ if (index == 9) {
+ // break;
+ }
+ index++;
+ }
+
+ /*
+ * convert the number of bytes to two 16 bit
+ * values and write them to the requested page register
+ */
+ /* even number of bytes required */
+
+ /* program the program's execution start register */
+ gTargetAddr[0] = (uint16)((st_firmware->execAddr & 0xFFFF0000) >> 16);
+ gTargetAddr[1] = (uint16)(st_firmware->execAddr & 0x0000FFFF);
+ status = VprocTwolfHbiWrite(0x12C, 2, gTargetAddr);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, " unable to program page 1 execution address\n");
+ return status;
+ }
+
+ /* print out the srecord program info */
+ DEBUG_LOGI(TAG_SPI, "prgmBase 0x%08x\n", (int)st_firmware->prgmBase);
+ DEBUG_LOGI(TAG_SPI, "execAddr 0x%08x\n", (int)st_firmware->execAddr);
+ DEBUG_LOGI(TAG_SPI, "DONE\n");
+ return VPROC_STATUS_SUCCESS;
+}
+
+/*VprocTwolfHbiBoot_alt - use this function to bootload the firmware
+ * into the device
+ * \param[in] pointer to image data structure
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ * \retval ::VPROC_STATUS_MAILBOX_BUSY
+ */
+VprocStatusType VprocTwolfHbiBoot_alt(twFirmware* st_firmware) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf[2] = {0, 0};
+
+ /* write a value of 1 to address 0x14 (direct page offset 0x0A).
+ * to stop current firmware, reset the device into the Boot Rom mode.
+ */
+ buf[0] = 1; // TWOLF_CLK_STATUS_HBI_BOOT;
+ status = VprocTwolfHbiWrite(CLK_STATUS_REG, 1, buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ Vproc_msDelay(300); /*wait for reset to complete*/
+
+ buf[0] = buf[1] = 0;
+ status = VprocTwolfHbiRead(HOST_CMD_PARAM_RESULT_REG, 1, buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ /*Check if the device is accessible for command*/
+ if ((buf[0] != 0xD3D3)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: HBI is not accessible\n");
+ return VPROC_STATUS_ERR_HBI;
+ }
+ /*Transfer the image*/
+ status = HbiSrecBoot_alt(st_firmware);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ /*tell Twolf that the firmware loading is complete*/
+ buf[0] = HOST_CMD_HOST_LOAD_CMP;
+ status = VprocTwolfcmdRegWr(buf[0]);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ /*Verify whether the boot loading is successful*/
+ if (VprocTwolfCheckCmdResult() != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: Failed to load the Firmware...\n");
+ return VPROC_STATUS_FW_LOAD_FAILED;
+ }
+
+ return VPROC_STATUS_SUCCESS;
+}
+
+/*The following 3 functions provide a mean to loading the *.s3 firmare into
+ * the device
+ * - Call sequence:
+ * 1- Call VprocTwolfHbiBootPrepare()
+ * 2- Call VprocTwolfHbiBootMoreData() in a loop by passing one line at a time
+ * from the *.S3 image file until the whole file is transferred
+ * to the device. or until a TWOLF_STATUS_BOOT_COMPLETE status
+ * is reported
+ * 3- Call VprocTwolfHbiBootConclude() once the whole data is transferred suc-
+ * cessfully
+ */
+VprocStatusType VprocTwolfHbiBootPrepare(void) {
+ unsigned short buf[2] = {0, 0};
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ /* write a value of 1 to address 0x14 (direct page offset 0x0A).
+ * to stop current firmware, reset the device into the Boot Rom mode.
+ */
+ buf[0] = 1; // TWOLF_CLK_STATUS_HBI_BOOT;
+ status = VprocTwolfHbiWrite(CLK_STATUS_REG, 1, buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ return VPROC_STATUS_ERR_HBI;
+ }
+ Vproc_msDelay(300); /*wait for reset to complete*/
+
+ buf[0] = buf[1] = 0;
+ status = VprocTwolfHbiRead(HOST_CMD_PARAM_RESULT_REG, 1, buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ /*Check if the device is accessible for command*/
+ if ((buf[0] != 0xD3D3)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: HBI is not accessible\n");
+ return VPROC_STATUS_ERR_HBI;
+ }
+
+ return status;
+}
+/*AsciiHexToHex() - to convert ascii char hex to integer hex
+ * pram[in] - str - pointer to the char to convert.
+ * pram[in] - len - the number of character to convert (2:u8, 4:u16, 8:u32).
+
+ */
+static unsigned int AsciiHexToHex(const char* str, unsigned char len) {
+ unsigned int val = 0;
+ char c;
+ unsigned char i = 0;
+ for (i = 0; i < len; i++) {
+ c = *str++;
+ val <<= 4;
+
+ if (c >= '0' && c <= '9') {
+ val += c & 0x0F;
+ continue;
+ }
+
+ c &= 0xDF;
+ if (c >= 'A' && c <= 'F') {
+ val += (c & 0x07) + 9;
+ continue;
+ }
+ return 0;
+ }
+ return val;
+}
+static int spisTwBootWrite(char* blockOfFwrData) /*0: HBI; 1:FLASH*/
+{
+ /*Use this method to load the actual *.s3 file line by line*/
+ int status = 0;
+ int rec_type, i = 0, j = 0;
+ uint8 numbytesPerLine = 0;
+ uint8 numdataWordPerLine = 0;
+ uint16 dataBuf[64];
+ unsigned long address = 0;
+ uint8 page255Offset = 0x00;
+ uint16 cmd = 0;
+ uint16 gTargetAddr[2] = {0, 0};
+ DEBUG_LOGI(TAG_SPI, "blockOfFwrData = %s\n", blockOfFwrData);
+
+ if (blockOfFwrData == NULL) {
+ DEBUG_LOGE(TAG_SPI, "blockOfFwrData[0] = %c\n", blockOfFwrData[0]);
+ return VPROC_STATUS_INVALID_ARG;
+ }
+ /* if this line is not an srecord skip it */
+ if (blockOfFwrData[0] != 'S') {
+ DEBUG_LOGE(TAG_SPI, "blockOfFwrData[0] = %c\n", blockOfFwrData[0]);
+ return VPROC_STATUS_INVALID_ARG;
+ }
+ numbytesPerLine = AsciiHexToHex(&blockOfFwrData[2], 2);
+ numdataWordPerLine = (numbytesPerLine - 5) / 2;
+ DEBUG_LOGI(TAG_SPI, "numbytesPerLine = %d\n", numbytesPerLine);
+ if (numbytesPerLine == 0) {
+ DEBUG_LOGE(TAG_SPI, "blockOfFwrData[3] = %c\n", blockOfFwrData[3]);
+ return VPROC_STATUS_INVALID_ARG;
+ }
+ /* get the srecord type */
+ rec_type = blockOfFwrData[1] - '0';
+
+ /* skip non-existent srecord types and block header */
+ if ((rec_type == 4) || (rec_type == 5) || (rec_type == 6) ||
+ (rec_type == 0)) {
+ return TWOLF_STATUS_NEED_MORE_DATA;
+ }
+
+ /* get the info based on srecord type (skip checksum) */
+ address = AsciiHexToHex(&blockOfFwrData[4], 8);
+
+ page255Offset = (uint8)(address & 0xFF);
+
+ gTargetAddr[0] = (uint16)((address & 0xFFFF0000) >> 16);
+ gTargetAddr[1] = (uint16)(address & 0x0000FFFF);
+
+ /* store the execution address */
+ if ((rec_type == 7) || (rec_type == 8) || (rec_type == 9)) {
+ /* the address is the execution address for the program */
+ DEBUG_LOGI(TAG_SPI, "execAddr = 0x%08lx\n", address);
+ /* program the program's execution start register */
+ // status = spis_tw_hbi_multi_wr8(0x012C, 4, buf);
+ status = VprocTwolfHbiWrite(0x12C, 2, gTargetAddr);
+
+ if (status != 0) {
+ DEBUG_LOGE(TAG_SPI, " unable to program page 1 execution address\n");
+ return status;
+ }
+ DEBUG_LOGI(TAG_SPI, "Loading firmware data complete...\n");
+ return TWOLF_STATUS_BOOT_COMPLETE; /*BOOT_COMPLETE Sucessfully*/
+ }
+
+ /* put the address into our global target addr */
+
+ // DEBUG_LOGE(TAG_SPI, "gTargetAddr = 0x%08lx: \n", address);
+ status = VprocTwolfHbiWrite(PAGE_255_BASE_HI_REG, 2, gTargetAddr);
+ // status = spis_tw_hbi_multi_wr8(PAGE_255_BASE_HI_REG, 4, buf);
+ if (status != 0) {
+ DEBUG_LOGE(TAG_SPI, "gTargetAddr = 0x%08lx: \n", address);
+ return VPROC_STATUS_FW_LOAD_FAILED;
+ }
+
+ /* get the data bytes */
+ j = 12;
+ DEBUG_LOGI(TAG_SPI, "dataBuf[]=\n");
+ for (i = 0; i < numdataWordPerLine; i++) {
+ dataBuf[i] = AsciiHexToHex(&blockOfFwrData[j], 4);
+ j += 4;
+ DEBUG_LOGI(TAG_SPI, "0x%04x, ", dataBuf[i]);
+ }
+ /* write the data to the device */
+ cmd = (uint16)(0xFF << 8) | (uint16)page255Offset;
+ status = VprocTwolfHbiWrite(cmd, numdataWordPerLine, dataBuf);
+ if (status != 0) {
+ return status;
+ }
+
+ DEBUG_LOGI(TAG_SPI, "Provide next block of data...\n");
+ return TWOLF_STATUS_NEED_MORE_DATA; /*REQUEST STATUS_MORE_DATA*/
+}
+
+VprocStatusType VprocTwolfHbiBootMoreData(char* dataBlock) {
+ // return ioctl(twolf_fd, TWOLF_BOOT_SEND_MORE_DATA, dataBlock);
+ return spisTwBootWrite(dataBlock);
+}
+
+VprocStatusType VprocTwolfHbiBootConclude(void) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf;
+
+ /*tell Twolf that the firmware loading is complete*/
+ buf = HOST_CMD_HOST_LOAD_CMP;
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ /*Verify whether the boot loading is successful*/
+ if (VprocTwolfCheckCmdResult() != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR: Failed to load the Firmware...\n");
+ return VPROC_STATUS_FW_LOAD_FAILED;
+ }
+ return status;
+ // return status;
+}
+
+/*USe this function to erase a slave flash device controlled by the Twolf*/
+VprocStatusType VprocTwolfEraseFlash(void) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf;
+ /*Save firmware to flash*/
+
+ status = VprocTwolfReset(VPROC_RST_HARDWARE_RAM);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ buf = HOST_CMD_HOST_FLASH_INIT;
+ /*if there is a flash on board initialize it*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ buf = 0xAA55;
+ status = VprocTwolfHbiWrite(HOST_CMD_PARAM_RESULT_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Unable to set command reg = 0x%04x: \n", buf);
+ return VPROC_STATUS_ERR_HBI;
+ }
+
+ buf = 0x0009;
+ /*delete all applications on flash*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ return VPROC_STATUS_SUCCESS;
+}
+
+/* VprocTwolfReset(): use this function to reset the device.
+ *
+ *
+ * Input Argument: mode - the reset mode (VPROC_RST_HARDWARE_ROM,
+ * VPROC_RST_HARDWARE_ROM, VPROC_RST_SOFT, VPROC_RST_AEC)
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+VprocStatusType VprocTwolfReset(VprocResetMode mode) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf;
+ /*PLATFORM SPECIFIC code*/
+ if (mode == VPROC_RST_HARDWARE_RAM) { /*hard reset*/
+ /*hard reset*/
+ buf = 0x05;
+ status = VprocTwolfHbiWrite(0x014, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ } else if (mode == VPROC_RST_HARDWARE_ROM) { /*power on reset*/
+ /*hard reset*/
+ buf = 0x09;
+ status = VprocTwolfHbiWrite(0x014, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ } else if (mode == VPROC_RST_AEC) { /*AEC method*/
+ buf = 0x01;
+ status = VprocTwolfHbiWrite(0x0300, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ } else if (mode == VPROC_RST_SOFTWARE) { /*soft reset*/
+ buf = 0x02;
+ status = VprocTwolfHbiWrite(0x006, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ } else {
+ DEBUG_LOGE(TAG_SPI, "Invalid reset type\n");
+ return VPROC_STATUS_INVALID_ARG;
+ }
+ Vproc_msDelay(200);
+ return VPROC_STATUS_SUCCESS;
+}
+
+VprocStatusType VprocTwolfSetVolume(uint8 vol) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf = vol; // Gain A
+ buf += (unsigned short)vol << 8; // Gain B
+ VprocHALInit();
+ status = VprocTwolfHbiWrite(0x238, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ status = VprocTwolfHbiWrite(0x23A, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ return status;
+}
+
+VprocStatusType VprocTwolfGetVolume(int8_t* vol) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ unsigned short buf = 0;
+ VprocHALInit();
+ status = VprocTwolfHbiRead(0x238, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ *vol = (int8_t)buf;
+ return status;
+}
+
+VprocStatusType VprocTwolfGetAppStatus(uint16* status) {
+ VprocStatusType ret = VPROC_STATUS_SUCCESS;
+ unsigned short buf = 0;
+ VprocHALInit();
+ ret = VprocTwolfHbiRead(0x030, 1, &buf);
+ if (ret != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", ret);
+ return ret;
+ }
+ *status = buf & 0x0F;
+ return ret;
+}
+/* VprocTwolfSaveImgToFlash(): use this function to
+ * save both the config record and the firmware to flash. It Sets the bit
+ * which initiates a firmware save to flash when the device
+ * moves from a STOPPED state to a RUNNING state (by using the GO bit)
+ *
+ * Input Argument: None
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+
+/* VprocTwolfSaveImgToFlash(): use this function to
+ * save both the config record and the firmware to flash. It Sets the bit
+ * which initiates a firmware save to flash when the device
+ * moves from a STOPPED state to a RUNNING state (by using the GO bit)
+ *
+ * Input Argument: None
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ */
+VprocStatusType VprocTwolfSaveImgToFlash(void) {
+ unsigned short buf;
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ /*Save firmware to flash*/
+
+ buf = HOST_CMD_HOST_FLASH_INIT;
+ /*if there is a flash on board initialize it*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ buf = 0xAA55;
+ status = VprocTwolfHbiWrite(HOST_CMD_PARAM_RESULT_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Unable to set command reg = 0x%04x: \n", buf);
+ return VPROC_STATUS_ERR_HBI;
+ }
+
+ buf = 0x0009;
+ /*delete all applications on flash*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ buf = HOST_CMD_IMG_CFG_SAVE;
+ /*save the image to flash*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Save firmware to flash failed... reg = 0x%04x: \n",
+ buf);
+ return VPROC_STATUS_ERR_HBI;
+ }
+ /*check whethe the actions above were performed successfully*/
+ return VprocTwolfCheckCmdResult();
+}
+
+/* VprocTwolfSaveCfgToFlash(): use this function to
+ * save the config record to flash. It Sets the bit
+ * which initiates a config save to flash when the device
+ * moves from a STOPPED state to a RUNNING state (by using the GO bit)
+ *
+ * Input Argument: None
+ * Return: (VprocStatusType) type error code (0 = success, else= fail)
+ * The firmware must be stopped first with VprocTwolfFirmwareStop()
+ */
+
+VprocStatusType VprocTwolfSaveCfgToFlash(void) {
+ unsigned short buf;
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ /*Save firmware to flash*/
+ /*if there is a flash on board initialize it*/
+
+ /* Clear the checksum register so that the fimrware can calculate a new chk
+ * value If this register is not cleared first, then an invalid checksum will
+ * be calculated which will cause this procedure to fail
+ */
+
+ buf = HOST_CMD_HOST_FLASH_INIT;
+
+ /*if there is a flash on the board initialize it*/
+ status = VprocTwolfcmdRegWr(buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ /*Check if there is a flash device and an image already saved to it - load it
+ * to RAM*/
+ status = VprocTwolfHbiRead(0x026, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+ if ((buf > 0)) {
+ /*load the corresponding image/cr from flash*/
+ buf = 0x0001;
+ status = VprocTwolfHbiWrite(HOST_CMD_PARAM_RESULT_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Unable to set command reg = 0x%04x: \n", buf);
+ return VPROC_STATUS_ERR_HBI;
+ }
+ buf = 0x8002;
+ status = VprocTwolfHbiWrite(HOST_CMD_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Unable to set command reg = 0x%04x: \n", buf);
+ return VPROC_STATUS_ERR_HBI;
+ }
+
+ /*Release the command reg*/
+ /*read the Host Command register*/
+ buf = 0x0004;
+ status = VprocTwolfHbiWrite(HOST_SW_FLAGS_REG, 1, &buf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: \n", status);
+ return status;
+ }
+
+ status = VprocTwolfcmdRegAcquire(HOST_CMD_IDLE, TWOLF_MAILBOX_SPINWAIT);
+ if ((status != VPROC_STATUS_SUCCESS)) {
+ DEBUG_LOGE(TAG_SPI, "ERROR %d: CMD_REG - Operation is not complete\n",
+ status);
+ return status;
+ }
+
+ /*Verify wheter the operation completed sucessfully*/
+ status = VprocTwolfCheckCmdResult();
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d: Unable to verify result-param: \n",
+ status);
+ return status;
+ }
+ }
+
+ return VPROC_STATUS_SUCCESS;
+}
+
+/*VprocTwolfFirmwareStart - use this function to start/restart the firmware
+ * previously stopped with VprocTwolfFirmwareStop()
+ * \param[in] none
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfFirmwareStart(void) {
+ unsigned short buf;
+
+ /*Start firmware*/
+ buf = HOST_CMD_FWR_GO;
+ return VprocTwolfcmdRegWr(buf);
+}
+
+/*VprocTwolfFirmwareStop - use this function to stop the firmware currently
+ * running And set the device in boot mode \param[in] none
+ *
+ * \retval ::VPROC_STATUS_SUCCESS
+ * \retval ::VPROC_STATUS_ERR_HBI
+ */
+VprocStatusType VprocTwolfFirmwareStop(void) {
+ unsigned short buf;
+
+ /*Stop firmware*/
+ buf = HOST_CMD_FWR_STOP;
+ return VprocTwolfcmdRegWr(buf);
+}
diff --git a/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.h b/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.h
new file mode 100644
index 0000000..fc08691
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/api_lib/vprocTwolf_access.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+ *
+ * vprocTwolf_access.h - Voice Processor devices high level access module
+ *function prototypes, variables
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#ifndef VPROC_TWOLFACCESS_H
+#define VPROC_TWOLFACCESS_H
+
+#include "vproc_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TWOLF_MAILBOX_SPINWAIT 1000 /*at least a 1000 to avoid mailbox busy */
+
+/*device HBI command structure*/
+typedef struct hbiCmdInfo {
+ unsigned char page;
+ unsigned char offset;
+ unsigned char numwords;
+} hbiCmdInfo;
+
+/* external function prototypes */
+
+VprocStatusType VprocTwolfHbiInit(
+ void); /*Use this function to initialize the HBI bus*/
+
+VprocStatusType VprocTwolfHbiRead(
+ unsigned short cmd, /*the 16-bit register to read from*/
+ unsigned char numwords, /* The number of 16-bit words to read*/
+ unsigned short *pData); /* Pointer to the read data buffer*/
+
+VprocStatusType VprocTwolfHbiWrite(
+ unsigned short cmd, /*the 16-bit register to write to*/
+ unsigned char numwords, /* The number of 16-bit words to write*/
+ unsigned short *pData); /*the words (0-255) to write*/
+
+VprocStatusType
+TwolfHbiNoOp( /*send no-op command to the device*/
+ unsigned char numWords); /* The number of no-op (0-255) to write*/
+
+/*An alternative method to loading the firmware into the device
+ * USe this method if you have used the provided tool to convert the *.s3 into
+ * c code that can be compiled with the application
+ */
+VprocStatusType
+VprocTwolfHbiBoot_alt(/*use this function to boot load the firmware (*.c) from
+ the host to the device RAM*/
+ twFirmware *st_firmware); /*Pointer to the firmware image
+ in host RAM*/
+
+VprocStatusType VprocTwolfLoadConfig(dataArr *pCr2Buf,
+ unsigned short numElements);
+
+VprocStatusType VprocTwolfHbiCleanup(void);
+VprocStatusType VprocTwolfHbiBootPrepare(void);
+VprocStatusType VprocTwolfHbiBootMoreData(char *dataBlock);
+VprocStatusType VprocTwolfHbiBootConclude(void);
+VprocStatusType VprocTwolfFirmwareStop(
+ void); /*Use this function to halt the currently running firmware*/
+VprocStatusType VprocTwolfFirmwareStart(
+ void); /*Use this function to start/restart the firmware currently in RAM*/
+VprocStatusType VprocTwolfSaveImgToFlash(
+ void); /*Save current loaded firmware from device RAM to FLASH*/
+VprocStatusType VprocTwolfSaveCfgToFlash(
+ void); /*Save current device config from device RAM to FLASH*/
+VprocStatusType VprocTwolfReset(VprocResetMode mode);
+VprocStatusType VprocTwolfEraseFlash(void);
+VprocStatusType VprocTwolfLoadFwrCfgFromFlash(uint16 image_number);
+VprocStatusType VprocTwolfSetVolume(uint8 vol);
+VprocStatusType VprocTwolfGetVolume(int8_t *vol);
+VprocStatusType VprocTwolfGetAppStatus(uint16 *status);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* VPROCTWOLFACCESS_H */
diff --git a/components/audio_hal/driver/zl38063/api_lib/vproc_common.c b/components/audio_hal/driver/zl38063/api_lib/vproc_common.c
new file mode 100644
index 0000000..1319105
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/api_lib/vproc_common.c
@@ -0,0 +1,165 @@
+/****************************************************************************
+ * vproc_common.c - Hal functions for the VPROC API
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include "vproc_common.h"
+
+#include
+#include
+
+#include "audio_idf_version.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "driver/spi_master.h"
+#include "lwip/def.h"
+#include "soc/gpio_struct.h"
+
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 4))
+#define SPI_HOST_NUM SPI2_HOST
+#elif (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0))
+#define SPI_HOST_NUM SPI3_HOST
+#else
+#define SPI_HOST_NUM HSPI_HOST
+#endif
+
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
+#include "esp_rom_sys.h"
+#endif
+
+static spi_device_handle_t g_spi = NULL;
+
+int VprocHALInit(void) {
+ /*if the customer platform requires any init
+ * then implement such init here.
+ * Otherwise the implementation of this function is complete
+ */
+ esp_err_t ret = ESP_OK;
+
+ spi_bus_config_t buscfg = {0};
+ spi_device_interface_config_t devcfg = {
+ .clock_speed_hz = 1000000, // Clock out at 10 MHz
+ .mode = 0, // SPI mode 0
+ .queue_size = 6, // queue 7 transactions at a time
+ };
+
+ get_spi_pins(&buscfg, &devcfg);
+ // Initialize the SPI bus
+ if (g_spi) {
+ return ret;
+ }
+ ret = spi_bus_initialize(SPI_HOST_NUM, &buscfg, 0);
+ assert(ret == ESP_OK);
+ ret = spi_bus_add_device(SPI_HOST_NUM, &devcfg, &g_spi);
+ assert(ret == ESP_OK);
+ gpio_set_pull_mode(0, GPIO_FLOATING);
+ return ret;
+}
+
+/*HAL clean up function - To close any open file connection
+ * microsemi_spis_tw kernel char driver
+ *
+ * return: a positive integer value for success, a negative integer value for
+ * failure
+ */
+
+void VprocHALcleanup(void) {
+ /*if the customer platform requires any cleanup function
+ * then implement such function here.
+ * Otherwise the implementation of this function is complete
+ */
+ int ret = 0;
+ ret = spi_bus_remove_device(g_spi);
+ assert(ret == ESP_OK);
+ ret = spi_bus_free(SPI_HOST_NUM);
+
+ assert(ret == ESP_OK);
+}
+/*Note - These functions are PLATFORM SPECIFIC- They must be modified
+ * accordingly
+ **********************************************************************/
+
+/* Vproc_msDelay(): use this function to
+ * force a delay of specified time in resolution of milli-second
+ *
+ * Input Argument: time in unsigned 16-bit
+ * Return: none
+ */
+
+void Vproc_msDelay(unsigned short time) {
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
+ esp_rom_delay_us(time * 1000);
+#else
+ ets_delay_us(time * 1000);
+#endif
+}
+
+/* VprocWait(): use this function to
+ * force a delay of specified time in resolution of 125 micro-Seconds
+ *
+ * Input Argument: time in unsigned 32-bit
+ * Return: none
+ */
+void VprocWait(unsigned long int time) {
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
+ esp_rom_delay_us(time * 1000);
+#else
+ ets_delay_us(time * 1000);
+#endif
+}
+
+#define BIGENDIAN 1
+
+/* This is the platform dependent low level spi
+ * function to write 16-bit data to the ZL380xx device
+ */
+int VprocHALWrite(unsigned short val) {
+ /*Note: Implement this as per your platform*/
+ esp_err_t ret;
+ spi_transaction_t t;
+ unsigned short data = 0;
+ memset(&t, 0, sizeof(t)); // Zero out the transaction
+ t.length = sizeof(unsigned short) *
+ 8; // Len is in bytes, transaction length is in bits.
+#if BIGENDIAN
+ data = htons(val);
+ t.tx_buffer = &data; // Data
+#else
+ t.tx_buffer = &val;
+#endif
+ ret = spi_device_transmit(g_spi, &t); // Transmit
+ assert(ret == ESP_OK);
+
+ return 0;
+}
+
+/* This is the platform dependent low level spi
+ * function to read 16-bit data from the ZL380xx device
+ */
+int VprocHALRead(unsigned short *pVal) {
+ /*Note: Implement this as per your platform*/
+ esp_err_t ret;
+ spi_transaction_t t;
+ unsigned short data = 0;
+
+ memset(&t, 0, sizeof(t)); // Zero out the transaction
+ t.length = sizeof(unsigned short) * 8;
+ t.rxlength = sizeof(unsigned short) *
+ 8; // The unit of len is byte, and the unit of length is bit.
+ t.rx_buffer = &data;
+ ret = spi_device_transmit(g_spi, &t); // Transmit!
+#if BIGENDIAN
+ *pVal = ntohs(data);
+#else
+ *pVal = data;
+#endif
+ assert(ret == ESP_OK);
+
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/api_lib/vproc_common.h b/components/audio_hal/driver/zl38063/api_lib/vproc_common.h
new file mode 100644
index 0000000..4ed7d9b
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/api_lib/vproc_common.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+ * vproc_common.h - Hal functions prototypes, macros and variables for the VPROC
+ *API
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#ifndef VPROC_COMMON_H
+#define VPROC_COMMON_H
+
+#include
+#include
+#include
+
+#include "esp_log.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DEBUG_LOGD ESP_LOGD
+#define DEBUG_LOGE ESP_LOGE
+#define DEBUG_LOGI ESP_LOGI
+/*This header includes some platform dependent data types*/
+#include "vproc_data_types.h"
+
+// #define RETRY_COUNT 100
+#define VPROC_TIMEOUT 500
+
+#define TAG_SPI "SPI"
+
+/* external defines */
+#undef VPROC_DEBUG
+
+/*create a 16-bit word out of two bytes*/
+#define MAKE16(a, b) \
+ (unsigned short)(((unsigned short)(b) << 8) | (unsigned short)(a))
+/*create a 32-bit word out of 4 bytes*/
+
+#define MAKE32(a, b, c, d) \
+ (unsigned long)(((unsigned long)d << 24) | ((unsigned long)c << 16) | \
+ ((unsigned long)b << 8) | ((unsigned long)a))
+/*
+ * debug - print the function name and line number for the source of the error
+ * the line number count start at 1 and not 0
+ */
+
+/*
+ *Define this macro to report mode debug info
+ */
+#undef VPROC_API_DBG_INFO
+#ifdef VPROC_API_DBG_INFO
+#define VPROG_DBG_INFO(s, args...) printf(""s, ##args);
+#else
+#define VPROG_DBG_INFO(s, args...)
+#endif
+
+#define VPROC_API_DBG_ERROR
+#ifdef VPROC_API_DBG_ERROR
+#define VPROG_DBG_ERROR(s, args...) \
+ printf("---%s %d: "s, __func__, __LINE__, ##args);
+#else
+#define VPROG_DBG_ERROR(s, args...)
+#endif
+
+/*unsigned char deviceType;*/
+/*device/access Status codes*/
+typedef enum VprocStatusType {
+ VPROC_STATUS_SUCCESS = 0,
+ VPROC_STATUS_FAILURE,
+ VPROC_STATUS_INIT_FAILED,
+ VPROC_STATUS_WR_FAILED,
+ VPROC_STATUS_RD_FAILED,
+ VPROC_STATUS_FW_LOAD_FAILED,
+ VPROC_STATUS_CFG_LOAD_FAILED,
+ VPROC_STATUS_CLOSE_FAILED,
+ VPROC_STATUS_FW_SAVE_FAILED,
+ VPROC_STATUS_GFG_SAVE_FAILED,
+ VPROC_STATUS_MAU_NOT_READY,
+ VPROC_STATUS_CHK_FAILED,
+ VPROC_STATUS_FUNC_NOT_SUPPORTED,
+ VPROC_STATUS_INVALID_ARG,
+ VPROC_STATUS_ERR_VTD_CODE,
+ VPROC_STATUS_ERR_VERIFY,
+ VPROC_STATUS_DEVICE_BUSY,
+ VPROC_STATUS_ERR_HBI,
+ VPROC_STATUS_ERR_IMAGE,
+ VPROC_STATUS_MAILBOX_BUSY,
+ VPROC_STATUS_CMDREG_BUSY,
+ VPROC_STATUS_IN_CRTCL_SECTN,
+ VPROC_STATUS_BOOT_LOADING_MORE_DATA,
+ VPROC_STATUS_BOOT_LOADING_CMP,
+ VPROC_STATUS_DEV_NOT_INITIALIZED,
+
+} VprocStatusType;
+
+/* Device Reset modes*/
+typedef enum VprocResetMode {
+ VPROC_RST_HARDWARE_ROM =
+ 0, /*hardware reset -reset the device and reload the firmware from flash*/
+ VPROC_RST_HARDWARE_RAM =
+ 1, /*hardware reset -reset the device and reload the firmware from RAM*/
+ VPROC_RST_SOFTWARE = 2,
+ VPROC_RST_AEC = 3, /*software reset -reset and runs the firmware from RAM*/
+ VPROC_RST_BOOT = 4
+} VprocResetMode;
+
+typedef enum vProcDeviceType {
+ VPROC_DEV_GALILEO = 1, /*Galileo devices: ZL38004, ZL38012, ZL38005*/
+ VPROC_DEV_TIMBERWOLF = 2 /*Timberwolf: ZL38040*/
+} VprocDeviceType;
+
+extern void VprocHALcleanup(void);
+extern int VprocHALInit(void);
+extern void Vproc_msDelay(unsigned short time);
+extern void VprocWait(unsigned long int time);
+extern int VprocHALWrite(unsigned short val);
+extern int VprocHALRead(unsigned short* pVal);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VPROC_COMMON_H */
diff --git a/components/audio_hal/driver/zl38063/api_lib/vproc_data_types.h b/components/audio_hal/driver/zl38063/api_lib/vproc_data_types.h
new file mode 100644
index 0000000..409259e
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/api_lib/vproc_data_types.h
@@ -0,0 +1,124 @@
+/** \file vproc_data_types.h
+ * vproc_data_types.h
+ *
+ * This file is the header for all standard types used in the API code.
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#ifndef VP_API_TYPES_H
+#define VP_API_TYPES_H
+/* For maximum that can be stored in an int - if file exists in library */
+#include "esp_types.h"
+#include "limits.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef NULL
+#define NULL (0)
+#endif
+
+#ifdef EXTERN
+#undef EXTERN
+#error EXTERN was redefined!
+#endif /* undef EXTERN */
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+#else
+#define EXTERN extern
+#endif /* __cplusplus */
+
+/********************* DECLARATIONS ***************************/
+/* Constants */
+#define FALSE (0) /* Boolean constant */
+#define TRUE (1) /* Boolean constant */
+#ifndef __cplusplus
+/* C++ language provides a boolean data type; So no need to define
+ * one more data type; Make use of it
+ * NOTE: The 'C' potions of the VP-API assume C++ "bool" to be of the
+ * same size as that of "char". Please make sure this assumption is correct.
+ */
+
+// typedef unsigned char bool;
+#endif /* __cplusplus */
+/****************** typedefs ***********************************/
+/* These are the basic number types used */
+/* for uint8, uint16, uint32, int8, int16, int32, bool */
+// PLATFORM SPECIFIC DEFINITIONS
+typedef unsigned char uchar;
+typedef signed char int8;
+typedef unsigned char UCharT; // 8 bits unsigned - PLATFORM SPECIFIC
+typedef unsigned char UInt8T; // 8 bits unsigned - PLATFORM SPECIFIC
+typedef unsigned short UInt16T; // 16 bits unsigned - PLATFORM SPECIFIC
+typedef unsigned long UInt32T; // 32 bits unsigned - PLATFORM SPECIFIC
+typedef signed long Int32T; // 32 bits signed - PLATFORM SPECIFIC
+typedef unsigned char uint8; // 8 bits unsigned - PLATFORM SPECIFIC
+typedef unsigned short uint16; // 16 bits unsigned - PLATFORM SPECIFIC
+typedef uint8* uint8p; // pointer to 8 bits unsigned - PLATFORM SPECIFIC
+typedef uint16* uint16p; // pointer to 16 bits unsigned - PLATFORM SPECIFIC
+typedef uint32_t uint32; // 32 bits unsigned - PLATFORM SPECIFIC
+typedef signed short int16; // 32 bits unsigned - PLATFORM SPECIFIC
+typedef uint32* uint32p;
+typedef int8* int8p;
+typedef int16* int16p;
+typedef Int32T* int32p;
+
+/* external types */
+/* Some compilers optimize the size of enumeration data types based on
+ * the maximum data value assigned to the members of that data type.
+ * 'Standard C' requires enumeration data types to be of the same size
+ * as that of native 'int' implementation.
+ * The VP-API from a portability persepective adds a 'dummy' member to
+ * all enumeration data types that force the compilers to allocate the size
+ * of enumeration data types to be equal to that of native 'int'
+ * implementation */
+#define FORCE_STANDARD_C_ENUM_SIZE (INT_MAX)
+
+/* Eliminate error messages that occur when comparing an enumeration constant
+ < 0 */
+#define FORCE_SIGNED_ENUM (INT_MIN)
+
+/* Define any API specific basic data type ranges (that are necessary) */
+#define VP_INT16_MAX (SHRT_MAX)
+#define VP_INT16_MIN (SHRT_MIN)
+#define VP_INT32_MAX (LONG_MAX)
+#define VP_INT32_MIN (LONG_MIN)
+
+/*firmware data structures*/
+typedef struct {
+ uint16 buf[16]; /*the firmware data block to send to the device*/
+ uint16
+ numWords; /*the number of words within the block of data stored in buf[]*/
+ uint32 targetAddr; /*the target base address to write to register 0x00c of the
+ device*/
+ uint8 useTargetAddr; /*this value is either 0 or 1. When 1 the tarGetAddr must
+ be written to the device*/
+} twFwr;
+
+typedef struct {
+ twFwr* st_Fwr;
+ uint32 byteCount; /*The total number of bytes within the firmware - NOT USED*/
+ uint8 havePrgmBase;
+ uint32 prgmBase;
+ uint32 execAddr; /*The execution start address of the firmware in RAM*/
+ uint16 twFirmwareStreamLen; /*The number of blocks within the firmware*/
+} twFirmware;
+
+/*config record structures*/
+typedef struct {
+ uint16 reg; /*the register */
+ uint16 value; /*the value to write into reg */
+} dataArr;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VP_API_TYPES_H */
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_hal_verify.c b/components/audio_hal/driver/zl38063/example_apps/tw_hal_verify.c
new file mode 100644
index 0000000..af2255b
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_hal_verify.c
@@ -0,0 +1,307 @@
+/****************************************************************************
+ * tw_hal_verify.c - Read/write registers of the device and verify whether the
+ * device is accessed properly
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include
+#include /* malloc, free, rand */
+
+#include "esp_log.h"
+#include "vprocTwolf_access.h"
+#include "vproc_common.h"
+#include "zl38063_config.h"
+#include "zl38063_firmware.h"
+
+/*NOTE: notice that the *.c code are included in the apps-
+ * This is because the compiler I'm using requires that
+ * But if your makefile is such that compiler knows where to find these files
+ * then remove the #include *.c below
+ */
+
+#undef SAVE_IMAGE_TO_FLASH /*define this macro to save the firmware from RAM \
+ to flash*/
+#undef SAVE_CFG_TO_FLASH /*define this macro to save the cfg from RAM to \
+ flash*/
+/*quick test*/
+
+#define TW_HAL_VERIFY_DEBUG
+
+#define MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST 125
+
+static const char* TAG = "TW_HAL_VERIFY";
+
+/*LoadFwrConfig_Alt - to load a converted *s3, *cr2 to c code into the device.
+ * Basically instead of loading the *.s3, *cr2 directly,
+ * use the tw_convert tool to convert the ascii hex fwr mage into code and
+ * compile with the application
+ *
+ * input arg: mode: 0 - load both firmware and confing
+ * 1 - load firmware only
+ * 2 - load config only
+ */
+VprocStatusType LoadFwrConfig_Alt(uint8 mode) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ if ((mode == 0) || (mode == 1)) {
+ twFirmware st_Firmware;
+ st_Firmware.st_Fwr = (twFwr*)st_twFirmware;
+ st_Firmware.twFirmwareStreamLen = (uint16)firmwareStreamLen;
+ st_Firmware.execAddr = (uint32)executionAddress;
+ st_Firmware.havePrgmBase = (uint8)haveProgramBaseAddress;
+ st_Firmware.prgmBase = (uint32)programBaseAddress;
+ ESP_LOGD(TAG, "Firmware boot loading started ....");
+ status = VprocTwolfHbiBoot_alt(&st_Firmware);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiBoot()", status);
+ return -1;
+ }
+ ESP_LOGD(TAG, "Loading the image to RAM....done");
+#ifdef SAVE_IMAGE_TO_FLASH
+ ESP_LOGD(TAG, "Saving firmware to flash....");
+ status = VprocTwolfSaveImgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfSaveImgToFlash()", status);
+
+ return status;
+ }
+ ESP_LOGD(TAG, "Saving firmware to flash....done");
+
+#endif
+
+ status = VprocTwolfFirmwareStart();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfFirmwareStart()", status);
+
+ return status;
+ }
+ }
+ if ((mode == 0) || (mode == 2)) {
+ ESP_LOGD(TAG, "Loading the config file into the device RAM....");
+
+ status =
+ VprocTwolfLoadConfig((dataArr*)st_twConfig, (uint16)configStreamLen);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfLoadConfig()", status);
+
+ return status;
+ }
+#ifdef SAVE_CFG_TO_FLASH
+ ESP_LOGD(TAG, "Saving config to flash....");
+ status = VprocTwolfSaveCfgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfSaveCfgToFlash()", status);
+
+ return status;
+ }
+ ESP_LOGD(TAG, "Saving config to flash....done");
+
+#endif
+ }
+ { /*Verify that the boot loading PASS or Fail*/
+ uint16 val = 0;
+
+ status = VprocTwolfHbiRead(0x0022, 1, &val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiRead()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ if ((val == 38040) || (val == 38050) || (val == 38060) || (val == 38080) ||
+ (val == 38051) || (val == 38041)) {
+ ESP_LOGD(TAG, "Device boot loading completed successfully...");
+ } else {
+ ESP_LOGD(TAG, "Device boot loading failed!!!...");
+ return VPROC_STATUS_FAILURE;
+ }
+ }
+
+ /*Firmware reset - in order for the configuration to take effect
+ * NOTE: The ZL38040 needs a soft reset for the uploaded configuration
+ * to take effect. This soft-reset is sent below
+ * if the ZL38040 is an I2S slave, if the I2S master is not stable
+ * at the time of this reset, then that reset will not take effect.
+ * In that case the host has to to simply resend the reset
+ * command once the I2S master
+ * is up and running and is at a stable state.
+ */
+ status = VprocTwolfReset(VPROC_RST_SOFTWARE);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfReset()", status);
+
+ return status;
+ }
+
+ ESP_LOGD(TAG, "Device boot loading completed successfully...");
+ return status;
+}
+
+int test_zl38063(void* arg) {
+ int status = 0;
+ uint16 cmdword = 0;
+ uint16 val[MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST];
+ uint8 numwords = 0;
+ uint16 tempbuf[MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST];
+ uint16 i = 0;
+#ifdef TW_HAL_VERIFY_DEBUG
+ uint16 j = 0;
+#endif
+ status = VprocTwolfHbiInit();
+ if (status < 0) {
+ perror("tw_spi_access open");
+ return -1;
+ }
+ if ((MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST > 125) ||
+ (MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST < 2)) {
+ ESP_LOGD(TAG, "MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST must between 2 and 126");
+ }
+ memset(val, 0, sizeof(val));
+ memset(tempbuf, 0, sizeof(tempbuf));
+
+ ESP_LOGD(TAG,
+ "Test 1 - Verifying that the device is present and working ....");
+ cmdword = 0x00C;
+ numwords = 2;
+ val[0] = 0x1234;
+ val[1] = 0x5678;
+ status = VprocTwolfHbiWrite(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiWrite()\n", status);
+ VprocHALcleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "wr: addr 0x%04x = 0x%04x", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+#endif
+ status = VprocTwolfHbiRead(cmdword, numwords, tempbuf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiRead()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "RD: addr 0x%04x = 0x%04x", (cmdword + j), tempbuf[i]);
+ j = j + 2;
+ }
+#endif
+ if ((tempbuf[0] != 0x1234) && (tempbuf[1] != 0x5600)) {
+ ESP_LOGD(TAG, "Test 1 - completed - FAIL!!!");
+ return -1;
+ }
+
+ ESP_LOGD(TAG, "Test 1 - completed - PASS\n\n");
+
+ status = VprocTwolfReset(0);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiRead()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ ESP_LOGD(TAG, "Device reset completed successfully...");
+
+ ESP_LOGD(TAG, "Test 2 - Verifying single word write/read access ....");
+ cmdword = 0x0300;
+ val[0] = 0x4008;
+ numwords = 1;
+ status = VprocTwolfHbiWrite(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiWrite()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "wr: addr 0x%04x = 0x%04x", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+#endif
+ status = VprocTwolfHbiRead(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiRead()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "RD: addr 0x%04x = 0x%04x\n", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+#endif
+ if ((val[0] != 0x4008)) {
+ ESP_LOGD(TAG, "Test 2 - completed - FAIL!!!");
+ return -1;
+ }
+ ESP_LOGD(TAG, "Test 2 - completed - PASS");
+
+ ESP_LOGD(TAG, "Test 3 - Verifying multiple words write/read access ....");
+
+ /* Fill the data buffer with unique data values. */
+ for (i = 0; i < MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST; i++) {
+ val[i] = i | ((0xFF - i) << 8);
+ }
+
+ cmdword = 0x0300;
+ numwords = MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST;
+ status = VprocTwolfHbiWrite(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiWrite()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "twr: addr 0x%04x = 0x%04x", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+#endif
+ status = VprocTwolfHbiRead(cmdword, numwords, tempbuf);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiRead()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+#ifdef TW_HAL_VERIFY_DEBUG
+ j = 0;
+ for (i = 0; i < numwords; i++) {
+ ESP_LOGD(TAG, "RD: addr 0x%04x = 0x%04x =? 0x%04x", (cmdword + j),
+ tempbuf[i], val[i]);
+ j = j + 2;
+ }
+#endif
+ j = 0;
+ for (i = 0; i < MAX_WORDS_FOR_MULTIWORD_ACCESS_TEST; i++) {
+ if (tempbuf[i] != val[i]) {
+ ESP_LOGD(TAG, "RD: addr 0x%04x = 0x%04x =? 0x%04x", (cmdword + j),
+ tempbuf[i], val[i]);
+ ESP_LOGD(TAG, "Test 3 - completed - FAIL!!!");
+ return -1;
+ }
+ j = j + 2;
+ }
+ ESP_LOGD(TAG, "Test 3 - completed - PASS");
+
+ ESP_LOGD(TAG, "Test 4 - Verifying the firmware/config boot loading ....");
+ if (LoadFwrConfig_Alt(0) != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Device boot loading failed.....");
+ ESP_LOGD(TAG, "Test 4 - completed - FAIL!!!");
+
+ } else {
+ ESP_LOGD(TAG, "Test 4 - completed - PASS");
+ }
+ VprocTwolfHbiCleanup();
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_ldcfg.c b/components/audio_hal/driver/zl38063/example_apps/tw_ldcfg.c
new file mode 100644
index 0000000..f41f152
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_ldcfg.c
@@ -0,0 +1,161 @@
+/****************************************************************************
+ * tw_ldfwcfg.c - To load a *.s3 firmware and/or a *.cr2 into the device
+ * and optionally save the loaded image to flash
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include
+#include /* malloc, free, rand */
+
+#include "esp_log.h"
+#include "vprocTwolf_access.h"
+#include "vproc_common.h"
+
+/*NOTE: notice that the *.c code are included in the apps-
+ * This is because the compiler I'm using requires that
+ * But if your makefile is such that compiler knows where to find these files
+ * then remove the #include *.c below
+ */
+
+#undef SAVE_CFG_TO_FLASH /*define this macro to save the cfg from RAM to \
+ flash*/
+static const char* TAG = "TW_LDCFG";
+uint16 numElements;
+dataArr* pCr2Buf;
+
+/* fseekNunlines() -- The firmware file is an ascii text file.
+ * the information from fseek will not be useful.
+ * this is our own fseek equivalent
+ */
+static unsigned long fseekNunlines(FILE* BOOT_FD) {
+ uint32 line_count = 0;
+ int c;
+
+ while ((c = fgetc(BOOT_FD)) != EOF) {
+ if (c == '\n') line_count++;
+ }
+ return line_count;
+}
+
+/* readCfgFile() use this function to
+ * Read the Voice processing cr2 config file into RAM
+ * filepath -- pointer to the location where to find the file
+ * pCr2Buf -- the actual firmware data array will be pointed to this buffer
+ */
+static int readCfgFile(char* filepath) {
+ unsigned int reg[2], val[2], len;
+ uint8 done = 0;
+ uint16 index = 0;
+ FILE* BOOT_FD;
+ char* s;
+ char line[512] = "";
+
+ BOOT_FD = fopen(filepath, "rb");
+ if (BOOT_FD != NULL) {
+ len = fseekNunlines(BOOT_FD);
+ if (len <= 0) {
+ ESP_LOGD(TAG, "Error: file is not of the correct format...");
+ return -1;
+ }
+ ESP_LOGD(TAG, "fileLength = %u", len);
+ /*start at the beginning of the file*/
+ // fseek(BOOT_FD, 0, SEEK_SET);
+
+ /* allocate memory to contain the reg and val:*/
+ pCr2Buf = (dataArr*)malloc(len * sizeof(dataArr));
+ if (pCr2Buf == NULL) {
+ ESP_LOGD(TAG, "not enough memory to allocate %u bytes.. ",
+ len * sizeof(dataArr));
+ return -1;
+ }
+
+ rewind(BOOT_FD);
+ /*read and format the data accordingly*/
+ numElements = 0;
+ do {
+ s = fgets(line, 512, BOOT_FD);
+ if (line[0] == ';') {
+ continue;
+ } else if (s != NULL) {
+ numElements++;
+ sscanf(line, "%x %c %x", reg, s, val);
+ pCr2Buf[index].reg = reg[0];
+ pCr2Buf[index].value = val[0];
+ // ESP_LOGD(TAG,"pCr2Buf[%d].reg pCr2Buf[%d].value = 0x%04x\t0x%04x\n",
+ // index, index, pCr2Buf[index].reg, pCr2Buf[index].value);
+ index++;
+ } else {
+ done = 1;
+ }
+
+ } while (done == 0);
+
+ fclose(BOOT_FD);
+ ESP_LOGD(TAG, "size of pCr2Buf = %u bytes.. ", sizeof(pCr2Buf));
+ } else {
+ ESP_LOGD(TAG, "Error: can't open file");
+ }
+ return 0;
+}
+
+/*This example host app load the *.s3 firmware to the device RAM. Optionally
+ * save it to flash Then start the firmware from the execution address in RAM It
+ * then stops the firmware - Load the cr2 file into RAM. Optionally save it to
+ * flash Then restarts the firmware
+ */
+
+int main(int argc, char** argv) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+
+ if (argc != 2) {
+ ESP_LOGD(TAG, "Error: argc = %d - missing %d arg(s)... ", argc,
+ 3 - (argc - 1));
+ ESP_LOGD(TAG, "command Usage:%s ConfigPath", argv[0]);
+ exit(1);
+ }
+ ESP_LOGD(TAG, ":%s %s %s", argv[0], argv[1], argv[2]);
+
+ /*global file handle*/
+ status = VprocTwolfHbiInit();
+
+ if (status < 0) {
+ perror("tw_spi_access open");
+ return -1;
+ }
+
+ if (readCfgFile(argv[1]) < 0) {
+ ESP_LOGD(TAG, "Error:read %s file", argv[1]);
+ }
+ ESP_LOGD(TAG, "a- Reading config file to host RAM - done....");
+
+ ESP_LOGD(TAG, "c- Loading the config file into the device RAM");
+ status = VprocTwolfLoadConfig(pCr2Buf, numElements);
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfLoadConfig()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+#ifdef SAVE_CONFIG_TO_FLASH
+ status = VprocTwolfSaveCfgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfSaveCfgToFlash()", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ ESP_LOGD(TAG, "d- Saving config to flash- done....");
+#endif
+
+ ESP_LOGD(TAG, "e- Loading config record - done....");
+ free(pCr2Buf);
+ pCr2Buf = NULL;
+ VprocTwolfHbiCleanup();
+
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_ldfw.c b/components/audio_hal/driver/zl38063/example_apps/tw_ldfw.c
new file mode 100644
index 0000000..5e07cc7
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_ldfw.c
@@ -0,0 +1,118 @@
+
+/****************************************************************************
+ * tw_ldfw.c - To load a *.s3 firmware into the device
+ * and optionally save the loaded image to flash
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include "esp_log.h"
+#include "vprocTwolf_access.h"
+#include "vproc_common.h"
+
+/*NOTE: notice that the *.c code are included in the apps-
+ * This is because the compiler I'm using requires that
+ * But if your makefile is such that compiler knows where to find these files
+ * then remove the #include *.c below
+ */
+
+// #undef SAVE_IMAGE_TO_FLASH /*define this macro to save the firmware from RAM
+// to flash*/
+static const char* TAG = "TW_LDFW";
+/*quick test*/
+
+/*This example host app load the *.s3 firmware to the device RAM. Optionally
+ * save it to flash Then start the firmware from the execution address in RAM
+ */
+int main(int argc, char** argv) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ FILE* BOOT_FD;
+ char line[256] = "";
+
+ if (argc != 2) {
+ ESP_LOGD(TAG, "Error: argc = %d - missing %d arg(s)... ", argc,
+ 3 - (argc - 1));
+ ESP_LOGD(TAG, "command Usage:%s firmwarePath", argv[0]);
+ exit(1);
+ }
+ ESP_LOGD(TAG, ":%s %s %s", argv[0], argv[1], argv[2]);
+
+ BOOT_FD = fopen(argv[1], "rb");
+ if (BOOT_FD == NULL) {
+ ESP_LOGD(TAG, "Error: can't open file %s", argv[1]);
+ return -1;
+ }
+
+ /*global file handle*/
+ status = VprocTwolfHbiInit();
+ if (status < 0) {
+ perror("tw_spi_access open");
+ fclose(BOOT_FD);
+ return -1;
+ }
+
+ ESP_LOGD(TAG, "1- Opening firmware file - done....");
+
+ status = VprocTwolfHbiBootPrepare();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiBootPrepare()", status);
+ fclose(BOOT_FD);
+ VprocHALcleanup();
+ return -1;
+ }
+ ESP_LOGD(TAG, "-- Boot prepare - done....");
+
+ while (fgets(line, 256, BOOT_FD) != NULL) {
+ status = VprocTwolfHbiBootMoreData(line);
+ if (status == VPROC_STATUS_BOOT_LOADING_MORE_DATA) {
+ continue;
+ } else if (status == VPROC_STATUS_BOOT_LOADING_CMP) {
+ break;
+ } else if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiBootMoreData()", status);
+ fclose(BOOT_FD);
+ VprocHALcleanup();
+ return -1;
+ }
+ }
+ ESP_LOGD(TAG, "-- Firmware data transfer - done....");
+ fclose(BOOT_FD);
+ /*clean up and verify that the boodloading completed correctly*/
+ status = VprocTwolfHbiBootConclude();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfHbiBootConclude()", status);
+ VprocHALcleanup();
+ return -1;
+ }
+
+ ESP_LOGD(TAG, "2- Loading firmware - done....");
+#ifdef SAVE_IMAGE_TO_FLASH
+ ESP_LOGD(TAG, "-- Saving firmware to flash....");
+ status = VprocTwolfSaveImgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfSaveImgToFlash()", status);
+ VprocHALcleanup();
+ return -1;
+ }
+ ESP_LOGD(TAG, "-- Saving firmware to flash....done");
+
+#endif
+
+ status = VprocTwolfFirmwareStart();
+ if (status != VPROC_STATUS_SUCCESS) {
+ ESP_LOGD(TAG, "Error %d:VprocTwolfFirmwareStart()", status);
+ VprocHALcleanup();
+ return -1;
+ }
+
+ ESP_LOGD(TAG, "Device boot loading completed successfully...");
+
+ VprocHALcleanup();
+
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_ldfwcfg.c b/components/audio_hal/driver/zl38063/example_apps/tw_ldfwcfg.c
new file mode 100644
index 0000000..36cd015
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_ldfwcfg.c
@@ -0,0 +1,222 @@
+/****************************************************************************
+ * tw_ldfwcfg.c - To load a *.s3 firmware and/or a *.cr2 into the device
+ * and optionally save the loaded image to flash
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include
+#include /* malloc, free, rand */
+
+#include "vprocTwolf_access.h"
+#include "vproc_common.h"
+
+/*NOTE: notice that the *.c code are included in the apps-
+ * This is because the compiler I'm using requires that
+ * But if your makefile is such that compiler knows where to find these files
+ * then remove the #include *.c below
+ */
+
+#undef SAVE_IMAGE_TO_FLASH /*define this macro to save the firmware from RAM \
+ to flash*/
+#undef SAVE_CFG_TO_FLASH /*define this macro to save the cfg from RAM to \
+ flash*/
+/*quick test*/
+
+uint16 numElements;
+
+dataArr* pCr2Buf;
+/* fseekNunlines() -- The firmware file is an ascii text file.
+ * the information from fseek will not be useful.
+ * this is our own fseek equivalent.
+ */
+static unsigned long fseekNunlines(FILE* BOOT_FD) {
+ uint32 line_count = 0;
+ int c;
+
+ while ((c = fgetc(BOOT_FD)) != EOF) {
+ if (c == '\n') line_count++;
+ }
+ return line_count;
+}
+
+/* readCfgFile() use this function to
+ * Read the Voice processing cr2 config file into RAM
+ * filepath -- pointer to the location where to find the file
+ * pCr2Buf -- the actual firmware data array will be pointed to this buffer
+ */
+static int readCfgFile(char* filepath) {
+ unsigned int reg[2], val[2], len;
+ uint8 done = 0;
+ uint16 index = 0;
+ FILE* BOOT_FD;
+ char* s;
+ char line[512] = "";
+
+ BOOT_FD = fopen(filepath, "rb");
+ if (BOOT_FD != NULL) {
+ len = fseekNunlines(BOOT_FD);
+ if (len <= 0) {
+ printf("Error: file is not of the correct format...\n");
+ return -1;
+ }
+ // printf("fileLength = %u\n", len);
+ /*start at the beginning of the file*/
+ // fseek(BOOT_FD, 0, SEEK_SET);
+
+ /* allocate memory to contain the reg and val:*/
+ pCr2Buf = (dataArr*)malloc(len * sizeof(dataArr));
+ if (pCr2Buf == NULL) {
+ printf("not enough memory to allocate %u bytes.. ",
+ len * sizeof(dataArr));
+ return -1;
+ }
+
+ rewind(BOOT_FD);
+ /*read and format the data accordingly*/
+ numElements = 0;
+ do {
+ s = fgets(line, 512, BOOT_FD);
+ if (line[0] == ';') {
+ continue;
+ } else if (s != NULL) {
+ numElements++;
+ sscanf(line, "%x %c %x", reg, s, val);
+ pCr2Buf[index].reg = reg[0];
+ pCr2Buf[index].value = val[0];
+ // printf("pCr2Buf[%d].reg pCr2Buf[%d].value = 0x%04x\t0x%04x\n",
+ // index, index, pCr2Buf[index].reg, pCr2Buf[index].value);
+ index++;
+ } else {
+ done = 1;
+ }
+
+ } while (done == 0);
+
+ fclose(BOOT_FD);
+ // printf ("size of pCr2Buf = %u bytes.. \n", len*sizeof(pCr2Buf));
+ } else {
+ printf("Error: can't open file\n");
+ }
+ return 0;
+}
+
+/*This example host app load the *.s3 firmware to the device RAM. Optionally
+ * save it to flash Then start the firmware from the execution address in RAM It
+ * then stops the firmware - Load the cr2 file into RAM. Optionally save it to
+ * flash Then resstarts the firmware
+ */
+int main(int argc, char** argv) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+ FILE* BOOT_FD;
+ char line[256] = "";
+
+ if (argc < 3) {
+ printf("Error: argc = %d - missing %d arg(s)... \n", argc, 3 - (argc - 1));
+ printf("command Usage:%s firmwarePath ConfigPath\n", argv[0]);
+ exit(1);
+ }
+ printf(":%s %s %s\n", argv[0], argv[1], argv[2]);
+
+ BOOT_FD = fopen(argv[1], "rb");
+ if (BOOT_FD == NULL) {
+ printf("Error: can't open file %s\n", argv[1]);
+ return -1;
+ }
+ /*global file handle*/
+ status = VprocTwolfHbiInit();
+ // gTwolf_fd = open(file_name, O_RDWR);
+ if (status < 0) {
+ perror("tw_spi_access open");
+ fclose(BOOT_FD);
+ return -1;
+ }
+
+ printf("1- Opening firmware file - done....\n");
+
+ status = VprocTwolfHbiBootPrepare();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiBootPrepare()\n", status);
+ fclose(BOOT_FD);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("-- Boot prepare - done....\n");
+
+ while (fgets(line, 256, BOOT_FD) != NULL) {
+ status = VprocTwolfHbiBootMoreData(line);
+ if (status == VPROC_STATUS_BOOT_LOADING_MORE_DATA) {
+ continue;
+ } else if (status == VPROC_STATUS_BOOT_LOADING_CMP) {
+ break;
+ } else if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiBootMoreData()\n", status);
+ fclose(BOOT_FD);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ }
+ printf("-- Firmware data transfer - done....\n");
+ fclose(BOOT_FD);
+
+ status = VprocTwolfHbiBootConclude();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiBootConclude()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+#ifdef SAVE_IMAGE_TO_FLASH
+ printf("-- Saving firmware to flash....\n");
+ status = VprocTwolfSaveImgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfSaveImgToFlash()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("-- Saving firmware to flash....done\n");
+
+#endif
+
+ status = VprocTwolfFirmwareStart();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfFirmwareStart()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+ printf("3- Loading the config file into the device RAM\n");
+ if (readCfgFile(argv[2]) < 0) {
+ printf("Error:read %s file\n", argv[2]);
+ }
+ printf("a- Reading config file to host RAM - done....\n");
+
+ status = VprocTwolfLoadConfig(pCr2Buf, numElements);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfLoadConfig()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+#ifdef SAVE_CFG_TO_FLASH
+ printf("-- Saving config to flash....\n");
+ status = VprocTwolfSaveCfgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfSaveCfgToFlash()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("-- Saving config to flash....done\n");
+
+#endif
+ printf("Device boot loading completed successfully...\n");
+
+ VprocTwolfHbiCleanup();
+
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.c b/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.c
new file mode 100644
index 0000000..da80171
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.c
@@ -0,0 +1,458 @@
+/****************************************************************************
+ * tw_spi_access.c - Demo apps demonstrating how to access registers of the
+ * device over spi or I2C. Loading a firmware and or config into the device
+ *
+ *
+ ****************************************************************************
+ * Copyright Microsemi Inc, 2018. All rights reserved.
+ * Licensed under the MIT License. See LICENSE.txt in the project
+ * root for license information.
+ *
+ ***************************************************************************/
+
+#include "vprocTwolf_access.h"
+#include "vproc_common.h"
+
+/*NOTE: notice that the *.c code are included in the apps-
+ * This is because the compiler I'm using requires that
+ * But if your makefile is such that compiler knows where to find these files
+ * then remove the #include *.c below
+ */
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "zl38063_config.h"
+#include "zl38063_firmware.h"
+
+#undef SAVE_IMAGE_TO_FLASH /*define this macro to save the firmware from RAM \
+ to flash*/
+#undef SAVE_CFG_TO_FLASH /*define this macro to save the cfg from RAM to \
+ flash*/
+
+#define SAVE_IMAGE_TO_FLASH
+#define SAVE_CFG_TO_FLASH
+/*quick test*/
+
+/*LoadFwrConfig_Alt - to load a converted *s3, *cr2 to c code into the device.
+ * Basically instead of loading the *.s3, *cr2 directly,
+ * use the tw_convert tool to convert the ascii hex fwr mage into code and
+ * compile with the application
+ *
+ * input arg: mode: 0 - load both firmware and confing
+ * 1 - load firmware only
+ * 2 - load config only
+ * -1 - Force loading
+ */
+int tw_upload_dsp_firmware(int mode) {
+ union {
+ short a;
+ char b;
+ } test_bigendian;
+ if (mode >= 0) {
+ uint16 vol = 0;
+ vTaskDelay(1000 / portTICK_PERIOD_MS);
+ int ret = VprocTwolfGetAppStatus(&vol);
+ if (vol) {
+ ESP_LOGW(TAG_SPI, "MCS ret:%d,Status:%d", ret, vol);
+ return 0;
+ }
+ ESP_LOGI(TAG_SPI, "** Loading DSP firmware ret:%d,Status:%d **", ret, vol);
+ } else {
+ mode = 0;
+ }
+ test_bigendian.a = 1;
+ ESP_LOGI(TAG_SPI, "b=%d", test_bigendian.b);
+
+ int status = VprocTwolfHbiInit();
+ if (status < 0) {
+ DEBUG_LOGE(TAG_SPI, "tw_spi_access open");
+ return -1;
+ }
+
+ if ((mode == 0) || (mode == 1)) {
+ twFirmware st_Firmware;
+ st_Firmware.st_Fwr = (twFwr *)st_twFirmware;
+ st_Firmware.twFirmwareStreamLen = (uint16)firmwareStreamLen;
+ st_Firmware.execAddr = (uint32)executionAddress;
+ st_Firmware.havePrgmBase = (uint8)haveProgramBaseAddress;
+ st_Firmware.prgmBase = (uint32)programBaseAddress;
+
+ ESP_LOGI(TAG_SPI, "1- Firmware boot loading started ....");
+
+ status = VprocTwolfHbiBoot_alt(&st_Firmware);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfHbiBoot()", status);
+ // VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+ ESP_LOGI(TAG_SPI, "2- Loading the image to RAM....done");
+#ifdef SAVE_IMAGE_TO_FLASH
+ ESP_LOGI(TAG_SPI, "-- Saving firmware to flash....");
+ status = VprocTwolfSaveImgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfSaveImgToFlash()", status);
+ // VprocTwolfHbiCleanup();
+ return status;
+ }
+ ESP_LOGI(TAG_SPI, "-- Saving firmware to flash....done");
+
+#endif
+ status = VprocTwolfFirmwareStart();
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfFirmwareStart()", status);
+ // VprocTwolfHbiCleanup();
+ return status;
+ }
+ }
+
+#if 1
+ if ((mode == 0) || (mode == 2)) {
+ ESP_LOGI(TAG_SPI, "3- Loading the config file into the device RAM....");
+
+ status =
+ VprocTwolfLoadConfig((dataArr *)st_twConfig, (uint16)configStreamLen);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfLoadConfig()", status);
+ // VprocTwolfHbiCleanup();
+ return status;
+ }
+#ifdef SAVE_CFG_TO_FLASH
+ ESP_LOGI(TAG_SPI, "-- Saving config to flash....");
+ status = VprocTwolfSaveCfgToFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfSaveCfgToFlash()", status);
+ // VprocTwolfHbiCleanup();
+ return status;
+ }
+ ESP_LOGI(TAG_SPI, "-- Saving config to flash....done");
+
+#endif
+ }
+ /*Firmware reset - in order for the configuration to take effect*/
+ status = VprocTwolfReset(VPROC_RST_SOFTWARE);
+ if (status != VPROC_STATUS_SUCCESS) {
+ DEBUG_LOGE(TAG_SPI, "Error %d:VprocTwolfReset()", status);
+ ESP_LOGI(TAG_SPI, "Error");
+ // VprocTwolfHbiCleanup();
+ return status;
+ }
+#endif
+
+ ESP_LOGI(TAG_SPI, "Device boot loading completed successfully...");
+ return status;
+}
+
+int zl38063_comm(int argc, char **argv) {
+ VprocStatusType status = VPROC_STATUS_SUCCESS;
+
+ if (argc == 1) {
+ printf("Usage: for help type:%s -h", argv[0]);
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "-h") == 0) {
+ printf(
+ "\nUsage:\n\t%s [-cmd mode] [options...] see supported"
+ " command modes below\n\n",
+ argv[0]);
+ printf(
+ "\t-wr : to write one or more 16-bit words to the device\n"
+ "\t-rd : to read one or more 16-bit words from the device\n"
+ "\t-rst : to reset the device in one of these"
+ " supported reset modes:\n"
+ "\t\t - [0: RAM | 1: ROM | 2: SOFT | 3: AEC | 4: BOOT]\n");
+ printf(
+ "\t-lfcff : to load a specific firmware and related"
+ " config from flash - arg: 1 to 14\n");
+ printf(
+ "\t-lfcfh-a : to load a pre-compiled firmware and related config"
+ " from host via SPI\n");
+ printf("\t-lffh-a: to load a pre-compiled firmware from host via SPI\n");
+ printf("\t-lcfh-a: to load a pre-compiled config from host via SPI\n");
+ printf("\t-fclr : to erase the content of the ZL380xx slave flash\n");
+ printf("\t-sto : to reset the device into boot mode\n");
+ printf(
+ "\t-sta : to start execution of firmware found at "
+ "exec address in RAM\n");
+ printf(
+ "\t-apla : to configure the ZL380xx x-point for "
+ "audio playback mode\n");
+ printf(
+ "\t-arec : to configure the ZL380xx x-point for audio "
+ "recording mode\n");
+ printf("Example:\n");
+ printf(
+ "\tEx to write 0x8004 into register 0x0300:"
+ "\n\t%s -wr 0x0300 0x8004\n\n",
+ argv[0]);
+ printf(
+ "\tEx to read 12 words starting from register 0x020:"
+ "\n\t%s -rd 0x0020 12\n\n",
+ argv[0]);
+ printf(
+ "\tEx to reset the device in boot mode:"
+ "\n\t%s -rst n 'where n:[1-4]\n\n",
+ argv[0]);
+ printf(
+ "\tEx to load to RAM a firmware and config previously"
+ " saved to flash at index 1:\n\t%s -lfcff 1\n\n",
+ argv[0]);
+ printf(
+ "\tEx to load to RAM a firmware previously"
+ " saved to flash at index 1:\n\t%s -lfff 1\n\n",
+ argv[0]);
+ printf(
+ "\tEx to load to RAM the pre-compiled (in)firmware "
+ "from teh host "
+ "HBI (SPI):\n\t%s -lffh-a\n\n",
+ argv[0]);
+ printf(
+ "\tEx to load to RAM the pre-compiled (in)config "
+ "from teh host "
+ "HBI (SPI):\n\t%s -lcfh-a\n\n",
+ argv[0]);
+ printf(
+ "\tEx to load to RAM the pre-compiled (in)firmware and config "
+ "from teh host "
+ "HBI (SPI):\n\t%s -lfcfh-a\n\n",
+ argv[0]);
+ printf(
+ "\tEx to stop the firmware currently running and clear "
+ "the RAM:\n\t%s -sto\n\n",
+ argv[0]);
+ printf(
+ "\tEx to start a firmware previously loaded into "
+ "RAM:\n\t%s -sta\n\n",
+ argv[0]);
+ printf("\tEx to mute SOUT :\n\t%s -mute_s [1 | 0]\n\n", argv[0]);
+ printf("\tEx to mute ROUT :\n\t%s -mute_r [1 | 0]\n\n", argv[0]);
+ printf(
+ "\tEx to erase the slave flash device controlled by "
+ "the ZL380xx :\n\t%s -fclr\n\n",
+ argv[0]);
+ printf(
+ "\tEx to configure the device for recording mode at a "
+ "desired clock and sample rates"
+ " with AEC off[0] or on [1]:\n\t%s -arec clkrate "
+ "fsrate n 'where n:[0 | 1]'\n\n",
+ argv[0]);
+ printf(
+ "\tEx to configure the device for playback mode at a "
+ "desired clock and sample rates"
+ " with AEC off[0] or on [1]:\n\t%s -apla clkrate "
+ "fsrate n 'where n:[0 | 1]'\n\n",
+ argv[0]);
+ return -1;
+ }
+
+ if ((argc < 3) && (strcmp(argv[1], "-wr") == 0)) {
+ printf("Usage:%s -wr register value0 value1....value124 \n", argv[0]);
+ return -1;
+ }
+ if ((argc < 3) && (strcmp(argv[1], "-rd") == 0)) {
+ printf("Usage:%s -rd register n 'where n:[1-127]'\n", argv[0]);
+ return -1;
+ }
+ if ((argc < 3) && (strcmp(argv[1], "-rst") == 0)) {
+ printf("Usage:%s -rst n 'where n:[0-4]'\n", argv[0]);
+ return -1;
+ }
+ if ((argc < 3) && (strcmp(argv[1], "-apla") == 0)) {
+ printf(
+ "Usage:%s -apla n"
+ " 'where n:[0 | 1]'\n",
+ argv[0]);
+ return -1;
+ }
+ if ((argc < 3) && (strcmp(argv[1], "-arec") == 0)) {
+ printf(
+ "Usage:%s -arec n"
+ " 'where n:[0 | 1]'\n",
+ argv[0]);
+ return -1;
+ }
+ if ((argc < 3) && (strcmp(argv[1], "-lfcff") == 0)) {
+ printf("Usage:%s -lfcfh 1\n", argv[0]);
+ return -1;
+ }
+ /*global file handle*/
+ status = VprocTwolfHbiInit();
+ if (status < 0) {
+ perror("tw_spi_access open");
+ return -1;
+ }
+ if ((strcmp(argv[1], "-wr") == 0) || (strcmp(argv[1], "-rd") == 0)) {
+ int i = 0, j = 0;
+ unsigned short val[128];
+ unsigned short cmdword = (unsigned short)strtoul(argv[2], NULL, 0);
+ unsigned char numwords = 0;
+
+ memset(val, 0, sizeof(val));
+
+ if (strcmp(argv[1], "-wr") ==
+ 0) { /*for WRITING 1 or more ZL380xx registers*/
+
+ unsigned short val[128];
+ numwords = argc - 3; /*calculate the number of words to write*/
+ ;
+ for (i = 0; i < numwords; i++) {
+ val[i] = (unsigned short)strtoul(argv[3 + i], NULL, 0);
+ }
+ status = VprocTwolfHbiWrite(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiWrite()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ for (i = 0; i < numwords; i++) {
+ printf("wr: addr 0x%04x = 0x%04x\n", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+
+ } else { /*for READING 1 or more ZL380xx registers**/
+ numwords = (unsigned char)strtoul(argv[3], NULL, 0);
+ if ((numwords == 0) || (numwords > 128)) {
+ printf("number of words is out of range. Maximum is 128\n");
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ status = VprocTwolfHbiRead(cmdword, numwords, val);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiRead()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ for (i = 0; i < numwords; i++) {
+ printf("RD: addr 0x%04x = 0x%04x\n", (cmdword + j), val[i]);
+ j = j + 2;
+ }
+ }
+ } else if (strcmp(argv[1], "-rst") == 0) { /*for RESETTING ZL380xx*/
+ unsigned char rstMode = (unsigned char)strtoul(argv[2], NULL, 0);
+ status = VprocTwolfReset((uint16)rstMode);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfHbiRead()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("Device reset completed successfully...\n");
+
+ } else if (strcmp(argv[1], "-lfcff") == 0) {
+ /*Load ZL380x0 firmware + related config record from flash*/
+ unsigned short image_num = (unsigned short)strtoul(argv[2], NULL, 0);
+ status = VprocTwolfFirmwareStop();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfFirmwareStop()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ status = VprocTwolfLoadFwrCfgFromFlash(image_num);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfLoadFwrCfgFromFlash()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ status = VprocTwolfReset(VPROC_RST_HARDWARE_RAM);
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfReset()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("Device boot loading from flash completed successfully...\n");
+ } else if (strcmp(argv[1], "-lfff") == 0) {
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfLoadFwrFromFlash()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+
+ printf("Device boot loading from flash completed successfully...\n");
+
+ } else if (strcmp(argv[1], "-lfcfh-a") == 0) { /*for LOADING FWR/CFG via SPI*/
+ if (tw_upload_dsp_firmware(0) != VPROC_STATUS_SUCCESS)
+ printf("Device boot loading failed.....\n");
+
+ } else if (strcmp(argv[1], "-lcfh-a") == 0) { /*for LOADING CFG via SPI*/
+ if (tw_upload_dsp_firmware(2) != VPROC_STATUS_SUCCESS)
+ printf("Device boot loading failed.....\n");
+
+ } else if (strcmp(argv[1], "-lffh-a") == 0) { /*for LOADING FWR via SPI*/
+ if (tw_upload_dsp_firmware(1) != VPROC_STATUS_SUCCESS)
+ printf("Device boot loading failed.....\n");
+
+ } else if (strcmp(argv[1], "-sto") == 0) { /*for resetting into boot mode*/
+ if (VprocTwolfFirmwareStop() != 0)
+ VprocTwolfHbiCleanup();
+ else
+ printf(
+ "Firmware stopped to boot mode completed"
+ " successfully...\n");
+ } else if (strcmp(argv[1], "-sta") == 0) { /*start executing FWR/CFG */
+ if (VprocTwolfFirmwareStart() != 0)
+ VprocTwolfHbiCleanup();
+ else
+ printf("Firmware is now running successfully...\n");
+ } else if (strcmp(argv[1], "-mute_r") == 0) { /*start executing FWR/CFG */
+ uint8 mute = (uint8)strtoul(argv[2], NULL, 0);
+ // to do need fix
+ // if(VprocTwolfMute(VPROC_ROUT, mute) != 0)
+ if (1) {
+ VprocTwolfHbiCleanup();
+ } else {
+ if (mute)
+ printf("ROUT Port muted sucessfully...\n");
+ else
+ printf("ROUT Port unmuted sucessfully...\n");
+ }
+ } else if (strcmp(argv[1], "-mute_s") == 0) { /*start executing FWR/CFG */
+ uint8 mute = (uint8)strtoul(argv[2], NULL, 0);
+ // to do need fix
+ // if(VprocTwolfMute(VPROC_SOUT, mute) != 0)
+ if (1)
+ VprocTwolfHbiCleanup();
+ else {
+ if (mute)
+ printf("SOUT Port muted sucessfully...\n");
+ else
+ printf("SOUT Port unmuted sucessfully...\n");
+ }
+ } else if ((strcmp(argv[1], "-arec") == 0) || (strcmp(argv[1], "-apla") == 0))
+ /* configure the ZL380x0 for either audio recording or playback
+ * Over an I2S link
+ */
+ {
+ unsigned short pclkrate = (unsigned short)strtoul(argv[2], NULL, 0);
+ unsigned short fsrate = (unsigned short)strtoul(argv[3], NULL, 0);
+ unsigned short aecState = (unsigned char)strtoul(argv[4], NULL, 0);
+ printf("pclkrate = %u KHz, fsrate = %u Hz, AEC state = %d\n", pclkrate,
+ fsrate, aecState);
+ // to do need fix
+#if 0
+ if (strcmp(argv[1], "-arec") == 0) {
+ if (VprocTwolfUpstreamConfigure(pclkrate, fsrate, aecState) != 0)
+ VprocTwolfHbiCleanup();
+ else
+ printf("Device configured for audio recording...\n");
+ } else if (strcmp(argv[1], "-apla") == 0) {
+ if (VprocTwolfDownstreamConfigure(pclkrate, fsrate, aecState) != 0)
+ VprocTwolfHbiCleanup();
+ else
+ printf("Device configured for audio playback...\n");
+ }
+#endif
+ } else if (strcmp(argv[1], "-fclr") == 0) {
+ /*Erase the full content of the ZL380x0 controlled slave flash*/
+ status = VprocTwolfEraseFlash();
+ if (status != VPROC_STATUS_SUCCESS) {
+ printf("Error %d:VprocTwolfEraseFlash()\n", status);
+ VprocTwolfHbiCleanup();
+ return -1;
+ }
+ printf("flash erasing completed successfully...\n");
+ } else {
+ printf("Usage: for help type:\n%s -h\n", argv[0]);
+ }
+ printf("\n");
+
+ return 0;
+}
diff --git a/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.h b/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.h
new file mode 100644
index 0000000..f2d3eb6
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/example_apps/tw_spi_access.h
@@ -0,0 +1,10 @@
+#ifndef TW_SPI_ACCESS_H
+#define TW_SPI_ACCESS_H
+
+#include
+#include
+#include
+
+int tw_upload_dsp_firmware(int mode);
+
+#endif
diff --git a/components/audio_hal/driver/zl38063/firmware/libfirmware.a b/components/audio_hal/driver/zl38063/firmware/libfirmware.a
new file mode 100644
index 0000000..b7f8781
Binary files /dev/null and b/components/audio_hal/driver/zl38063/firmware/libfirmware.a differ
diff --git a/components/audio_hal/driver/zl38063/firmware/zl38063_config.h b/components/audio_hal/driver/zl38063/firmware/zl38063_config.h
new file mode 100644
index 0000000..0680137
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/firmware/zl38063_config.h
@@ -0,0 +1,44 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2018
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/*Configuration file version: Microsemi_ZLS38063_1_P1_4_0_Config.cr2, modified:
+ * Tue Sep 18 20:48:31 2018*/
+
+#ifndef _ZL38063_CONFIG_H_
+#define _ZL38063_CONFIG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const unsigned short configStreamLen;
+extern const dataArr st_twConfig[];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_hal/driver/zl38063/firmware/zl38063_firmware.h b/components/audio_hal/driver/zl38063/firmware/zl38063_firmware.h
new file mode 100644
index 0000000..c8121ed
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/firmware/zl38063_firmware.h
@@ -0,0 +1,48 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2018
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/*Firmware Version : Microsemi_ZLS38063_1_P1_4_0_Firmware.s3, modified: Tue Sep
+ * 18 20:50:24 2018 */
+
+#ifndef _ZL38063_FIRMWARE_H_
+#define _ZL38063_FIRMWARE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const twFwr st_twFirmware[];
+
+extern const unsigned short firmwareStreamLen;
+extern const unsigned long programBaseAddress;
+extern const unsigned long executionAddress;
+extern const unsigned char haveProgramBaseAddress;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_hal/driver/zl38063/zl38063.c b/components/audio_hal/driver/zl38063/zl38063.c
new file mode 100644
index 0000000..cf5feaf
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/zl38063.c
@@ -0,0 +1,153 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2018
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "zl38063.h"
+
+#include
+
+#include "audio_volume.h"
+#include "board.h"
+#include "driver/gpio.h"
+#include "driver/i2c.h"
+#include "esp_log.h"
+#include "tw_spi_access.h"
+#include "vprocTwolf_access.h"
+
+static const char *TAG = "zl38063";
+
+static int codec_init_flag = 0;
+static codec_dac_volume_config_t *dac_vol_handle;
+
+#define ZL38063_DAC_VOL_CFG_DEFAULT() \
+ { \
+ .max_dac_volume = 6, .min_dac_volume = -90, \
+ .board_pa_gain = BOARD_PA_GAIN, .volume_accuracy = 1, .dac_vol_symbol = 1, \
+ .zero_volume_reg = 0, .reg_value = 0, .user_volume = 0, \
+ .offset_conv_volume = NULL, \
+ }
+
+audio_hal_func_t AUDIO_CODEC_ZL38063_DEFAULT_HANDLE = {
+ .audio_codec_initialize = zl38063_codec_init,
+ .audio_codec_deinitialize = zl38063_codec_deinit,
+ .audio_codec_ctrl = zl38063_codec_ctrl_state,
+ .audio_codec_config_iface = zl38063_codec_config_i2s,
+ .audio_codec_set_mute = zl38063_codec_set_voice_mute,
+ .audio_codec_set_volume = zl38063_codec_set_voice_volume,
+ .audio_codec_get_volume = zl38063_codec_get_voice_volume,
+ .audio_codec_enable_pa = NULL,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
+};
+
+static bool zl38063_codec_initialized() { return codec_init_flag; }
+
+esp_err_t zl38063_codec_init(audio_hal_codec_config_t *cfg) {
+ if (zl38063_codec_initialized()) {
+ ESP_LOGW(TAG, "The zl38063 codec has been already initialized");
+ return ESP_OK;
+ }
+ tw_upload_dsp_firmware(0);
+ gpio_config_t borad_conf;
+ memset(&borad_conf, 0, sizeof(borad_conf));
+ borad_conf.mode = GPIO_MODE_OUTPUT;
+ borad_conf.pin_bit_mask = 1UL << (get_reset_board_gpio());
+ borad_conf.pull_down_en = 0;
+ borad_conf.pull_up_en = 0;
+
+ gpio_config_t pa_conf;
+ memset(&pa_conf, 0, sizeof(pa_conf));
+ pa_conf.mode = GPIO_MODE_OUTPUT;
+ pa_conf.pin_bit_mask = 1UL << (get_pa_enable_gpio());
+ pa_conf.pull_down_en = 0;
+ pa_conf.pull_up_en = 0;
+
+ gpio_config(&pa_conf);
+ gpio_config(&borad_conf);
+ gpio_set_level(get_pa_enable_gpio(), 1); // enable PA
+ gpio_set_level(get_reset_board_gpio(), 0); // enable DSP
+ codec_init_flag = 1;
+
+ codec_dac_volume_config_t vol_cfg = ZL38063_DAC_VOL_CFG_DEFAULT();
+ dac_vol_handle = audio_codec_volume_init(&vol_cfg);
+ return ESP_OK;
+}
+
+esp_err_t zl38063_codec_deinit(void) {
+ gpio_set_level(get_pa_enable_gpio(), 0);
+ gpio_set_level(get_reset_board_gpio(), 1);
+ codec_init_flag = 0;
+ audio_codec_volume_deinit(dac_vol_handle);
+ return ESP_OK;
+}
+
+esp_err_t zl38063_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
+ return ESP_OK;
+}
+
+esp_err_t zl38063_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
+ return ESP_OK;
+}
+
+esp_err_t zl38063_codec_set_voice_mute(bool mute) {
+ /* For now we do not have implementation for this */
+ return ESP_OK;
+}
+
+/**
+ * @param volume: 0 ~ 100, 0 means mute
+ *
+ * @note Register values. 0xA6: -90 dB, 0xCE: -50 dB, 0x00: 0 dB, 0x06: 6 dB
+ * @note Accuracy of gain is 1 dB
+ *
+ * @return
+ * - (-1) Error
+ * - (0) Success
+ */
+esp_err_t zl38063_codec_set_voice_volume(int volume) {
+ int ret = 0;
+ uint8_t reg = 0;
+ reg = audio_codec_get_dac_reg_value(dac_vol_handle, volume);
+ ret = VprocTwolfSetVolume(reg);
+ ESP_LOGD(TAG, "Set volume:%.2d reg_value:0x%.2x dB:%.1f",
+ dac_vol_handle->user_volume, reg, (int8_t)reg * 1.0);
+ return ret;
+}
+
+esp_err_t zl38063_codec_get_voice_volume(int *volume) {
+ int ret = 0;
+ int8_t reg = 0;
+ ret = VprocTwolfGetVolume(®);
+ if (reg == (int8_t)dac_vol_handle->reg_value) {
+ *volume = dac_vol_handle->user_volume;
+ } else {
+ *volume = 0;
+ ret = ESP_FAIL;
+ }
+ ESP_LOGD(TAG, "Get volume:%.2d reg_value:0x%x", *volume, (uint8_t)reg);
+ return ret;
+}
diff --git a/components/audio_hal/driver/zl38063/zl38063.h b/components/audio_hal/driver/zl38063/zl38063.h
new file mode 100644
index 0000000..5ab8c3e
--- /dev/null
+++ b/components/audio_hal/driver/zl38063/zl38063.h
@@ -0,0 +1,123 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2018
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __ZL38063_H__
+#define __ZL38063_H__
+
+#include "audio_hal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize ZL38063 chip
+ *
+ * @param cfg configuration of ZL38063
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t zl38063_codec_init(audio_hal_codec_config_t *cfg);
+/**
+ * @brief Deinitialize ZL38063 chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t zl38063_codec_deinit(void);
+/**
+ * The functions zl38063_ctrl_state and zl38063_config_i2s are not used by this
+ * driver. They are kept here to maintain the uniformity and convenience of the
+ * interface of the ADF project. These settings for zl38063 are burned in
+ * firmware and configuration files. Default i2s configuration: 48000Hz, 16bit,
+ * Left-Right channels. Use resampling to be compatible with different file
+ * types.
+ *
+ * @brief Control ZL38063 chip
+ *
+ * @param mode codec mode
+ * @param ctrl_state start or stop decode or encode progress
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t zl38063_codec_ctrl_state(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+/**
+ * @brief Configure ZL38063 codec mode and I2S interface
+ *
+ * @param mode codec mode
+ * @param iface I2S config
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+esp_err_t zl38063_codec_config_i2s(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+
+/**
+ * @brief mute or unmute the codec
+ *
+ * @param mute: true, false
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t zl38063_codec_set_voice_mute(bool mute);
+
+/**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t zl38063_codec_set_voice_volume(int volume);
+
+/**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t zl38063_codec_get_voice_volume(int *volume);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/audio_hal/include/audio_hal.h b/components/audio_hal/include/audio_hal.h
index ac3718b..9e4d457 100644
--- a/components/audio_hal/include/audio_hal.h
+++ b/components/audio_hal/include/audio_hal.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -32,241 +32,237 @@
#include "freertos/task.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#define AUDIO_HAL_VOL_DEFAULT 70
- typedef struct audio_hal *audio_hal_handle_t;
+typedef struct audio_hal *audio_hal_handle_t;
- /**
- * @brief Select media hal codec mode
- */
- typedef enum
- {
- AUDIO_HAL_CODEC_MODE_ENCODE = 1, /*!< select adc */
- AUDIO_HAL_CODEC_MODE_DECODE, /*!< select dac */
- AUDIO_HAL_CODEC_MODE_BOTH, /*!< select both adc and dac */
- AUDIO_HAL_CODEC_MODE_LINE_IN, /*!< set adc channel */
- } audio_hal_codec_mode_t;
+/**
+ * @brief Select media hal codec mode
+ */
+typedef enum {
+ AUDIO_HAL_CODEC_MODE_ENCODE = 1, /*!< select adc */
+ AUDIO_HAL_CODEC_MODE_DECODE, /*!< select dac */
+ AUDIO_HAL_CODEC_MODE_BOTH, /*!< select both adc and dac */
+ AUDIO_HAL_CODEC_MODE_LINE_IN, /*!< set adc channel */
+} audio_hal_codec_mode_t;
- /**
- * @brief Select adc channel for input mic signal
- */
- typedef enum
- {
- AUDIO_HAL_ADC_INPUT_LINE1 = 0x00, /*!< mic input to adc channel 1 */
- AUDIO_HAL_ADC_INPUT_LINE2, /*!< mic input to adc channel 2 */
- AUDIO_HAL_ADC_INPUT_ALL, /*!< mic input to both channels of adc */
- AUDIO_HAL_ADC_INPUT_DIFFERENCE, /*!< mic input to adc difference channel */
- } audio_hal_adc_input_t;
+/**
+ * @brief Select adc channel for input mic signal
+ */
+typedef enum {
+ AUDIO_HAL_ADC_INPUT_LINE1 = 0x00, /*!< mic input to adc channel 1 */
+ AUDIO_HAL_ADC_INPUT_LINE2, /*!< mic input to adc channel 2 */
+ AUDIO_HAL_ADC_INPUT_ALL, /*!< mic input to both channels of adc */
+ AUDIO_HAL_ADC_INPUT_DIFFERENCE, /*!< mic input to adc difference channel */
+} audio_hal_adc_input_t;
- /**
- * @brief Select channel for dac output
- */
- typedef enum
- {
- AUDIO_HAL_DAC_OUTPUT_LINE1 = 0x00, /*!< dac output signal to channel 1 */
- AUDIO_HAL_DAC_OUTPUT_LINE2, /*!< dac output signal to channel 2 */
- AUDIO_HAL_DAC_OUTPUT_ALL, /*!< dac output signal to both channels */
- } audio_hal_dac_output_t;
+/**
+ * @brief Select channel for dac output
+ */
+typedef enum {
+ AUDIO_HAL_DAC_OUTPUT_LINE1 = 0x00, /*!< dac output signal to channel 1 */
+ AUDIO_HAL_DAC_OUTPUT_LINE2, /*!< dac output signal to channel 2 */
+ AUDIO_HAL_DAC_OUTPUT_ALL, /*!< dac output signal to both channels */
+} audio_hal_dac_output_t;
- /**
- * @brief Select operating mode i.e. start or stop for audio codec chip
- */
- typedef enum
- {
- AUDIO_HAL_CTRL_STOP = 0x00, /*!< set stop mode */
- AUDIO_HAL_CTRL_START = 0x01, /*!< set start mode */
- } audio_hal_ctrl_t;
+/**
+ * @brief Select operating mode i.e. start or stop for audio codec chip
+ */
+typedef enum {
+ AUDIO_HAL_CTRL_STOP = 0x00, /*!< set stop mode */
+ AUDIO_HAL_CTRL_START = 0x01, /*!< set start mode */
+} audio_hal_ctrl_t;
- /**
- * @brief Select I2S interface operating mode i.e. master or slave for audio
- * codec chip
- */
- typedef enum
- {
- AUDIO_HAL_MODE_SLAVE = 0x00, /*!< set slave mode */
- AUDIO_HAL_MODE_MASTER = 0x01, /*!< set master mode */
- } audio_hal_iface_mode_t;
+/**
+ * @brief Select I2S interface operating mode i.e. master or slave for audio
+ * codec chip
+ */
+typedef enum {
+ AUDIO_HAL_MODE_SLAVE = 0x00, /*!< set slave mode */
+ AUDIO_HAL_MODE_MASTER = 0x01, /*!< set master mode */
+} audio_hal_iface_mode_t;
- /**
- * @brief Select I2S interface samples per second
- */
- typedef enum
- {
- AUDIO_HAL_08K_SAMPLES, /*!< set to 8k samples per second */
- AUDIO_HAL_11K_SAMPLES, /*!< set to 11.025k samples per second */
- AUDIO_HAL_16K_SAMPLES, /*!< set to 16k samples in per second */
- AUDIO_HAL_22K_SAMPLES, /*!< set to 22.050k samples per second */
- AUDIO_HAL_24K_SAMPLES, /*!< set to 24k samples in per second */
- AUDIO_HAL_32K_SAMPLES, /*!< set to 32k samples in per second */
- AUDIO_HAL_44K_SAMPLES, /*!< set to 44.1k samples per second */
- AUDIO_HAL_48K_SAMPLES, /*!< set to 48k samples per second */
- } audio_hal_iface_samples_t;
+/**
+ * @brief Select I2S interface samples per second
+ */
+typedef enum {
+ AUDIO_HAL_08K_SAMPLES, /*!< set to 8k samples per second */
+ AUDIO_HAL_11K_SAMPLES, /*!< set to 11.025k samples per second */
+ AUDIO_HAL_16K_SAMPLES, /*!< set to 16k samples in per second */
+ AUDIO_HAL_22K_SAMPLES, /*!< set to 22.050k samples per second */
+ AUDIO_HAL_24K_SAMPLES, /*!< set to 24k samples in per second */
+ AUDIO_HAL_32K_SAMPLES, /*!< set to 32k samples in per second */
+ AUDIO_HAL_44K_SAMPLES, /*!< set to 44.1k samples per second */
+ AUDIO_HAL_48K_SAMPLES, /*!< set to 48k samples per second */
+} audio_hal_iface_samples_t;
- /**
- * @brief Select I2S interface number of bits per sample
- */
- typedef enum
- {
- AUDIO_HAL_BIT_LENGTH_16BITS = 1, /*!< set 16 bits per sample */
- AUDIO_HAL_BIT_LENGTH_24BITS, /*!< set 24 bits per sample */
- AUDIO_HAL_BIT_LENGTH_32BITS, /*!< set 32 bits per sample */
- } audio_hal_iface_bits_t;
+/**
+ * @brief Select I2S interface number of bits per sample
+ */
+typedef enum {
+ AUDIO_HAL_BIT_LENGTH_16BITS = 1, /*!< set 16 bits per sample */
+ AUDIO_HAL_BIT_LENGTH_24BITS, /*!< set 24 bits per sample */
+ AUDIO_HAL_BIT_LENGTH_32BITS, /*!< set 32 bits per sample */
+} audio_hal_iface_bits_t;
- /**
- * @brief Select I2S interface format for audio codec chip
- */
- typedef enum
- {
- AUDIO_HAL_I2S_NORMAL = 0, /*!< set normal I2S format */
- AUDIO_HAL_I2S_LEFT, /*!< set all left format */
- AUDIO_HAL_I2S_RIGHT, /*!< set all right format */
- AUDIO_HAL_I2S_DSP, /*!< set dsp/pcm format */
- } audio_hal_iface_format_t;
+/**
+ * @brief Select I2S interface format for audio codec chip
+ */
+typedef enum {
+ AUDIO_HAL_I2S_NORMAL = 0, /*!< set normal I2S format */
+ AUDIO_HAL_I2S_LEFT, /*!< set all left format */
+ AUDIO_HAL_I2S_RIGHT, /*!< set all right format */
+ AUDIO_HAL_I2S_DSP, /*!< set dsp/pcm format */
+} audio_hal_iface_format_t;
- /**
- * @brief I2s interface configuration for audio codec chip
- */
- typedef struct
- {
- audio_hal_iface_mode_t mode; /*!< audio codec chip mode */
- audio_hal_iface_format_t fmt; /*!< I2S interface format */
- audio_hal_iface_samples_t samples; /*!< I2S interface samples per second */
- audio_hal_iface_bits_t
- bits; /*!< i2s interface number of bits per sample */
- } audio_hal_codec_i2s_iface_t;
+/**
+ * @brief I2s interface configuration for audio codec chip
+ */
+typedef struct {
+ audio_hal_iface_mode_t mode; /*!< audio codec chip mode */
+ audio_hal_iface_format_t fmt; /*!< I2S interface format */
+ audio_hal_iface_samples_t samples; /*!< I2S interface samples per second */
+ audio_hal_iface_bits_t bits; /*!< i2s interface number of bits per sample */
+} audio_hal_codec_i2s_iface_t;
- /**
- * @brief Configure media hal for initialization of audio codec chip
- */
- typedef struct
- {
- audio_hal_adc_input_t adc_input; /*!< set adc channel */
- audio_hal_dac_output_t dac_output; /*!< set dac channel */
- audio_hal_codec_mode_t
- codec_mode; /*!< select codec mode: adc, dac or both */
- audio_hal_codec_i2s_iface_t
- i2s_iface; /*!< set I2S interface configuration */
- } audio_hal_codec_config_t;
+/**
+ * @brief Configure media hal for initialization of audio codec chip
+ */
+typedef struct {
+ audio_hal_adc_input_t adc_input; /*!< set adc channel */
+ audio_hal_dac_output_t dac_output; /*!< set dac channel */
+ audio_hal_codec_mode_t codec_mode; /*!< select codec mode: adc, dac or both */
+ audio_hal_codec_i2s_iface_t i2s_iface; /*!< set I2S interface configuration */
+} audio_hal_codec_config_t;
- /**
- * @brief Configuration of functions and variables used to operate audio
- * codec chip
- */
- typedef struct audio_hal
- {
- esp_err_t (*audio_codec_initialize) (
- audio_hal_codec_config_t *codec_cfg); /*!< initialize codec */
- esp_err_t (*audio_codec_deinitialize) (void); /*!< deinitialize codec */
- esp_err_t (*audio_codec_ctrl) (
- audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state); /*!< control codec mode and state */
- esp_err_t (*audio_codec_config_iface) (
- audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface); /*!< configure i2s interface */
- esp_err_t (*audio_codec_set_mute) (bool mute); /*!< set codec mute */
- esp_err_t (*audio_codec_set_volume) (int volume); /*!< set codec volume */
- esp_err_t (*audio_codec_get_volume) (int *volume); /*!< get codec volume */
- xSemaphoreHandle audio_hal_lock; /*!< semaphore of codec */
- void *handle; /*!< handle of audio codec */
- } audio_hal_func_t;
+/**
+ * @brief Configuration of functions and variables used to operate audio codec
+ * chip
+ */
+typedef struct audio_hal {
+ esp_err_t (*audio_codec_initialize)(
+ audio_hal_codec_config_t *codec_cfg); /*!< initialize codec */
+ esp_err_t (*audio_codec_deinitialize)(void); /*!< deinitialize codec */
+ esp_err_t (*audio_codec_ctrl)(
+ audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state); /*!< control codec mode and state */
+ esp_err_t (*audio_codec_config_iface)(
+ audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface); /*!< configure i2s interface */
+ esp_err_t (*audio_codec_set_mute)(bool mute); /*!< set codec mute */
+ esp_err_t (*audio_codec_set_volume)(int volume); /*!< set codec volume */
+ esp_err_t (*audio_codec_get_volume)(int *volume); /*!< get codec volume */
+ esp_err_t (*audio_codec_enable_pa)(bool enable); /*!< enable pa */
+ xSemaphoreHandle audio_hal_lock; /*!< semaphore of codec */
+ void *handle; /*!< handle of audio codec */
+} audio_hal_func_t;
- /**
- * @brief Initialize media codec driver
- *
- * @note If selected codec has already been installed, it'll return the
- * audio_hal handle.
- *
- * @param audio_hal_conf Configure structure audio_hal_config_t
- * @param audio_hal_func Structure containing functions used to operate audio
- * the codec chip
- *
- * @return int, 0--success, others--fail
- */
- audio_hal_handle_t audio_hal_init (audio_hal_codec_config_t *audio_hal_conf,
- audio_hal_func_t *audio_hal_func);
+/**
+ * @brief Initialize media codec driver
+ *
+ * @note If selected codec has already been installed, it'll return the
+ * audio_hal handle.
+ *
+ * @param audio_hal_conf Configure structure audio_hal_config_t
+ * @param audio_hal_func Structure containing functions used to operate audio
+ * the codec chip
+ *
+ * @return int, 0--success, others--fail
+ */
+audio_hal_handle_t audio_hal_init(audio_hal_codec_config_t *audio_hal_conf,
+ audio_hal_func_t *audio_hal_func);
- /**
- * @brief Uninitialize media codec driver
- *
- * @param audio_hal reference function pointer for selected audio codec
- *
- * @return int, 0--success, others--fail
- */
- esp_err_t audio_hal_deinit (audio_hal_handle_t audio_hal);
+/**
+ * @brief Uninitialize media codec driver
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_deinit(audio_hal_handle_t audio_hal);
- /**
- * @brief Start/stop codec driver
- *
- * @param audio_hal reference function pointer for selected audio codec
- * @param mode select media hal codec mode either encode/decode/or both to
- * start from audio_hal_codec_mode_t
- * @param audio_hal_ctrl select start stop state for specific mode
- *
- * @return int, 0--success, others--fail
- */
- esp_err_t audio_hal_ctrl_codec (audio_hal_handle_t audio_hal,
- audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t audio_hal_ctrl);
+/**
+ * @brief Start/stop codec driver
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param mode select media hal codec mode either encode/decode/or both to start
+ * from audio_hal_codec_mode_t
+ * @param audio_hal_ctrl select start stop state for specific mode
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_ctrl_codec(audio_hal_handle_t audio_hal,
+ audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t audio_hal_ctrl);
- /**
- * @brief Set codec I2S interface samples rate & bit width and format either
- * I2S or PCM/DSP.
- *
- * @param audio_hal reference function pointer for selected audio codec
- * @param mode select media hal codec mode either encode/decode/or both to
- * start from audio_hal_codec_mode_t
- * @param iface I2S sample rate (ex: 16000, 44100), I2S bit width (16, 24,
- * 32),I2s format (I2S, PCM, DSP).
- *
- * @return
- * - 0 Success
- * - -1 Error
- */
- esp_err_t audio_hal_codec_iface_config (audio_hal_handle_t audio_hal,
- audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
+/**
+ * @brief Set codec I2S interface samples rate & bit width and format either I2S
+ * or PCM/DSP.
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param mode select media hal codec mode either encode/decode/or both to start
+ * from audio_hal_codec_mode_t
+ * @param iface I2S sample rate (ex: 16000, 44100), I2S bit width (16, 24,
+ * 32),I2s format (I2S, PCM, DSP).
+ *
+ * @return
+ * - 0 Success
+ * - -1 Error
+ */
+esp_err_t audio_hal_codec_iface_config(audio_hal_handle_t audio_hal,
+ audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
- /**
- * @brief Set voice mute. Enables or disables DAC mute of a codec.
- * @note `audio_hal_get_volume` will still give a non-zero number in
- * mute state. It will be set to that number when speaker is unmuted.
- *
- * @param audio_hal reference function pointer for selected audio codec
- * @param mute true/false. If true speaker will be muted and if false
- * speaker will be unmuted.
- *
- * @return int, 0--success, others--fail
- */
- esp_err_t audio_hal_set_mute (audio_hal_handle_t audio_hal, bool mute);
+/**
+ * @brief Set voice mute. Enables or disables DAC mute of a codec.
+ * @note `audio_hal_get_volume` will still give a non-zero number in mute
+ * state. It will be set to that number when speaker is unmuted.
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param mute true/false. If true speaker will be muted and if false
+ * speaker will be unmuted.
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_set_mute(audio_hal_handle_t audio_hal, bool mute);
- /**
- * @brief Set voice volume.
- * @note if volume is 0, mute is enabled,range is 0-100.
- *
- * @param audio_hal reference function pointer for selected audio codec
- * @param volume value of volume in percent(%)
- *
- * @return int, 0--success, others--fail
- */
- esp_err_t audio_hal_set_volume (audio_hal_handle_t audio_hal, int volume);
+/**
+ * @brief Set voice volume.
+ * @note if volume is 0, mute is enabled,range is 0-100.
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param volume value of volume in percent(%)
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_set_volume(audio_hal_handle_t audio_hal, int volume);
- /**
- * @brief get voice volume.
- * @note if volume is 0, mute is enabled, range is 0-100.
- *
- * @param audio_hal reference function pointer for selected audio codec
- * @param volume value of volume in percent returned(%)
- *
- * @return int, 0--success, others--fail
- */
- esp_err_t audio_hal_get_volume (audio_hal_handle_t audio_hal, int *volume);
+/**
+ * @brief get voice volume.
+ * @note if volume is 0, mute is enabled, range is 0-100.
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param volume value of volume in percent returned(%)
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_get_volume(audio_hal_handle_t audio_hal, int *volume);
+
+/**
+ * @brief Enables or disables PA.
+ *
+ * @param audio_hal reference function pointer for selected audio codec
+ * @param enable true/false.
+ *
+ * @return int, 0--success, others--fail
+ */
+esp_err_t audio_hal_enable_pa(audio_hal_handle_t audio_hal, bool enable);
#ifdef __cplusplus
}
#endif
-#endif //__AUDIO_HAL_H__
+#endif //__AUDIO_HAL_H__
diff --git a/components/audio_hal/include/audio_volume.h b/components/audio_hal/include/audio_volume.h
new file mode 100644
index 0000000..616ef3a
--- /dev/null
+++ b/components/audio_hal/include/audio_volume.h
@@ -0,0 +1,99 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2022
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _AUDIO_VOLUME_H_
+#define _AUDIO_VOLUME_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Map of user volume to codec dac volume offset
+ */
+typedef float (*audio_codec_dac_vol_offset)(int volume);
+
+typedef void *volume_handle_t;
+
+/**
+ * @brief Codec dac volume configurations
+ */
+typedef struct {
+ float max_dac_volume; /*!< Codec support max volume */
+ float min_dac_volume; /*!< Codec support min volume */
+ float board_pa_gain; /*!< Board power amplifier gain */
+ float volume_accuracy; /*!< Codec dac volume accuracy(0.5 or 1) */
+ int8_t dac_vol_symbol; /*!< Whether the dac volume is positively correlated
+ with the register value */
+ uint8_t zero_volume_reg; /*!< Codec register value for zero dac volume */
+ uint8_t reg_value; /*!< Record current dac volume register value */
+ int user_volume; /*!< Record the user set volume */
+ audio_codec_dac_vol_offset
+ offset_conv_volume; /*!< Convert user volume to dac volume offset */
+} codec_dac_volume_config_t;
+
+/**
+ * @brief Init the audio dac volume by config
+ *
+ * @param config Codec dac volume config
+ *
+ * @return volume_handle_t
+ */
+volume_handle_t audio_codec_volume_init(codec_dac_volume_config_t *config);
+
+/**
+ * @brief Calculate codec register value by a linear formula
+ *
+ * @param vol_handle The dac volume handle
+ * @param volume User set volume (0-100)
+ *
+ * @return Codec dac register value
+ */
+uint8_t audio_codec_get_dac_reg_value(volume_handle_t vol_handle, int volume);
+
+/**
+ * @brief Calculate codec dac volume by a linear formula
+ *
+ * @param vol_handle The dac volume handle
+ *
+ * @return Codec dac volume
+ */
+float audio_codec_cal_dac_volume(volume_handle_t vol_handle);
+
+/**
+ * @brief Deinit the dac volume handle
+ *
+ * @param vol_handle The dac volume handle
+ */
+void audio_codec_volume_deinit(volume_handle_t vol_handle);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //_AUDIO_VOLUME_H_
diff --git a/components/audio_hal/test/test_audio_hal.c b/components/audio_hal/test/test_audio_hal.c
index c4f1fd3..0e8de04 100644
--- a/components/audio_hal/test/test_audio_hal.c
+++ b/components/audio_hal/test/test_audio_hal.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -42,148 +42,139 @@ static const char *TAG = "TEST_AUDIO_HAL";
extern const uint8_t test_pcm_start[] asm("_binary_test_pcm_start");
extern const uint8_t test_pcm_end[] asm("_binary_test_pcm_end");
-static void
-i2s_init ()
-{
+static void i2s_init() {
i2s_config_t i2s_cfg = {
- .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX,
- .sample_rate = 16000,
- .bits_per_sample = 16,
- .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
- .communication_format = I2S_COMM_FORMAT_I2S,
- .dma_buf_count = 3,
- .dma_buf_len = 300,
- .use_apll = 1,
- .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
+ .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX,
+ .sample_rate = 16000,
+ .bits_per_sample = 16,
+ .channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
+ .communication_format = I2S_COMM_FORMAT_I2S,
+ .dma_buf_count = 3,
+ .dma_buf_len = 300,
+ .use_apll = 1,
+ .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
};
- i2s_driver_install (TEST_I2S_NUM, &i2s_cfg, 0, NULL);
- i2s_pin_config_t i2s_pin_cfg = { 0 };
- get_i2s_pins (TEST_I2S_NUM, &i2s_pin_cfg);
- i2s_set_pin (TEST_I2S_NUM, &i2s_pin_cfg);
- i2s_mclk_gpio_select (TEST_I2S_NUM, GPIO_NUM_0);
+ i2s_driver_install(TEST_I2S_NUM, &i2s_cfg, 0, NULL);
+ i2s_pin_config_t i2s_pin_cfg = {0};
+ if (sizeof(board_i2s_pin_t) == sizeof(i2s_pin_config_t)) {
+ get_i2s_pins(TEST_I2S_NUM, (board_i2s_pin_t *)&i2s_pin_cfg);
+ i2s_set_pin(TEST_I2S_NUM, &i2s_pin_cfg);
+ }
}
-static void
-i2s_deinit ()
-{
- i2s_driver_uninstall (TEST_I2S_NUM);
-}
+static void i2s_deinit() { i2s_driver_uninstall(TEST_I2S_NUM); }
-TEST_CASE ("Usage test", "[audio_hal]")
-{
- ESP_LOGI (TAG, "Initialize i2s");
- i2s_init ();
+TEST_CASE("Usage test", "[audio_hal]") {
+ ESP_LOGI(TAG, "Initialize i2s");
+ i2s_init();
- ESP_LOGI (TAG, "Start codec chip");
- audio_board_handle_t board_handle = audio_board_init ();
- TEST_ASSERT_NOT_NULL (board_handle);
- TEST_ASSERT_FALSE (audio_hal_ctrl_codec (board_handle->audio_hal,
- AUDIO_HAL_CODEC_MODE_DECODE,
- AUDIO_HAL_CTRL_START));
+ ESP_LOGI(TAG, "Start codec chip");
+ audio_board_handle_t board_handle = audio_board_init();
+ TEST_ASSERT_NOT_NULL(board_handle);
+ TEST_ASSERT_FALSE(audio_hal_ctrl_codec(board_handle->audio_hal,
+ AUDIO_HAL_CODEC_MODE_DECODE,
+ AUDIO_HAL_CTRL_START));
- ESP_LOGI (TAG, "Set codec volume");
- TEST_ASSERT_FALSE (audio_hal_set_volume (board_handle->audio_hal, 65));
+ ESP_LOGI(TAG, "Set codec volume");
+ TEST_ASSERT_FALSE(audio_hal_set_volume(board_handle->audio_hal, 65));
int volume = 0;
- TEST_ASSERT_FALSE (audio_hal_get_volume (board_handle->audio_hal, &volume));
- ESP_LOGI (TAG, "Get codec volume: %d", volume);
+ TEST_ASSERT_FALSE(audio_hal_get_volume(board_handle->audio_hal, &volume));
+ ESP_LOGI(TAG, "Get codec volume: %d", volume);
size_t bytes_written = 0;
- ESP_LOGI (TAG, "Start to play music");
- TEST_ASSERT_FALSE (i2s_write (TEST_I2S_NUM, test_pcm_start,
- test_pcm_end - test_pcm_start, &bytes_written,
- portMAX_DELAY));
+ ESP_LOGI(TAG, "Start to play music");
+ TEST_ASSERT_FALSE(i2s_write(TEST_I2S_NUM, test_pcm_start,
+ test_pcm_end - test_pcm_start, &bytes_written,
+ portMAX_DELAY));
- ESP_LOGW (TAG, "Reach the end of music, release all resource");
- TEST_ASSERT_FALSE (audio_board_deinit (board_handle));
- i2c_driver_delete (I2C_NUM_0);
- i2s_deinit ();
+ ESP_LOGW(TAG, "Reach the end of music, release all resource");
+ TEST_ASSERT_FALSE(audio_board_deinit(board_handle));
+ i2c_driver_delete(I2C_NUM_0);
+ i2s_deinit();
}
/*
* To run this case, please choose Lyrat_v4.3 in menuconfig and run on
* lyrat_v4.3 board
*/
-TEST_CASE ("Test for es8388 driver", "[audio_hal]")
-{
- ESP_LOGI (TAG, "Initialize i2s");
- i2s_init ();
+TEST_CASE("Test for es8388 driver", "[audio_hal]") {
+ ESP_LOGI(TAG, "Initialize i2s");
+ i2s_init();
- ESP_LOGI (TAG, "Start es8388 codec chip");
- audio_hal_codec_config_t es8388_cfg = AUDIO_CODEC_DEFAULT_CONFIG ();
- TEST_ASSERT_FALSE (es8388_init (&es8388_cfg));
- TEST_ASSERT_FALSE (
- es8388_config_i2s (es8388_cfg.codec_mode, &es8388_cfg.i2s_iface));
- TEST_ASSERT_FALSE (
- es8388_ctrl_state (AUDIO_HAL_CODEC_MODE_BOTH, AUDIO_HAL_CTRL_START));
- TEST_ASSERT_FALSE (es8388_set_voice_volume (50));
+ ESP_LOGI(TAG, "Start es8388 codec chip");
+ audio_hal_codec_config_t es8388_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ TEST_ASSERT_FALSE(es8388_init(&es8388_cfg));
+ TEST_ASSERT_FALSE(
+ es8388_config_i2s(es8388_cfg.codec_mode, &es8388_cfg.i2s_iface));
+ TEST_ASSERT_FALSE(
+ es8388_ctrl_state(AUDIO_HAL_CODEC_MODE_BOTH, AUDIO_HAL_CTRL_START));
+ TEST_ASSERT_FALSE(es8388_set_voice_volume(50));
size_t bytes_written = 0;
- ESP_LOGI (TAG, "Start to play music");
- TEST_ASSERT_FALSE (i2s_write (TEST_I2S_NUM, test_pcm_start,
- test_pcm_end - test_pcm_start, &bytes_written,
- portMAX_DELAY));
+ ESP_LOGI(TAG, "Start to play music");
+ TEST_ASSERT_FALSE(i2s_write(TEST_I2S_NUM, test_pcm_start,
+ test_pcm_end - test_pcm_start, &bytes_written,
+ portMAX_DELAY));
- ESP_LOGW (TAG, "Reach the end of music, release all resource");
- i2c_driver_delete (I2C_NUM_0);
- i2s_deinit ();
+ ESP_LOGW(TAG, "Reach the end of music, release all resource");
+ i2c_driver_delete(I2C_NUM_0);
+ i2s_deinit();
}
/*
* To run this case, please choose Lyrat_mini in menuconfig and run on
* lyrat_mini board
*/
-TEST_CASE ("Test for es8311 driver", "[audio_hal]")
-{
- ESP_LOGI (TAG, "Initialize i2s");
- i2s_init ();
+TEST_CASE("Test for es8311 driver", "[audio_hal]") {
+ ESP_LOGI(TAG, "Initialize i2s");
+ i2s_init();
- ESP_LOGI (TAG, "Start es8311 codec chip");
- audio_hal_codec_config_t es8311_cfg = AUDIO_CODEC_DEFAULT_CONFIG ();
- TEST_ASSERT_FALSE (es8311_codec_init (&es8311_cfg));
- TEST_ASSERT_FALSE (
- es8311_codec_config_i2s (es8311_cfg.codec_mode, &es8311_cfg.i2s_iface));
- TEST_ASSERT_FALSE (es8311_codec_ctrl_state (AUDIO_HAL_CODEC_MODE_BOTH,
- AUDIO_HAL_CTRL_START));
- TEST_ASSERT_FALSE (es8311_codec_set_voice_volume (50));
+ ESP_LOGI(TAG, "Start es8311 codec chip");
+ audio_hal_codec_config_t es8311_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ TEST_ASSERT_FALSE(es8311_codec_init(&es8311_cfg));
+ TEST_ASSERT_FALSE(
+ es8311_codec_config_i2s(es8311_cfg.codec_mode, &es8311_cfg.i2s_iface));
+ TEST_ASSERT_FALSE(
+ es8311_codec_ctrl_state(AUDIO_HAL_CODEC_MODE_BOTH, AUDIO_HAL_CTRL_START));
+ TEST_ASSERT_FALSE(es8311_codec_set_voice_volume(50));
size_t bytes_written = 0;
- ESP_LOGI (TAG, "Start to play music");
- TEST_ASSERT_FALSE (i2s_write (TEST_I2S_NUM, test_pcm_start,
- test_pcm_end - test_pcm_start, &bytes_written,
- portMAX_DELAY));
+ ESP_LOGI(TAG, "Start to play music");
+ TEST_ASSERT_FALSE(i2s_write(TEST_I2S_NUM, test_pcm_start,
+ test_pcm_end - test_pcm_start, &bytes_written,
+ portMAX_DELAY));
- ESP_LOGW (TAG, "Reach the end of music, release all resource");
- i2c_driver_delete (I2C_NUM_0);
- i2s_deinit ();
+ ESP_LOGW(TAG, "Reach the end of music, release all resource");
+ i2c_driver_delete(I2C_NUM_0);
+ i2s_deinit();
}
/*
* To run this case, please choose LyratD_MSC in menuconfig and run on
* lyratD_MSC board
*/
-TEST_CASE ("Test for zl38063 driver", "[audio_hal]")
-{
- ESP_LOGI (TAG, "Initialize i2s");
- i2s_init ();
+TEST_CASE("Test for zl38063 driver", "[audio_hal]") {
+ ESP_LOGI(TAG, "Initialize i2s");
+ i2s_init();
- ESP_LOGI (TAG, "Start zl38063 DSP");
- audio_hal_codec_config_t zl38063_cfg = AUDIO_CODEC_DEFAULT_CONFIG ();
- TEST_ASSERT_FALSE (zl38063_codec_init (&zl38063_cfg));
- TEST_ASSERT_FALSE (zl38063_codec_config_i2s (zl38063_cfg.codec_mode,
- &zl38063_cfg.i2s_iface));
- TEST_ASSERT_FALSE (zl38063_codec_ctrl_state (AUDIO_HAL_CODEC_MODE_BOTH,
- AUDIO_HAL_CTRL_START));
- TEST_ASSERT_FALSE (zl38063_codec_set_voice_volume (50));
+ ESP_LOGI(TAG, "Start zl38063 DSP");
+ audio_hal_codec_config_t zl38063_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
+ TEST_ASSERT_FALSE(zl38063_codec_init(&zl38063_cfg));
+ TEST_ASSERT_FALSE(
+ zl38063_codec_config_i2s(zl38063_cfg.codec_mode, &zl38063_cfg.i2s_iface));
+ TEST_ASSERT_FALSE(zl38063_codec_ctrl_state(AUDIO_HAL_CODEC_MODE_BOTH,
+ AUDIO_HAL_CTRL_START));
+ TEST_ASSERT_FALSE(zl38063_codec_set_voice_volume(50));
size_t bytes_written = 0;
- ESP_LOGI (TAG, "Start to play music");
- TEST_ASSERT_FALSE (i2s_write (TEST_I2S_NUM, test_pcm_start,
- test_pcm_end - test_pcm_start, &bytes_written,
- portMAX_DELAY));
+ ESP_LOGI(TAG, "Start to play music");
+ TEST_ASSERT_FALSE(i2s_write(TEST_I2S_NUM, test_pcm_start,
+ test_pcm_end - test_pcm_start, &bytes_written,
+ portMAX_DELAY));
- ESP_LOGW (TAG, "Reach the end of music, release all resource");
- i2c_driver_delete (I2C_NUM_0);
- i2s_deinit ();
+ ESP_LOGW(TAG, "Reach the end of music, release all resource");
+ i2c_driver_delete(I2C_NUM_0);
+ i2s_deinit();
}
diff --git a/components/audio_sal/CMakeLists.txt b/components/audio_sal/CMakeLists.txt
index 0b1dce3..aafc71a 100644
--- a/components/audio_sal/CMakeLists.txt
+++ b/components/audio_sal/CMakeLists.txt
@@ -4,6 +4,11 @@ set(COMPONENT_ADD_INCLUDEDIRS "include")
set(COMPONENT_SRCS "audio_mem.c"
"audio_sys.c"
"audio_thread.c"
- "audio_url.c")
+ "audio_url.c"
+ "audio_mutex.c"
+ "audio_queue.c"
+ "media_os_ctype.c")
+
+list(APPEND COMPONENT_REQUIRES efuse)
register_component()
diff --git a/components/audio_sal/audio_mem.c b/components/audio_sal/audio_mem.c
index 0e13e6c..73fc66d 100644
--- a/components/audio_sal/audio_mem.c
+++ b/components/audio_sal/audio_mem.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,177 +18,180 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "audio_mem.h"
-#include "esp_efuse.h"
+
+#include
+
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "esp_system.h"
#include "sdkconfig.h"
#include "string.h"
-#include
-// #define ENABLE_AUDIO_MEM_TRACE
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 4)
+#include "hal/efuse_hal.h"
+#else
+#include "esp_efuse.h"
+#endif
-void *
-audio_malloc (size_t size)
-{
+#ifdef CONFIG_MEDIA_LIB_MEM_AUTO_TRACE
+#define ENABLE_AUDIO_MEM_TRACE
+#define MALLOC_RAM_FLAG 1
+#endif
+/**
+ * @brief Memory trace function is replaced by mem_trace module in
+ * `media_lib_sal` Users need follow below steps to let trace function work
+ * 1. After app start `#include "media_lib_adapter.h"` and call
+ * `media_lib_add_default_adapter();`
+ * 2. Automatically enable memory trace function from menuconfig
+ * `ADF Library Configuration --> Support trace memory
+ * automatically` Or call `media_lib_start_mem_trace` manually
+ * 3. Call `media_lib_stop_mem_trace` to stop trace and see trace results
+ *
+ * Use weak realization of trace function so that can work without
+ * `media_lib_sal`
+ */
+#ifdef ENABLE_AUDIO_MEM_TRACE
+int __attribute__((weak))
+media_lib_add_trace_mem(const char *module, void *addr, int size,
+ uint8_t flag) {
+ return 0;
+}
+
+void __attribute__((weak)) media_lib_remove_trace_mem(void *addr) {}
+#endif
+
+void *audio_malloc(size_t size) {
void *data = NULL;
#if CONFIG_SPIRAM_BOOT_INIT
- data = heap_caps_malloc (size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
+ data = heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
#else
- data = malloc (size);
+ data = malloc(size);
#endif
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUDIO_MEM", "malloc:%p, size:%d, called:0x%08x", data, size,
- (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_add_trace_mem(NULL, data, size, 0);
#endif
return data;
}
-void
-audio_free (void *ptr)
-{
- free (ptr);
+void audio_free(void *ptr) {
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUIDO_MEM", "free:%p, called:0x%08x", ptr,
- (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_remove_trace_mem(ptr);
#endif
+ free(ptr);
}
-void *
-audio_calloc (size_t nmemb, size_t size)
-{
+void *audio_calloc(size_t nmemb, size_t size) {
void *data = NULL;
#if CONFIG_SPIRAM_BOOT_INIT
- data = heap_caps_malloc (nmemb * size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
- if (data)
- {
- memset (data, 0, nmemb * size);
- }
+ data = heap_caps_malloc(nmemb * size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
+ if (data) {
+ memset(data, 0, nmemb * size);
+ }
#else
- data = calloc (nmemb, size);
+ data = calloc(nmemb, size);
#endif
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUIDO_MEM", "calloc:%p, size:%d, called:0x%08x", data, size,
- (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_add_trace_mem(NULL, data, nmemb * size, 0);
#endif
return data;
}
-void *
-audio_realloc (void *ptr, size_t size)
-{
+void *audio_realloc(void *ptr, size_t size) {
void *p = NULL;
+#ifdef ENABLE_AUDIO_MEM_TRACE
+ media_lib_remove_trace_mem(ptr);
+#endif
+
#if CONFIG_SPIRAM_BOOT_INIT
- p = heap_caps_realloc (ptr, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
+ p = heap_caps_realloc(ptr, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
#else
- p = heap_caps_realloc (ptr, size, MALLOC_CAP_8BIT);
+ p = heap_caps_realloc(ptr, size, MALLOC_CAP_8BIT);
#endif
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUDIO_MEM", "realloc,new:%p, ptr:%p size:%d, called:0x%08x", p,
- ptr, size, (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_add_trace_mem(NULL, p, size, 0);
#endif
return p;
}
-char *
-audio_strdup (const char *str)
-{
+char *audio_strdup(const char *str) {
+ int size = strlen(str) + 1;
#if CONFIG_SPIRAM_BOOT_INIT
- char *copy = heap_caps_malloc (strlen (str) + 1,
- MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
+ char *copy = heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
#else
- char *copy = malloc (strlen (str) + 1);
+ char *copy = malloc(size);
#endif
- if (copy)
- {
- strcpy (copy, str);
- }
+ if (copy) {
+ strcpy(copy, str);
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUDIO_MEM", "strdup:%p, size:%d, called:0x%08x", copy,
- strlen (copy), (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_add_trace_mem(NULL, copy, size, 0);
#endif
+ }
return copy;
}
-void *
-audio_calloc_inner (size_t n, size_t size)
-{
+void *audio_calloc_inner(size_t n, size_t size) {
void *data = NULL;
#if CONFIG_SPIRAM_BOOT_INIT
- data = heap_caps_calloc_prefer (
+ data = heap_caps_calloc_prefer(
n, size, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT,
MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM);
#else
- data = heap_caps_calloc (n, size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
+ data = heap_caps_calloc(n, size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
#endif
-
#ifdef ENABLE_AUDIO_MEM_TRACE
- ESP_LOGI ("AUIDO_MEM", "calloc_inner:%p, size:%d, called:0x%08x", data, size,
- (intptr_t)__builtin_return_address (0) - 2);
+ media_lib_add_trace_mem(NULL, data, n * size, MALLOC_RAM_FLAG);
#endif
return data;
}
-void
-audio_mem_print (const char *tag, int line, const char *func)
-{
+void audio_mem_print(const char *tag, int line, const char *func) {
#ifdef CONFIG_SPIRAM_BOOT_INIT
- ESP_LOGI (tag,
- "Func:%s, Line:%d, MEM Total:%d Bytes, Inter:%d Bytes, Dram:%d "
- "Bytes\r\n",
- func, line, esp_get_free_heap_size (),
- heap_caps_get_free_size (MALLOC_CAP_INTERNAL),
- heap_caps_get_free_size (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT));
+ ESP_LOGI(
+ tag,
+ "Func:%s, Line:%d, MEM Total:%d Bytes, Inter:%d Bytes, Dram:%d Bytes\r\n",
+ func, line, (int)esp_get_free_heap_size(),
+ (int)heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
+ (int)heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT));
#else
- ESP_LOGI (tag, "Func:%s, Line:%d, MEM Total:%d Bytes\r\n", func, line,
- esp_get_free_heap_size ());
+ ESP_LOGI(tag, "Func:%s, Line:%d, MEM Total:%d Bytes\r\n", func, line,
+ (int)esp_get_free_heap_size());
#endif
}
+bool audio_mem_spiram_is_enabled(void) {
#if defined(CONFIG_SPIRAM_BOOT_INIT)
-bool
-audio_mem_spiram_is_enabled (void)
-{
return true;
-}
#else
-bool
-audio_mem_spiram_is_enabled (void)
-{
return false;
-}
#endif
+}
-#if defined(CONFIG_SPIRAM_BOOT_INIT) \
- && (CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY)
-bool
-audio_mem_spiram_stack_is_enabled (void)
-{
+bool audio_mem_spiram_stack_is_enabled(void) {
+#if defined(CONFIG_SPIRAM_BOOT_INIT) && \
+ (CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY)
bool ret = true;
-#if CONFIG_IDF_TARGET_ESP32
- uint8_t chip_ver = esp_efuse_get_chip_ver ();
- if (chip_ver < 3)
- {
- ESP_LOGW (
- "AUIDO_MEM",
- "Can't support stack on external memory due to ESP32 chip is %d",
- chip_ver);
- ret = false;
- }
-#endif
- return ret;
-}
+#if defined(CONFIG_IDF_TARGET_ESP32)
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 4)
+ uint32_t chip_ver = efuse_hal_chip_revision();
#else
-bool
-audio_mem_spiram_stack_is_enabled (void)
-{
- return false;
-}
+ uint8_t chip_ver = esp_efuse_get_chip_ver();
#endif
+ if (chip_ver < 3) {
+ ESP_LOGW("AUIDO_MEM",
+ "Can't support stack on external memory due to ESP32 chip is %d",
+ (int)chip_ver);
+ ret = false;
+ }
+#endif // defined(CONFIG_IDF_TARGET_ESP32)
+ return ret;
+#else // defined(CONFIG_SPIRAM_BOOT_INIT) ...
+ return false;
+#endif
+}
diff --git a/components/audio_sal/audio_mutex.c b/components/audio_sal/audio_mutex.c
new file mode 100644
index 0000000..d2d54fb
--- /dev/null
+++ b/components/audio_sal/audio_mutex.c
@@ -0,0 +1,72 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "audio_mutex.h"
+
+#include "audio_idf_version.h"
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/semphr.h"
+#include "freertos/task.h"
+
+#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 3, 0))
+
+// The xQueueSemaphoreTake is not available on FreeRTOS v8.2.0, it's compatible
+// implementation.
+BaseType_t __attribute__((weak))
+xQueueSemaphoreTake(QueueHandle_t xQueue, TickType_t xTicksToWait) {
+ xSemaphoreTake(xQueue, xTicksToWait);
+ return pdPASS;
+}
+#endif
+
+void *mutex_create(void) {
+ void *handle = NULL;
+ handle = xSemaphoreCreateMutex();
+ return (void *)handle;
+}
+
+int mutex_destroy(void *mutex) {
+ vSemaphoreDelete((QueueHandle_t)mutex);
+ return 0;
+}
+
+int mutex_lock(void *mutex) {
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0))
+ while (xSemaphoreTake((QueueHandle_t)mutex, portMAX_DELAY) != pdPASS)
+ ;
+#else
+ while (xSemaphoreTake((QueueHandle_t)mutex, portMAX_DELAY) != pdPASS)
+ ;
+#endif
+ return 0;
+}
+
+int mutex_unlock(void *mutex) {
+ int ret = 0;
+ ret = xSemaphoreGive((QueueHandle_t)mutex);
+ return ret;
+}
diff --git a/components/audio_sal/audio_queue.c b/components/audio_sal/audio_queue.c
new file mode 100644
index 0000000..8cee187
--- /dev/null
+++ b/components/audio_sal/audio_queue.c
@@ -0,0 +1,79 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "audio_queue.h"
+
+#include "freertos/FreeRTOS.h"
+#include "freertos/semphr.h"
+#include "freertos/task.h"
+
+audio_queue_handle_t audio_queue_create(uint32_t queue_len,
+ uint32_t item_size) {
+ audio_queue_handle_t handle = NULL;
+ handle = (QueueHandle_t)xQueueCreate(queue_len, item_size);
+ return handle;
+}
+
+int audio_queue_delete(audio_queue_handle_t queue) {
+ vQueueDelete((QueueHandle_t)queue);
+ return 0;
+}
+
+int audio_queue_send(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms) {
+ int ret = 0;
+ ret = xQueueSend((QueueHandle_t)queue, item,
+ block_time_ms / portTICK_PERIOD_MS);
+ return ret;
+}
+
+int audio_queue_send_to_front(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms) {
+ int ret = 0;
+ ret = xQueueSendToFront((QueueHandle_t)queue, item,
+ block_time_ms / portTICK_PERIOD_MS);
+ return ret;
+}
+
+int audio_queue_recv(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms) {
+ int ret = 0;
+ ret = xQueueReceive((QueueHandle_t)queue, item,
+ block_time_ms / portTICK_PERIOD_MS);
+ return ret;
+}
+
+int audio_queue_message_available(const audio_queue_handle_t queue) {
+ int ret = 0;
+ ret = uxQueueMessagesWaiting((QueueHandle_t)queue);
+ return ret;
+}
+
+int audio_queue_spaces_available(const audio_queue_handle_t queue) {
+ int ret = 0;
+ ret = uxQueueSpacesAvailable((QueueHandle_t)queue);
+ return ret;
+}
diff --git a/components/audio_sal/audio_sys.c b/components/audio_sal/audio_sys.c
index 3d243e7..56f54cb 100644
--- a/components/audio_sal/audio_sys.c
+++ b/components/audio_sal/audio_sys.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,57 +18,52 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "audio_sys.h"
+
+#include
+#include
+
#include "audio_error.h"
#include "audio_mem.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "soc/soc_memory_layout.h"
-#include
static const char *TAG = "AUDIO_SYS";
-#define ARRAY_SIZE_OFFSET \
- 8 // Increase this if audio_sys_get_real_time_stats returns
- // ESP_ERR_INVALID_SIZE
-#define AUDIO_SYS_TASKS_ELAPSED_TIME_MS 1000 // Period of stats measurement
+#define ARRAY_SIZE_OFFSET \
+ 8 // Increase this if audio_sys_get_real_time_stats returns
+ // ESP_ERR_INVALID_SIZE
+#define AUDIO_SYS_TASKS_ELAPSED_TIME_MS 1000 // Period of stats measurement
-const char *task_state[]
- = { "Running", "Ready", "Blocked", "Suspended", "Deleted" };
+const char *task_state[] = {"Running", "Ready", "Blocked", "Suspended",
+ "Deleted"};
/** @brief
* "Extr": Allocated task stack from psram, "Intr": Allocated task stack from
* internel
*/
-const char *task_stack[] = { "Extr", "Intr" };
+const char *task_stack[] = {"Extr", "Intr"};
-int
-audio_sys_get_tick_by_time_ms (int ms)
-{
- return (ms / portTICK_PERIOD_MS);
-}
+int audio_sys_get_tick_by_time_ms(int ms) { return (ms / portTICK_PERIOD_MS); }
-int64_t
-audio_sys_get_time_ms (void)
-{
+int64_t audio_sys_get_time_ms(void) {
struct timeval te;
- gettimeofday (&te, NULL);
+ gettimeofday(&te, NULL);
int64_t milliseconds = te.tv_sec * 1000LL + te.tv_usec / 1000;
return milliseconds;
}
-esp_err_t
-audio_sys_get_real_time_stats (void)
-{
-#if (CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID \
- && CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS)
+esp_err_t audio_sys_get_real_time_stats(void) {
+#if (CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID && \
+ CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS)
TaskStatus_t *start_array = NULL, *end_array = NULL;
UBaseType_t start_array_size, end_array_size;
uint32_t start_run_time, end_run_time;
@@ -76,122 +71,111 @@ audio_sys_get_real_time_stats (void)
esp_err_t ret;
// Allocate array to store current task states
- start_array_size = uxTaskGetNumberOfTasks () + ARRAY_SIZE_OFFSET;
- start_array = audio_malloc (sizeof (TaskStatus_t) * start_array_size);
- AUDIO_MEM_CHECK (TAG, start_array, {
+ start_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET;
+ start_array = audio_malloc(sizeof(TaskStatus_t) * start_array_size);
+ AUDIO_MEM_CHECK(TAG, start_array, {
ret = ESP_FAIL;
goto exit;
});
// Get current task states
- start_array_size
- = uxTaskGetSystemState (start_array, start_array_size, &start_run_time);
- if (start_array_size == 0)
- {
- ESP_LOGE (TAG, "Insufficient array size for uxTaskGetSystemState. "
- "Trying increasing ARRAY_SIZE_OFFSET");
- ret = ESP_FAIL;
- goto exit;
- }
+ start_array_size =
+ uxTaskGetSystemState(start_array, start_array_size, &start_run_time);
+ if (start_array_size == 0) {
+ ESP_LOGE(TAG,
+ "Insufficient array size for uxTaskGetSystemState. Trying "
+ "increasing ARRAY_SIZE_OFFSET");
+ ret = ESP_FAIL;
+ goto exit;
+ }
- vTaskDelay (pdMS_TO_TICKS (AUDIO_SYS_TASKS_ELAPSED_TIME_MS));
+ vTaskDelay(pdMS_TO_TICKS(AUDIO_SYS_TASKS_ELAPSED_TIME_MS));
// Allocate array to store tasks states post delay
- end_array_size = uxTaskGetNumberOfTasks () + ARRAY_SIZE_OFFSET;
- end_array = audio_malloc (sizeof (TaskStatus_t) * end_array_size);
- AUDIO_MEM_CHECK (TAG, start_array, {
+ end_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET;
+ end_array = audio_malloc(sizeof(TaskStatus_t) * end_array_size);
+ AUDIO_MEM_CHECK(TAG, start_array, {
ret = ESP_FAIL;
goto exit;
});
// Get post delay task states
- end_array_size
- = uxTaskGetSystemState (end_array, end_array_size, &end_run_time);
- if (end_array_size == 0)
- {
- ESP_LOGE (TAG, "Insufficient array size for uxTaskGetSystemState. "
- "Trying increasing ARRAY_SIZE_OFFSET");
- ret = ESP_FAIL;
- goto exit;
- }
+ end_array_size =
+ uxTaskGetSystemState(end_array, end_array_size, &end_run_time);
+ if (end_array_size == 0) {
+ ESP_LOGE(TAG,
+ "Insufficient array size for uxTaskGetSystemState. Trying "
+ "increasing ARRAY_SIZE_OFFSET");
+ ret = ESP_FAIL;
+ goto exit;
+ }
// Calculate total_elapsed_time in units of run time stats clock period.
uint32_t total_elapsed_time = (end_run_time - start_run_time);
- if (total_elapsed_time == 0)
- {
- ESP_LOGE (TAG, "Delay duration too short. Trying increasing "
- "AUDIO_SYS_TASKS_ELAPSED_TIME_MS");
- ret = ESP_FAIL;
- goto exit;
- }
+ if (total_elapsed_time == 0) {
+ ESP_LOGE(TAG,
+ "Delay duration too short. Trying increasing "
+ "AUDIO_SYS_TASKS_ELAPSED_TIME_MS");
+ ret = ESP_FAIL;
+ goto exit;
+ }
- ESP_LOGI (TAG, "| Task | Run Time | Per | Prio | HWM "
- "| State | CoreId | Stack ");
+ ESP_LOGI(TAG,
+ "| Task | Run Time | Per | Prio | HWM | State "
+ " | CoreId | Stack ");
// Match each task in start_array to those in the end_array
- for (int i = 0; i < start_array_size; i++)
- {
- for (int j = 0; j < end_array_size; j++)
- {
- if (start_array[i].xHandle == end_array[j].xHandle)
- {
+ for (int i = 0; i < start_array_size; i++) {
+ for (int j = 0; j < end_array_size; j++) {
+ if (start_array[i].xHandle == end_array[j].xHandle) {
+ task_elapsed_time =
+ end_array[j].ulRunTimeCounter - start_array[i].ulRunTimeCounter;
+ percentage_time = (task_elapsed_time * 100UL) /
+ (total_elapsed_time * portNUM_PROCESSORS);
+ ESP_LOGI(
+ TAG, "| %-17s | %-11d |%2d%% | %-4u | %-9u | %-7s | %-8x | %s",
+ start_array[i].pcTaskName, (int)task_elapsed_time,
+ (int)percentage_time, start_array[i].uxCurrentPriority,
+ (int)start_array[i].usStackHighWaterMark,
+ task_state[(start_array[i].eCurrentState)], start_array[i].xCoreID,
+ task_stack[esp_ptr_internal(
+ pxTaskGetStackStart(start_array[i].xHandle))]);
- task_elapsed_time = end_array[j].ulRunTimeCounter
- - start_array[i].ulRunTimeCounter;
- percentage_time = (task_elapsed_time * 100UL)
- / (total_elapsed_time * portNUM_PROCESSORS);
- ESP_LOGI (
- TAG,
- "| %-17s | %-11d |%2d%% | %-4u | %-9u | %-7s | %-8x | %s",
- start_array[i].pcTaskName, task_elapsed_time,
- percentage_time, start_array[i].uxCurrentPriority,
- start_array[i].usStackHighWaterMark,
- task_state[(start_array[i].eCurrentState)],
- start_array[i].xCoreID,
- task_stack[esp_ptr_internal (
- pxTaskGetStackStart (start_array[i].xHandle))]);
-
- // Mark that task have been matched by overwriting their handles
- start_array[i].xHandle = NULL;
- end_array[j].xHandle = NULL;
- break;
- }
- }
+ // Mark that task have been matched by overwriting their handles
+ start_array[i].xHandle = NULL;
+ end_array[j].xHandle = NULL;
+ break;
+ }
}
+ }
// Print unmatched tasks
- for (int i = 0; i < start_array_size; i++)
- {
- if (start_array[i].xHandle != NULL)
- {
- ESP_LOGI (TAG, "| %s | Deleted", start_array[i].pcTaskName);
- }
+ for (int i = 0; i < start_array_size; i++) {
+ if (start_array[i].xHandle != NULL) {
+ ESP_LOGI(TAG, "| %s | Deleted", start_array[i].pcTaskName);
}
- for (int i = 0; i < end_array_size; i++)
- {
- if (end_array[i].xHandle != NULL)
- {
- ESP_LOGI (TAG, "| %s | Created", end_array[i].pcTaskName);
- }
+ }
+ for (int i = 0; i < end_array_size; i++) {
+ if (end_array[i].xHandle != NULL) {
+ ESP_LOGI(TAG, "| %s | Created", end_array[i].pcTaskName);
}
- printf ("\n");
+ }
+ printf("\n");
ret = ESP_OK;
-exit: // Common return path
- if (start_array)
- {
- audio_free (start_array);
- start_array = NULL;
- }
- if (end_array)
- {
- audio_free (end_array);
- end_array = NULL;
- }
+exit: // Common return path
+ if (start_array) {
+ audio_free(start_array);
+ start_array = NULL;
+ }
+ if (end_array) {
+ audio_free(end_array);
+ end_array = NULL;
+ }
return ret;
#else
- ESP_LOGW (TAG,
- "Please enbale `CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID` and "
- "`CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS` in menuconfig");
+ ESP_LOGW(TAG,
+ "Please enbale `CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID` and "
+ "`CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS` in menuconfig");
return ESP_FAIL;
#endif
}
diff --git a/components/audio_sal/audio_thread.c b/components/audio_sal/audio_thread.c
index 39ea36a..84aaa1c 100644
--- a/components/audio_sal/audio_thread.c
+++ b/components/audio_sal/audio_thread.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,105 +18,104 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
+#include "audio_thread.h"
+
+#include "audio_error.h"
+#include "audio_idf_version.h"
+#include "audio_mem.h"
+#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/task.h"
-#include "audio_error.h"
-#include "audio_mem.h"
-#include "audio_thread.h"
-#include "esp_log.h"
-
static const char *TAG = "AUDIO_THREAD";
-BaseType_t __attribute__ ((weak)) xTaskCreateRestrictedPinnedToCore (
- const TaskParameters_t *const pxTaskDefinition,
- TaskHandle_t *pxCreatedTask, const BaseType_t xCoreID)
-{
- ESP_LOGE (TAG,
- "Not found right %s.\r\nPlease enter IDF-PATH with \"cd "
- "$IDF_PATH\" and apply the IDF patch with \"git apply "
- "$ADF_PATH/idf_patches/idf_v3.3_freertos.patch\" first\r\n",
- __func__);
+#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
+#define TASK_HANDLE_T TaskHandle_t
+#else
+#define TASK_HANDLE_T xTaskHandle
+#endif
+
+BaseType_t __attribute__((weak)) xTaskCreateRestrictedPinnedToCore(
+ const TaskParameters_t *const pxTaskDefinition, TaskHandle_t *pxCreatedTask,
+ const BaseType_t xCoreID) {
+ ESP_LOGE(TAG,
+ "Not found right %s.\r\nPlease enter IDF-PATH with \"cd $IDF_PATH\" "
+ "and apply the IDF patch with \"git apply "
+ "$ADF_PATH/idf_patches/idf_%.4s_freertos.patch\" first\r\n",
+ __func__, IDF_VER);
return pdFALSE;
}
-esp_err_t
-audio_thread_create (audio_thread_t *p_handle, const char *name,
- void (*main_func) (void *arg), void *arg, uint32_t stack,
- int prio, bool stack_in_ext, int core_id)
-{
+esp_err_t audio_thread_create(audio_thread_t *p_handle, const char *name,
+ void (*main_func)(void *arg), void *arg,
+ uint32_t stack, int prio, bool stack_in_ext,
+ int core_id) {
StackType_t *task_stack = NULL;
- if (stack_in_ext && audio_mem_spiram_stack_is_enabled ())
- {
- /*
- * Note: 1. ESP32-ECO3 chip support stack on external memory only.
- * 2. Make sure selected the `CONFIG_SPIRAM_BOOT_INIT` and
- * `CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` by `make menuconfig`
- * 3. Please apply the
- * $ADF_PATH/idf_patches/idf_v3.3_freertos.patch
- *
- */
- ESP_LOGI (TAG, "The %s task allocate stack on external memory", name);
- /* task_stack freed by freertos*/
- task_stack = (StackType_t *)audio_calloc (1, stack);
- AUDIO_MEM_CHECK (TAG, task_stack, goto audio_thread_create_error);
- TaskParameters_t xRegParameters
- = { .pvTaskCode = main_func,
- .pcName = name,
- .usStackDepth = stack,
- .pvParameters = arg,
- .uxPriority = prio | portPRIVILEGE_BIT,
- .puxStackBuffer = task_stack,
- .xRegions = { {
- .pvBaseAddress = 0x00,
- .ulLengthInBytes = 0x00,
- .ulParameters = 0x00,
- } } };
- if (xTaskCreateRestrictedPinnedToCore (&xRegParameters,
- (xTaskHandle)p_handle, core_id)
- != pdPASS)
- {
- ESP_LOGE (TAG, "Error creating RestrictedPinnedToCore %s", name);
- goto audio_thread_create_error;
- }
+ if (stack_in_ext && audio_mem_spiram_stack_is_enabled()) {
+ /*
+ * Note: 1. ESP32-ECO3 chip support stack on external memory only.
+ * 2. Make sure selected the `CONFIG_SPIRAM_BOOT_INIT` and
+ * `CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` by `make menuconfig`
+ * 3. Please apply the $ADF_PATH/idf_patches/idf_v3.3_freertos.patch
+ *
+ */
+ ESP_LOGI(TAG, "The %s task allocate stack on external memory", name);
+ /* task_stack freed by freertos*/
+ task_stack = (StackType_t *)audio_calloc(1, stack);
+ AUDIO_MEM_CHECK(TAG, task_stack, goto audio_thread_create_error);
+ TaskParameters_t xRegParameters = {.pvTaskCode = main_func,
+ .pcName = name,
+ .usStackDepth = stack,
+ .pvParameters = arg,
+ .uxPriority = prio | portPRIVILEGE_BIT,
+ .puxStackBuffer = task_stack,
+ .xRegions = {{
+ .pvBaseAddress = 0x00,
+ .ulLengthInBytes = 0x00,
+ .ulParameters = 0x00,
+ }}};
+ if (xTaskCreateRestrictedPinnedToCore(
+ &xRegParameters, (TASK_HANDLE_T *)p_handle, core_id) != pdPASS) {
+ ESP_LOGE(TAG, "Error creating RestrictedPinnedToCore %s", name);
+ goto audio_thread_create_error;
}
- else
- {
- if (xTaskCreatePinnedToCore (main_func, name, stack, arg, prio,
- (xTaskHandle)p_handle, core_id)
- != pdPASS)
- {
- ESP_LOGE (TAG, "Error creating task %s", name);
- goto audio_thread_create_error;
- }
+ } else {
+ if (stack_in_ext) {
+ ESP_LOGW(
+ TAG,
+ "Make sure selected the `CONFIG_SPIRAM_BOOT_INIT` and "
+ "`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` by `make menuconfig`");
}
+ if (xTaskCreatePinnedToCore(main_func, name, stack, arg, prio,
+ (TASK_HANDLE_T *)p_handle, core_id) != pdPASS) {
+ ESP_LOGE(TAG, "Error creating task %s", name);
+ goto audio_thread_create_error;
+ } else {
+ ESP_LOGI(TAG, "The %s task allocate stack on internal memory", name);
+ }
+ }
return ESP_OK;
audio_thread_create_error:
- if (task_stack)
- {
- audio_free (task_stack);
- }
+ if (task_stack) {
+ audio_free(task_stack);
+ }
return ESP_FAIL;
}
-esp_err_t
-audio_thread_cleanup (audio_thread_t *p_handle)
-{
+esp_err_t audio_thread_cleanup(audio_thread_t *p_handle) {
// TODO nothing
return ESP_OK;
}
-esp_err_t
-audio_thread_delete_task (audio_thread_t *p_handle)
-{
- vTaskDelete (NULL);
+esp_err_t audio_thread_delete_task(audio_thread_t *p_handle) {
+ vTaskDelete(NULL);
return ESP_OK; /* Control never reach here if this is self delete */
}
diff --git a/components/audio_sal/audio_url.c b/components/audio_sal/audio_url.c
index aaff637..ed0a679 100644
--- a/components/audio_sal/audio_url.c
+++ b/components/audio_sal/audio_url.c
@@ -1,66 +1,53 @@
-#include "audio_error.h"
-#include "audio_mem.h"
-#include "esp_log.h"
#include
#include
+#include "audio_error.h"
+#include "audio_mem.h"
+#include "esp_log.h"
+
static char *TAG = "AUDIO_URL";
-static unsigned char
-char_to_hex (unsigned char x)
-{
+static unsigned char char_to_hex(unsigned char x) {
return x > 9 ? x + 0x37 : x + 0x30;
}
-char *
-audio_url_encode (const char *str)
-{
- int out_len = (strlen (str) + 1) * 3;
- char *final = audio_malloc (out_len);
- AUDIO_MEM_CHECK (TAG, final, return NULL);
+char *audio_url_encode(const char *str) {
+ int out_len = (strlen(str) + 1) * 3;
+ char *final = audio_malloc(out_len);
+ AUDIO_MEM_CHECK(TAG, final, return NULL);
char *tmp = final;
- for (size_t i = 0; i < strlen (str); i++)
- {
- if (isalnum ((unsigned char)str[i]) || (str[i] == '-') || (str[i] == '_')
- || (str[i] == '.') || (str[i] == '!') || (str[i] == '@')
- || (str[i] == '#') || (str[i] == '$') || (str[i] == '&')
- || (str[i] == '*') || (str[i] == '(') || (str[i] == ')')
- || (str[i] == '=') || (str[i] == ':') || (str[i] == '/')
- || (str[i] == ',') || (str[i] == ';') || (str[i] == '?')
- || (str[i] == '+') || (str[i] == '\'') || (str[i] == '~'))
- {
- *final++ = str[i];
- }
- else
- {
- *final++ = '%';
- *final++ = char_to_hex ((unsigned char)str[i] >> 4);
- *final++ = char_to_hex ((unsigned char)str[i] % 16);
- }
+ for (size_t i = 0; i < strlen(str); i++) {
+ if (isalnum((unsigned char)str[i]) || (str[i] == '-') || (str[i] == '_') ||
+ (str[i] == '.') || (str[i] == '!') || (str[i] == '@') ||
+ (str[i] == '#') || (str[i] == '$') || (str[i] == '&') ||
+ (str[i] == '*') || (str[i] == '(') || (str[i] == ')') ||
+ (str[i] == '=') || (str[i] == ':') || (str[i] == '/') ||
+ (str[i] == ',') || (str[i] == ';') || (str[i] == '?') ||
+ (str[i] == '+') || (str[i] == '\'') || (str[i] == '~')) {
+ *final++ = str[i];
+ } else {
+ *final++ = '%';
+ *final++ = char_to_hex((unsigned char)str[i] >> 4);
+ *final++ = char_to_hex((unsigned char)str[i] % 16);
}
+ }
*final = 0;
return tmp;
}
-char *
-audio_url_decode (const char *str)
-{
- char *final = audio_malloc (strlen (str) + 1);
- AUDIO_MEM_CHECK (TAG, final, return NULL);
+char *audio_url_decode(const char *str) {
+ char *final = audio_malloc(strlen(str) + 1);
+ AUDIO_MEM_CHECK(TAG, final, return NULL);
char *tmp = final;
- while (*str)
- {
- if (*str == '%')
- {
- char buffer[3] = { str[1], str[2], 0 };
- *final++ = strtol (buffer, NULL, 16);
- str += 3;
- }
- else
- {
- *final++ = *str++;
- }
+ while (*str) {
+ if (*str == '%') {
+ char buffer[3] = {str[1], str[2], 0};
+ *final++ = strtol(buffer, NULL, 16);
+ str += 3;
+ } else {
+ *final++ = *str++;
}
+ }
*final = 0;
return tmp;
}
diff --git a/components/audio_sal/include/audio_error.h b/components/audio_sal/include/audio_error.h
index 130bc4f..31e2335 100644
--- a/components/audio_sal/include/audio_error.h
+++ b/components/audio_sal/include/audio_error.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,26 +30,25 @@
#include "esp_err.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#ifndef __FILENAME__
#define __FILENAME__ __FILE__
#endif
-#define ESP_ERR_ADF_BASE \
- 0x80000 /*!< Starting number of ESP-ADF error codes \
+#define ESP_ERR_ADF_BASE \
+ 0x80000 /*!< Starting number of ESP-ADF error codes \
*/
- /*
- * ESP-ADF error code field start from 0x80000, end of the -1.
- * The whole area is divided into series independent modules.
- * The range of each module is 0x1000.
- * //////////////////////////////////////////////////////////
- * ESP-Audio module starting on 0x81000;
- *
- */
+/*
+ * ESP-ADF error code field start from 0x80000, end of the -1.
+ * The whole area is divided into series independent modules.
+ * The range of each module is 0x1000.
+ * //////////////////////////////////////////////////////////
+ * ESP-Audio module starting on 0x81000;
+ *
+ */
#define ESP_ERR_ADF_NO_ERROR ESP_OK
#define ESP_ERR_ADF_NO_FAIL ESP_FAIL
@@ -67,22 +66,28 @@ extern "C"
#define ESP_ERR_ADF_INITIALIZED ESP_ERR_ADF_BASE + 10
#define ESP_ERR_ADF_UNINITIALIZED ESP_ERR_ADF_BASE + 11
-#define AUDIO_CHECK(TAG, a, action, msg) \
- if (!(a)) \
- { \
- ESP_LOGE (TAG, "%s:%d (%s): %s", __FILENAME__, __LINE__, __FUNCTION__, \
- msg); \
- action; \
- }
+#define AUDIO_CHECK(TAG, a, action, msg) \
+ if (!(a)) { \
+ ESP_LOGE(TAG, "%s:%d (%s): %s", __FILENAME__, __LINE__, __FUNCTION__, \
+ msg); \
+ action; \
+ }
-#define AUDIO_MEM_CHECK(TAG, a, action) \
- AUDIO_CHECK (TAG, a, action, "Memory exhausted")
+#define AUDIO_RET_ON_FALSE(TAG, a, action, msg) \
+ if (unlikely(a == ESP_FAIL)) { \
+ ESP_LOGE(TAG, "%s:%d (%s): %s", __FILENAME__, __LINE__, __FUNCTION__, \
+ msg); \
+ action; \
+ }
-#define AUDIO_NULL_CHECK(TAG, a, action) \
- AUDIO_CHECK (TAG, a, action, "Got NULL Pointer")
+#define AUDIO_MEM_CHECK(TAG, a, action) \
+ AUDIO_CHECK(TAG, a, action, "Memory exhausted")
-#define AUDIO_ERROR(TAG, str) \
- ESP_LOGE (TAG, "%s:%d (%s): %s", __FILENAME__, __LINE__, __FUNCTION__, str)
+#define AUDIO_NULL_CHECK(TAG, a, action) \
+ AUDIO_CHECK(TAG, a, action, "Got NULL Pointer")
+
+#define AUDIO_ERROR(TAG, str) \
+ ESP_LOGE(TAG, "%s:%d (%s): %s", __FILENAME__, __LINE__, __FUNCTION__, str)
#define ESP_EXISTS (ESP_OK + 1)
diff --git a/components/audio_sal/include/audio_idf_version.h b/components/audio_sal/include/audio_idf_version.h
new file mode 100644
index 0000000..7827fa4
--- /dev/null
+++ b/components/audio_sal/include/audio_idf_version.h
@@ -0,0 +1,44 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __AUDIO_IDF_VERSION_H__
+#define __AUDIO_IDF_VERSION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if __has_include("esp_idf_version.h")
+#include "esp_idf_version.h"
+#else
+#define ESP_IDF_VERSION_VAL(major, minor, patch) 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef __AUDIO_IDF_VERSION_H__ */
diff --git a/components/audio_sal/include/audio_mem.h b/components/audio_sal/include/audio_mem.h
index 4452153..e6fb3c2 100644
--- a/components/audio_sal/include/audio_mem.h
+++ b/components/audio_sal/include/audio_mem.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,114 +30,113 @@
#include
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Malloc memory in ADF
- *
- * @param[in] size memory size
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- void *audio_malloc (size_t size);
+/**
+ * @brief Malloc memory in ADF
+ *
+ * @param[in] size memory size
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+void *audio_malloc(size_t size);
- /**
- * @brief Free memory in ADF
- *
- * @param[in] ptr memory pointer
- *
- * @return
- * - void
- */
- void audio_free (void *ptr);
+/**
+ * @brief Free memory in ADF
+ *
+ * @param[in] ptr memory pointer
+ *
+ * @return
+ * - void
+ */
+void audio_free(void *ptr);
- /**
- * @brief Malloc memory in ADF, if spi ram is enabled, it will malloc memory
- * in the spi ram
- *
- * @param[in] nmemb number of block
- * @param[in] size block memory size
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- void *audio_calloc (size_t nmemb, size_t size);
+/**
+ * @brief Malloc memory in ADF, if spi ram is enabled, it will malloc memory in
+ * the spi ram
+ *
+ * @param[in] nmemb number of block
+ * @param[in] size block memory size
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+void *audio_calloc(size_t nmemb, size_t size);
- /**
- * @brief Malloc memory in ADF, it will malloc to internal memory
- *
- * @param[in] nmemb number of block
- * @param[in] size block memory size
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- void *audio_calloc_inner (size_t nmemb, size_t size);
+/**
+ * @brief Malloc memory in ADF, it will malloc to internal memory
+ *
+ * @param[in] nmemb number of block
+ * @param[in] size block memory size
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+void *audio_calloc_inner(size_t nmemb, size_t size);
- /**
- * @brief Print heap memory status
- *
- * @param[in] tag tag of log
- * @param[in] line line of log
- * @param[in] func function name of log
- *
- * @return
- * - void
- */
- void audio_mem_print (const char *tag, int line, const char *func);
+/**
+ * @brief Print heap memory status
+ *
+ * @param[in] tag tag of log
+ * @param[in] line line of log
+ * @param[in] func function name of log
+ *
+ * @return
+ * - void
+ */
+void audio_mem_print(const char *tag, int line, const char *func);
- /**
- * @brief Reallocate memory in ADF, if spi ram is enabled, it will allocate
- * memory in the spi ram
- *
- * @param[in] ptr memory pointer
- * @param[in] size block memory size
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- void *audio_realloc (void *ptr, size_t size);
+/**
+ * @brief Reallocate memory in ADF, if spi ram is enabled, it will allocate
+ * memory in the spi ram
+ *
+ * @param[in] ptr memory pointer
+ * @param[in] size block memory size
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+void *audio_realloc(void *ptr, size_t size);
- /**
- * @brief Duplicate given string.
- *
- * Allocate new memory, copy contents of given string into it and
- * return the pointer
- *
- * @param[in] str String to be duplicated
- *
- * @return
- * - Pointer to new malloc'ed string
- * - NULL otherwise
- */
- char *audio_strdup (const char *str);
+/**
+ * @brief Duplicate given string.
+ *
+ * Allocate new memory, copy contents of given string into it and
+ * return the pointer
+ *
+ * @param[in] str String to be duplicated
+ *
+ * @return
+ * - Pointer to new malloc'ed string
+ * - NULL otherwise
+ */
+char *audio_strdup(const char *str);
- /**
- * @brief SPI ram is enabled or not
- *
- * @return
- * - true, spi ram is enabled
- * - false, spi ram is not enabled
- */
- bool audio_mem_spiram_is_enabled (void);
+/**
+ * @brief SPI ram is enabled or not
+ *
+ * @return
+ * - true, spi ram is enabled
+ * - false, spi ram is not enabled
+ */
+bool audio_mem_spiram_is_enabled(void);
- /**
- * @brief Stack on external SPI ram is enabled or not
- *
- * @return
- * - true, stack on spi ram is enabled
- * - false, stack on spi ram is not enabled
- */
- bool audio_mem_spiram_stack_is_enabled (void);
+/**
+ * @brief Stack on external SPI ram is enabled or not
+ *
+ * @return
+ * - true, stack on spi ram is enabled
+ * - false, stack on spi ram is not enabled
+ */
+bool audio_mem_spiram_stack_is_enabled(void);
-#define AUDIO_MEM_SHOW(x) audio_mem_print (x, __LINE__, __func__)
+#define AUDIO_MEM_SHOW(x) audio_mem_print(x, __LINE__, __func__)
#ifdef __cplusplus
}
diff --git a/components/audio_sal/include/audio_mutex.h b/components/audio_sal/include/audio_mutex.h
index 0a3c23f..5b2e44c 100644
--- a/components/audio_sal/include/audio_mutex.h
+++ b/components/audio_sal/include/audio_mutex.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,33 +18,60 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
-#ifndef _AUDIO_MUTEX_H_
-#define _AUDIO_MUTEX_H_
+#ifndef __AUDIO_MUTEX_H__
+#define __AUDIO_MUTEX_H__
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/task.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
-#define mutex_lock(x) \
- while (xSemaphoreTake (x, portMAX_DELAY) != pdPASS) \
- ;
-#define mutex_unlock(x) xSemaphoreGive (x)
-#define mutex_create() xSemaphoreCreateMutex ()
-#define mutex_destroy(x) vSemaphoreDelete (x)
+/**
+ * @brief Create a mutex instance
+ *
+ * @return - Others: A mutex handle is returned
+ * - NULL: Failed to create mutex
+ */
+void *mutex_create(void);
+
+/**
+ * @brief Delete the mutex instance
+ *
+ * @param mutex The pointer to mutex handle
+ *
+ * @return - 0: Success to delete mutex
+ */
+int mutex_destroy(void *mutex);
+
+/**
+ * @brief Take the mutex
+ *
+ * @param mutex The pointer to mutex handle
+ *
+ * @return - 0: The lock was obtained
+ */
+int mutex_lock(void *mutex);
+
+/**
+ * @brief Release the mutex
+ *
+ * @param mutex The pointer to mutex handle
+ *
+ * @return - 0: The lock was released
+ */
+int mutex_unlock(void *mutex);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* #ifndef __AUDIO_MUTEX_H__ */
diff --git a/components/audio_sal/include/audio_queue.h b/components/audio_sal/include/audio_queue.h
new file mode 100644
index 0000000..5f6eb3a
--- /dev/null
+++ b/components/audio_sal/include/audio_queue.h
@@ -0,0 +1,131 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __AUDIO_QUEUE_H__
+#define __AUDIO_QUEUE_H__
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *audio_queue_handle_t;
+
+/**
+ * @brief Allocate queue instance with given item size and length
+ *
+ * @param queue_len The maximum number of items that the queue can
+ * contain
+ * @param item_size The number of bytes each item in the queue will
+ * require
+ *
+ * @return - Others: Queue handle is returned
+ * - NULL: Failed to create queue handle
+ */
+audio_queue_handle_t audio_queue_create(uint32_t queue_len, uint32_t item_size);
+
+/**
+ * @brief Delete the queue
+ *
+ * @param queue A pointer to queue handle
+ *
+ * @return - 0: The queue deleted successfully
+ */
+int audio_queue_delete(audio_queue_handle_t queue);
+
+/**
+ * @brief Post an item on given queue
+ *
+ * @param queue A pointer to queue handle
+ * @param item A pointer to the item that is to be placed on
+ * the queue
+ * @param block_time_ms The maximum amount of millisecond the task
+ * should block waiting for space to become available on the queue, should it
+ * already be full
+ *
+ * @return - 0: The item was successfully posted
+ * - Otherwise: Queue full error
+ */
+int audio_queue_send(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms);
+
+/**
+ * @brief Post an item to the front of a queue
+ *
+ * @param queue A pointer to queue handle
+ * @param item A pointer to the item that is to be placed on
+ * the queue
+ * @param block_time_ms The maximum amount of millisecond the task
+ * should block waiting for space to become available on the queue, should it
+ * already be full
+ *
+ * @return - 0: The item was successfully posted
+ * - Otherwise: Queue full error
+ */
+int audio_queue_send_to_front(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms);
+
+/**
+ * @brief Receive an item from a queue.
+ *
+ * @param queue A pointer to queue handle
+ * @param item A pointer to the item that is to be placed on
+ * the queue
+ * @param block_time_ms The maximum amount of millisecond the task
+ * should block waiting for space to become available on the queue, should it
+ * already be full
+ *
+ * @return - 0: An item was successfully received from the
+ * queue
+ * - Otherwise: Failed to received queue
+ */
+int audio_queue_recv(audio_queue_handle_t queue, void *item,
+ uint32_t block_time_ms);
+
+/**
+ * @brief Return the number of messages stored in a queue.
+ *
+ * @param queue A pointer to queue handle
+ *
+ * @return The number of messages available in the queue.
+ */
+int audio_queue_message_available(const audio_queue_handle_t queue);
+
+/**
+ * @brief Return the number of free spaces available in a queue.
+ *
+ * @param queue A pointer to queue handle
+ *
+ * @return The number of spaces available in the queue.
+ */
+int audio_queue_spaces_available(const audio_queue_handle_t queue);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef __AUDIO_QUEUE_H__ */
diff --git a/components/audio_sal/include/audio_sys.h b/components/audio_sal/include/audio_sys.h
index 048de4c..fb2fa87 100644
--- a/components/audio_sal/include/audio_sys.h
+++ b/components/audio_sal/include/audio_sys.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -30,52 +30,57 @@
#include "esp_err.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
#define ___STR___(x) #x
-#define STR_AUDIO(x) ___STR___ (x)
+#define STR_AUDIO(x) ___STR___(x)
- /**
- * @brief Get system ticks by given millisecond
- *
- * @param[in] ms millisecond
- *
- * @return
- * - tick
- */
- int audio_sys_get_tick_by_time_ms (int ms);
+#if defined(__GNUC__) && (__GNUC__ >= 7)
+#define FALL_THROUGH __attribute__((fallthrough))
+#else
+#define FALL_THROUGH ((void)0)
+#endif /* __GNUC__ >= 7 */
- /**
- * @brief Get system time with millisecond
- *
- * @return
- * - time with millisecond
- */
- int64_t audio_sys_get_time_ms (void);
+/**
+ * @brief Get system ticks by given millisecond
+ *
+ * @param[in] ms millisecond
+ *
+ * @return
+ * - tick
+ */
+int audio_sys_get_tick_by_time_ms(int ms);
- /**
- * @brief Function to print the CPU usage of tasks over a given
- * AUDIO_SYS_TASKS_ELAPSED_TIME_MS.
- *
- * This function will measure and print the CPU usage of tasks over a
- * specified number of ticks (i.e. real time stats). This is implemented by
- * simply calling uxTaskGetSystemState() twice separated by a delay, then
- * calculating the differences of task run times before and after the delay.
- *
- * @note If any tasks are added or removed during the delay, the stats of
- * those tasks will not be printed.
- * @note This function should be called from a high priority task to
- * minimize inaccuracies with delays.
- * @note When running in dual core mode, each core will correspond to 50%
- * of the run time.
- *
- * @return
- * - ESP_OK
- * - ESP_FIAL
- */
- esp_err_t audio_sys_get_real_time_stats (void);
+/**
+ * @brief Get system time with millisecond
+ *
+ * @return
+ * - time with millisecond
+ */
+int64_t audio_sys_get_time_ms(void);
+
+/**
+ * @brief Function to print the CPU usage of tasks over a given
+ * AUDIO_SYS_TASKS_ELAPSED_TIME_MS.
+ *
+ * This function will measure and print the CPU usage of tasks over a specified
+ * number of ticks (i.e. real time stats). This is implemented by simply calling
+ * uxTaskGetSystemState() twice separated by a delay, then calculating the
+ * differences of task run times before and after the delay.
+ *
+ * @note If any tasks are added or removed during the delay, the stats of
+ * those tasks will not be printed.
+ * @note This function should be called from a high priority task to minimize
+ * inaccuracies with delays.
+ * @note When running in dual core mode, each core will correspond to 50% of
+ * the run time.
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+esp_err_t audio_sys_get_real_time_stats(void);
#ifdef __cplusplus
}
diff --git a/components/audio_sal/include/audio_thread.h b/components/audio_sal/include/audio_thread.h
index adb96ac..960bc79 100644
--- a/components/audio_sal/include/audio_thread.h
+++ b/components/audio_sal/include/audio_thread.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -31,64 +31,62 @@
#include "stdbool.h"
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
-#define audio_thread_t xTaskHandle
+typedef void *audio_thread_t;
- /**
- * @brief Allocate handle if not allocated and create a thread
- *
- * @param p_handle pointer to audio_thread_t handle
- * @param name Task name
- * @param main_func The function which task will execute
- * @param stack Task stack
- * @param prio Task priority
- * @param stack_in_ext If task should reside in external memory
- * @param core_id Core to which task will be pinned
- *
- * @return - ESP_OK : Task creation successful
- * - ESP_FAIL: Failed to create task
- *
- * @note - Please apply the
- * $ADF_PATH/idf_patches/idf_v3.3/4.x_freertos.patch first.
- * - Please enable support for external RAM and `Allow external
- * memory as an argument to xTaskCreateStatic` to be able to use external
- * memory for task stack, namely `CONFIG_SPIRAM_BOOT_INIT=y` and
- * `CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y`.
- *
- */
- esp_err_t audio_thread_create (audio_thread_t *p_handle, const char *name,
- void (*main_func) (void *arg), void *arg,
- uint32_t stack, int prio, bool stack_in_ext,
- int core_id);
+/**
+ * @brief Allocate handle if not allocated and create a thread
+ *
+ * @param p_handle pointer to audio_thread_t handle
+ * @param name Task name
+ * @param main_func The function which task will execute
+ * @param stack Task stack
+ * @param prio Task priority
+ * @param stack_in_ext If task should reside in external memory
+ * @param core_id Core to which task will be pinned
+ *
+ * @return - ESP_OK : Task creation successful
+ * - ESP_FAIL: Failed to create task
+ *
+ * @note - Please apply the
+ * $ADF_PATH/idf_patches/idf_v3.3/4.x_freertos.patch first.
+ * - Please enable support for external RAM and `Allow external
+ * memory as an argument to xTaskCreateStatic` to be able to use external memory
+ * for task stack, namely `CONFIG_SPIRAM_BOOT_INIT=y` and
+ * `CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y`.
+ *
+ */
+esp_err_t audio_thread_create(audio_thread_t *p_handle, const char *name,
+ void (*main_func)(void *arg), void *arg,
+ uint32_t stack, int prio, bool stack_in_ext,
+ int core_id);
- /**
- * @brief Cleanup all the task memory
- *
- * @param p_handle The pointer to audio_thread_t handle
- *
- * @return - ESP_OK : Task cleanup successful
- * - ESP_FAIL: Task is already cleaned up
- *
- * @note must be called from different task after this task is
- * deleted.
- */
- esp_err_t audio_thread_cleanup (audio_thread_t *p_handle);
+/**
+ * @brief Cleanup all the task memory
+ *
+ * @param p_handle The pointer to audio_thread_t handle
+ *
+ * @return - ESP_OK : Task cleanup successful
+ * - ESP_FAIL: Task is already cleaned up
+ *
+ * @note must be called from different task after this task is deleted.
+ */
+esp_err_t audio_thread_cleanup(audio_thread_t *p_handle);
- /**
- * @brief Delete the task
- *
- * @param p_handle The pointer to audio_thread_t handle
- *
- * @return - ESP_OK : Task deleted successfully
- * - ESP_FAIL: Task is not running or cleaned up
- *
- * @note This only deletes the task and all the memory cleanup should
- * be done with `audio_thread_cleanup`
- */
- esp_err_t audio_thread_delete_task (audio_thread_t *p_handle);
+/**
+ * @brief Delete the task
+ *
+ * @param p_handle The pointer to audio_thread_t handle
+ *
+ * @return - ESP_OK : Task deleted successfully
+ * - ESP_FAIL: Task is not running or cleaned up
+ *
+ * @note This only deletes the task and all the memory cleanup should be
+ * done with `audio_thread_cleanup`
+ */
+esp_err_t audio_thread_delete_task(audio_thread_t *p_handle);
#ifdef __cplusplus
}
diff --git a/components/audio_sal/include/audio_url.h b/components/audio_sal/include/audio_url.h
index e749cec..a2aaa00 100644
--- a/components/audio_sal/include/audio_url.h
+++ b/components/audio_sal/include/audio_url.h
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,9 +18,9 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
@@ -28,39 +28,38 @@
#define __AUDIO_URL_H__
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
- /**
- * @brief Allocate new memory, encoding given string to percent-encoding and
- * return the pointer
- *
- * @note Returned pointer should be freed by user.
- * ALPHA(0x41-0x5A and 0x61-0x7A), DIGIT (0x30-0x39) and
- * "~!@#$&*()=:/,;?+'-_." are reserved.
- *
- * @param str String to be encode
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- char *audio_url_encode (const char *str);
+/**
+ * @brief Allocate new memory, encoding given string to percent-encoding and
+ * return the pointer
+ *
+ * @note Returned pointer should be freed by user.
+ * ALPHA(0x41-0x5A and 0x61-0x7A), DIGIT (0x30-0x39) and
+ * "~!@#$&*()=:/,;?+'-_." are reserved.
+ *
+ * @param str String to be encode
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+char *audio_url_encode(const char *str);
- /**
- * @brief Allocate new memory, decoding given percent-encoding string and
- * return the pointer
- *
- * @note Returned pointer should be freed by user
- *
- * @param str String to be decode
- *
- * @return
- * - valid pointer on success
- * - NULL when any errors
- */
- char *audio_url_decode (const char *str);
+/**
+ * @brief Allocate new memory, decoding given percent-encoding string and return
+ * the pointer
+ *
+ * @note Returned pointer should be freed by user
+ *
+ * @param str String to be decode
+ *
+ * @return
+ * - valid pointer on success
+ * - NULL when any errors
+ */
+char *audio_url_decode(const char *str);
#ifdef __cplusplus
}
diff --git a/components/audio_sal/include/media_os_ctype.h b/components/audio_sal/include/media_os_ctype.h
new file mode 100644
index 0000000..8f747c0
--- /dev/null
+++ b/components/audio_sal/include/media_os_ctype.h
@@ -0,0 +1,199 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __MEDIA_OS_CTYPE_H__
+#define __MEDIA_OS_CTYPE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Checks whether c is either a decimal digit or an uppercase or
+ * lowercase letter. The result is true if either isalpha or isdigit would also
+ * return true.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is either a
+ * digit or a letter. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isalnum(int c);
+
+/**
+ * @brief Checks whether c is an alphabetic letter.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is an
+ * alphabetic letter. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isalpha(int c);
+
+/**
+ * @brief Checks whether c is a blank character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a blank
+ * character. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isblank(int c);
+
+/**
+ * @brief Checks whether c is a control character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * control character. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_iscntrl(int c);
+
+/**
+ * @brief Checks whether c is a decimal digit character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * decimal digit. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isdigit(int c);
+
+/**
+ * @brief Checks whether c is a character with graphical representation.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c has a
+ * graphical representation as character. Zero (i.e., false) otherwise.
+ */
+int media_os_isgraph(int c);
+
+/**
+ * @brief Checks whether c is a lowercase letter.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * lowercase alphabetic letter. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_islower(int c);
+
+/**
+ * @brief Checks whether c is a printable character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * printable character. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isprint(int c);
+
+/**
+ * @brief Checks whether c is a punctuation character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * punctuation character. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_ispunct(int c);
+
+/**
+ * @brief Checks whether c is a white-space character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * white-space character. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isspace(int c);
+
+/**
+ * @brief Checks if parameter c is an uppercase alphabetic letter.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is an
+ * uppercase alphabetic letter. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isupper(int c);
+
+/**
+ * @brief Checks whether c is a hexdecimal digit character.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return A value different from zero (i.e., true) if indeed c is a
+ * hexadecimal digit. Zero (i.e., false) otherwise.
+ *
+ */
+int media_os_isxdigit(int c);
+
+/**
+ * @brief Converts c to its lowercase equivalent if c is an uppercase
+ * letter and has a lowercase equivalent. If no such conversion is possible, the
+ * value returned is c unchanged.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return The lowercase equivalent to c, if such value exists, or c
+ * (unchanged) otherwise. The value is returned as an int value that can be
+ * implicitly casted to char.
+ *
+ */
+int media_os_tolower(int c);
+
+/**
+ * @brief Converts c to its uppercase equivalent if c is a lowercase
+ * letter and has an uppercase equivalent. If no such conversion is possible,
+ * the value returned is c unchanged.
+ *
+ * @param[in] Character to be checked, casted as an int, or EOF.
+ *
+ * @return The uppercase equivalent to c, if such value exists, or c
+ * (unchanged) otherwise. The value is returned as an int value that can be
+ * implicitly casted to char.
+ *
+ */
+int media_os_toupper(int c);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef __MEDIA_OS_CTYPE_H__ */
diff --git a/components/audio_sal/media_os_ctype.c b/components/audio_sal/media_os_ctype.c
new file mode 100644
index 0000000..a922d64
--- /dev/null
+++ b/components/audio_sal/media_os_ctype.c
@@ -0,0 +1,55 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2021
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include "ctype.h"
+
+int media_os_isalnum(int c) { return isalnum(c); }
+
+int media_os_isalpha(int c) { return isalpha(c); }
+
+int media_os_isblank(int c) { return isblank(c); }
+
+int media_os_iscntrl(int c) { return iscntrl(c); }
+
+int media_os_isdigit(int c) { return isdigit(c); }
+
+int media_os_isgraph(int c) { return isgraph(c); }
+
+int media_os_islower(int c) { return islower(c); }
+
+int media_os_isprint(int c) { return isprint(c); }
+
+int media_os_ispunct(int c) { return ispunct(c); }
+
+int media_os_isspace(int c) { return isspace(c); }
+
+int media_os_isupper(int c) { return isupper(c); }
+
+int media_os_isxdigit(int c) { return isxdigit(c); }
+
+int media_os_tolower(int c) { return tolower(c); }
+
+int media_os_toupper(int c) { return toupper(c); }
diff --git a/components/audio_sal/test/audio_mem_test.c b/components/audio_sal/test/audio_mem_test.c
index bb3cf05..00f7854 100644
--- a/components/audio_sal/test/audio_mem_test.c
+++ b/components/audio_sal/test/audio_mem_test.c
@@ -6,10 +6,10 @@
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
* which case, it is free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
- * Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * Software without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@@ -18,72 +18,72 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*
*/
#include "audio_mem.h"
+
+#include
+
#include "esp_err.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "unity.h"
-#include
-static const char *TAG = "AUDIO_MEM_TEST";
+static const char* TAG = "AUDIO_MEM_TEST";
-TEST_CASE ("audio_mem", "esp-adf")
-{
- esp_log_level_set ("AUDIO_MEM", ESP_LOG_VERBOSE);
+TEST_CASE("audio_mem", "esp-adf") {
+ esp_log_level_set("AUDIO_MEM", ESP_LOG_VERBOSE);
- ESP_LOGI (TAG, "[✓] audio_malloc,audio_callo,audio_calloc_inner, "
- "audio_inaudio memory print");
- AUDIO_MEM_SHOW (TAG);
- uint8_t *pdata = audio_malloc (1024);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- audio_free (pdata);
+ ESP_LOGI(TAG,
+ "[✓] audio_malloc,audio_callo,audio_calloc_inner, audio_inaudio "
+ "memory print");
+ AUDIO_MEM_SHOW(TAG);
+ uint8_t* pdata = audio_malloc(1024);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ audio_free(pdata);
- AUDIO_MEM_SHOW (TAG);
- pdata = audio_calloc (1, 2 * 1024 * 1024);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- audio_free (pdata);
+ AUDIO_MEM_SHOW(TAG);
+ pdata = audio_calloc(1, 2 * 1024 * 1024);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ audio_free(pdata);
- AUDIO_MEM_SHOW (TAG);
- pdata = audio_calloc_inner (1, 1024);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- audio_free (pdata);
- AUDIO_MEM_SHOW (TAG);
+ AUDIO_MEM_SHOW(TAG);
+ pdata = audio_calloc_inner(1, 1024);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ audio_free(pdata);
+ AUDIO_MEM_SHOW(TAG);
}
-TEST_CASE ("audio_strdup", "esp-adf")
-{
- esp_log_level_set ("AUDIO_STRDUP", ESP_LOG_VERBOSE);
- ESP_LOGI (TAG, "[✓] audio_strdup");
- AUDIO_MEM_SHOW (TAG);
- char *strings = "audio string dump";
- char *pdata = audio_strdup (strings);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- audio_free (pdata);
- AUDIO_MEM_SHOW (TAG);
+TEST_CASE("audio_strdup", "esp-adf") {
+ esp_log_level_set("AUDIO_STRDUP", ESP_LOG_VERBOSE);
+ ESP_LOGI(TAG, "[✓] audio_strdup");
+ AUDIO_MEM_SHOW(TAG);
+ char* strings = "audio string dump";
+ char* pdata = audio_strdup(strings);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ audio_free(pdata);
+ AUDIO_MEM_SHOW(TAG);
}
-TEST_CASE ("audio_realloc", "esp-adf")
-{
- esp_log_level_set ("AUDIO_REALLOC", ESP_LOG_VERBOSE);
- ESP_LOGI (TAG, "[✓] audio_realloc");
- AUDIO_MEM_SHOW (TAG);
- uint8_t *pdata = audio_malloc (1024);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- pdata = audio_realloc (pdata, 2 * 1024);
- TEST_ASSERT_NOT_NULL (pdata);
- AUDIO_MEM_SHOW (TAG);
- audio_free (pdata);
- AUDIO_MEM_SHOW (TAG);
+TEST_CASE("audio_realloc", "esp-adf") {
+ esp_log_level_set("AUDIO_REALLOC", ESP_LOG_VERBOSE);
+ ESP_LOGI(TAG, "[✓] audio_realloc");
+ AUDIO_MEM_SHOW(TAG);
+ uint8_t* pdata = audio_malloc(1024);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ pdata = audio_realloc(pdata, 2 * 1024);
+ TEST_ASSERT_NOT_NULL(pdata);
+ AUDIO_MEM_SHOW(TAG);
+ audio_free(pdata);
+ AUDIO_MEM_SHOW(TAG);
}
diff --git a/components/custom_board/CMakeLists.txt b/components/custom_board/CMakeLists.txt
index 3ff4ee5..82e0c3d 100644
--- a/components/custom_board/CMakeLists.txt
+++ b/components/custom_board/CMakeLists.txt
@@ -17,7 +17,7 @@ if(CONFIG_AUDIO_BOARD_CUSTOM)
endif()
if(CONFIG_DAC_PCM51XX)
- message(STATUS "Selected DAC is " CONFIG_DAC_PCM15XX)
+ message(STATUS "Selected DAC is " CONFIG_DAC_PCM51XX)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./pcm51xx/include)
list(APPEND COMPONENT_SRCS ./pcm51xx/pcm51xx.c)
endif()
@@ -45,6 +45,18 @@ if(CONFIG_AUDIO_BOARD_CUSTOM)
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./max98357/include)
list(APPEND COMPONENT_SRCS ./max98357/max98357.c)
endif()
+
+ if(CONFIG_DAC_TAS5805M)
+ message(STATUS "Selected DAC is " CONFIG_DAC_TAS5805M)
+ list(APPEND COMPONENT_ADD_INCLUDEDIRS ./tas5805m/include)
+ list(APPEND COMPONENT_SRCS ./tas5805m/tas5805m.c)
+ endif()
+
+ if(CONFIG_DAC_PT8211)
+ message(STATUS "Selected DAC is " CONFIG_DAC_PT8211)
+ list(APPEND COMPONENT_ADD_INCLUDEDIRS ./pt8211/include)
+ list(APPEND COMPONENT_SRCS ./pt8211/pt8211.c)
+ endif()
endif()
register_component()
diff --git a/components/custom_board/Kconfig.projbuild b/components/custom_board/Kconfig.projbuild
index b8c3e4a..10c871f 100644
--- a/components/custom_board/Kconfig.projbuild
+++ b/components/custom_board/Kconfig.projbuild
@@ -1,183 +1 @@
-menu "Custom Audio Board"
- depends on AUDIO_BOARD_CUSTOM
-
- choice GENERIC_BOARD_DAC
- prompt "DAC chip"
- default DAC_MA120
- help
- Select a DAC connected to the generic ESP32 board
-
- config DAC_PCM51XX
- bool "TI PCM51XX/TAS57XX based DAC"
-
- config DAC_PCM5102A
- bool "TI PCM5102A based DAC"
-
- config DAC_MA120
- bool "Infineon MA120 ClassD AMP"
-
- config DAC_MA120X0
- bool "Infineon MA120X0 ClassD AMP"
-
- config DAC_ADAU1961
- bool "Analog Devices ADAU1961 DAC"
-
- config DAC_MAX98357
- bool "Analog Devices MAX98357 DAC"
-
- endchoice
-
- menu "DAC I2C control interface"
- config DAC_I2C_SDA
- int "SDA pin"
- default 12 if DAC_ADAU1961
- default 21 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A
- help
- I2C SDA pin of the DAC control interface
- config DAC_I2C_SCL
- int "SCL pin"
- default 14 if DAC_ADAU1961
- default 22 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A
- help
- I2C SCL pin of the DAC control interface
- config DAC_I2C_ADDR
- hex "I2C address"
- default 0x70 if DAC_ADAU1961
- default 0x20 if DAC_MA120 || DAC_PCM51XX || DAC_MA120 || DAC_MA120X0 || DAC_MAX98357 || DAC_PCM5102A
- help
- I2C Address of the DAC control interface
- endmenu
-
- menu "I2S master interface"
- config MASTER_I2S_MCLK_PIN
- int "Master i2s mclk"
- default 0
- help
- Master audio interface master clock.
-
- config MASTER_I2S_BCK_PIN
- int "Master i2s bck"
- default 23 if DAC_MAX98357
- default 23
- help
- Master audio interface bit clock.
-
- config MASTER_I2S_LRCK_PIN
- int "Master i2s lrck"
- default 24 if DAC_MAX98357
- default 13
- help
- Master audio interface left/right sync clock.
-
- config MASTER_I2S_DATAOUT_PIN
- int "Master i2s data out"
- default 25 if DAC_MAX98357
- default 14
- help
- Master audio interface data out.
- endmenu
-
- menu "I2S slave interface"
- config SLAVE_I2S_BCK_PIN
- int "Slave i2s bck"
- default 26
- help
- Slave audio interface bit clock.
-
- config SLAVE_I2S_LRCK_PIN
- int "Slave i2s lrck"
- default 12
- help
- Slave audio interface left/right sync clock.
-
- config SLAVE_I2S_DATAOUT_PIN
- int "Slave i2s data out"
- default 5
- help
- Slave audio interface data out.
- endmenu
-
- menu "Merus MA120x0 interface Configuration"
- depends on DAC_MA120X0
-
- config MA120X0_NENABLE_PIN
- int "Master enable/disable for ma120x0"
- default 16
- help
- GPIO number to control enable/disable.
-
- config MA120X0_NMUTE_PIN
- int "Master mute/unmute for ma120x0"
- default 2
- help
- GPIO number to controm mute/unmute.
-
- config MERUS_NERR_PIN
- int "NERR monitor pin"
- default 21
- help
- GPIO number to monitor NERROR.
-
- config MERUS_NCLIP_PIN
- int "Clip indication pin"
- default 22
- help
- GPIO number low if clip observed
- endmenu
-
- menu "Merus MA120 interface Configuration"
- depends on DAC_MA120
-
- config MA120_ENABLE_PIN
- int "Master enable/disable for ma120x0"
- default 16
- help
- GPIO number to control enable/disable.
-
- config MA120_NMUTE_PIN
- int "Master mute/unmute for ma120x0"
- default 2
- help
- GPIO number to controm mute/unmute.
-
- config MERUS_NERR_PIN
- int "NERR monitor pin"
- default 21
- help
- GPIO number to monitor NERROR.
-
- config MERUS_NCLIP_PIN
- int "Clip indication pin"
- default 22
- help
- GPIO number low if clip observed
- endmenu
-
- menu "TI PCM5102A interface Configuration"
- depends on DAC_PCM5102A
-
- config PCM5102A_MUTE_PIN
- int "Master mute/unmute for PCM5102A"
- default 18
- help
- GPIO number to control mute/unmute.
- This is labeled "X(S)MT" on chip/boards
- endmenu
-
- menu "MAX98357 interface Configuration"
- depends on DAC_MAX98357
-
- config MAX98357_MUTE_PIN
- int "Master mute/mode for MAX98357"
- default 18
- help
- GPIO number to control mute/mode. This require a special resistor to select the correct mode.
- You need to put a serie resistor to select the mode (GPIO --> Resistor --> SD):
- LEFT only : 0ohm (direct connection)
- RIGHT only : 220Kohm
- (L+R)/2 : 1Mohm
- Refer to Analog Devices' doc for more infos.
- This is labeled "SD" on chip/boards.
- endmenu
-
-endmenu
+# this was moved to audio_board
diff --git a/components/custom_board/component.mk b/components/custom_board/component.mk
index 3bebfc2..665e5fa 100644
--- a/components/custom_board/component.mk
+++ b/components/custom_board/component.mk
@@ -27,4 +27,14 @@ COMPONENT_ADD_INCLUDEDIRS += ./max98357/include
COMPONENT_SRCDIRS += ./max98357
endif
+ifdef CONFIG_DAC_TAS5805M
+COMPONENT_ADD_INCLUDEDIRS += ./tas5805m/include
+COMPONENT_SRCDIRS += ./tas5805m
+endif
+
+ifdef CONFIG_DAC_PT8211
+COMPONENT_ADD_INCLUDEDIRS += ./pt8211/include
+COMPONENT_SRCDIRS += ./pt8211
+endif
+
endif
diff --git a/components/custom_board/generic_board/board.c b/components/custom_board/generic_board/board.c
index 3b50a43..202e298 100644
--- a/components/custom_board/generic_board/board.c
+++ b/components/custom_board/generic_board/board.c
@@ -49,6 +49,12 @@ extern audio_hal_func_t AUDIO_CODEC_ADAU1961_DEFAULT_HANDLE;
#elif CONFIG_DAC_MAX98357
extern audio_hal_func_t AUDIO_CODEC_MAX98357_DEFAULT_HANDLE;
#define AUDIO_CODEC_DEFAULT_HANDLE AUDIO_CODEC_MAX98357_DEFAULT_HANDLE
+#elif CONFIG_DAC_TAS5805M
+extern audio_hal_func_t AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_HANDLE AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE
+#elif CONFIG_DAC_PT8211
+extern audio_hal_func_t AUDIO_CODEC_PT8211_DEFAULT_HANDLE;
+#define AUDIO_CODEC_DEFAULT_HANDLE AUDIO_CODEC_PT8211_DEFAULT_HANDLE
#endif
static const char *TAG = "AUDIO_BOARD";
diff --git a/components/custom_board/generic_board/board_pins_config.c b/components/custom_board/generic_board/board_pins_config.c
index 502237b..205cca4 100644
--- a/components/custom_board/generic_board/board_pins_config.c
+++ b/components/custom_board/generic_board/board_pins_config.c
@@ -32,6 +32,10 @@
#include "driver/gpio.h"
#include "esp_log.h"
+#if SOC_I2S_NUM > 1
+#define I2S_NUM_MAX I2S_NUM_1 + 1
+#endif
+
static const char *TAG = "GENERIC_BOARD";
esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
@@ -48,20 +52,22 @@ esp_err_t get_i2c_pins(i2c_port_t port, i2c_config_t *i2c_config) {
return ESP_OK;
}
-esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config) {
+esp_err_t get_i2s_pins(i2s_port_t port, board_i2s_pin_t *i2s_config) {
AUDIO_NULL_CHECK(TAG, i2s_config, return ESP_FAIL);
if (port == I2S_NUM_0) {
+ i2s_config->mck_io_num = CONFIG_MASTER_I2S_MCLK_PIN;
i2s_config->bck_io_num = CONFIG_MASTER_I2S_BCK_PIN;
i2s_config->ws_io_num = CONFIG_MASTER_I2S_LRCK_PIN;
i2s_config->data_out_num = CONFIG_MASTER_I2S_DATAOUT_PIN;
i2s_config->data_in_num = -1;
} else if (port == I2S_NUM_1) {
+ i2s_config->mck_io_num = CONFIG_SLAVE_I2S_MCLK_PIN;
i2s_config->bck_io_num = CONFIG_SLAVE_I2S_BCK_PIN;
i2s_config->ws_io_num = CONFIG_SLAVE_I2S_LRCK_PIN;
i2s_config->data_out_num = CONFIG_SLAVE_I2S_DATAOUT_PIN;
i2s_config->data_in_num = -1;
} else {
- memset(i2s_config, -1, sizeof(i2s_pin_config_t));
+ memset(i2s_config, -1, sizeof(board_i2s_pin_t));
ESP_LOGE(TAG, "i2s port %d is not supported", port);
return ESP_FAIL;
}
@@ -69,32 +75,6 @@ esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config) {
return ESP_OK;
}
-esp_err_t i2s_mclk_gpio_select(i2s_port_t i2s_num, gpio_num_t gpio_num) {
- if (i2s_num >= I2S_NUM_MAX) {
- ESP_LOGE(TAG, "Does not support i2s number(%d)", i2s_num);
- return ESP_ERR_INVALID_ARG;
- }
- if (gpio_num != GPIO_NUM_0 && gpio_num != GPIO_NUM_1 &&
- gpio_num != GPIO_NUM_3) {
- ESP_LOGE(TAG, "Only support GPIO0/GPIO1/GPIO3, gpio_num:%d", gpio_num);
- return ESP_ERR_INVALID_ARG;
- }
- ESP_LOGI(TAG, "I2S%d, MCLK output by GPIO%d", i2s_num, gpio_num);
- if (i2s_num == I2S_NUM_0) {
- if (gpio_num == GPIO_NUM_0) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
- WRITE_PERI_REG(PIN_CTRL, 0xFFF0);
- } else if (gpio_num == GPIO_NUM_1) {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_CLK_OUT3);
- WRITE_PERI_REG(PIN_CTRL, 0xF0F0);
- } else {
- PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_CLK_OUT2);
- WRITE_PERI_REG(PIN_CTRL, 0xFF00);
- }
- }
- return ESP_OK;
-}
-
esp_err_t get_spi_pins(
spi_bus_config_t *spi_config,
spi_device_interface_config_t *spi_device_interface_config) {
diff --git a/components/custom_board/generic_board/include/board_def.h b/components/custom_board/generic_board/include/board_def.h
index 40c4e22..60e91ac 100644
--- a/components/custom_board/generic_board/include/board_def.h
+++ b/components/custom_board/generic_board/include/board_def.h
@@ -27,6 +27,8 @@
#ifndef _AUDIO_BOARD_DEFINITION_H_
#define _AUDIO_BOARD_DEFINITION_H_
+#define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */
+
#define BUTTON_VOLUP_ID 0
#define BUTTON_VOLDOWN_ID 1
#define BUTTON_MUTE_ID 2
diff --git a/components/custom_board/ma120/ma120.c b/components/custom_board/ma120/ma120.c
index 3a5842b..4399c2f 100644
--- a/components/custom_board/ma120/ma120.c
+++ b/components/custom_board/ma120/ma120.c
@@ -9,15 +9,15 @@
//
//
+#include "ma120.h"
+
#include
#include
-#include "ma120.h"
#include "board.h"
#include "driver/i2c.h"
#include "esp_log.h"
-
static const char *TAG = "MA120";
#define MA_ENABLE_IO CONFIG_MA120_ENABLE_PIN
@@ -66,12 +66,12 @@ esp_err_t ma120_deinit(void) {
}
esp_err_t ma120_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state) {
- ESP_LOGI("MA120 Driver", "ctrl w. mode and ctrl_state");
+ ESP_LOGI("MA120 Driver", "ctrl w. mode and ctrl_state");
return ESP_OK;
}
esp_err_t ma120_config_iface(audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface) {
+ audio_hal_codec_i2s_iface_t *iface) {
ESP_LOGI("MA120 Driver", "config_iface w. mode and interface");
return ESP_OK;
}
@@ -111,13 +111,13 @@ esp_err_t ma120_get_mute(bool *enabled) {
esp_err_t ma120_init(audio_hal_codec_config_t *codec_cfg) {
esp_err_t ret = ESP_OK;
setup_ma120();
- return ret;
-}
+ return ret;
+}
-void setup_ma120(void){
+void setup_ma120(void) {
gpio_config_t io_conf;
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << MA_ENABLE_IO | 1ULL << MA_NMUTE_IO);
io_conf.pull_down_en = 0;
@@ -126,7 +126,7 @@ void setup_ma120(void){
printf("setup output %d %d \n", MA_ENABLE_IO, MA_NMUTE_IO);
gpio_config(&io_conf);
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pin_bit_mask = (1ULL << MA_NCLIP_IO | 1ULL << MA_NERR_IO);
io_conf.pull_down_en = 0;
@@ -136,8 +136,7 @@ void setup_ma120(void){
gpio_set_level(MA_NMUTE_IO, 0);
gpio_set_level(MA_ENABLE_IO, 0);
-
-
+
i2c_master_init();
gpio_set_level(MA_ENABLE_IO, 1);
@@ -145,7 +144,7 @@ void setup_ma120(void){
uint8_t res = ma_write_byte(MA120_ADDR, 2, 0x060c, 0);
res = ma_read_byte(MA120_ADDR, 2, 0x060c);
printf("Hardware version: 0x%02x\n", res);
-
+
printf("Scan I2C bus: ");
for (uint8_t addr = 0x20; addr <= 0x23; addr++) {
res = ma_read_byte(addr, 2, 0);
@@ -153,7 +152,7 @@ void setup_ma120(void){
// printf("Scan i2c address 0x%02x read address 0 : 0x%02x \n", addr ,res);
}
printf("\n");
-
+
uint8_t rxbuf[32];
uint8_t otp[1024];
for (uint8_t i = 0; i < 16; i++) {
@@ -234,7 +233,7 @@ void ma120_read_error(uint8_t i2c_addr) { // 0x0118 error now ch0 [clip_stuck
// printf("\n");
}
-static i2c_config_t i2c_cfg = {
+static i2c_config_t i2c_cfg = {
.mode = I2C_MODE_MASTER,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
diff --git a/components/custom_board/ma120x0/MerusAudio.c b/components/custom_board/ma120x0/MerusAudio.c
index 1bd762f..1afd591 100644
--- a/components/custom_board/ma120x0/MerusAudio.c
+++ b/components/custom_board/ma120x0/MerusAudio.c
@@ -17,12 +17,12 @@
#include "driver/i2c.h"
#include "esp_log.h"
#include "ma120x0.h"
-//#include "ma120_rev1_all.h"
+// #include "ma120_rev1_all.h"
+#include "audio_hal.h"
static const char *TAG = "MA120X0";
#define MA_NENABLE_IO CONFIG_MA120X0_NENABLE_PIN
-#define MA_ENABLE_IO CONFIG_MA120X0_ENABLE_PIN
#define MA_NMUTE_IO CONFIG_MA120X0_NMUTE_PIN
#define MA_NERR_IO CONFIG_MA120X0_NERR_PIN
#define MA_NCLIP_IO CONFIG_MA120X0_NCLIP_PIN
@@ -51,6 +51,16 @@ static const char *I2C_TAG = "i2c";
static i2c_config_t i2c_cfg;
+esp_err_t ma120x0_init(audio_hal_codec_config_t *codec_cfg);
+esp_err_t ma120x0_deinit(void);
+esp_err_t ma120x0_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+esp_err_t ma120x0_set_volume(int vol);
+esp_err_t ma120x0_get_volume(int *vol);
+esp_err_t ma120x0_set_mute(bool enable);
+esp_err_t ma120x0_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+
audio_hal_func_t AUDIO_CODEC_MA120X0_DEFAULT_HANDLE = {
.audio_codec_initialize = ma120x0_init,
.audio_codec_deinitialize = ma120x0_deinit,
diff --git a/components/custom_board/ma120x0/include/MerusAudio.h b/components/custom_board/ma120x0/include/MerusAudio.h
index 6c49ccc..d574926 100644
--- a/components/custom_board/ma120x0/include/MerusAudio.h
+++ b/components/custom_board/ma120x0/include/MerusAudio.h
@@ -1,6 +1,10 @@
#ifndef _MERUSAUDIO_H_
#define _MERUSAUDIO_H_
+#include
+
+#include "esp_err.h"
+
void setup_ma120x0(void);
void setup_ma120(void);
void ma120_read_error(uint8_t i2c_addr);
diff --git a/components/custom_board/max98357/max98357.c b/components/custom_board/max98357/max98357.c
index 8cd16b2..8423439 100644
--- a/components/custom_board/max98357/max98357.c
+++ b/components/custom_board/max98357/max98357.c
@@ -36,7 +36,7 @@ esp_err_t max98357_init(audio_hal_codec_config_t *codec_cfg) {
gpio_config_t io_conf;
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << CONFIG_MAX98357_MUTE_PIN);
io_conf.pull_down_en = 0;
diff --git a/components/custom_board/pcm5102a/pcm5102a.c b/components/custom_board/pcm5102a/pcm5102a.c
index f116796..fd15126 100644
--- a/components/custom_board/pcm5102a/pcm5102a.c
+++ b/components/custom_board/pcm5102a/pcm5102a.c
@@ -1,30 +1,29 @@
/*
* TI PCM5102A audio hal
- *
+ *
* Mostly stubs (no I2C or volume control)
* Configuration of mute/unmute gpio in init (connected to XSMT)
*/
#include "pcm5102a.h"
+#include
+
#include "board.h"
#include "esp_log.h"
-#include
static const char *TAG = "PCM5102A";
-
#define PCM5102A_ASSERT(a, format, b, ...) \
- if ((a) != 0) { \
- ESP_LOGE(TAG, format, ##__VA_ARGS__); \
- return b; \
+ if ((a) != 0) { \
+ ESP_LOGE(TAG, format, ##__VA_ARGS__); \
+ return b; \
}
esp_err_t pcm5102a_ctrl(audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state);
+ audio_hal_ctrl_t ctrl_state);
esp_err_t pcm5102a_config_iface(audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface);
-
+ audio_hal_codec_i2s_iface_t *iface);
audio_hal_func_t AUDIO_CODEC_PCM5102A_DEFAULT_HANDLE = {
.audio_codec_initialize = pcm5102a_init,
@@ -43,19 +42,17 @@ esp_err_t pcm5102a_init(audio_hal_codec_config_t *codec_cfg) {
gpio_config_t io_conf;
- io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << CONFIG_PCM5102A_MUTE_PIN);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
ret = gpio_config(&io_conf);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Mute gpio config failed for pin %d", CONFIG_PCM5102A_MUTE_PIN);
- }
- else
- {
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Mute gpio config failed for pin %d",
+ CONFIG_PCM5102A_MUTE_PIN);
+ } else {
gpio_set_level(CONFIG_PCM5102A_MUTE_PIN, 0);
ESP_LOGD(TAG, "Setup mute (XMT) output %d\n", CONFIG_PCM5102A_MUTE_PIN);
}
@@ -63,32 +60,26 @@ esp_err_t pcm5102a_init(audio_hal_codec_config_t *codec_cfg) {
return ret;
}
-esp_err_t pcm5102a_set_volume(int vol) {
- return ESP_OK;
-}
+esp_err_t pcm5102a_set_volume(int vol) { return ESP_OK; }
-esp_err_t pcm5102a_get_volume(int *value) {
- return ESP_OK;
-}
+esp_err_t pcm5102a_get_volume(int *value) { return ESP_OK; }
esp_err_t pcm5102a_set_mute(bool enable) {
return gpio_set_level(CONFIG_PCM5102A_MUTE_PIN, enable ? 0 : 1);
}
-esp_err_t pcm5102a_get_mute(bool *enabled) {
- return ESP_OK;
-}
+esp_err_t pcm5102a_get_mute(bool *enabled) { return ESP_OK; }
esp_err_t pcm5102a_deinit(void) {
return gpio_reset_pin(CONFIG_PCM5102A_MUTE_PIN);
}
esp_err_t pcm5102a_ctrl(audio_hal_codec_mode_t mode,
- audio_hal_ctrl_t ctrl_state) {
+ audio_hal_ctrl_t ctrl_state) {
return ESP_OK;
}
esp_err_t pcm5102a_config_iface(audio_hal_codec_mode_t mode,
- audio_hal_codec_i2s_iface_t *iface) {
+ audio_hal_codec_i2s_iface_t *iface) {
return ESP_OK;
}
diff --git a/components/custom_board/pt8211/include/pt8211.h b/components/custom_board/pt8211/include/pt8211.h
new file mode 100644
index 0000000..62b35ee
--- /dev/null
+++ b/components/custom_board/pt8211/include/pt8211.h
@@ -0,0 +1,49 @@
+/*
+ * Princeton Technology PT8211 audio hal
+ */
+
+#ifndef _PT8211_H_
+#define _PT8211_H_
+
+#include "audio_hal.h"
+#include "esp_err.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Initialize PT8211 codec chip
+ */
+esp_err_t pt8211_init(audio_hal_codec_config_t *codec_cfg);
+
+/**
+ * Deinitialize PT8211 codec chip
+ */
+esp_err_t pt8211_deinit(void);
+
+/**
+ * Set volume - NOT AVAILABLE
+ */
+esp_err_t pt8211_set_volume(int vol);
+
+/**
+ * Get volume - NOT AVAILABLE
+ */
+esp_err_t pt8211_get_volume(int *value);
+
+/**
+ * Set PT8211 mute or not
+ */
+esp_err_t pt8211_set_mute(bool enable);
+
+/**
+ * Get PT8211 mute status - NOT IMPLEMENTED
+ */
+esp_err_t pt8211_get_mute(bool *enabled);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/custom_board/pt8211/pt8211.c b/components/custom_board/pt8211/pt8211.c
new file mode 100644
index 0000000..cddbecf
--- /dev/null
+++ b/components/custom_board/pt8211/pt8211.c
@@ -0,0 +1,90 @@
+/*
+ * Princeton Technology PT8211 audio hal
+ *
+ * Mostly stubs (no I2C or volume control)
+ * Configuration of mute/unmute gpio in init (for external amplifier)
+ */
+
+#include "pt8211.h"
+
+#include
+
+#include "board.h"
+#include "esp_log.h"
+
+#ifndef CONFIG_PT8211_MUTE_ACTIVE_LOW
+#define CONFIG_PT8211_MUTE_ACTIVE_LOW 0
+#endif
+
+static const char *TAG = "PT8211";
+
+esp_err_t pt8211_ctrl(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state);
+esp_err_t pt8211_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+
+audio_hal_func_t AUDIO_CODEC_PT8211_DEFAULT_HANDLE = {
+ .audio_codec_initialize = pt8211_init,
+ .audio_codec_deinitialize = pt8211_deinit,
+ .audio_codec_ctrl = pt8211_ctrl,
+ .audio_codec_config_iface = pt8211_config_iface,
+ .audio_codec_set_mute = pt8211_set_mute,
+ .audio_codec_set_volume = pt8211_set_volume,
+ .audio_codec_get_volume = pt8211_get_volume,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
+};
+
+esp_err_t pt8211_init(audio_hal_codec_config_t *codec_cfg) {
+ esp_err_t ret = ESP_OK;
+
+#if CONFIG_PT8211_MUTE_PIN != -1
+ gpio_config_t io_conf;
+
+ io_conf.intr_type = GPIO_INTR_DISABLE;
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = (1ULL << CONFIG_PT8211_MUTE_PIN);
+ io_conf.pull_down_en = 0;
+ io_conf.pull_up_en = 0;
+
+ ret = gpio_config(&io_conf);
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Mute gpio config failed for pin %d", CONFIG_PT8211_MUTE_PIN);
+ } else {
+ gpio_set_level(CONFIG_PT8211_MUTE_PIN, 0);
+ ESP_LOGD(TAG, "Setup mute output %d\n", CONFIG_PT8211_MUTE_PIN);
+ }
+#else
+ ESP_LOGD(TAG, "Mute gpio not specified\n");
+#endif
+
+ return ret;
+}
+
+esp_err_t pt8211_set_volume(int vol) { return ESP_OK; }
+
+esp_err_t pt8211_get_volume(int *value) { return ESP_OK; }
+
+esp_err_t pt8211_set_mute(bool enable) {
+ esp_err_t ret = ESP_OK;
+
+#if CONFIG_PT8211_MUTE_PIN != -1
+ ret = gpio_set_level(CONFIG_PT8211_MUTE_PIN,
+ enable ^ CONFIG_PT8211_MUTE_ACTIVE_LOW);
+#endif
+
+ return ret;
+}
+
+esp_err_t pt8211_get_mute(bool *enabled) { return ESP_OK; }
+
+esp_err_t pt8211_deinit(void) { return gpio_reset_pin(CONFIG_PT8211_MUTE_PIN); }
+
+esp_err_t pt8211_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state) {
+ return ESP_OK;
+}
+
+esp_err_t pt8211_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface) {
+ return ESP_OK;
+}
diff --git a/components/custom_board/tas5805m/include/tas5805m.h b/components/custom_board/tas5805m/include/tas5805m.h
new file mode 100644
index 0000000..ef609a2
--- /dev/null
+++ b/components/custom_board/tas5805m/include/tas5805m.h
@@ -0,0 +1,146 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _TAS5805M_H_
+#define _TAS5805M_H_
+
+#include "audio_hal.h"
+
+#include "esp_err.h"
+#include "esp_log.h"
+#include "board.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#define I2C_MASTER_FREQ_HZ 400000 /*!< I2C master clock frequency */
+#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
+#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
+#define I2C_MASTER_TIMEOUT_MS 1000
+
+/* Represented in % */
+#define TAS5805M_VOLUME_MIN 0
+#define TAS5805M_VOLUME_MAX 100
+
+#define TAS5805M_VOLUME_MUTE 255
+/* See here for the original Implementation : audio_hal/driver/tas5805m */
+/* Its not from me it was developed by Espressif */
+/* Volume steps tas5805m_volume[0] => 255 which means mute */
+ static const uint8_t tas5805m_volume[]
+ = { 0xff, 0x9f, 0x8f, 0x7f, 0x6f, 0x5f, 0x5c, 0x5a, 0x58, 0x54, 0x50,
+ 0x4c, 0x4a, 0x48, 0x44, 0x40, 0x3d, 0x3b, 0x39, 0x37, 0x35 };
+
+ int8_t currentVolume = 0; // Last Volume gets updated after a change or before a mute
+ /**
+ * @brief Initialize TAS5805 codec chip
+ *
+ * @param cfg configuration of TAS5805
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+ esp_err_t tas5805m_init ();
+
+ /**
+ * @brief Deinitialize TAS5805 codec chip
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+ esp_err_t tas5805m_deinit (void);
+
+ /**
+ * @brief Set voice volume
+ *
+ * @param volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+ esp_err_t tas5805m_set_volume (int vol);
+
+ /**
+ * @brief Get voice volume
+ *
+ * @param[out] *volume: voice volume (0~100)
+ *
+ * @return
+ * - ESP_OK
+ * - ESP_FAIL
+ */
+ esp_err_t tas5805m_get_volume(int *vol);
+
+ /**
+ * @brief Set TAS5805 mute or not
+ * Continuously call should have an interval time determined by
+ * tas5805m_set_mute_fade()
+ *
+ * @param enable enable(1) or disable(0)
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+ esp_err_t tas5805m_set_mute (bool enable);
+
+ /**
+ * @brief Mute TAS5805M
+ *
+ * @param value Time for mute with millisecond.
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ *
+ */
+
+
+ /**
+ * @brief Get TAS5805 mute status
+ *
+ * @return
+ * - ESP_FAIL Parameter error
+ * - ESP_OK Success
+ */
+ esp_err_t tas5805m_get_mute (bool *enabled);
+
+ esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state);
+
+
+ esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h
new file mode 100644
index 0000000..b571531
--- /dev/null
+++ b/components/custom_board/tas5805m/include/tas5805m_reg_cfg.h
@@ -0,0 +1,100 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _TAS5805M_REG_CFG_
+#define _TAS5805M_REG_CFG_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* Register Naming*/
+#define I2C_MASTER_NUM I2C_NUM_0 /*!< I2C port number for master dev */
+#define WRITE_BIT I2C_MASTER_WRITE /*!< I2C master write */
+#define READ_BIT I2C_MASTER_READ /*!< I2C master read */
+#define ACK_CHECK_EN 0x1 /*!< I2C master will check ack from slave*/
+#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
+#define ACK_VAL I2C_MASTER_ACK /*!< I2C ack value */
+#define NACK_VAL I2C_MASTER_NACK /*!< I2C nack value */
+
+#define I2C_TAS5805M_MASTER_NUM I2C_MASTER_NUM /*!< I2C port number for master dev */
+
+#define TAS5805M_ADDRESS 0x2D /*!< 7-bit address with a 15k pull up resistor */
+
+
+#ifdef PIN_DAC_PWDN
+#define TAS5805M_GPIO_PDN PIN_DAC_PWDN
+#else
+#define TAS5805M_GPIO_PDN GPIO_NUM_33 /*!< GPIO used for !PDN pin */
+#endif
+
+#define TAS5805M_GPIO_PDN_MASK ((1ULL << TAS5805M_GPIO_PDN))
+
+#define TAS5805M_RESET_CTRL_REGISTER 0x01
+#define TAS5805M_DEVICE_CTRL_1_REGISTER 0x02
+#define TAS5805M_DEVICE_CTRL_2_REGISTER 0x03
+#define TAS5805M_I2C_PAGE_AUTO_INC_REGISTER 0x0f
+#define TAS5805M_SIG_CH_CTRL_REGISTER 0x28
+#define TAS5805M_CLOCK_DET_CTRL_REGISTER 0x29
+#define TAS5805M_SDOUT_SEL_REGISTER 0x30
+#define TAS5805M_I2S_CTRL_REGISTER 0x31
+#define TAS5805M_SAP_CTRL1_REGISTER 0x33
+#define TAS5805M_SAP_CTRL2_REGISTER 0x34
+#define TAS5805M_SAP_CTRL3_REGISTER 0x35
+#define TAS5805M_FS_MON_REGISTER 0x37
+#define TAS5805M_BCK_MON_REGISTER 0x38
+#define TAS5805M_CLKDET_STATUS_REGISTER 0x39
+#define TAS5805M_CHANNEL_FORCE_HIZ_REGISTER 0x40
+#define TAS5805M_DIG_VOL_CTRL_REGISTER 0x4c
+#define TAS5805M_DIG_VOL_CTRL2_REGISTER 0x4e
+#define TAS5805M_DIG_VOL_CTRL3_REGISTER 0x4f
+#define TAS5805M_AUTO_MUTE_CTRL_REGISTER 0x50
+#define TAS5805M_AUTO_MUTE_TIME_REGISTER 0x51
+#define TAS5805M_ANA_CTRL_REGISTER 0x53
+#define TAS5805M_AGAIN_REGISTER 0x54
+#define TAS5805M_BQ_WR_CTRL1_REGISTER 0x5c
+#define TAS5805M_DAC_CTRL_REGISTER 0x5d
+#define TAS5805M_ADR_PIN_CTRL_REGISTER 0x60
+#define TAS5805M_ADR_PIN_CONFIG_REGISTER 0x61
+#define TAS5805M_DSP_MISC_REGISTER 0x66
+#define TAS5805M_DIE_ID_REGISTER 0x67
+#define TAS5805M_POWER_STATE_REGISTER 0x68
+#define TAS5805M_AUTOMUTE_STATE_REGISTER 0x69
+#define TAS5805M_PHASE_CTRL_REGISTER 0x6a
+#define TAS5805M_SS_CTRL0_REGISTER 0x6b
+#define TAS5805M_SS_CTRL1_REGISTER 0x6c
+#define TAS5805M_SS_CTRL2_REGISTER 0x6d
+#define TAS5805M_SS_CTRL3_REGISTER 0x6e
+#define TAS5805M_SS_CTRL4_REGISTER 0x6f
+#define TAS5805M_CHAN_FAULT_REGISTER 0x70
+#define TAS5805M_GLOBAL_FAULT1_REGISTER 0x71
+#define TAS5805M_GLOBAL_FAULT2_REGISTER 0x72
+#define TAS5805M_OT_WARNING_REGISTER 0x73
+#define TAS5805M_PIN_CONTROL1_REGISTER 0x74
+#define TAS5805M_PIN_CONTROL2_REGISTER 0x75
+#define TAS5805M_MISC_CONTROL_REGISTER 0x76
+#define TAS5805M_FAULT_CLEAR_REGISTER 0x78
+#endif
\ No newline at end of file
diff --git a/components/custom_board/tas5805m/tas5805m.c b/components/custom_board/tas5805m/tas5805m.c
new file mode 100644
index 0000000..96b501f
--- /dev/null
+++ b/components/custom_board/tas5805m/tas5805m.c
@@ -0,0 +1,291 @@
+/*
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2020
+ *
+ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in
+ * which case, it is free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the
+ * Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "tas5805m.h"
+#include "esp_log.h"
+#include "i2c_bus.h"
+#include "tas5805m_reg_cfg.h"
+
+static const char *TAG = "TAS5805M";
+
+/* Default I2C config */
+
+static i2c_config_t i2c_cfg = {
+ .mode = I2C_MODE_MASTER,
+ .sda_pullup_en = GPIO_PULLUP_ENABLE,
+ .scl_pullup_en = GPIO_PULLUP_ENABLE,
+ .master.clk_speed = I2C_MASTER_FREQ_HZ,
+};
+
+/*
+ * Operate fuction of PA
+ */
+audio_hal_func_t AUDIO_CODEC_TAS5805M_DEFAULT_HANDLE = {
+ .audio_codec_initialize = tas5805m_init,
+ .audio_codec_deinitialize = tas5805m_deinit,
+ .audio_codec_ctrl = tas5805m_ctrl,
+ .audio_codec_config_iface = tas5805m_config_iface,
+ .audio_codec_set_mute = tas5805m_set_mute,
+ .audio_codec_set_volume = tas5805m_set_volume,
+ .audio_codec_get_volume = tas5805m_get_volume,
+ .audio_hal_lock = NULL,
+ .handle = NULL,
+};
+
+/* Init the I2C Driver */
+
+void i2c_master_init()
+{
+ int i2c_master_port = I2C_MASTER_NUM;
+
+
+ ESP_ERROR_CHECK(get_i2c_pins(I2C_NUM_0, &i2c_cfg));
+
+ ESP_ERROR_CHECK(i2c_param_config(i2c_master_port, &i2c_cfg));
+
+
+
+ ESP_ERROR_CHECK(i2c_driver_install(i2c_master_port, i2c_cfg.mode,
+ I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE,
+ 0));
+
+}
+
+/* Helper Functions */
+
+
+// Reading of TAS5805M-Register
+
+esp_err_t tas5805m_read_byte(uint8_t register_name, uint8_t *data)
+{
+
+ int ret;
+ i2c_cmd_handle_t cmd = i2c_cmd_link_create();
+ i2c_master_start(cmd);
+ i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | WRITE_BIT, ACK_CHECK_EN);
+ i2c_master_write_byte(cmd, register_name, ACK_CHECK_EN);
+ i2c_master_stop(cmd);
+ ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
+ i2c_cmd_link_delete(cmd);
+
+ if (ret != ESP_OK)
+ {
+ ESP_LOGW(TAG, "I2C ERROR");
+ }
+
+ vTaskDelay(1 / portTICK_RATE_MS);
+ cmd = i2c_cmd_link_create();
+ i2c_master_start(cmd);
+ i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | READ_BIT, ACK_CHECK_EN);
+ i2c_master_read_byte(cmd, data, NACK_VAL);
+ i2c_master_stop(cmd);
+ ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
+ i2c_cmd_link_delete(cmd);
+
+ return ret;
+}
+
+// Writing of TAS5805M-Register
+
+esp_err_t tas5805m_write_byte(uint8_t register_name, uint8_t value)
+{
+ int ret =0;
+ i2c_cmd_handle_t cmd = i2c_cmd_link_create();
+ i2c_master_start(cmd);
+ i2c_master_write_byte(cmd, TAS5805M_ADDRESS << 1 | WRITE_BIT, ACK_CHECK_EN);
+ i2c_master_write_byte(cmd, register_name, ACK_CHECK_EN);
+ i2c_master_write_byte(cmd, value, ACK_CHECK_EN);
+ i2c_master_stop(cmd);
+
+ ret = i2c_master_cmd_begin(I2C_TAS5805M_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
+
+ // Check if ret is OK
+ if (ret != ESP_OK) {
+ ESP_LOGE(TAG, "Fehler bei der I2C-Übertragung: %s", esp_err_to_name(ret));
+
+ }
+
+ i2c_cmd_link_delete(cmd);
+
+ return ret;
+}
+
+// Inits the TAS5805M change Settings in Menuconfig to enable Bridge-Mode
+
+esp_err_t tas5805m_init()
+{
+ int ret =0;
+ // Init the I2C-Driver
+ i2c_master_init();
+ /* Register the PDN pin as output and write 1 to enable the TAS chip */
+ /* TAS5805M.INIT() */
+ gpio_config_t io_conf;
+ io_conf.intr_type = GPIO_INTR_DISABLE;
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pin_bit_mask = TAS5805M_GPIO_PDN_MASK;
+ io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
+ io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
+ ESP_LOGW(TAG, "Power down pin: %d", TAS5805M_GPIO_PDN);
+ gpio_config(&io_conf);
+ gpio_set_level(TAS5805M_GPIO_PDN, 0);
+ vTaskDelay(10 / portTICK_RATE_MS);
+ gpio_set_level(TAS5805M_GPIO_PDN, 1);
+ vTaskDelay(10 / portTICK_RATE_MS);
+
+ /* TAS5805M.Begin()*/
+
+ ESP_LOGW(TAG, "Setting to HI Z");
+
+ ESP_ERROR_CHECK(tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, 0x02));
+ vTaskDelay(10 / portTICK_RATE_MS);
+ if (ret != ESP_OK){
+ ESP_LOGW(TAG, "TAS5805M_DEVICE_CTRL_2_REGISTER, 0x02 FAILED!!!");
+ return ret;
+ }
+
+ ESP_LOGW(TAG, "Setting to PLAY");
+
+ ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_2_REGISTER, 0x03);
+ if (ret != ESP_OK){
+ ESP_LOGW(TAG, "TAS5805M_DEVICE_CTRL_2_REGISTER, 0x03 FAILED!!");
+ return ret;
+ }
+
+
+ // Check if Bridge-Mode is enabled
+ #ifdef CONFIG_DAC_BRIDGE_MODE
+ uint8_t value = 0;
+ ret = tas5805m_read_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, &value);
+ if (ret != ESP_OK)
+ return ret;
+ value = 0b100;
+
+ ret = tas5805m_write_byte(TAS5805M_DEVICE_CTRL_1_REGISTER, value);
+ if (ret != ESP_OK)
+ return ret;
+ #endif
+
+ return ret;
+}
+
+// Setting the Volume
+
+esp_err_t
+tas5805m_set_volume(int vol)
+{
+ int vol_idx = 0; // Temp-Variable
+
+ /* Checking if Volume is bigger or smaller than the max values */
+ if (vol < TAS5805M_VOLUME_MIN)
+ {
+ vol = TAS5805M_VOLUME_MIN;
+ }
+ if (vol > TAS5805M_VOLUME_MAX)
+ {
+ vol = TAS5805M_VOLUME_MAX;
+ }
+ /* Mapping the Values from 0-100 to 254-0 */
+ vol_idx = vol / 5;
+ /* Updating the global volume Variable */
+ currentVolume = vol_idx;
+ /* Writing the Volume to the Register*/
+ return tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, tas5805m_volume[vol_idx]);
+}
+
+esp_err_t
+tas5805m_get_volume(int *vol)
+{
+ esp_err_t ret = ESP_OK;
+ uint8_t rxbuf = 0;
+ ret = tas5805m_read_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, &rxbuf);
+ int i;
+ for (i = 0; i < sizeof (tas5805m_volume); i++)
+ {
+ if (rxbuf>= tas5805m_volume[i])
+ break;
+ }
+ /* Updating the global volume Variable */
+ currentVolume = i;
+ ESP_LOGI (TAG, "Volume is %d", i * 5);
+ *vol = 5 * i; // Converting it to percent
+ return ret;
+}
+
+esp_err_t tas5805m_deinit(void)
+{
+ // TODO
+ return ESP_OK;
+}
+
+
+
+esp_err_t
+tas5805m_set_mute(bool enable)
+{
+
+ if (enable == true)
+ {
+ // Set the Volume to 255 to enable the MUTE
+ return tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER, TAS5805M_VOLUME_MUTE);
+ }
+ else{
+ return tas5805m_write_byte(TAS5805M_DIG_VOL_CTRL_REGISTER,tas5805m_volume[currentVolume]); // Restore Volume to its old value
+ }
+ return ESP_OK;
+}
+
+esp_err_t
+tas5805m_get_mute(bool *enabled)
+{
+ int currentVolume;
+ if (tas5805m_get_volume(¤tVolume) != ESP_OK)
+ {
+ ESP_LOGW(TAG, "Cant get volume in get-Mute-Function");
+ }
+ if (currentVolume == TAS5805M_VOLUME_MUTE)
+ {
+ *enabled = true;
+ }
+ else
+ {
+ *enabled = false;
+ }
+ return ESP_OK;
+}
+
+esp_err_t tas5805m_ctrl(audio_hal_codec_mode_t mode,
+ audio_hal_ctrl_t ctrl_state)
+{
+ // TODO
+ return ESP_OK;
+}
+
+esp_err_t tas5805m_config_iface(audio_hal_codec_mode_t mode,
+ audio_hal_codec_i2s_iface_t *iface)
+{
+ // TODO
+ return ESP_OK;
+}
diff --git a/components/custom_driver/CMakeLists.txt b/components/custom_driver/CMakeLists.txt
deleted file mode 100644
index 7bd6050..0000000
--- a/components/custom_driver/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-idf_component_register( SRCS "i2s.c"
- INCLUDE_DIRS "include")
diff --git a/components/custom_driver/component.mk b/components/custom_driver/component.mk
deleted file mode 100644
index 3272a3c..0000000
--- a/components/custom_driver/component.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-COMPONENT_SRCDIRS := .
-# CFLAGS +=
diff --git a/components/custom_driver/i2s.c b/components/custom_driver/i2s.c
deleted file mode 100644
index 6f9d341..0000000
--- a/components/custom_driver/i2s.c
+++ /dev/null
@@ -1,1290 +0,0 @@
-// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Modifications copyright (C) 2021 CarlosDerSeher
-
-#include
-#include
-#include
-#include
-
-#include "freertos/FreeRTOS.h"
-#include "freertos/queue.h"
-#include "freertos/semphr.h"
-
-#include "driver/gpio.h"
-#include "hal/gpio_hal.h"
-#include "i2s.h"
-#include "soc/lldesc.h"
-
-#include "soc/rtc.h"
-
-#include "esp_attr.h"
-#include "soc/chip_revision.h"
-#include "hal/efuse_hal.h"
-#include "esp_err.h"
-#include "esp_intr_alloc.h"
-#include "esp_log.h"
-#include "esp_pm.h"
-#include "esp_rom_gpio.h"
-
-#include "sdkconfig.h"
-
-static const char *I2S_TAG = "c_I2S";
-
-#define I2S_CHECK(a, str, ret) \
- if (!(a)) { \
- ESP_LOGE(I2S_TAG, "%s(%d): %s", __FUNCTION__, __LINE__, str); \
- return (ret); \
- }
-
-#define I2S_ENTER_CRITICAL_ISR() portENTER_CRITICAL_ISR(&i2s_spinlock[i2s_num])
-#define I2S_EXIT_CRITICAL_ISR() portEXIT_CRITICAL_ISR(&i2s_spinlock[i2s_num])
-#define I2S_ENTER_CRITICAL() portENTER_CRITICAL(&i2s_spinlock[i2s_num])
-#define I2S_EXIT_CRITICAL() portEXIT_CRITICAL(&i2s_spinlock[i2s_num])
-#define I2S_FULL_DUPLEX_SLAVE_MODE_MASK \
- (I2S_MODE_TX | I2S_MODE_RX | I2S_MODE_SLAVE)
-#define I2S_FULL_DUPLEX_MASTER_MODE_MASK \
- (I2S_MODE_TX | I2S_MODE_RX | I2S_MODE_MASTER)
-
-// TODO: Refactor to put this logic into LL
-#define I2S_AD_BCK_FACTOR (2)
-#define I2S_PDM_BCK_FACTOR (64)
-#define I2S_BASE_CLK (2 * APB_CLK_FREQ)
-
-/**
- * @brief DMA buffer object
- *
- */
-typedef struct {
- char **buf;
- int buf_size;
- int rw_pos;
- void *curr_ptr;
- SemaphoreHandle_t mux;
- xQueueHandle queue;
- lldesc_t **desc;
-} i2s_dma_t;
-
-/**
- * @brief I2S object instance
- *
- */
-typedef struct {
- i2s_port_t i2s_num; /*!< I2S port number*/
- int queue_size; /*!< I2S event queue size*/
- QueueHandle_t i2s_queue; /*!< I2S queue handler*/
- int dma_buf_count; /*!< DMA buffer count, number of buffer*/
- int dma_buf_len; /*!< DMA buffer length, length of each buffer*/
- i2s_dma_t *rx; /*!< DMA Tx buffer*/
- i2s_dma_t *tx; /*!< DMA Rx buffer*/
- i2s_isr_handle_t i2s_isr_handle; /*!< I2S Interrupt handle*/
- int channel_num; /*!< Number of channels*/
- int bytes_per_sample; /*!< Bytes per sample*/
- int bits_per_sample; /*!< Bits per sample*/
- i2s_mode_t mode; /*!< I2S Working mode*/
- uint32_t sample_rate; /*!< I2S sample rate */
- bool use_apll; /*!< I2S use APLL clock */
- bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor on underflow */
- int fixed_mclk; /*!< I2S fixed MLCK clock */
- double real_rate;
-#ifdef CONFIG_PM_ENABLE
- esp_pm_lock_handle_t pm_lock;
-#endif
- i2s_hal_context_t hal; /*!< I2S hal context*/
-} i2s_obj_t;
-
-static i2s_obj_t *p_i2s_obj[I2S_NUM_MAX] = {0};
-
-static portMUX_TYPE i2s_spinlock[I2S_NUM_MAX];
-
-static i2s_dma_t *i2s_create_dma_queue(i2s_port_t i2s_num, int dma_buf_count,
- int dma_buf_len);
-static esp_err_t i2s_destroy_dma_queue(i2s_port_t i2s_num, i2s_dma_t *dma);
-
-static inline void gpio_matrix_out_check(int gpio, uint32_t signal_idx,
- bool out_inv, bool oen_inv) {
- // if pin = -1, do not need to configure
- if (gpio != -1) {
- gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
- gpio_set_direction(gpio, GPIO_MODE_OUTPUT);
- esp_rom_gpio_connect_out_signal(gpio, signal_idx, out_inv, oen_inv);
- }
-}
-
-static inline void gpio_matrix_in_check(int gpio, uint32_t signal_idx,
- bool inv) {
- if (gpio != -1) {
- gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
- // Set direction, for some GPIOs, the input function are not enabled as
- // default.
- gpio_set_direction(gpio, GPIO_MODE_INPUT);
- esp_rom_gpio_connect_in_signal(gpio, signal_idx, inv);
- }
-}
-
-esp_err_t i2s_custom_clear_intr_status(i2s_port_t i2s_num, uint32_t clr_mask) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- i2s_hal_clear_intr_status(&(p_i2s_obj[i2s_num]->hal), clr_mask);
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_enable_rx_intr(i2s_port_t i2s_num) {
- I2S_ENTER_CRITICAL();
- i2s_hal_enable_rx_intr(&(p_i2s_obj[i2s_num]->hal));
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_disable_rx_intr(i2s_port_t i2s_num) {
- I2S_ENTER_CRITICAL();
- i2s_hal_disable_rx_intr(&(p_i2s_obj[i2s_num]->hal));
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_disable_tx_intr(i2s_port_t i2s_num) {
- I2S_ENTER_CRITICAL();
- i2s_hal_disable_tx_intr(&(p_i2s_obj[i2s_num]->hal));
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_enable_tx_intr(i2s_port_t i2s_num) {
- I2S_ENTER_CRITICAL();
- i2s_hal_enable_tx_intr(&(p_i2s_obj[i2s_num]->hal));
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-float i2s_custom_get_clk(i2s_port_t i2s_num) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- return p_i2s_obj[i2s_num]->real_rate;
-}
-
-static esp_err_t i2s_isr_register(i2s_port_t i2s_num, int intr_alloc_flags,
- void (*fn)(void *), void *arg,
- i2s_isr_handle_t *handle) {
- return esp_intr_alloc(i2s_periph_signal[i2s_num].irq, intr_alloc_flags, fn,
- arg, handle);
-}
-
-static float i2s_apll_get_fi2s(int bits_per_sample, int sdm0, int sdm1,
- int sdm2, int odir) {
- int f_xtal = (int)rtc_clk_xtal_freq_get() * 1000000;
-
-#if CONFIG_IDF_TARGET_ESP32
- /* ESP32 rev0 silicon issue for APLL range/accuracy, please see ESP32 ECO document for more information on this */
- if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 100)) {
- sdm0 = 0;
- sdm1 = 0;
- }
-#endif
- float fout = f_xtal * (sdm2 + sdm1 / 256.0f + sdm0 / 65536.0f + 4);
- if (fout < SOC_I2S_APLL_MIN_FREQ || fout > SOC_I2S_APLL_MAX_FREQ) {
- return SOC_I2S_APLL_MAX_FREQ;
- }
- float fpll = fout / (2 * (odir + 2)); //== fi2s (N=1, b=0, a=1)
- return fpll / 2;
-}
-
-/**
- * @brief APLL calculate function, was described by following:
- * APLL Output frequency is given by the formula:
- *
- * apll_freq = xtal_freq * (4 + sdm2 + sdm1/256 +
- * sdm0/65536)/((o_div + 2) * 2) apll_freq = fout / ((o_div + 2) * 2)
- *
- * The dividend in this expression should be in the range of 240 -
- * 600 MHz. In rev. 0 of ESP32, sdm0 and sdm1 are unused and always set to 0.
- * * sdm0 frequency adjustment parameter, 0..255
- * * sdm1 frequency adjustment parameter, 0..255
- * * sdm2 frequency adjustment parameter, 0..63
- * * o_div frequency divider, 0..31
- *
- * The most accurate way to find the sdm0..2 and odir parameters is
- * to loop through them all, then apply the above formula, finding the closest
- * frequency to the desired one. But 256*256*64*32 = 134.217.728 loops are too
- * slow with ESP32
- * 1. We will choose the parameters with the highest level of
- * change, With 350MHztx), "tx NULL", ESP_ERR_INVALID_ARG);
-
- i2s_custom_stop(i2s_num);
-
- xSemaphoreTake(p_i2s_obj[i2s_num]->tx->mux, (portTickType)portMAX_DELAY);
-
- i2s_hal_set_out_link_addr(&(p_i2s_obj[i2s_num]->hal),
- (uint32_t)p_i2s_obj[i2s_num]->tx->desc[0]);
-
- p_i2s_obj[i2s_num]->tx->curr_ptr = NULL;
- p_i2s_obj[i2s_num]->tx->rw_pos = 0;
-
- // fill DMA buffers
- if ((data != NULL) && (written != NULL) && (size != 0)) {
- size_t offset = *currentDescriptorOffset;
- size_t maxDmaBufBytes = p_i2s_obj[i2s_num]->dma_buf_len *
- p_i2s_obj[i2s_num]->bytes_per_sample *
- p_i2s_obj[i2s_num]->channel_num;
-
- for (i = *currentDescriptor; i < p_i2s_obj[i2s_num]->dma_buf_count; i++) {
- char *buf = (char *)p_i2s_obj[i2s_num]->tx->desc[i]->buf;
-
- if (tmpSize > maxDmaBufBytes) {
- memcpy(buf, &data[offset], maxDmaBufBytes);
- offset += maxDmaBufBytes;
-
- // ESP_LOGW(I2S_TAG, "wrote %d to desc[%d]", maxDmaBufBytes, i);
-
- tmpSize -= maxDmaBufBytes;
- } else {
- memcpy(buf, &data[offset], tmpSize);
- offset += tmpSize;
-
- // ESP_LOGW(I2S_TAG, "wrote %d to desc[%d]", tmpSize, i);
-
- tmpSize = 0;
- }
-
- if (tmpSize == 0) {
- break;
- }
- }
-
- if (currentDescriptor) {
- *currentDescriptor = i + 1;
- }
-
- if (currentDescriptorOffset) {
- if (offset == size) {
- *currentDescriptorOffset = 0;
- } else {
- *currentDescriptorOffset = offset;
- }
- }
-
- *written = offset;
- }
-
- // empty queue
- xQueueReset(p_i2s_obj[i2s_num]->tx->queue);
-
- xSemaphoreGive(p_i2s_obj[i2s_num]->tx->mux);
-
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_set_clk(i2s_port_t i2s_num, uint32_t rate,
- i2s_bits_per_sample_t bits, i2s_channel_t ch) {
- int factor =
- (256 % bits) ? 384 : 256; // According to hardware codec
- // requirement(supported 256fs or 384fs)
- int clkmInteger, clkmDecimals, bck = 0;
- double denom = (double)1 / 64;
- int channel = 2;
- i2s_dma_t *save_tx = NULL, *save_rx = NULL;
-
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
-
- if (bits % 8 != 0 || bits > I2S_BITS_PER_SAMPLE_32BIT ||
- bits < I2S_BITS_PER_SAMPLE_16BIT) {
- ESP_LOGE(I2S_TAG, "Invalid bits per sample");
- return ESP_ERR_INVALID_ARG;
- }
-
- if (p_i2s_obj[i2s_num] == NULL) {
- ESP_LOGE(I2S_TAG, "Not initialized yet");
- return ESP_ERR_INVALID_ARG;
- }
- p_i2s_obj[i2s_num]->sample_rate = rate;
- double clkmdiv = (double)I2S_BASE_CLK / (rate * factor);
-
- if (clkmdiv > 256) {
- ESP_LOGE(I2S_TAG, "clkmdiv is too large\r\n");
- return ESP_ERR_INVALID_ARG;
- }
-
- // wait all on-going writing finish
- if ((p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) && p_i2s_obj[i2s_num]->tx) {
- xSemaphoreTake(p_i2s_obj[i2s_num]->tx->mux, (portTickType)portMAX_DELAY);
- }
- if ((p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) && p_i2s_obj[i2s_num]->rx) {
- xSemaphoreTake(p_i2s_obj[i2s_num]->rx->mux, (portTickType)portMAX_DELAY);
- }
-
- i2s_custom_stop(i2s_num);
- i2s_hal_set_rx_mode(&(p_i2s_obj[i2s_num]->hal), ch, bits);
- i2s_hal_set_tx_mode(&(p_i2s_obj[i2s_num]->hal), ch, bits);
-
- if (p_i2s_obj[i2s_num]->channel_num != (int)ch) {
- p_i2s_obj[i2s_num]->channel_num = (ch == 2) ? 2 : 1;
- }
-
- if ((int)bits != p_i2s_obj[i2s_num]->bits_per_sample) {
- p_i2s_obj[i2s_num]->bits_per_sample = bits;
-
- // Round bytes_per_sample up to next multiple of 16 bits
- int halfwords_per_sample = (bits + 15) / 16;
- p_i2s_obj[i2s_num]->bytes_per_sample = halfwords_per_sample * 2;
-
- // Because limited of DMA buffer is 4092 bytes
- if (p_i2s_obj[i2s_num]->dma_buf_len * p_i2s_obj[i2s_num]->bytes_per_sample *
- p_i2s_obj[i2s_num]->channel_num >
- 4092) {
- p_i2s_obj[i2s_num]->dma_buf_len = 4092 /
- p_i2s_obj[i2s_num]->bytes_per_sample /
- p_i2s_obj[i2s_num]->channel_num;
- }
- // Re-create TX DMA buffer
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- save_tx = p_i2s_obj[i2s_num]->tx;
-
- p_i2s_obj[i2s_num]->tx =
- i2s_create_dma_queue(i2s_num, p_i2s_obj[i2s_num]->dma_buf_count,
- p_i2s_obj[i2s_num]->dma_buf_len);
- if (p_i2s_obj[i2s_num]->tx == NULL) {
- ESP_LOGE(I2S_TAG, "Failed to create tx dma buffer");
- i2s_custom_driver_uninstall(i2s_num);
- return ESP_ERR_NO_MEM;
- }
- i2s_hal_set_out_link_addr(&(p_i2s_obj[i2s_num]->hal),
- (uint32_t)p_i2s_obj[i2s_num]->tx->desc[0]);
-
- // destroy old tx dma if exist
- if (save_tx) {
- i2s_destroy_dma_queue(i2s_num, save_tx);
- }
- }
- // Re-create RX DMA buffer
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- save_rx = p_i2s_obj[i2s_num]->rx;
-
- p_i2s_obj[i2s_num]->rx =
- i2s_create_dma_queue(i2s_num, p_i2s_obj[i2s_num]->dma_buf_count,
- p_i2s_obj[i2s_num]->dma_buf_len);
- if (p_i2s_obj[i2s_num]->rx == NULL) {
- ESP_LOGE(I2S_TAG, "Failed to create rx dma buffer");
- i2s_custom_driver_uninstall(i2s_num);
- return ESP_ERR_NO_MEM;
- }
- i2s_hal_set_in_link(&(p_i2s_obj[i2s_num]->hal),
- p_i2s_obj[i2s_num]->dma_buf_len *
- p_i2s_obj[i2s_num]->channel_num *
- p_i2s_obj[i2s_num]->bytes_per_sample,
- (uint32_t)p_i2s_obj[i2s_num]->rx->desc[0]);
- // destroy old rx dma if exist
- if (save_rx) {
- i2s_destroy_dma_queue(i2s_num, save_rx);
- }
- }
- }
-
- double mclk;
- int sdm0, sdm1, sdm2, odir, m_scale = 8;
- int fi2s_clk = rate * channel * bits * m_scale;
-#if SOC_I2S_SUPPORTS_PDM
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_PDM) {
- uint32_t b_clk = 0;
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- uint32_t fp, fs;
- i2s_hal_get_tx_pdm(&(p_i2s_obj[i2s_num]->hal), &fp, &fs);
- // Recommended set `fp = 960, fs = sample_rate / 100`
- fs = rate / 100;
- i2s_hal_tx_pdm_cfg(&(p_i2s_obj[i2s_num]->hal), fp, fs);
- b_clk = rate * I2S_PDM_BCK_FACTOR * fp / fs;
- } else if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- uint32_t dsr;
- i2s_hal_get_rx_pdm(&(p_i2s_obj[i2s_num]->hal), &dsr);
- b_clk = rate * I2S_PDM_BCK_FACTOR * (dsr ? 2 : 1);
- }
- fi2s_clk = b_clk * m_scale;
- int factor2 = 5;
- mclk = b_clk * factor2;
- clkmdiv = ((double)I2S_BASE_CLK) / mclk;
- clkmInteger = clkmdiv;
- clkmDecimals = (clkmdiv - clkmInteger) / denom;
- bck = mclk / b_clk;
- } else
-#endif
- {
- clkmInteger = clkmdiv;
- clkmDecimals = (clkmdiv - clkmInteger) / denom;
- mclk = clkmInteger + denom * clkmDecimals;
- bck = factor / (bits * channel);
- }
-
- if (p_i2s_obj[i2s_num]->use_apll && p_i2s_obj[i2s_num]->fixed_mclk) {
- fi2s_clk = p_i2s_obj[i2s_num]->fixed_mclk;
- m_scale = fi2s_clk / bits / rate / channel;
- }
- if (p_i2s_obj[i2s_num]->use_apll &&
- i2s_apll_calculate_fi2s(fi2s_clk, bits, &sdm0, &sdm1, &sdm2, &odir) ==
- ESP_OK) {
- ESP_LOGD(I2S_TAG, "sdm0=%d, sdm1=%d, sdm2=%d, odir=%d", sdm0, sdm1, sdm2,
- odir);
- rtc_clk_apll_enable(1, sdm0, sdm1, sdm2, odir);
- i2s_hal_set_clk_div(&(p_i2s_obj[i2s_num]->hal), 1, 1, 0, m_scale, m_scale);
- i2s_hal_set_clock_sel(&(p_i2s_obj[i2s_num]->hal), I2S_CLK_APLL);
- double fi2s_rate = i2s_apll_get_fi2s(bits, sdm0, sdm1, sdm2, odir);
- p_i2s_obj[i2s_num]->real_rate = fi2s_rate / bits / channel / m_scale;
- ESP_LOGI(I2S_TAG,
- "APLL: Req RATE: %d, real rate: %0.3f, BITS: %u, CLKM: %u, "
- "BCK_M: %u, MCLK: %0.3f, SCLK: %f, diva: %d, divb: %d",
- rate, fi2s_rate / bits / channel / m_scale, bits, 1, m_scale,
- fi2s_rate, fi2s_rate / 8, 1, 0);
- } else {
- i2s_hal_set_clock_sel(&(p_i2s_obj[i2s_num]->hal), I2S_CLK_D2CLK);
- i2s_hal_set_clk_div(&(p_i2s_obj[i2s_num]->hal), clkmInteger, 63,
- clkmDecimals, bck, bck);
- double real_rate = (double)(I2S_BASE_CLK / (bck * bits * clkmInteger) / 2);
- p_i2s_obj[i2s_num]->real_rate = real_rate;
- ESP_LOGI(I2S_TAG,
- "PLL_D2: Req RATE: %d, real rate: %0.3f, BITS: %u, CLKM: %u, "
- "BCK: %u, MCLK: %0.3f, SCLK: %f, diva: %d, divb: %d",
- rate, real_rate, bits, clkmInteger, bck,
- (double)I2S_BASE_CLK / mclk, real_rate * bits * channel, 64,
- clkmDecimals);
- }
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- p_i2s_obj[i2s_num]->tx->curr_ptr = NULL;
- p_i2s_obj[i2s_num]->tx->rw_pos = 0;
- }
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- p_i2s_obj[i2s_num]->rx->curr_ptr = NULL;
- p_i2s_obj[i2s_num]->rx->rw_pos = 0;
- }
-
- i2s_hal_set_tx_bits_mod(&(p_i2s_obj[i2s_num]->hal), bits);
- i2s_hal_set_rx_bits_mod(&(p_i2s_obj[i2s_num]->hal), bits);
-
- // wait all writing on-going finish
- if ((p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) && p_i2s_obj[i2s_num]->tx) {
- xSemaphoreGive(p_i2s_obj[i2s_num]->tx->mux);
- }
- if ((p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) && p_i2s_obj[i2s_num]->rx) {
- xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
- }
-
- // i2s_custom_start(i2s_num); // don't start just yet, we want to
- // fill dma buffer first return ESP_OK;
-
- // ensure all DMA buffers are available right after initialization
- // ENSURE i2s_custom_start() isn't called before i2s_write has filled at
- // least one buffer
- return i2s_custom_init_dma_tx_queues(i2s_num, NULL, 0, NULL, NULL, NULL);
-}
-
-static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
- i2s_obj_t *p_i2s = (i2s_obj_t *)arg;
- uint32_t status;
- i2s_hal_get_intr_status(&(p_i2s->hal), &status);
- if (status == 0) {
- // Avoid spurious interrupt
- return;
- }
-
- i2s_event_t i2s_event;
- int dummy;
-
- portBASE_TYPE high_priority_task_awoken = 0;
-
- lldesc_t *finish_desc = NULL;
-
- if ((status & I2S_INTR_OUT_DSCR_ERR) || (status & I2S_INTR_IN_DSCR_ERR)) {
- ESP_EARLY_LOGE(I2S_TAG, "dma error, interrupt status: 0x%08x", status);
- if (p_i2s->i2s_queue) {
- i2s_event.type = I2S_EVENT_DMA_ERROR;
- if (xQueueIsQueueFullFromISR(p_i2s->i2s_queue)) {
- xQueueReceiveFromISR(p_i2s->i2s_queue, &dummy,
- &high_priority_task_awoken);
- }
- xQueueSendFromISR(p_i2s->i2s_queue, (void *)&i2s_event,
- &high_priority_task_awoken);
- }
- }
-
- if ((status & I2S_INTR_OUT_EOF) && p_i2s->tx) {
- i2s_hal_get_out_eof_des_addr(&(p_i2s->hal), (uint32_t *)&finish_desc);
- // All buffers are empty. This means we have an underflow on our hands.
- if (xQueueIsQueueFullFromISR(p_i2s->tx->queue)) {
- xQueueReceiveFromISR(p_i2s->tx->queue, &dummy,
- &high_priority_task_awoken);
- // See if tx descriptor needs to be auto cleared:
- // This will avoid any kind of noise that may get introduced due to
- // transmission of previous data from tx descriptor on I2S line.
- if (p_i2s->tx_desc_auto_clear == true) {
- memset((void *)dummy, 0, p_i2s->tx->buf_size);
- }
- }
- xQueueSendFromISR(p_i2s->tx->queue, (void *)(&finish_desc->buf),
- &high_priority_task_awoken);
- if (p_i2s->i2s_queue) {
- i2s_event.type = I2S_EVENT_TX_DONE;
- if (xQueueIsQueueFullFromISR(p_i2s->i2s_queue)) {
- xQueueReceiveFromISR(p_i2s->i2s_queue, &dummy,
- &high_priority_task_awoken);
- }
- xQueueSendFromISR(p_i2s->i2s_queue, (void *)&i2s_event,
- &high_priority_task_awoken);
- }
- }
-
- if ((status & I2S_INTR_IN_SUC_EOF) && p_i2s->rx) {
- // All buffers are full. This means we have an overflow.
- i2s_hal_get_in_eof_des_addr(&(p_i2s->hal), (uint32_t *)&finish_desc);
- if (xQueueIsQueueFullFromISR(p_i2s->rx->queue)) {
- xQueueReceiveFromISR(p_i2s->rx->queue, &dummy,
- &high_priority_task_awoken);
- }
- xQueueSendFromISR(p_i2s->rx->queue, (void *)(&finish_desc->buf),
- &high_priority_task_awoken);
- if (p_i2s->i2s_queue) {
- i2s_event.type = I2S_EVENT_RX_DONE;
- if (p_i2s->i2s_queue && xQueueIsQueueFullFromISR(p_i2s->i2s_queue)) {
- xQueueReceiveFromISR(p_i2s->i2s_queue, &dummy,
- &high_priority_task_awoken);
- }
- xQueueSendFromISR(p_i2s->i2s_queue, (void *)&i2s_event,
- &high_priority_task_awoken);
- }
- }
- i2s_hal_clear_intr_status(&(p_i2s->hal), status);
-
- if (high_priority_task_awoken == pdTRUE) {
- portYIELD_FROM_ISR();
- }
-}
-
-static esp_err_t i2s_destroy_dma_queue(i2s_port_t i2s_num, i2s_dma_t *dma) {
- int bux_idx;
- if (p_i2s_obj[i2s_num] == NULL) {
- ESP_LOGE(I2S_TAG, "Not initialized yet");
- return ESP_ERR_INVALID_ARG;
- }
- if (dma == NULL) {
- ESP_LOGE(I2S_TAG, "dma is NULL");
- return ESP_ERR_INVALID_ARG;
- }
- for (bux_idx = 0; bux_idx < p_i2s_obj[i2s_num]->dma_buf_count; bux_idx++) {
- if (dma->desc && dma->desc[bux_idx]) {
- free(dma->desc[bux_idx]);
- }
- if (dma->buf && dma->buf[bux_idx]) {
- free(dma->buf[bux_idx]);
- }
- }
- if (dma->buf) {
- free(dma->buf);
- }
- if (dma->desc) {
- free(dma->desc);
- }
- vQueueDelete(dma->queue);
- vSemaphoreDelete(dma->mux);
- free(dma);
- return ESP_OK;
-}
-
-static i2s_dma_t *i2s_create_dma_queue(i2s_port_t i2s_num, int dma_buf_count,
- int dma_buf_len) {
- int bux_idx;
- int sample_size =
- p_i2s_obj[i2s_num]->bytes_per_sample * p_i2s_obj[i2s_num]->channel_num;
- i2s_dma_t *dma = (i2s_dma_t *)malloc(sizeof(i2s_dma_t));
- if (dma == NULL) {
- ESP_LOGE(I2S_TAG, "Error malloc i2s_dma_t");
- return NULL;
- }
- memset(dma, 0, sizeof(i2s_dma_t));
-
- dma->buf = (char **)malloc(sizeof(char *) * dma_buf_count);
- if (dma->buf == NULL) {
- ESP_LOGE(I2S_TAG, "Error malloc dma buffer pointer");
- free(dma);
- return NULL;
- }
- memset(dma->buf, 0, sizeof(char *) * dma_buf_count);
-
- for (bux_idx = 0; bux_idx < dma_buf_count; bux_idx++) {
- dma->buf[bux_idx] =
- (char *)heap_caps_calloc(1, dma_buf_len * sample_size, MALLOC_CAP_DMA);
- if (dma->buf[bux_idx] == NULL) {
- ESP_LOGE(I2S_TAG, "Error malloc dma buffer");
- i2s_destroy_dma_queue(i2s_num, dma);
- return NULL;
- }
- ESP_LOGD(I2S_TAG, "Addr[%d] = %d", bux_idx, (int)dma->buf[bux_idx]);
- }
-
- dma->desc = (lldesc_t **)malloc(sizeof(lldesc_t *) * dma_buf_count);
- if (dma->desc == NULL) {
- ESP_LOGE(I2S_TAG, "Error malloc dma description");
- i2s_destroy_dma_queue(i2s_num, dma);
- return NULL;
- }
- for (bux_idx = 0; bux_idx < dma_buf_count; bux_idx++) {
- dma->desc[bux_idx] =
- (lldesc_t *)heap_caps_malloc(sizeof(lldesc_t), MALLOC_CAP_DMA);
- if (dma->desc[bux_idx] == NULL) {
- ESP_LOGE(I2S_TAG, "Error malloc dma description entry");
- i2s_destroy_dma_queue(i2s_num, dma);
- return NULL;
- }
- }
-
- for (bux_idx = 0; bux_idx < dma_buf_count; bux_idx++) {
- dma->desc[bux_idx]->owner = 1;
- dma->desc[bux_idx]->eof = 1;
- dma->desc[bux_idx]->sosf = 0;
- dma->desc[bux_idx]->length = dma_buf_len * sample_size;
- dma->desc[bux_idx]->size = dma_buf_len * sample_size;
- dma->desc[bux_idx]->buf = (uint8_t *)dma->buf[bux_idx];
- dma->desc[bux_idx]->offset = 0;
- dma->desc[bux_idx]->empty =
- (uint32_t)((bux_idx < (dma_buf_count - 1)) ? (dma->desc[bux_idx + 1])
- : dma->desc[0]);
- }
-
- dma->queue = xQueueCreate(dma_buf_count - 1, sizeof(char *));
- dma->mux = xSemaphoreCreateMutex();
- dma->buf_size = dma_buf_len * sample_size;
- ESP_LOGI(I2S_TAG, "DMA Malloc info, datalen=blocksize=%d, dma_buf_count=%d",
- dma_buf_len * sample_size, dma_buf_count);
- return dma;
-}
-
-esp_err_t i2s_custom_start(i2s_port_t i2s_num) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- // start DMA link
- I2S_ENTER_CRITICAL();
- i2s_hal_reset(&(p_i2s_obj[i2s_num]->hal));
-
- esp_intr_disable(p_i2s_obj[i2s_num]->i2s_isr_handle);
- i2s_hal_clear_intr_status(&(p_i2s_obj[i2s_num]->hal), I2S_INTR_MAX);
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- i2s_custom_enable_tx_intr(i2s_num);
- i2s_hal_start_tx(&(p_i2s_obj[i2s_num]->hal));
- }
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- i2s_custom_enable_rx_intr(i2s_num);
- i2s_hal_start_rx(&(p_i2s_obj[i2s_num]->hal));
- }
- esp_intr_enable(p_i2s_obj[i2s_num]->i2s_isr_handle);
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_stop(i2s_port_t i2s_num) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_ENTER_CRITICAL();
- esp_intr_disable(p_i2s_obj[i2s_num]->i2s_isr_handle);
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- i2s_hal_stop_tx(&(p_i2s_obj[i2s_num]->hal));
- i2s_custom_disable_tx_intr(i2s_num);
- }
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- i2s_hal_stop_rx(&(p_i2s_obj[i2s_num]->hal));
- i2s_custom_disable_rx_intr(i2s_num);
- }
- uint32_t mask;
- i2s_hal_get_intr_status(&(p_i2s_obj[i2s_num]->hal), &mask);
- i2s_hal_clear_intr_status(&(p_i2s_obj[i2s_num]->hal), mask);
- I2S_EXIT_CRITICAL();
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- if (pin == NULL) {
- return ESP_ERR_INVALID_ARG;
- }
-
- if (pin->bck_io_num != -1 && !GPIO_IS_VALID_GPIO(pin->bck_io_num)) {
- ESP_LOGE(I2S_TAG, "bck_io_num error");
- return ESP_FAIL;
- }
- if (pin->ws_io_num != -1 && !GPIO_IS_VALID_GPIO(pin->ws_io_num)) {
- ESP_LOGE(I2S_TAG, "ws_io_num error");
- return ESP_FAIL;
- }
- if (pin->data_out_num != -1 &&
- !GPIO_IS_VALID_OUTPUT_GPIO(pin->data_out_num)) {
- ESP_LOGE(I2S_TAG, "data_out_num error");
- return ESP_FAIL;
- }
- if (pin->data_in_num != -1 && !GPIO_IS_VALID_GPIO(pin->data_in_num)) {
- ESP_LOGE(I2S_TAG, "data_in_num error");
- return ESP_FAIL;
- }
-
- int bck_sig = -1, ws_sig = -1, data_out_sig = -1, data_in_sig = -1;
- // Each IIS hw module has a RX and TX unit.
- // For TX unit, the output signal index should be I2SnO_xxx_OUT_IDX
- // For TX unit, the input signal index should be I2SnO_xxx_IN_IDX
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX) {
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_MASTER) {
- bck_sig = i2s_periph_signal[i2s_num].o_bck_out_sig;
- ws_sig = i2s_periph_signal[i2s_num].o_ws_out_sig;
- data_out_sig = i2s_periph_signal[i2s_num].o_data_out_sig;
- } else if (p_i2s_obj[i2s_num]->mode & I2S_MODE_SLAVE) {
- bck_sig = i2s_periph_signal[i2s_num].o_bck_in_sig;
- ws_sig = i2s_periph_signal[i2s_num].o_ws_in_sig;
- data_out_sig = i2s_periph_signal[i2s_num].o_data_out_sig;
- }
- }
- // For RX unit, the output signal index should be I2SnI_xxx_OUT_IDX
- // For RX unit, the input signal index should be I2SnI_xxx_IN_IDX
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) {
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_MASTER) {
- bck_sig = i2s_periph_signal[i2s_num].i_bck_out_sig;
- ws_sig = i2s_periph_signal[i2s_num].i_ws_out_sig;
- data_in_sig = i2s_periph_signal[i2s_num].i_data_in_sig;
- } else if (p_i2s_obj[i2s_num]->mode & I2S_MODE_SLAVE) {
- bck_sig = i2s_periph_signal[i2s_num].i_bck_in_sig;
- ws_sig = i2s_periph_signal[i2s_num].i_ws_in_sig;
- data_in_sig = i2s_periph_signal[i2s_num].i_data_in_sig;
- }
- }
- // For "full-duplex + slave" mode, we should select RX signal index for ws
- // and bck. For "full-duplex + master" mode, we should select TX signal index
- // for ws and bck.
- if ((p_i2s_obj[i2s_num]->mode & I2S_FULL_DUPLEX_SLAVE_MODE_MASK) ==
- I2S_FULL_DUPLEX_SLAVE_MODE_MASK) {
- bck_sig = i2s_periph_signal[i2s_num].i_bck_in_sig;
- ws_sig = i2s_periph_signal[i2s_num].i_ws_in_sig;
- } else if ((p_i2s_obj[i2s_num]->mode & I2S_FULL_DUPLEX_MASTER_MODE_MASK) ==
- I2S_FULL_DUPLEX_MASTER_MODE_MASK) {
- bck_sig = i2s_periph_signal[i2s_num].o_bck_out_sig;
- ws_sig = i2s_periph_signal[i2s_num].o_ws_out_sig;
- }
- gpio_matrix_out_check(pin->data_out_num, data_out_sig, 0, 0);
- gpio_matrix_in_check(pin->data_in_num, data_in_sig, 0);
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_MASTER) {
- gpio_matrix_out_check(pin->ws_io_num, ws_sig, 0, 0);
- gpio_matrix_out_check(pin->bck_io_num, bck_sig, 0, 0);
- } else if (p_i2s_obj[i2s_num]->mode & I2S_MODE_SLAVE) {
- gpio_matrix_in_check(pin->ws_io_num, ws_sig, 0);
- gpio_matrix_in_check(pin->bck_io_num, bck_sig, 0);
- }
- ESP_LOGD(I2S_TAG, "data: out %d, in: %d, ws: %d, bck: %d", data_out_sig,
- data_in_sig, ws_sig, bck_sig);
-
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_set_sample_rates(i2s_port_t i2s_num, uint32_t rate) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((p_i2s_obj[i2s_num]->bytes_per_sample > 0),
- "bits_per_sample not set", ESP_ERR_INVALID_ARG);
- return i2s_custom_set_clk(i2s_num, rate, p_i2s_obj[i2s_num]->bits_per_sample,
- p_i2s_obj[i2s_num]->channel_num);
-}
-
-#if SOC_I2S_SUPPORTS_PDM
-esp_err_t i2s_custom_set_pdm_rx_down_sample(i2s_port_t i2s_num,
- i2s_pdm_dsr_t dsr) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- i2s_hal_rx_pdm_cfg(&(p_i2s_obj[i2s_num]->hal), dsr);
- return i2s_custom_set_clk(i2s_num, p_i2s_obj[i2s_num]->sample_rate,
- p_i2s_obj[i2s_num]->bits_per_sample,
- p_i2s_obj[i2s_num]->channel_num);
-}
-#endif
-
-static esp_err_t i2s_custom_check_cfg_static(i2s_port_t i2s_num,
- const i2s_config_t *cfg) {
-#if SOC_I2S_SUPPORTS_PDM
- // We only check if the I2S number is invalid when set to PDM mode.
- I2S_CHECK(!((cfg->mode & I2S_MODE_PDM) && (i2s_num != I2S_NUM_0)),
- "I2S DAC PDM only support on I2S0", ESP_ERR_INVALID_ARG);
- return ESP_OK;
-#endif
-
- I2S_CHECK(cfg->communication_format &&
- (cfg->communication_format < I2S_COMM_FORMAT_STAND_MAX),
- "invalid communication formats", ESP_ERR_INVALID_ARG);
- I2S_CHECK(!((cfg->communication_format & I2S_COMM_FORMAT_STAND_MSB) &&
- (cfg->communication_format & I2S_COMM_FORMAT_STAND_PCM_LONG)),
- "multiple communication formats specified", ESP_ERR_INVALID_ARG);
- return ESP_OK;
-}
-
-static esp_err_t i2s_param_config(i2s_port_t i2s_num,
- const i2s_config_t *i2s_config) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((i2s_config), "param null", ESP_ERR_INVALID_ARG);
- I2S_CHECK((i2s_custom_check_cfg_static(i2s_num, i2s_config) == ESP_OK),
- "param check error", ESP_ERR_INVALID_ARG);
-
- periph_module_enable(i2s_periph_signal[i2s_num].module);
-
- // configure I2S data port interface.
- i2s_hal_config_param(&(p_i2s_obj[i2s_num]->hal), i2s_config);
- if ((p_i2s_obj[i2s_num]->mode & I2S_MODE_RX) &&
- (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX)) {
- i2s_hal_enable_sig_loopback(&(p_i2s_obj[i2s_num]->hal));
- if (p_i2s_obj[i2s_num]->mode & I2S_MODE_MASTER) {
- i2s_hal_enable_master_mode(&(p_i2s_obj[i2s_num]->hal));
- } else {
- i2s_hal_enable_slave_mode(&(p_i2s_obj[i2s_num]->hal));
- }
- }
-
- p_i2s_obj[i2s_num]->use_apll = i2s_config->use_apll;
- p_i2s_obj[i2s_num]->tx_desc_auto_clear = i2s_config->tx_desc_auto_clear;
- p_i2s_obj[i2s_num]->fixed_mclk = i2s_config->fixed_mclk;
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_zero_dma_buffer(i2s_port_t i2s_num) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- if (p_i2s_obj[i2s_num]->rx && p_i2s_obj[i2s_num]->rx->buf != NULL &&
- p_i2s_obj[i2s_num]->rx->buf_size != 0) {
- for (int i = 0; i < p_i2s_obj[i2s_num]->dma_buf_count; i++) {
- memset(p_i2s_obj[i2s_num]->rx->buf[i], 0,
- p_i2s_obj[i2s_num]->rx->buf_size);
- }
- }
- if (p_i2s_obj[i2s_num]->tx && p_i2s_obj[i2s_num]->tx->buf != NULL &&
- p_i2s_obj[i2s_num]->tx->buf_size != 0) {
- int bytes_left = 0;
- bytes_left =
- (p_i2s_obj[i2s_num]->tx->buf_size - p_i2s_obj[i2s_num]->tx->rw_pos) % 4;
- if (bytes_left) {
- size_t zero_bytes = 0, bytes_written;
- i2s_custom_write(i2s_num, (void *)&zero_bytes, bytes_left, &bytes_written,
- portMAX_DELAY);
- }
- for (int i = 0; i < p_i2s_obj[i2s_num]->dma_buf_count; i++) {
- memset(p_i2s_obj[i2s_num]->tx->buf[i], 0,
- p_i2s_obj[i2s_num]->tx->buf_size);
- }
- }
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_driver_install(i2s_port_t i2s_num,
- const i2s_config_t *i2s_config,
- int queue_size, void *i2s_queue) {
- esp_err_t err;
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((i2s_config != NULL), "I2S configuration must not NULL",
- ESP_ERR_INVALID_ARG);
- I2S_CHECK(
- (i2s_config->dma_buf_count >= 2 && i2s_config->dma_buf_count <= 128),
- "I2S buffer count less than 128 and more than 2", ESP_ERR_INVALID_ARG);
- I2S_CHECK((i2s_config->dma_buf_len >= 8 && i2s_config->dma_buf_len <= 1024),
- "I2S buffer length at most 1024 and more than 8",
- ESP_ERR_INVALID_ARG);
- if (p_i2s_obj[i2s_num] == NULL) {
- p_i2s_obj[i2s_num] = (i2s_obj_t *)malloc(sizeof(i2s_obj_t));
- if (p_i2s_obj[i2s_num] == NULL) {
- ESP_LOGE(I2S_TAG, "Malloc I2S driver error");
- return ESP_ERR_NO_MEM;
- }
- memset(p_i2s_obj[i2s_num], 0, sizeof(i2s_obj_t));
-
- portMUX_TYPE i2s_spinlock_unlocked[1] = {portMUX_INITIALIZER_UNLOCKED};
- for (int x = 0; x < I2S_NUM_MAX; x++) {
- i2s_spinlock[x] = i2s_spinlock_unlocked[0];
- }
- // To make sure hardware is enabled before any hardware register
- // operations.
- periph_module_enable(i2s_periph_signal[i2s_num].module);
- i2s_hal_init(&(p_i2s_obj[i2s_num]->hal), i2s_num);
-
- p_i2s_obj[i2s_num]->i2s_num = i2s_num;
- p_i2s_obj[i2s_num]->dma_buf_count = i2s_config->dma_buf_count;
- p_i2s_obj[i2s_num]->dma_buf_len = i2s_config->dma_buf_len;
- p_i2s_obj[i2s_num]->i2s_queue = i2s_queue;
- p_i2s_obj[i2s_num]->mode = i2s_config->mode;
-
- p_i2s_obj[i2s_num]->bits_per_sample = 0;
- p_i2s_obj[i2s_num]->bytes_per_sample = 0; // Not initialized yet
- p_i2s_obj[i2s_num]->channel_num =
- i2s_config->channel_format < I2S_CHANNEL_FMT_ONLY_RIGHT ? 2 : 1;
-
-#ifdef CONFIG_PM_ENABLE
- if (i2s_config->use_apll) {
- err = esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "i2s_driver",
- &p_i2s_obj[i2s_num]->pm_lock);
- } else {
- err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "i2s_driver",
- &p_i2s_obj[i2s_num]->pm_lock);
- }
- if (err != ESP_OK) {
- free(p_i2s_obj[i2s_num]);
- p_i2s_obj[i2s_num] = NULL;
- ESP_LOGE(I2S_TAG, "I2S pm lock error");
- return err;
- }
-#endif // CONFIG_PM_ENABLE
-
- // initial interrupt
- err = i2s_isr_register(i2s_num, i2s_config->intr_alloc_flags,
- i2s_intr_handler_default, p_i2s_obj[i2s_num],
- &p_i2s_obj[i2s_num]->i2s_isr_handle);
- if (err != ESP_OK) {
-#ifdef CONFIG_PM_ENABLE
- if (p_i2s_obj[i2s_num]->pm_lock) {
- esp_pm_lock_delete(p_i2s_obj[i2s_num]->pm_lock);
- }
-#endif
- free(p_i2s_obj[i2s_num]);
- p_i2s_obj[i2s_num] = NULL;
- ESP_LOGE(I2S_TAG, "Register I2S Interrupt error");
- return err;
- }
- i2s_custom_stop(i2s_num);
- err = i2s_param_config(i2s_num, i2s_config);
- if (err != ESP_OK) {
- i2s_custom_driver_uninstall(i2s_num);
- ESP_LOGE(I2S_TAG, "I2S param configure error");
- return err;
- }
-
- if (i2s_queue) {
- p_i2s_obj[i2s_num]->i2s_queue =
- xQueueCreate(queue_size, sizeof(i2s_event_t));
- *((QueueHandle_t *)i2s_queue) = p_i2s_obj[i2s_num]->i2s_queue;
- ESP_LOGI(I2S_TAG, "queue free spaces: %d",
- uxQueueSpacesAvailable(p_i2s_obj[i2s_num]->i2s_queue));
- } else {
- p_i2s_obj[i2s_num]->i2s_queue = NULL;
- }
- // set clock and start
- return i2s_custom_set_clk(i2s_num, i2s_config->sample_rate,
- i2s_config->bits_per_sample,
- p_i2s_obj[i2s_num]->channel_num);
- }
-
- ESP_LOGW(I2S_TAG, "I2S driver already installed");
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_driver_uninstall(i2s_port_t i2s_num) {
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- if (p_i2s_obj[i2s_num] == NULL) {
- ESP_LOGI(I2S_TAG, "already uninstalled");
- return ESP_OK;
- }
- i2s_custom_stop(i2s_num);
- esp_intr_free(p_i2s_obj[i2s_num]->i2s_isr_handle);
-
- if (p_i2s_obj[i2s_num]->tx != NULL &&
- (p_i2s_obj[i2s_num]->mode & I2S_MODE_TX)) {
- i2s_destroy_dma_queue(i2s_num, p_i2s_obj[i2s_num]->tx);
- p_i2s_obj[i2s_num]->tx = NULL;
- }
- if (p_i2s_obj[i2s_num]->rx != NULL &&
- (p_i2s_obj[i2s_num]->mode & I2S_MODE_RX)) {
- i2s_destroy_dma_queue(i2s_num, p_i2s_obj[i2s_num]->rx);
- p_i2s_obj[i2s_num]->rx = NULL;
- }
-
- if (p_i2s_obj[i2s_num]->i2s_queue) {
- vQueueDelete(p_i2s_obj[i2s_num]->i2s_queue);
- p_i2s_obj[i2s_num]->i2s_queue = NULL;
- }
-
- if (p_i2s_obj[i2s_num]->use_apll) {
- rtc_clk_apll_enable(0, 0, 0, 0, 0);
- }
-#ifdef CONFIG_PM_ENABLE
- if (p_i2s_obj[i2s_num]->pm_lock) {
- esp_pm_lock_delete(p_i2s_obj[i2s_num]->pm_lock);
- }
-#endif
-
- free(p_i2s_obj[i2s_num]);
- p_i2s_obj[i2s_num] = NULL;
- periph_module_disable(i2s_periph_signal[i2s_num].module);
-
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_write(i2s_port_t i2s_num, const void *src, size_t size,
- size_t *bytes_written, TickType_t ticks_to_wait) {
- char *data_ptr, *src_byte;
- size_t bytes_can_write;
- *bytes_written = 0;
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((size < SOC_I2S_MAX_BUFFER_SIZE), "size is too large",
- ESP_ERR_INVALID_ARG);
- I2S_CHECK((p_i2s_obj[i2s_num]->tx), "tx NULL", ESP_ERR_INVALID_ARG);
- xSemaphoreTake(p_i2s_obj[i2s_num]->tx->mux, (portTickType)portMAX_DELAY);
-#ifdef CONFIG_PM_ENABLE
- esp_pm_lock_acquire(p_i2s_obj[i2s_num]->pm_lock);
-#endif
- src_byte = (char *)src;
- while (size > 0) {
- // for (int i = 0; i < p_i2s_obj[i2s_num]->dma_buf_count; i++) {
- // ESP_LOGI(I2S_TAG,"%d: EOF %d", i,
- // p_i2s_obj[i2s_num]->tx->desc[i]->eof);
- // }
-
- if (p_i2s_obj[i2s_num]->tx->rw_pos == p_i2s_obj[i2s_num]->tx->buf_size ||
- p_i2s_obj[i2s_num]->tx->curr_ptr == NULL) {
- if (xQueueReceive(p_i2s_obj[i2s_num]->tx->queue,
- &p_i2s_obj[i2s_num]->tx->curr_ptr,
- ticks_to_wait) == pdFALSE) {
- break;
- }
- p_i2s_obj[i2s_num]->tx->rw_pos = 0;
- }
- ESP_LOGD(I2S_TAG, "size: %d, rw_pos: %d, buf_size: %d, curr_ptr: %d", size,
- p_i2s_obj[i2s_num]->tx->rw_pos, p_i2s_obj[i2s_num]->tx->buf_size,
- (int)p_i2s_obj[i2s_num]->tx->curr_ptr);
- data_ptr = (char *)p_i2s_obj[i2s_num]->tx->curr_ptr;
- data_ptr += p_i2s_obj[i2s_num]->tx->rw_pos;
- bytes_can_write =
- p_i2s_obj[i2s_num]->tx->buf_size - p_i2s_obj[i2s_num]->tx->rw_pos;
- if (bytes_can_write > size) {
- bytes_can_write = size;
- }
- memcpy(data_ptr, src_byte, bytes_can_write);
- size -= bytes_can_write;
- src_byte += bytes_can_write;
- p_i2s_obj[i2s_num]->tx->rw_pos += bytes_can_write;
- (*bytes_written) += bytes_can_write;
- }
-#ifdef CONFIG_PM_ENABLE
- esp_pm_lock_release(p_i2s_obj[i2s_num]->pm_lock);
-#endif
-
- xSemaphoreGive(p_i2s_obj[i2s_num]->tx->mux);
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_write_expand(i2s_port_t i2s_num, const void *src,
- size_t size, size_t src_bits, size_t aim_bits,
- size_t *bytes_written,
- TickType_t ticks_to_wait) {
- char *data_ptr;
- int bytes_can_write, tail;
- int src_bytes, aim_bytes, zero_bytes;
- *bytes_written = 0;
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((size > 0), "size must greater than zero", ESP_ERR_INVALID_ARG);
- I2S_CHECK((aim_bits * size < SOC_I2S_MAX_BUFFER_SIZE), "size is too large",
- ESP_ERR_INVALID_ARG);
- I2S_CHECK((aim_bits >= src_bits), "aim_bits mustn't be less than src_bits",
- ESP_ERR_INVALID_ARG);
- I2S_CHECK((p_i2s_obj[i2s_num]->tx), "tx NULL", ESP_ERR_INVALID_ARG);
- if (src_bits < I2S_BITS_PER_SAMPLE_8BIT ||
- aim_bits < I2S_BITS_PER_SAMPLE_8BIT) {
- ESP_LOGE(I2S_TAG, "bits mustn't be less than 8, src_bits %d aim_bits %d",
- src_bits, aim_bits);
- return ESP_ERR_INVALID_ARG;
- }
- if (src_bits > I2S_BITS_PER_SAMPLE_32BIT ||
- aim_bits > I2S_BITS_PER_SAMPLE_32BIT) {
- ESP_LOGE(I2S_TAG,
- "bits mustn't be greater than 32, src_bits %d aim_bits %d",
- src_bits, aim_bits);
- return ESP_ERR_INVALID_ARG;
- }
- if ((src_bits == I2S_BITS_PER_SAMPLE_16BIT ||
- src_bits == I2S_BITS_PER_SAMPLE_32BIT) &&
- (size % 2 != 0)) {
- ESP_LOGE(I2S_TAG,
- "size must be a even number while src_bits is even, src_bits "
- "%d size %d",
- src_bits, size);
- return ESP_ERR_INVALID_ARG;
- }
- if (src_bits == I2S_BITS_PER_SAMPLE_24BIT && (size % 3 != 0)) {
- ESP_LOGE(I2S_TAG,
- "size must be a multiple of 3 while src_bits is 24, size %d",
- size);
- return ESP_ERR_INVALID_ARG;
- }
-
- src_bytes = src_bits / 8;
- aim_bytes = aim_bits / 8;
- zero_bytes = aim_bytes - src_bytes;
- xSemaphoreTake(p_i2s_obj[i2s_num]->tx->mux, (portTickType)portMAX_DELAY);
- size = size * aim_bytes / src_bytes;
- ESP_LOGD(I2S_TAG, "aim_bytes %d src_bytes %d size %d", aim_bytes, src_bytes,
- size);
- while (size > 0) {
- if (p_i2s_obj[i2s_num]->tx->rw_pos == p_i2s_obj[i2s_num]->tx->buf_size ||
- p_i2s_obj[i2s_num]->tx->curr_ptr == NULL) {
- if (xQueueReceive(p_i2s_obj[i2s_num]->tx->queue,
- &p_i2s_obj[i2s_num]->tx->curr_ptr,
- ticks_to_wait) == pdFALSE) {
- break;
- }
- p_i2s_obj[i2s_num]->tx->rw_pos = 0;
- }
- data_ptr = (char *)p_i2s_obj[i2s_num]->tx->curr_ptr;
- data_ptr += p_i2s_obj[i2s_num]->tx->rw_pos;
- bytes_can_write =
- p_i2s_obj[i2s_num]->tx->buf_size - p_i2s_obj[i2s_num]->tx->rw_pos;
- if (bytes_can_write > (int)size) {
- bytes_can_write = size;
- }
- tail = bytes_can_write % aim_bytes;
- bytes_can_write = bytes_can_write - tail;
-
- memset(data_ptr, 0, bytes_can_write);
- for (int j = 0; j < bytes_can_write; j += (aim_bytes - zero_bytes)) {
- j += zero_bytes;
- memcpy(&data_ptr[j], (const char *)(src + *bytes_written),
- aim_bytes - zero_bytes);
- (*bytes_written) += (aim_bytes - zero_bytes);
- }
- size -= bytes_can_write;
- p_i2s_obj[i2s_num]->tx->rw_pos += bytes_can_write;
- }
- xSemaphoreGive(p_i2s_obj[i2s_num]->tx->mux);
- return ESP_OK;
-}
-
-esp_err_t i2s_custom_read(i2s_port_t i2s_num, void *dest, size_t size,
- size_t *bytes_read, TickType_t ticks_to_wait) {
- char *data_ptr, *dest_byte;
- int bytes_can_read;
- *bytes_read = 0;
- dest_byte = (char *)dest;
- I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_ERR_INVALID_ARG);
- I2S_CHECK((size < SOC_I2S_MAX_BUFFER_SIZE), "size is too large",
- ESP_ERR_INVALID_ARG);
- I2S_CHECK((p_i2s_obj[i2s_num]->rx), "rx NULL", ESP_ERR_INVALID_ARG);
- xSemaphoreTake(p_i2s_obj[i2s_num]->rx->mux, (portTickType)portMAX_DELAY);
-#ifdef CONFIG_PM_ENABLE
- esp_pm_lock_acquire(p_i2s_obj[i2s_num]->pm_lock);
-#endif
- while (size > 0) {
- if (p_i2s_obj[i2s_num]->rx->rw_pos == p_i2s_obj[i2s_num]->rx->buf_size ||
- p_i2s_obj[i2s_num]->rx->curr_ptr == NULL) {
- if (xQueueReceive(p_i2s_obj[i2s_num]->rx->queue,
- &p_i2s_obj[i2s_num]->rx->curr_ptr,
- ticks_to_wait) == pdFALSE) {
- break;
- }
- p_i2s_obj[i2s_num]->rx->rw_pos = 0;
- }
- data_ptr = (char *)p_i2s_obj[i2s_num]->rx->curr_ptr;
- data_ptr += p_i2s_obj[i2s_num]->rx->rw_pos;
- bytes_can_read =
- p_i2s_obj[i2s_num]->rx->buf_size - p_i2s_obj[i2s_num]->rx->rw_pos;
- if (bytes_can_read > (int)size) {
- bytes_can_read = size;
- }
- memcpy(dest_byte, data_ptr, bytes_can_read);
- size -= bytes_can_read;
- dest_byte += bytes_can_read;
- p_i2s_obj[i2s_num]->rx->rw_pos += bytes_can_read;
- (*bytes_read) += bytes_can_read;
- }
-#ifdef CONFIG_PM_ENABLE
- esp_pm_lock_release(p_i2s_obj[i2s_num]->pm_lock);
-#endif
- xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
- return ESP_OK;
-}
diff --git a/components/custom_driver/include/i2s.h b/components/custom_driver/include/i2s.h
deleted file mode 100644
index c5628bc..0000000
--- a/components/custom_driver/include/i2s.h
+++ /dev/null
@@ -1,379 +0,0 @@
-// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Modifications copyright (C) 2021 CarlosDerSeher
-
-#pragma once
-
-#include "driver/periph_ctrl.h"
-#include "esp_err.h"
-#include "esp_intr_alloc.h"
-#include "esp_types.h"
-#include "freertos/FreeRTOS.h"
-#include "freertos/semphr.h"
-#include "hal/i2s_hal.h"
-#include "hal/i2s_types.h"
-#include "soc/i2s_periph.h"
-#include "soc/rtc_periph.h"
-#include "soc/soc_caps.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define I2S_PIN_NO_CHANGE \
- (-1) /*!< Use in i2s_pin_config_t for pins which should not be changed */
-
-typedef intr_handle_t i2s_isr_handle_t;
-
-/**
- * @brief Set I2S pin number
- *
- * @note
- * The I2S peripheral output signals can be connected to multiple GPIO pads.
- * However, the I2S peripheral input signal can only be connected to one GPIO
- * pad.
- *
- * @param i2s_num I2S_NUM_0 or I2S_NUM_1
- *
- * @param pin I2S Pin structure, or NULL to set 2-channel 8-bit
- * internal DAC pin configuration (GPIO25 & GPIO26)
- *
- * Inside the pin configuration structure, set I2S_PIN_NO_CHANGE for any pin
- * where the current configuration should not be changed.
- *
- * @note if *pin is set as NULL, this function will initialize both of the
- * built-in DAC channels by default. if you don't want this to happen and you
- * want to initialize only one of the DAC channels, you can call
- * i2s_set_dac_mode instead.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- * - ESP_FAIL IO error
- */
-esp_err_t i2s_custom_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin);
-
-#if SOC_I2S_SUPPORTS_PDM
-/**
- * @brief Set PDM mode down-sample rate
- * In PDM RX mode, there would be 2 rounds of downsample process in
- * hardware. In the first downsample process, the sampling number can be 16
- * or 8. In the second downsample process, the sampling number is fixed as 8.
- * So the clock frequency in PDM RX mode would be (fpcm * 64) or (fpcm
- * * 128) accordingly.
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- * @param dsr i2s RX down sample rate for PDM mode.
- *
- * @note After calling this function, it would call i2s_set_clk inside to
- * update the clock frequency. Please call this function after I2S driver has
- * been initialized.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- * - ESP_ERR_NO_MEM Out of memory
- */
-esp_err_t i2s_custom_set_pdm_rx_down_sample(i2s_port_t i2s_num,
- i2s_pdm_dsr_t dsr);
-#endif
-
-/**
- * @brief Set I2S dac mode, I2S built-in DAC is disabled by default
- *
- * @param dac_mode DAC mode configurations - see i2s_dac_mode_t
- *
- * @note Built-in DAC functions are only supported on I2S0 for current ESP32
- * chip. If either of the built-in DAC channel are enabled, the other one can
- * not be used as RTC DAC function at the same time.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- */
-esp_err_t i2s_custom_set_dac_mode(i2s_dac_mode_t dac_mode);
-
-/**
- * @brief Install and start I2S driver.
- *
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- *
- * @param i2s_config I2S configurations - see i2s_config_t struct
- *
- * @param queue_size I2S event queue size/depth.
- *
- * @param i2s_queue I2S event queue handle, if set NULL, driver will
- * not use an event queue.
- *
- * This function must be called before any I2S driver read/write operations.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- * - ESP_ERR_NO_MEM Out of memory
- */
-esp_err_t i2s_custom_driver_install(i2s_port_t i2s_num,
- const i2s_config_t *i2s_config,
- int queue_size, void *i2s_queue);
-
-/**
- * @brief Uninstall I2S driver.
- *
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- */
-esp_err_t i2s_custom_driver_uninstall(i2s_port_t i2s_num);
-
-/**
- * @brief Write data to I2S DMA transmit buffer.
- *
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- *
- * @param src Source address to write from
- *
- * @param size Size of data in bytes
- *
- * @param[out] bytes_written Number of bytes written, if timeout, the result
- * will be less than the size passed in.
- *
- * @param ticks_to_wait TX buffer wait timeout in RTOS ticks. If this
- * many ticks pass without space becoming available in the DMA
- * transmit buffer, then the function will return (note that if the
- * data is written to the DMA buffer in pieces, the overall operation
- * may still take longer than this timeout.) Pass portMAX_DELAY for no
- * timeout.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- */
-esp_err_t i2s_custom_write(i2s_port_t i2s_num, const void *src, size_t size,
- size_t *bytes_written, TickType_t ticks_to_wait);
-
-/**
- * @brief Write data to I2S DMA transmit buffer while expanding the number of
- * bits per sample. For example, expanding 16-bit PCM to 32-bit PCM.
- *
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- *
- * @param src Source address to write from
- *
- * @param size Size of data in bytes
- *
- * @param src_bits Source audio bit
- *
- * @param aim_bits Bit wanted, no more than 32, and must be
- * greater than src_bits
- *
- * @param[out] bytes_written Number of bytes written, if timeout, the result
- * will be less than the size passed in.
- *
- * @param ticks_to_wait TX buffer wait timeout in RTOS ticks. If this
- * many ticks pass without space becoming available in the DMA
- * transmit buffer, then the function will return (note that if the
- * data is written to the DMA buffer in pieces, the overall operation
- * may still take longer than this timeout.) Pass portMAX_DELAY for no
- * timeout.
- *
- * Format of the data in source buffer is determined by the I2S
- * configuration (see i2s_config_t).
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- */
-esp_err_t i2s_custom_write_expand(i2s_port_t i2s_num, const void *src,
- size_t size, size_t src_bits, size_t aim_bits,
- size_t *bytes_written,
- TickType_t ticks_to_wait);
-
-/**
- * @brief Read data from I2S DMA receive buffer
- *
- * @param i2s_num I2S_NUM_0, I2S_NUM_1
- *
- * @param dest Destination address to read into
- *
- * @param size Size of data in bytes
- *
- * @param[out] bytes_read Number of bytes read, if timeout, bytes read will
- * be less than the size passed in.
- *
- * @param ticks_to_wait RX buffer wait timeout in RTOS ticks. If this many
- * ticks pass without bytes becoming available in the DMA receive buffer,
- * then the function will return (note that if data is read from the DMA
- * buffer in pieces, the overall operation may still take longer than this
- * timeout.) Pass portMAX_DELAY for no timeout.
- *
- * @note If the built-in ADC mode is enabled, we should call i2s_adc_enable
- * and i2s_adc_disable around the whole reading process, to prevent the data
- * getting corrupted.
- *
- * @return
- * - ESP_OK Success
- * - ESP_ERR_INVALID_ARG Parameter error
- */
-esp_err_t i2s_custom_read(i2s_port_t i2s_num, void *dest, size_t size,
- size_t *bytes_read, TickType_t ticks_to_wait);
-
-/**
- * @brief APLL calculate function, was described by following:
- * APLL Output frequency is given by the formula:
- *
- * apll_freq = xtal_freq * (4 + sdm2 + sdm1/256 +
- * sdm0/65536)/((o_div + 2) * 2) apll_freq = fout / ((o_div + 2) * 2)
- *
- * The dividend in this expression should be in the range of 240 -
- * 600 MHz. In rev. 0 of ESP32, sdm0 and sdm1 are unused and always set to 0.
- * * sdm0 frequency adjustment parameter, 0..255
- * * sdm1 frequency adjustment parameter, 0..255
- * * sdm2 frequency adjustment parameter, 0..63
- * * o_div frequency divider, 0..31
- *
- * The most accurate way to find the sdm0..2 and odir parameters
- * is to loop through them all, then apply the above formula, finding the
- * closest frequency to the desired one. But 256*256*64*32 = 134.217.728
- * loops are too slow with ESP32
- * 1. We will choose the parameters with the highest level of
- * change, With 350MHz/dev/null || exit 1
- eval $(ssh-agent -s)
- printf '%s\n' "${GH_PUSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- [[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- git remote remove github || true
- git remote add github ${GH_PUSH_REPO}
-
-after_script:
- # Just for cleaning space, no other causes
- - git clean -ffdx
-
-build:
- stage: build
- tags:
- - build
- script:
- # Get ESP-IDF
- - git clone ${ESP_IDF_GIT} esp-idf
- - pushd esp-idf
- # Non-recursive getting its submodules
- - git submodule update --init
- - export IDF_PATH=$PWD
- - *setup_idf_tools
- - popd
-
- # Create a copy of the project in "esp-dsp" directory.
- # This is needed because CMake build system can not build a component
- # when ESP-IDF directory is inside the component.
- # After cloning, we will have two directories at the same level: "esp-idf" and "esp-dsp"
- - git clone $PWD esp-dsp
- - cd esp-dsp
-
- # Build test app by both Makefiles and CMake ways
- - pushd test_app
- - make defconfig && make
- - rm -rf build
- - idf.py build
- - popd
-
- # Build examples
- - ./build_examples.sh
-
-build_docs:
- stage: build
- tags:
- - build_docs
- artifacts:
- when: always
- paths:
- - docs/doxygen-warning-log.txt
- - docs/sphinx-warning-log.txt
- - docs/_build/html
- expire_in: 1 day
- # No cleaning when the artifacts
- after_script: []
- script:
- - cd docs
- - make html
- - ./check_doc_warnings.sh
-
-push_master_to_github:
- stage: deploy
- tags:
- - deploy
- only:
- - master
- - /^release\/v/
- - /^v\d+\.\d+(\.\d+)?($|-)/
- when: on_success
- script:
- # Just for a helper script
- - git clone --depth 1 ${ESP_IDF_GIT} esp-idf
- - *add_gh_key_remote
- - esp-idf/tools/ci/push_to_github.sh
diff --git a/components/esp-dsp/CMakeLists.txt b/components/esp-dsp/CMakeLists.txt
deleted file mode 100644
index 37ab147..0000000
--- a/components/esp-dsp/CMakeLists.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-set(COMPONENT_SRCS "modules/common/misc/dsps_pwroftwo.cpp"
- "modules/dotprod/float/dsps_dotprod_f32_ae32.S"
- "modules/dotprod/float/dsps_dotprod_f32_m_ae32.S"
- "modules/dotprod/float/dsps_dotprode_f32_ae32.S"
- "modules/dotprod/float/dsps_dotprode_f32_m_ae32.S"
- "modules/dotprod/float/dsps_dotprod_f32_ansi.c"
- "modules/dotprod/float/dsps_dotprode_f32_ansi.c"
- "modules/dotprod/fixed/dsps_dotprod_s16_ae32.S"
- "modules/dotprod/fixed/dsps_dotprod_s16_m_ae32.S"
- "modules/dotprod/fixed/dsps_dotprod_s16_ansi.c"
- "modules/matrix/float/dspm_mult_3x3x1_f32_ae32.S"
- "modules/matrix/float/dspm_mult_3x3x3_f32_ae32.S"
- "modules/matrix/float/dspm_mult_4x4x1_f32_ae32.S"
- "modules/matrix/float/dspm_mult_4x4x4_f32_ae32.S"
- "modules/matrix/float/dspm_mult_f32_ae32.S"
- "modules/matrix/float/dspm_mult_f32_ansi.c"
- "modules/matrix/fixed/dspm_mult_s16_ae32.S"
- "modules/matrix/fixed/dspm_mult_s16_m_ae32_vector.S"
- "modules/matrix/fixed/dspm_mult_s16_m_ae32.S"
- "modules/matrix/fixed/dspm_mult_s16_ansi.c"
- "modules/matrix/mat/mat.cpp"
- "modules/math/mulc/float/dsps_mulc_f32_ansi.c"
- "modules/math/addc/float/dsps_addc_f32_ansi.c"
- "modules/math/mulc/fixed/dsps_mulc_s16_ansi.c"
- "modules/math/mulc/fixed/dsps_mulc_s16_ae32.S"
- "modules/math/add/float/dsps_add_f32_ansi.c"
- "modules/math/add/fixed/dsps_add_s16_ansi.c"
- "modules/math/add/fixed/dsps_add_s16_ae32.S"
- "modules/math/sub/float/dsps_sub_f32_ansi.c"
- "modules/math/mul/float/dsps_mul_f32_ansi.c"
- "modules/math/mul/fixed/dsps_mul_s16_ansi.c"
- "modules/math/mulc/float/dsps_mulc_f32_ae32.S"
- "modules/math/addc/float/dsps_addc_f32_ae32.S"
- "modules/math/add/float/dsps_add_f32_ae32.S"
- "modules/math/sub/float/dsps_sub_f32_ae32.S"
- "modules/math/mul/float/dsps_mul_f32_ae32.S"
- "modules/math/sqrt/float/dsps_sqrt_f32_ansi.c"
-
- "modules/fft/float/dsps_fft2r_fc32_ae32_.S"
- "modules/fft/float/dsps_fft2r_fc32_ansi.c"
- "modules/fft/float/dsps_fft2r_fc32_ae32.c"
- "modules/fft/float/dsps_fft4r_fc32_ansi.c"
- "modules/fft/float/dsps_fft4r_fc32_ae32.c"
- "modules/fft/float/dsps_fft2r_bitrev_tables_fc32.c"
- "modules/fft/float/dsps_fft4r_bitrev_tables_fc32.c"
- "modules/fft/fixed/dsps_fft2r_sc16_ae32.S"
- "modules/fft/fixed/dsps_fft2r_sc16_ansi.c"
-
- "modules/dct/float/dsps_dct_f32.c"
- "modules/support/snr/float/dsps_snr_f32.cpp"
- "modules/support/sfdr/float/dsps_sfdr_f32.cpp"
- "modules/support/misc/dsps_d_gen.c"
- "modules/support/misc/dsps_h_gen.c"
- "modules/support/misc/dsps_tone_gen.c"
- "modules/support/view/dsps_view.cpp"
- "modules/windows/hann/float/dsps_wind_hann_f32.c"
- "modules/windows/blackman/float/dsps_wind_blackman_f32.c"
- "modules/windows/blackman_harris/float/dsps_wind_blackman_harris_f32.c"
- "modules/windows/blackman_nuttall/float/dsps_wind_blackman_nuttall_f32.c"
- "modules/windows/nuttall/float/dsps_wind_nuttall_f32.c"
- "modules/windows/flat_top/float/dsps_wind_flat_top_f32.c"
- "modules/conv/float/dsps_conv_f32_ansi.c"
- "modules/conv/float/dsps_conv_f32_ae32.S"
- "modules/conv/float/dsps_corr_f32_ansi.c"
- "modules/conv/float/dsps_corr_f32_ae32.S"
- "modules/conv/float/dsps_ccorr_f32_ansi.c"
- "modules/conv/float/dsps_ccorr_f32_ae32.S"
- "modules/iir/biquad/dsps_biquad_f32_ae32.S"
- "modules/iir/biquad/dsps_biquad_f32_ansi.c"
- "modules/iir/biquad/dsps_biquad_gen_f32.c"
- "modules/fir/float/dsps_fir_f32_ae32.S"
- "modules/fir/float/dsps_fird_f32_ae32.S"
- "modules/fir/float/dsps_fir_f32_ansi.c"
- "modules/fir/float/dsps_fir_init_f32.c"
- "modules/fir/float/dsps_fird_f32_ansi.c"
- "modules/fir/float/dsps_fird_init_f32.c")
-
-set(COMPONENT_ADD_INCLUDEDIRS "modules/dotprod/include"
- "modules/support/include"
- "modules/windows/include"
- "modules/windows/hann/include"
- "modules/windows/blackman/include"
- "modules/windows/blackman_harris/include"
- "modules/windows/blackman_nuttall/include"
- "modules/windows/nuttall/include"
- "modules/windows/flat_top/include"
- "modules/iir/include"
- "modules/fir/include"
- "modules/math/include"
- "modules/math/add/include"
- "modules/math/sub/include"
- "modules/math/mul/include"
- "modules/math/addc/include"
- "modules/math/mulc/include"
- "modules/math/sqrt/include"
- "modules/matrix/include"
- "modules/fft/include"
- "modules/dct/include"
- "modules/conv/include"
- "modules/common/include")
-
-set(COMPONENT_PRIV_INCLUDEDIRS "modules/dotprod/float"
- "modules/dotprod/fixed"
- "modules/common/private_include")
-
-register_component()
-
-#component_compile_options(-ffast-math -O2 -Wno-error=maybe-uninitialized)
diff --git a/components/esp-dsp/Kconfig b/components/esp-dsp/Kconfig
deleted file mode 100644
index 5c8eaf7..0000000
--- a/components/esp-dsp/Kconfig
+++ /dev/null
@@ -1,53 +0,0 @@
-menu "DSP Library"
-
-
-choice DSP_OPTIMIZATION
- bool "DSP Optimization for ESP32"
- default DSP_OPTIMIZED
- help
- An Ansi C version could be used for verification and debug purpose.
-
-config DSP_ANSI
- bool "ANSI C"
-config DSP_OPTIMIZED
- bool "ESP32 Optimized"
-endchoice
-
-config DSP_OPTIMIZATION
- int
- default 0 if DSP_ANSI
- default 1 if DSP_OPTIMIZED
-
-choice DSP_MAX_FFT_SIZE
- bool "Maximum FFT length"
- default DSP_MAX_FFT_SIZE_4096
- help
- This is default FFT size for internal usage.
-
-config DSP_MAX_FFT_SIZE_512
- bool "512"
-config DSP_MAX_FFT_SIZE_1024
- bool "1024"
-config DSP_MAX_FFT_SIZE_2048
- bool "2048"
-config DSP_MAX_FFT_SIZE_4096
- bool "4096"
-config DSP_MAX_FFT_SIZE_8192
- bool "8192"
-config DSP_MAX_FFT_SIZE_16384
- bool "16384"
-config DSP_MAX_FFT_SIZE_32768
- bool "32768"
-endchoice
-
-config DSP_MAX_FFT_SIZE
- int
- default 512 if DSP_MAX_FFT_SIZE_512
- default 1024 if DSP_MAX_FFT_SIZE_1024
- default 2048 if DSP_MAX_FFT_SIZE_2048
- default 4096 if DSP_MAX_FFT_SIZE_4096
- default 8192 if DSP_MAX_FFT_SIZE_8192
- default 16384 if DSP_MAX_FFT_SIZE_16384
- default 32768 if DSP_MAX_FFT_SIZE_32768
-
-endmenu
diff --git a/components/esp-dsp/LICENSE b/components/esp-dsp/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/components/esp-dsp/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/components/esp-dsp/README.md b/components/esp-dsp/README.md
deleted file mode 100644
index ac3efef..0000000
--- a/components/esp-dsp/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-# Espressif DSP Library
-
-ESP-DSP is the official DSP library for the [ESP32](https://espressif.com/en/products/hardware/esp32/overview) chip.
-
-## Overview
-
-ESP-DSP is intended to be used as an [ESP-IDF](https://github.com/espressif/esp-idf) component. For the introduction to ESP-IDF, refer to the [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/latest/).
-
-The ESP-DSP library includes implementations of the following functions:
-- Matrix multiplication: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#matrix-operations-apis)
-- Dot product: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#dot-product), [example](https://github.com/espressif/esp-dsp/tree/master/examples/dotprod)
-- FFT: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#fft), [example](https://github.com/espressif/esp-dsp/tree/master/examples/fft)
-- IIR: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#iir), [example](https://github.com/espressif/esp-dsp/tree/master/examples/iir)
-- FIR: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#fir)
-- Vector math operations: [reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html#math)
-
-Many of the library functions are written in assembly and are optimized for the CPU configuration used in the ESP32. In addition to the optimized implementations, reference implementations written in ANSI C are provided.
-
-Function implementations are provided for single precision floating point (32-bit float), and 16-bit signed integers.
-
-## Documentation
-
-- [ESP-DSP Overview](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-library.html)
-- [ESP-DSP API Reference](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-apis.html)
-- [ESP-DSP Benchmarks](https://docs.espressif.com/projects/esp-dsp/en/latest/esp-dsp-benchmarks.html)
-
-Documentation found in the above links is automatically generated from the contents of this repository. If you find that some information is missing or incomplete, please report an issue.
-
-## Installation and Usage
-
-The ESP-DSP library is a component for the [ESP-IDF build system](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html). It also works with the [new CMake-based build system](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system-cmake.html).
-
-### Trying out ESP-DSP examples
-
-If you haven't created an ESP-IDF project yet, and wish to try the examples provided with ESP-DSP, you can clone ESP-DSP repository into any directory, and then run examples from there:
-
- cd ~/esp
- git clone https://github.com/espressif/esp-dsp.git
- cd esp-dsp/examples/dotprod
- make -j4 flash monitor ESPPORT=PORT
-
-or, if you are using CMake based build system,
-
- idf.py -p PORT flash monitor
-
-where `PORT` is the UART port name of your development board, such as `/dev/ttyUSB0` or `COM1`.
-
-Note that you need to set up environment variables (`IDF_PATH`, `PATH`) before building the project. Refer to the [ESP-IDF Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) if you don't have the environment set up yet.
-
-For the list of the examples, please see [README.md](examples/README.md) in the examples directory.
-
-### Including ESP-DSP into your own project
-
-To include ESP-DSP into your ESP-IDF project, clone ESP-DSP repository (or add it as a submodule) into the components directory of the project:
-
- cd your-project-directory
- mkdir -p components
- cd components
- git clone https://github.com/espressif/esp-dsp.git
-
-ESP-IDF build system also allows including components which are not located in the project components directory, using `EXTRA_COMPONENT_DIRS` project variable. Please refer to the [ESP-IDF build system documentation](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html) for details.
-
-## Reporting Issues
-
-If you have found an issue in ESP-DSP, or wish to submit an enhancement request, please use the [Issues](https://github.com/espressif/esp-dsp/issues) section on Github.
-
-For general questions related to this library, please use the [esp32.com forum](https://esp32.com/).
-
-## Copyrights and License
-
-All original source code in this repository is Copyright (C) 2018-2019 Espressif Systems. This source code is licensed under the Apache License 2.0 as described in the file LICENSE.
diff --git a/components/esp-dsp/build_examples.sh b/components/esp-dsp/build_examples.sh
deleted file mode 100644
index 47974d8..0000000
--- a/components/esp-dsp/build_examples.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-#
-# Build all examples from the examples directory.
-#
-# -----------------------------------------------------------------------------
-# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).
-
-if [[ ! -z ${DEBUG_SHELL} ]]
-then
- set -x # Activate the expand mode if DEBUG is anything but empty.
-fi
-
-set -o errexit # Exit if command failed.
-set -o pipefail # Exit if pipe failed.
-set -o nounset # Exit if variable not set.
-
-# Remove the initial space and instead use '\n'.
-IFS=$'\n\t'
-
-STARS='***************************************************'
-
-# -----------------------------------------------------------------------------
-
-die() {
- echo "${1:-"Unknown Error"}" 1>&2
- exit 1
-}
-
-pushd examples
-
-EXAMPLES=$(find . -maxdepth 1 -mindepth 1 -type d | cut -d '/' -f 2)
-
-for NAME in ${EXAMPLES}
-do
- echo "$STARS"
- echo "Building example $NAME with Make"
- pushd $NAME
- # -j option will be set via MAKEFLAGS in .gitlab-ci.yml
- make defconfig && make || die "Make build for ${NAME} has failed"
- rm -rf build
- echo "$STARS"
- echo "Building example $NAME with CMake for Esp32"
- idf.py set-target esp32
- idf.py build || die "CMake build for ${NAME} has failed for Esp32"
- echo "Building example $NAME with CMake for Esp32-s2"
- idf.py clean
- idf.py set-target esp32s2
- idf.py build || die "CMake build for ${NAME} has failed for Esp32-s2"
- popd
-done
-
-popd
diff --git a/components/esp-dsp/component.mk b/components/esp-dsp/component.mk
deleted file mode 100644
index d8730b6..0000000
--- a/components/esp-dsp/component.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-COMPONENT_ADD_INCLUDEDIRS := modules/dotprod/include \
- modules/support/include \
- modules/windows/include \
- modules/windows/hann/include \
- modules/windows/blackman/include \
- modules/windows/blackman_harris/include \
- modules/windows/blackman_nuttall/include \
- modules/windows/nuttall/include \
- modules/windows/flat_top/include \
- modules/iir/include \
- modules/fir/include \
- modules/math/include \
- modules/math/add/include \
- modules/math/sub/include \
- modules/math/mul/include \
- modules/math/addc/include \
- modules/math/mulc/include \
- modules/math/sqrt/include \
- modules/matrix/include \
- modules/fft/include \
- modules/dct/include \
- modules/conv/include \
- modules/common/include
-
-COMPONENT_SRCDIRS :=. \
- modules/common \
- modules/common/misc \
- modules/dotprod \
- modules/dotprod/float \
- modules/dotprod/fixed \
- modules/matrix \
- modules/matrix/float \
- modules/matrix/fixed \
- modules/matrix/mat \
- modules/math \
- modules/math/mulc \
- modules/math/mulc/float \
- modules/math/mulc/fixed \
- modules/math/addc \
- modules/math/addc/float \
- modules/math/add \
- modules/math/add/float \
- modules/math/add/fixed \
- modules/math/mul \
- modules/math/mul/float \
- modules/math/mul/fixed \
- modules/math/sub \
- modules/math/sub/float \
- modules/math/sqrt/float \
- modules/fft/float \
- modules/fft/fixed \
- modules/support \
- modules/support/snr/float \
- modules/support/sfdr/float \
- modules/support/misc \
- modules/support/view \
- modules/windows/hann \
- modules/windows/hann/float \
- modules/windows/hann/fixed \
- modules/windows/blackman \
- modules/windows/blackman/float \
- modules/windows/blackman/fixed \
- modules/windows/blackman_harris \
- modules/windows/blackman_harris/float \
- modules/windows/blackman_harris/fixed \
- modules/windows/blackman_nuttall \
- modules/windows/blackman_nuttall/float \
- modules/windows/blackman_nuttall/fixed \
- modules/windows/nuttall \
- modules/windows/nuttall/float \
- modules/windows/nuttall/fixed \
- modules/windows/flat_top \
- modules/windows/flat_top/float \
- modules/windows/flat_top/fixed \
- modules/conv \
- modules/conv/float \
- modules/dct \
- modules/dct/float \
- modules/iir \
- modules/iir/biquad \
- modules/fir \
- modules/fir/float
-
-COMPONENT_PRIV_INCLUDEDIRS := modules/dotprod/float \
- modules/dotprod/fixed \
- modules/common/private_include
-
diff --git a/components/esp-dsp/docs/Doxyfile b/components/esp-dsp/docs/Doxyfile
deleted file mode 100644
index b276c24..0000000
--- a/components/esp-dsp/docs/Doxyfile
+++ /dev/null
@@ -1,109 +0,0 @@
-# This is Doxygen configuration file
-#
-# Doxygen provides over 260 configuration statements
-# To make this file easier to follow,
-# it contains only statements that are non-default
-#
-# NOTE:
-# It is recommended not to change defaults unless specifically required
-# Test any changes how they affect generated documentation
-# Make sure that correct warnings are generated to flag issues with documented code
-#
-# For the complete list of configuration statements see:
-# https://www.stack.nl/~dimitri/doxygen/manual/config.html
-
-
-PROJECT_NAME = "Espressif DSP Library"
-
-## The 'INPUT' statement below is used as input by script 'gen-df-input.py'
-## to automatically generate API reference list files heder_file.inc
-## These files are placed in '_inc' directory
-## and used to include in API reference documentation
-
-INPUT = \
- ##
- ## Common - API Reference
- ##
- ../modules/common/include/dsp_common.h \
- ## Dot Product - API Reference
- ../modules/dotprod/include/dsps_dotprod.h \
- ## FFT - API Reference
- ../modules/fft/include/dsps_fft2r.h \
- ## DCT - API Reference
- ../modules/dct/include/dsps_dct.h \
- ## FIR Filter - API Reference
- ../modules/fir/include/dsps_fir.h \
- ## IIR Filter - API Reference
- ../modules/iir/include/dsps_biquad_gen.h \
- ../modules/iir/include/dsps_biquad.h \
- ## Math - API Reference
- ../modules/math/mulc/include/dsps_mulc.h \
- ../modules/math/addc/include/dsps_addc.h \
- ../modules/math/add/include/dsps_add.h \
- ../modules/math/sub/include/dsps_sub.h \
- ../modules/math/mul/include/dsps_mul.h \
- ## Matrix - API Reference
- ../modules/matrix/include/dspm_mult.h \
- ../modules/matrix/include/mat.h \
- ## Convolution/Cprrelation - API Reference
- ../modules/conv/include/dsps_conv.h \
- ../modules/conv/include/dsps_corr.h \
- ## Support - API Reference
- ../modules/support/include/dsps_view.h \
- ../modules/support/include/dsps_tone_gen.h \
- ../modules/support/include/dsps_snr.h \
- ../modules/support/include/dsps_sfdr.h \
- ../modules/support/include/dsps_d_gen.h \
- ../modules/support/include/dsps_h_gen.h \
- ## Windows - API Reference
- ../modules/windows/hann/include/dsps_wind_hann.h \
- ../modules/windows/blackman/include/dsps_wind_blackman.h \
- ../modules/windows/blackman_harris/include/dsps_wind_blackman_harris.h \
- ../modules/windows/blackman_nuttall/include/dsps_wind_blackman_nuttall.h \
- ../modules/windows/nuttall/include/dsps_wind_nuttall.h \
- ../modules/windows/flat_top/include/dsps_wind_flat_top.h
-
-
-## Get warnings for functions that have no documentation for their parameters or return value
-##
-WARN_NO_PARAMDOC = YES
-
-## Enable preprocessing and remove __attribute__(...) expressions from the INPUT files
-##
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-PREDEFINED = \
- __attribute__(x)= \
- IRAM_ATTR= \
- configSUPPORT_DYNAMIC_ALLOCATION=1 \
- configSUPPORT_STATIC_ALLOCATION=1 \
- configQUEUE_REGISTRY_SIZE=1 \
- configUSE_RECURSIVE_MUTEXES=1 \
- configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS=1 \
- configNUM_THREAD_LOCAL_STORAGE_POINTERS=1 \
- configUSE_APPLICATION_TASK_TAG=1 \
- configTASKLIST_INCLUDE_COREID=1
-
-## Do not complain about not having dot
-##
-HAVE_DOT = NO
-
-## Generate XML that is required for Breathe
-##
-GENERATE_XML = YES
-XML_OUTPUT = xml
-
-GENERATE_HTML = NO
-HAVE_DOT = NO
-GENERATE_LATEX = NO
-GENERATE_MAN = YES
-GENERATE_RTF = NO
-
-## Skip distracting progress messages
-##
-QUIET = YES
-## Log warnings in a file for further review
-##
-WARN_LOGFILE = "doxygen-warning-log.txt"
-
diff --git a/components/esp-dsp/docs/Makefile b/components/esp-dsp/docs/Makefile
deleted file mode 100644
index cce4db5..0000000
--- a/components/esp-dsp/docs/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-LANGUAGE=en
-include docs_common.mk
diff --git a/components/esp-dsp/docs/check_doc_warnings.sh b/components/esp-dsp/docs/check_doc_warnings.sh
deleted file mode 100644
index e8680da..0000000
--- a/components/esp-dsp/docs/check_doc_warnings.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-#
-# Check for Documentation warnings:
-# doxygen-warning-log.txt should be an empty file
-# sphinx-warning-log.txt should only contain (fuzzy) matches to ../sphinx-known-warnings.txt
-RESULT=0
-STARS='***************************************************'
-
-if [ -s doxygen-warning-log.txt ]; then
- echo "$STARS"
- echo "Build failed due to doxygen warnings:"
- cat doxygen-warning-log.txt
- echo "$STARS"
- RESULT=1
-fi
-
-
-SED=sed
-os_name=`uname -s`
-if [[ "${os_name}" == "Darwin" ]]; then
- SED=gsed
-fi
-
-# Remove escape characters, file paths, line numbers from
-# the Sphinx warning log
-# (escape char removal from https://www.commandlinefu.com/commands/view/6141/remove-color-codes-special-characters-with-sed
-${SED} -r 's:\x1B\[[0-9;]*[mK]::g' sphinx-warning-log.txt | \
- ${SED} -E "s~${IDF_PATH}~\${IDF_PATH}~" | \
- ${SED} -E "s/:[0-9]+:/:line:/" > sphinx-warning-log-sanitized.txt
-
-# diff sanitized warnings, ignoring lines which only appear in ../sphinx-known-warnings.txt
-
-# format is to display only lines new or changed in second argument
-DIFF_FORMAT="--unchanged-line-format= --old-line-format= --new-line-format=%L"
-
-SPHINX_WARNINGS=$(diff $DIFF_FORMAT sphinx-known-warnings.txt sphinx-warning-log-sanitized.txt)
-if ! [ -z "$SPHINX_WARNINGS" ]; then
- echo "$STARS"
- echo "Build failed due to new/different Sphinx warnings:"
- echo "$SPHINX_WARNINGS"
- echo "$STARS"
- RESULT=1
- echo "(Check files sphinx-known-warnings.txt and sphinx-warning-log.txt for full details.)"
-fi
-
-exit $RESULT
diff --git a/components/esp-dsp/docs/conf.py b/components/esp-dsp/docs/conf.py
deleted file mode 100644
index 08b3e3c..0000000
--- a/components/esp-dsp/docs/conf.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# English Language RTD & Sphinx config file
-#
-# Uses IDF_PATH/conf_common.py for most non-language-specific settings.
-
-# Importing conf_common adds all the non-language-specific
-# parts to this conf module
-import sys, os
-sys.path.insert(0, os.path.abspath('.'))
-from conf_common import *
-
-# General information about the project.
-project = u'Espressif DSP Library'
-copyright = u'2016 - 2018, Espressif Systems (Shanghai) PTE LTD'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-language = 'en'
diff --git a/components/esp-dsp/docs/conf_common.py b/components/esp-dsp/docs/conf_common.py
deleted file mode 100644
index 4c2f1e6..0000000
--- a/components/esp-dsp/docs/conf_common.py
+++ /dev/null
@@ -1,317 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Common (non-language-specific) configuration for Read The Docs & Sphinx
-#
-# Based on a Read the Docs Template documentation build configuration file,
-# created by sphinx-quickstart on Tue Aug 26 14:19:49 2014.
-#
-# This file is imported from a language-specific conf.py (ie en/conf.py or
-# zh_CN/conf.py)
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-from __future__ import print_function
-from __future__ import unicode_literals
-import sys, os
-import re
-import subprocess
-import shlex
-
-# Note: If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute
-sys.path.insert(0, os.path.abspath('.'))
-from local_util import run_cmd_get_output, copy_if_modified
-
-# build_docs on the CI server sometimes fails under Python3. This is a workaround:
-sys.setrecursionlimit(3500)
-
-try:
- builddir = os.environ['BUILDDIR']
-except KeyError:
- builddir = '_build'
-
-def call_with_python(cmd):
- # using sys.executable ensures that the scripts are called with the same Python interpreter
- if os.system('{} {}'.format(sys.executable, cmd)) != 0:
- raise RuntimeError('{} failed'.format(cmd))
-
-# Call Doxygen to get XML files from the header files
-print("Calling Doxygen to generate latest XML files")
-if os.system("doxygen Doxyfile") != 0:
- raise RuntimeError('Doxygen call failed')
-
-# Doxygen has generated XML files in 'xml' directory.
-# Copy them to 'xml_in', only touching the files which have changed.
-copy_if_modified('xml/', 'xml_in/')
-
-# Generate 'api_name.inc' files using the XML files by Doxygen
-call_with_python('gen-dxd.py')
-
-
-# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
-#
-suppress_warnings = ['image.nonlocal_uri']
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = ['breathe', 'link-roles' ]
-
-# Enabling this fixes cropping of blockdiag edge labels
-seqdiag_antialias = True
-
-# Breathe extension variables
-
-# Doxygen regenerates files in 'xml/' directory every time,
-# but we copy files to 'xml_in/' only when they change, to speed up
-# incremental builds.
-breathe_projects = { "esp32-idf": "xml_in/" }
-breathe_default_project = "esp32-idf"
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = ['.rst', '.md']
-
-source_parsers = {
- '.md': 'recommonmark.parser.CommonMarkParser',
- }
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-
-# Readthedocs largely ignores 'version' and 'release', and displays one of
-# 'latest', tag name, or branch name, depending on the build type.
-# Still, this is useful for non-RTD builds.
-# This is supposed to be "the short X.Y version", but it's the only version
-# visible when you open index.html.
-# Display full version to make things less confusing.
-version = run_cmd_get_output('git describe')
-# The full version, including alpha/beta/rc tags.
-# If needed, nearest tag is returned by 'git describe --abbrev=0'.
-release = version
-print('Version: {0} Release: {1}'.format(version, release))
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build', 'issue_template.md']
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'sphinx_rtd_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# " v documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = idf_path + "/docs/_static/espressif-logo.svg"
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = [idf_path + '/docs/_static']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'ReadtheDocsTemplatedoc'
-
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-# author, documentclass [howto, manual, or own class]).
-latex_documents = [
- ('index', 'ReadtheDocsTemplate.tex', u'Read the Docs Template Documentation',
- u'Read the Docs', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'readthedocstemplate', u'Read the Docs Template Documentation',
- [u'Read the Docs'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'ReadtheDocsTemplate', u'Read the Docs Template Documentation',
- u'Read the Docs', 'ReadtheDocsTemplate', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
-
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
-
-# Override RTD CSS theme to introduce the theme corrections
-# https://github.com/rtfd/sphinx_rtd_theme/pull/432
-# def setup(app):
-# app.add_stylesheet('theme_overrides.css')
-# generate_version_specific_includes(app)
diff --git a/components/esp-dsp/docs/docs_common.mk b/components/esp-dsp/docs/docs_common.mk
deleted file mode 100644
index 79d4baa..0000000
--- a/components/esp-dsp/docs/docs_common.mk
+++ /dev/null
@@ -1,214 +0,0 @@
-# "Common" Makefile for Sphinx documentation
-#
-# (included from en/Makefile & zh_CN/Makefile
-#
-# NOTE: This makefile runs with cwd=either en or zh_CN subfolder, so this
-# (docs/) directory is '..' relative to it.
-
-# ************ IMPORTANT *****************
-#
-# ReadTheDocs DOES NOT USE THIS MAKEFILE,
-# so any behaviour additions must be
-# done via Sphinx Config not here
-#
-# ****************************************
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-# note: this is changed from sphinx-build so it depends on default python interpreter, not on /bin/sphinx-build
-# (which will be the most recently installed version of sphinx and may not match)
-SPHINXBUILD = python -m sphinx
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -w sphinx-warning-log.txt .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext dependencies version-specific-includes check_python_packages
-
-help:
- @echo "Please use \`make \' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " xml to make Docutils-native XML files"
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled) "
-
-clean:
- rm -rf $(BUILDDIR)/*
-
-check_python_packages:
- true
-
-html: | check_python_packages
- @echo "Build the HTML pages are in $(BUILDDIR)/html."
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml: | check_python_packages
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml: | check_python_packages
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle: | check_python_packages
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json: | check_python_packages
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp: | check_python_packages
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp: | check_python_packages
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ReadtheDocsTemplate.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ReadtheDocsTemplate.qhc"
-
-devhelp: | check_python_packages
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/ReadtheDocsTemplate"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ReadtheDocsTemplate"
- @echo "# devhelp"
-
-epub: | check_python_packages
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex: | check_python_packages
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf: | check_python_packages
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-latexpdfja: | check_python_packages
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through platex and dvipdfmx..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text: | check_python_packages
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man: | check_python_packages
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo: | check_python_packages
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info: | check_python_packages
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext: | check_python_packages
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes: | check_python_packages
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck: | check_python_packages
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-gh-linkcheck: | check_python_packages
- @echo "Checking for hardcoded GitHub links"
- @if (find ../ -name '*.rst' | xargs grep \
- 'https://github.com/espressif/esp-idf/tree\|https://github.com/espressif/esp-idf/blob\|https://github.com/espressif/esp-idf/raw'\
- ); \
- then \
- echo "WARNINIG: Some .rst files contain hardcoded Github links."; \
- echo "Please check above output and replace links with one of the following:"; \
- echo "- :idf:\`dir\` - points to directory inside ESP-IDF"; \
- echo "- :idf_file:\`file\` - points to file inside ESP-IDF"; \
- echo "- :idf_raw:\`file\` - points to raw view of the file inside ESP-IDF"; \
- echo "- :component:\`dir\` - points to directory inside ESP-IDF components dir"; \
- echo "- :component_file:\`file\` - points to file inside ESP-IDF components dir"; \
- echo "- :component_raw:\`file\` - points to raw view of the file inside ESP-IDF"; \
- echo " components dir"; \
- echo "- :example:\`dir\` - points to directory inside ESP-IDF examples dir"; \
- echo "- :example_file:\`file\` - points to file inside ESP-IDF examples dir"; \
- echo "- :example_raw:\`file\` - points to raw view of the file inside ESP-IDF"; \
- echo " examples dir"; \
- echo "These link types will point to the correct GitHub version automatically"; \
- exit 1; \
- fi
- @echo "No hardcoded links found"
-
-doctest: | check_python_packages
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
-
-xml: | check_python_packages
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
- @echo
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
-
-pseudoxml: | check_python_packages
- $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
- @echo
- @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/components/esp-dsp/docs/esp-dsp-apis.rst b/components/esp-dsp/docs/esp-dsp-apis.rst
deleted file mode 100644
index ad19cf9..0000000
--- a/components/esp-dsp/docs/esp-dsp-apis.rst
+++ /dev/null
@@ -1,108 +0,0 @@
-Espressif DSP Library API Reference
-===================================
-
-Header Files
-------------
-
-To use the library, include ``esp_dsp.h`` header file into the source code.
-
-* :repo_file:`modules/common/include/esp_dsp.h`
-
-
-Signal (1D) Processing APIs
-----------------------------
-
-Signal processing APIs use ``dsps`` prefix. The following modules are available:
-
-- Dot-product_ - Calculates dot-product of two vectors
-- FFT_ - Fast Fourier Transform functionality
-- DCT_ - Discrete Cosine Transform functionality
-- IIR_ - IIR filter functionality
-- FIR_ - FIR filter functionality
-- Math_ - Basic vector operations
-- Conv_ - Convolution/correlation functionality
-- Support_ - Support functions
-- `Window functions`_ - FFT window generation functions
-
-Dot-product
-+++++++++++
-
-.. include:: /_build/inc/dsps_dotprod.inc
-
-FFT
-+++
-
-.. include:: /_build/inc/dsps_fft2r.inc
-
-DCT
-+++
-
-.. include:: /_build/inc/dsps_dct.inc
-
-FIR
-+++
-
-.. include:: /_build/inc/dsps_fir.inc
-
-IIR
-+++
-
-.. include:: /_build/inc/dsps_biquad_gen.inc
-.. include:: /_build/inc/dsps_biquad.inc
-
-Math
-++++
-
-.. include:: /_build/inc/dsps_add.inc
-.. include:: /_build/inc/dsps_sub.inc
-.. include:: /_build/inc/dsps_mul.inc
-.. include:: /_build/inc/dsps_addc.inc
-.. include:: /_build/inc/dsps_mulc.inc
-
-Conv
-++++
-
-.. include:: /_build/inc/dsps_conv.inc
-.. include:: /_build/inc/dsps_corr.inc
-
-Support
-+++++++
-
-.. include:: /_build/inc/dsps_d_gen.inc
-.. include:: /_build/inc/dsps_h_gen.inc
-.. include:: /_build/inc/dsps_tone_gen.inc
-.. include:: /_build/inc/dsps_view.inc
-.. include:: /_build/inc/dsps_snr.inc
-.. include:: /_build/inc/dsps_sfdr.inc
-
-Window Functions
-++++++++++++++++
-
-.. include:: /_build/inc/dsps_wind_hann.inc
-
-Matrix Operations APIs
-----------------------
-
-Matrix operations APIs use ``dspm`` prefix. The following modules are available:
-
-- Multiplication - basic matrix multiplication operations
-
-Matrix Multiplication
-+++++++++++++++++++++
-
-.. include:: /_build/inc/dspm_mult.inc
-
-Matrix Operations
-+++++++++++++++++++++
-
-.. include:: /_build/inc/mat.inc
-
-Miscellaneous
--------------
-
-Various common functions used by other modules are included in this module.
-
-Common APIs
-+++++++++++
-
-.. include:: /_build/inc/dsp_common.inc
diff --git a/components/esp-dsp/docs/esp-dsp-benchmarks.rst b/components/esp-dsp/docs/esp-dsp-benchmarks.rst
deleted file mode 100644
index 8217d9a..0000000
--- a/components/esp-dsp/docs/esp-dsp-benchmarks.rst
+++ /dev/null
@@ -1,66 +0,0 @@
-Espressif DSP Library Benchmarks
-================================
-
-The table bellow contains benchmarks of functions provided by ESP-DSP library. The values are CPU cycle counts taken to execute each of the functions. Values in "ESP32" column are for the optimized (assembly) implementation, values in "ANSI C" column are for the non-optimized implementation.
-
-+----------------------------------------------------------+----------+----------+
-| Function name and arguments | CPU cycles |
-+----------------------------------------------------------+----------+----------+
-| | ESP32 | ANSI C |
-+==========================================================+==========+==========+
-| | | |
-+----------------------------------------------------------+----------+----------+
-| **Dot Product** | | |
-+----------------------------------------------------------+----------+----------+
-| dsps_dotprod_f32 for N=256 points | 1057 | 2597 |
-+----------------------------------------------------------+----------+----------+
-| dsps_dotprode_f32 for N=256 points, with step 1 | 1318 | 2601 |
-+----------------------------------------------------------+----------+----------+
-| dsps_dotprod_s16 for N=256 points | 448 | 5185 |
-+----------------------------------------------------------+----------+----------+
-| | | |
-+----------------------------------------------------------+----------+----------+
-| **FIR Filters** | | |
-+----------------------------------------------------------+----------+----------+
-| dsps_fir_f32 1024 input samples and 256 coefficients | 1338418 | 3583556 |
-+----------------------------------------------------------+----------+----------+
-| dsps_fird_f32 1024 samples, 256 coeffs and decimation 4 | 37582 | 82535 |
-+----------------------------------------------------------+----------+----------+
-| | | |
-+----------------------------------------------------------+----------+----------+
-| **FFTs** | | |
-+----------------------------------------------------------+----------+----------+
-| dsps_fft2r_fc32 for 64 complex points | 5451 | 8187 |
-+----------------------------------------------------------+----------+----------+
-| dsps_fft2r_fc32 for 128 complex points | 12400 | 18756 |
-+----------------------------------------------------------+----------+----------+
-| dsps_fft2r_fc32 for 256 complex points | 27829 | 42381 |
-+----------------------------------------------------------+----------+----------+
-| dsps_fft2r_fc32 for 512 complex points | 61755 | 94616 |
-+----------------------------------------------------------+----------+----------+
-| dsps_fft2r_fc32 for 1024 complex points | 135745 | 209058 |
-+----------------------------------------------------------+----------+----------+
-| | | |
-+----------------------------------------------------------+----------+----------+
-| **IIR Filters** | | |
-+----------------------------------------------------------+----------+----------+
-| dsps_biquad_f32 - biquad filter for 1024 input samples | 17451 | 31778 |
-+----------------------------------------------------------+----------+----------+
-| | | |
-+----------------------------------------------------------+----------+----------+
-| **Matrix Multiplication** | | |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_f32 - C[16,16] = A[16,16]*B[16,16]; | 24669 | 59690 |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_s16 - C[16,16] = A[16,16]*B[16,16]; | 24964 | 114150 |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_3x3x1_f32 - C[3,1] = A[3,3]*B[3,1]; | 80 | 242 |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_3x3x3_f32 - C[3,3] = A[3,3]*B[3,3]; | 212 | 541 |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_4x4x1_f32 - C[4,1] = A[4,4]*B[4,1]; | 112 | 362 |
-+----------------------------------------------------------+----------+----------+
-| dspm_mult_4x4x4_f32 - C[4,4] = A[4,4]*B[4,4]; | 404 | 1130 |
-+----------------------------------------------------------+----------+----------+
-
-The benchmark test could be reproduced by executing test cases found in :repo_file:`test/test_dsp.c`.
diff --git a/components/esp-dsp/docs/esp-dsp-library.rst b/components/esp-dsp/docs/esp-dsp-library.rst
deleted file mode 100644
index 190c054..0000000
--- a/components/esp-dsp/docs/esp-dsp-library.rst
+++ /dev/null
@@ -1,78 +0,0 @@
-Espressif DSP Library
-=====================
-
-Overview
---------
-An Espressif DSP Library (esp-dsp) it's library of functions, modules and components that provides possibility
-to use Espressif's CPUs as DSPs in efficient way.
-
-
-Function Naming
----------------
-Naming conventions for the Library functions are similar for all covered domains. You can distinguish signal processing functions by the dsps prefix, while image and video processing functions have dspi prefix,
-and functions that are specific for operations on small matrices have dspm prefix in their names. Function names in Library have the following general format:
-
-dsp___[_]<_impl>();
-
-The elements of this format are explained in the sections that follow.
-
-Data-Domain
-^^^^^^^^^^^
-
-The data-domain is a single character that expresses the subset of functionality to which a given function belongs. The Library designed to supports the following data-domains:
-
- - s - for signals (expected data type is a 1D signal)
- - i - for images and video (expected data type is a 2D image)
- - m - for matrices (expected data type is a matrix)
- - r - for realistic rendering functionality and 3D data processing (expected data type depends on supported rendering techniques)
- - q - for signals of fixed length
-
-For example, function names that begin with dspi signify that respective functions are used for image or video processing.
-
-Name
-^^^^
-
-The name is an abbreviation for the core operation that the function really does, for example Add, Sqrt,
-followed in some cases by a function-specific modifier: = [_modifier]
-
-This modifier, if present, denotes a slight modification or variation of the given function.
-
-Data Types
-^^^^^^^^^^
-
-The library supports two main data types – int16 for fixed point arithmetic and float for floating point arithmetic. The datatype described as:
-
-Data type suffices:
-^^^^^^^^^^^^^^^^^^^
- - s - signed
- - u - unsigned
- - f - float
-
-Data type extensions:
-^^^^^^^^^^^^^^^^^^^^^
- - c - complex
-
-Data type Bits resolution:
-^^^^^^^^^^^^^^^^^^^^^^^^^^
- - 16
- - 32
-
-For example: dsps_mac_sc16 defines that mac operation with 1d array will be made with 16 bit signed complex data.
-
-Implementation Type
-^^^^^^^^^^^^^^^^^^^
-Each function could be implemented different for different platform and could use different style and resources.
-That's why every implemented function will have name extension <_impl> that will define which kind of implementation it is.
-User can use universal function without extension.
-
-Implementation extensions:
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-By default all functions could be used without extensions. The option that select optimized/ansi can be chosen in menuconfig.
-
-Inside library the extensions means:
- - _ansi - a universal function where body of function implemented on ANSI C. This implementation not includes any hardware optimization
- - _ae32 - written on ESP32 assembler and optimized for ESP32
- - _platform - header file with definitions of available CPUs instructions for different functions
- - others- depends on amount of supported CPUs. This list will be extended in future
-
-
diff --git a/components/esp-dsp/docs/gen-dxd.py b/components/esp-dsp/docs/gen-dxd.py
deleted file mode 100644
index cb2b542..0000000
--- a/components/esp-dsp/docs/gen-dxd.py
+++ /dev/null
@@ -1,318 +0,0 @@
-#!/usr/bin/env python
-#
-# gen-dxd.py - Generate Doxygen Directives
-#
-# This code is in the Public Domain (or CC0 licensed, at your option.)
-# Unless required by applicable law or agreed to in writing, this
-# software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-# CONDITIONS OF ANY KIND, either express or implied.
-#
-
-from __future__ import print_function
-from __future__ import unicode_literals
-from builtins import range
-from io import open
-import sys
-import os
-import re
-
-# Determime build directory
-builddir = '_build'
-if 'BUILDDIR' in os.environ:
- builddir = os.environ['BUILDDIR']
-
-# Script configuration
-header_file_path_prefix = "../modules/"
-"""string: path prefix for header files.
-"""
-doxyfile_path = "./Doxyfile"
-"""string: path to a file containing header files to processs.
-"""
-xml_directory_path = "xml"
-"""string: path to directory with XML files by Doxygen.
-"""
-inc_directory_path = os.path.join(builddir, 'inc')
-"""string: path prefix for header files.
-"""
-all_kinds = [
- ("function", "Functions"),
- ("union", "Unions"),
- ("struct", "Structures"),
- ("define", "Macros"),
- ("typedef", "Type Definitions"),
- ("enum", "Enumerations")
- ]
-"""list of items that will be generated for a single API file
-"""
-
-
-def get_doxyfile_input():
- """Get contents of Doxyfile's INPUT statement.
-
- Returns:
- Contents of Doxyfile's INPUT.
-
- """
- if not os.path.isfile(doxyfile_path):
- print("Doxyfile '%s' does not exist!" % doxyfile_path)
- sys.exit()
-
- print("Getting Doxyfile's INPUT")
-
- input_file = open(doxyfile_path, "r", encoding='utf-8')
-
- line = input_file.readline()
- # read contents of Doxyfile until 'INPUT' statement
- while line:
- if line.find("INPUT") == 0:
- break
- line = input_file.readline()
-
- doxyfile_INPUT = ""
- line = input_file.readline()
- # skip input_file contents until end of 'INPUT' statement
- while line:
- if line.isspace():
- # we have reached the end of 'INPUT' statement
- break
- # process only lines that are not comments
- if line.find("#") == -1:
- # extract header file path inside components folder
- m = re.search(header_file_path_prefix + "(.*\.h)", line)
- header_file_path = m.group(1)
- doxyfile_INPUT += "modules/" + header_file_path + "\n"
- # proceed reading next line
- line = input_file.readline()
-
- input_file.close()
- return doxyfile_INPUT
-
-
-def get_api_name(header_file_path):
- """Get name of API from header file path.
-
- Args:
- header_file_path: path to the header file.
-
- Returns:
- The name of API.
-
- """
- api_name = ""
- regex = r".*/(.*)\.h"
- m = re.search(regex, header_file_path)
- if m:
- api_name = m.group(1)
-
- return api_name
-
-
-def get_rst_header(header_name):
- """Get rst formatted code with a header.
-
- Args:
- header_name: name of header.
-
- Returns:
- Formatted rst code with the header.
-
- """
-
- rst_output = ""
- rst_output += header_name + "\n"
- rst_output += "^" * len(header_name) + "\n"
- rst_output += "\n"
-
- return rst_output
-
-
-def select_unions(innerclass_list):
- """Select unions from innerclass list.
-
- Args:
- innerclass_list: raw list with unions and structures
- extracted from Dogygen's xml file.
-
- Returns:
- Doxygen directives with unions selected from the list.
-
- """
-
- rst_output = ""
- for line in innerclass_list.splitlines():
- # union is denoted by "union" at the beginning of line
- if line.find("union") == 0:
- union_id, union_name = re.split(r"\t+", line)
- rst_output += ".. doxygenunion:: "
- rst_output += union_name
- rst_output += "\n"
-
- return rst_output
-
-
-def select_structs(innerclass_list):
- """Select structures from innerclass list.
-
- Args:
- innerclass_list: raw list with unions and structures
- extracted from Dogygen's xml file.
-
- Returns:
- Doxygen directives with structures selected from the list.
- Note: some structures are excluded as described on code below.
-
- """
-
- rst_output = ""
- for line in innerclass_list.splitlines():
- # structure is denoted by "struct" at the beginning of line
- if line.find("struct") == 0:
- # skip structures that are part of union
- # they are documented by 'doxygenunion' directive
- if line.find("::") > 0:
- continue
- struct_id, struct_name = re.split(r"\t+", line)
- rst_output += ".. doxygenstruct:: "
- rst_output += struct_name
- rst_output += "\n"
- rst_output += " :members:\n"
- rst_output += "\n"
-
- return rst_output
-
-
-def get_directives(tree, kind):
- """Get directives for specific 'kind'.
-
- Args:
- tree: the ElementTree 'tree' of XML by Doxygen
- kind: name of API "kind" to be generated
-
- Returns:
- Doxygen directives for selected 'kind'.
- Note: the header with "kind" name is included.
-
- """
-
- rst_output = ""
- if kind in ["union", "struct"]:
- innerclass_list = ""
- for elem in tree.iterfind('compounddef/innerclass'):
- innerclass_list += elem.attrib["refid"] + "\t" + elem.text + "\n"
- if kind == "union":
- rst_output += select_unions(innerclass_list)
- else:
- rst_output += select_structs(innerclass_list)
- else:
- for elem in tree.iterfind(
- 'compounddef/sectiondef/memberdef[@kind="%s"]' % kind):
- name = elem.find('name')
- rst_output += ".. doxygen%s:: " % kind
- rst_output += name.text + "\n"
- if rst_output:
- all_kinds_dict = dict(all_kinds)
- rst_output = get_rst_header(all_kinds_dict[kind]) + rst_output + "\n"
-
- return rst_output
-
-
-def generate_directives(header_file_path):
- """Generate API reference with Doxygen directives for a header file.
-
- Args:
- header_file_path: a path to the header file with API.
-
- Returns:
- Doxygen directives for the header file.
-
- """
-
- api_name = get_api_name(header_file_path)
-
- # in XLT file name each "_" in the api name is expanded by Doxygen to "__"
- xlt_api_name = api_name.replace("_", "__")
- xml_file_path = "%s/%s_8h.xml" % (xml_directory_path, xlt_api_name)
-
- rst_output = ""
- rst_output = ".. File automatically generated by 'gen-dxd.py'\n"
- rst_output += "\n"
- rst_output += get_rst_header("Header File")
- rst_output += "* :repo_file:`" + header_file_path + "`\n"
- rst_output += "\n"
-
- try:
- import xml.etree.cElementTree as ET
- except ImportError:
- import xml.etree.ElementTree as ET
-
- tree = ET.ElementTree(file=xml_file_path)
- for i in range(len(all_kinds)):
- kind = all_kinds[i][0]
- rst_output += get_directives(tree, kind)
-
- return rst_output
-
-
-def generate_api_inc_files():
- """Generate header_file.inc files
- with API reference made of doxygen directives
- for each header file
- specified in the 'INPUT' statement of Doxyfile.
-
- """
-
- if not os.path.isdir(xml_directory_path):
- print("Directory %s does not exist!" % xml_directory_path)
- sys.exit()
-
- if not os.path.exists(inc_directory_path):
- os.makedirs(inc_directory_path)
-
- list_to_generate = get_doxyfile_input()
- print("Generating 'api_name.inc' files with Doxygen directives")
- for header_file_path in list_to_generate.splitlines():
- api_name = get_api_name(header_file_path)
- inc_file_path = inc_directory_path + "/" + api_name + ".inc"
- rst_output = generate_directives(header_file_path)
-
- previous_rst_output = ''
- if os.path.isfile(inc_file_path):
- with open(inc_file_path, "r", encoding='utf-8') as inc_file_old:
- previous_rst_output = inc_file_old.read()
-
- if previous_rst_output != rst_output:
- with open(inc_file_path, "w", encoding='utf-8') as inc_file:
- inc_file.write(rst_output)
-
-
-if __name__ == "__main__":
- """The main script that generates
- Doxygen directives.
-
- """
-
- # Process command line arguments, if any
- if len(sys.argv) > 1:
- if not os.path.isdir(xml_directory_path):
- print("Directory %s does not exist!" % xml_directory_path)
- sys.exit()
- header_file_path = sys.argv[1]
- api_name = get_api_name(header_file_path)
- if api_name:
- rst_output = generate_directives(header_file_path)
- print("Doxygen directives for '%s'" % header_file_path)
- print()
- print(rst_output)
- else:
- print("Options to execute 'gen-dxd.py' application:")
- print("1: $ python gen-dxd.py")
- print(" Generate API 'header_file.inc' files for headers defined in '%s'" % doxyfile_path)
- print("2: $ python gen-dxd.py header_file_path")
- print(" Print out Doxygen directives for a single header file")
- print(" example: $ python gen-dxd.py mdns/include/mdns.h")
- print(" NOTE: Run Doxygen first to get XML files for the header file")
-
- sys.exit()
-
- # No command line arguments given
- generate_api_inc_files()
diff --git a/components/esp-dsp/docs/index.rst b/components/esp-dsp/docs/index.rst
deleted file mode 100644
index 1521e8c..0000000
--- a/components/esp-dsp/docs/index.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-ESP-DSP Library
-***************
-
-.. toctree::
- :maxdepth: 1
-
- Introduction
- Benchmarks
- API Reference
diff --git a/components/esp-dsp/docs/issue_template.md b/components/esp-dsp/docs/issue_template.md
deleted file mode 100644
index 7bf65e7..0000000
--- a/components/esp-dsp/docs/issue_template.md
+++ /dev/null
@@ -1,80 +0,0 @@
------------------------------ Delete below -----------------------------
-
-If your issue is a general question, starts similar to "How do I..", or is related to 3rd party development kits/libs, please discuss this on our community forum at esp32.com instead.
-
-INSTRUCTIONS
-============
-
-Before submitting a new issue, please follow the checklist and try to find the answer.
-
-- [ ] I have read the documentation [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/latest/) and the issue is not addressed there.
-- [ ] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
-- [ ] I have searched the issue tracker for a similar issue and not found a similar issue.
-
-If the issue cannot be solved after the steps before, please follow these instructions so we can get the needed information to help you in a quick and effective fashion.
-
-1. Fill in all the fields under **Environment** marked with [ ] by picking the correct option for you in each case and deleting the others.
-2. Describe your problem.
-3. Include [debug logs on the monitor](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/idf-monitor.html#automatically-decoding-addresses) or the [coredump](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/core_dump.html).
-4. Provide more items under **Other items if possible** can help us better locate your problem.
-5. Use markup (buttons above) and the Preview tab to check what the issue will look like.
-6. Delete these instructions from the above to the below marker lines before submitting this issue.
-
------------------------------ Delete above -----------------------------
-
-## Environment
-
-- Development Kit: [ESP32-Wrover-Kit|ESP32-DevKitC|ESP32-PICO-Kit|ESP32-LyraT|ESP32-LyraTD-MSC|none]
-- Kit version (for WroverKit/PicoKit/DevKitC): [v1|v2|v3|v4]
-- Module or chip used: [ESP32-WROOM-32|ESP32-WROOM-32D|ESP32-WROOM-32U|ESP32-WROVER|ESP32-WROVER-I|ESP32-WROVER-B|ESP32-WROVER-IB|ESP32-SOLO-1|ESP32-PICO-D4|ESP32]
-- IDF version (run ``git describe --tags`` to find it):
- // v3.2-dev-1148-g96cd3b75c
-- Build System: [Make|CMake]
-- Compiler version (run ``xtensa-esp32-elf-gcc --version`` to find it):
- // 1.22.0-80-g6c4433a
-- Operating System: [Windows|Linux|macOS]
-- Power Supply: [USB|external 5V|external 3.3V|Battery]
-
-## Problem Description
-
-//Detailed problem description goes here.
-
-### Expected Behavior
-
-### Actual Behavior
-
-### Steps to repropduce
-
-1. step1
-2. ...
-
-// It helps if you attach a picture of your setup/wiring here.
-
-
-### Code to reproduce this issue
-
-```cpp
-// the code should be wrapped in the ```cpp tag so that it will be displayed better.
-#include "esp_log.h"
-
-void app_main()
-{
-
-}
-
-```
-// If your code is longer than 30 lines, [GIST](https://gist.github.com) is preferred.
-
-## Debug Logs
-
-```
-Debug log goes here, should contain the backtrace, as well as the reset source if it is a crash.
-Please copy the plain text here for us to search the error log. Or attach the complete logs but leave the main part here if the log is *too* long.
-```
-
-## Other items if possible
-
-- [ ] sdkconfig file (attach the sdkconfig file from your project folder)
-- [ ] elf file in the ``build`` folder (**note this may contain all the code details and symbols of your project.**)
-- [ ] coredump (This provides stacks of tasks.)
-
diff --git a/components/esp-dsp/docs/link-roles.py b/components/esp-dsp/docs/link-roles.py
deleted file mode 100644
index 9cd6b32..0000000
--- a/components/esp-dsp/docs/link-roles.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# based on http://protips.readthedocs.io/link-roles.html
-
-from __future__ import print_function
-from __future__ import unicode_literals
-import re
-import os
-from docutils import nodes
-from local_util import run_cmd_get_output
-
-
-def get_github_rev():
- path = run_cmd_get_output('git rev-parse --short HEAD')
- tag = run_cmd_get_output('git describe --exact-match')
- print('Git commit ID: ', path)
- if len(tag):
- print('Git tag: ', tag)
- path = tag
- return path
-
-
-def setup(app):
- rev = get_github_rev()
-
- # links to files or folders on the GitHub
- baseurl = 'https://github.com/espressif/esp-dsp'
- app.add_role('repo', autolink('{}/tree/{}/%s'.format(baseurl, rev)))
- app.add_role('repo_file', autolink('{}/blob/{}/%s'.format(baseurl, rev)))
- app.add_role('repo_raw', autolink('{}/raw/{}/%s'.format(baseurl, rev)))
- app.add_role('example', autolink('{}/tree/{}/examples/%s'.format(baseurl, rev)))
- app.add_role('example_file', autolink('{}/blob/{}/examples/%s'.format(baseurl, rev)))
- app.add_role('example_raw', autolink('{}/raw/{}/examples/%s'.format(baseurl, rev)))
-
-
-def autolink(pattern):
- def role(name, rawtext, text, lineno, inliner, options={}, content=[]):
- m = re.search('(.*)\s*<(.*)>', text) # noqa: W605 - regular expression
- if m:
- link_text = m.group(1)
- link = m.group(2)
- else:
- link_text = text
- link = text
- url = pattern % (link,)
- node = nodes.reference(rawtext, link_text, refuri=url, **options)
- return [node], []
- return role
diff --git a/components/esp-dsp/docs/local_util.py b/components/esp-dsp/docs/local_util.py
deleted file mode 100644
index 666afa9..0000000
--- a/components/esp-dsp/docs/local_util.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Utility functions used in conf.py
-#
-# Copyright 2017 Espressif Systems (Shanghai) PTE LTD
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http:#www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import unicode_literals
-from io import open
-import os
-import shutil
-
-
-def run_cmd_get_output(cmd):
- return os.popen(cmd).read().strip()
-
-
-def files_equal(path_1, path_2):
- if not os.path.exists(path_1) or not os.path.exists(path_2):
- return False
- file_1_contents = ''
- with open(path_1, "r", encoding='utf-8') as f_1:
- file_1_contents = f_1.read()
- file_2_contents = ''
- with open(path_2, "r", encoding='utf-8') as f_2:
- file_2_contents = f_2.read()
- return file_1_contents == file_2_contents
-
-
-def copy_file_if_modified(src_file_path, dst_file_path):
- if not files_equal(src_file_path, dst_file_path):
- dst_dir_name = os.path.dirname(dst_file_path)
- if not os.path.isdir(dst_dir_name):
- os.makedirs(dst_dir_name)
- shutil.copy(src_file_path, dst_file_path)
-
-
-def copy_if_modified(src_path, dst_path):
- if os.path.isfile(src_path):
- copy_file_if_modified(src_path, dst_path)
- return
-
- src_path_len = len(src_path)
- for root, dirs, files in os.walk(src_path):
- for src_file_name in files:
- src_file_path = os.path.join(root, src_file_name)
- dst_file_path = os.path.join(dst_path + root[src_path_len:], src_file_name)
- copy_file_if_modified(src_file_path, dst_file_path)
diff --git a/components/esp-dsp/docs/requirements.txt b/components/esp-dsp/docs/requirements.txt
deleted file mode 100644
index 9b4bdad..0000000
--- a/components/esp-dsp/docs/requirements.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# This is a list of python packages used to generate documentation. This file is used with pip:
-# pip install --user -r requirements.txt
-#
-future
-sphinx==1.6.5
-sphinx-rtd-theme
-breathe==4.7.3
-recommonmark
diff --git a/components/esp-dsp/docs/sphinx-known-warnings.txt b/components/esp-dsp/docs/sphinx-known-warnings.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/components/esp-dsp/examples/README.md b/components/esp-dsp/examples/README.md
deleted file mode 100644
index 0a050c3..0000000
--- a/components/esp-dsp/examples/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# ESP-DSP Examples
-
-This directory contains a range of examples for ESP-DSP library.
-
-These examples are intended to demonstrate part of ESP-DSP functionality (e.g. initialization, execution) and to provide code that you can copy and adapt into your own projects.
-
-See the [README.md](../README.md) file in the upper level directory for more information about ESP-DSP.
-
-# Example Layout
-
-The examples are grouped into subdirectories by category. Each category directory contains one or more example projects:
-
-* [Dot Product Calculation](./dotprod/README.md) Example
-* [Basic Math Operations](./basic_math/README.md) Example
-* [FFT](./fft/README.md) Example
-* [Matrix](./matrix/README.md) example
-* [FFT Window](./fft_window/README.md) Example
-* [IIR Filter](./iir/README.md) Example
diff --git a/components/esp-dsp/examples/basic_math/CMakeLists.txt b/components/esp-dsp/examples/basic_math/CMakeLists.txt
deleted file mode 100644
index f5e6643..0000000
--- a/components/esp-dsp/examples/basic_math/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(basic_math)
\ No newline at end of file
diff --git a/components/esp-dsp/examples/basic_math/Makefile b/components/esp-dsp/examples/basic_math/Makefile
deleted file mode 100644
index f84a43e..0000000
--- a/components/esp-dsp/examples/basic_math/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := basic_math
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/basic_math/README.md b/components/esp-dsp/examples/basic_math/README.md
deleted file mode 100644
index 80bc09c..0000000
--- a/components/esp-dsp/examples/basic_math/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-# Basic Math Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use basic math functions from esp-dsp library. Example does the following steps:
-
-1. Initialize the library
-2. Initialize input signals with 1024 samples
-3. Apply window to input signal by standard C loop.
-4. Calculate FFT for 1024 complex samples and show the result
-5. Show results on the plots
-6. Apply window to input signal by basic math functions dsps_mul_f32 and dsps_mulc_f32.
-7. Calculate FFT for 1024 complex samples
-8. Show results on the plots
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config ---> DSP Library ---> Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```bash
-I (132) main: *** Start Example. ***
-I (132) main: *** Multiply tone signal with Hann window by standard C loop. ***
-I (152) view: Data min[432] = -173.749878, Data max[205] = 23.849705
- ________________________________________________________________
-0 | |
-1 | |
-2 | |
-3 || |
-4 | | |
-5 || | |
-6 ||| || |
-7 ||||| |||| |
-8||||||||||||||| |||||| |
-9 |||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (162) view: Plot: Length=512, min=-120.000000, max=40.000000
-I (162) main: *** Multiply tone signal with Hann window by esp-dsp basic math functions. ***
-I (162) view: Data min[432] = -173.749878, Data max[205] = 23.849705
- ________________________________________________________________
-0 | |
-1 | |
-2 | |
-3 || |
-4 | | |
-5 || | |
-6 ||| || |
-7 ||||| |||| |
-8||||||||||||||| |||||| |
-9 |||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (172) view: Plot: Length=512, min=-120.000000, max=40.000000
-I (172) main: *** End Example. ***
-```
diff --git a/components/esp-dsp/examples/basic_math/main/CMakeLists.txt b/components/esp-dsp/examples/basic_math/main/CMakeLists.txt
deleted file mode 100644
index c8c6546..0000000
--- a/components/esp-dsp/examples/basic_math/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_math_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/basic_math/main/component.mk b/components/esp-dsp/examples/basic_math/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/basic_math/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/basic_math/main/dsps_math_main.c b/components/esp-dsp/examples/basic_math/main/dsps_math_main.c
deleted file mode 100644
index 3c580a5..0000000
--- a/components/esp-dsp/examples/basic_math/main/dsps_math_main.c
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-#include
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use FFT from esp-dsp library
-
-#define N_SAMPLES 1024
-int N = N_SAMPLES;
-// Input test array
-float x1[N_SAMPLES];
-// Window coefficients
-float wind[N_SAMPLES];
-// working complex array
-float y_cf[N_SAMPLES*2];
-// Pointers to result arrays
-float* y1_cf = &y_cf[0];
-
-static void process_and_show(float* data, int length)
-{
- dsps_fft2r_fc32(data, length);
- // Bit reverse
- dsps_bit_rev_fc32(data, length);
- // Convert one complex vector to two complex vectors
- dsps_cplx2reC_fc32(data, length);
-
- for (int i = 0 ; i < length/2 ; i++) {
- data[i] = 10 * log10f((data[i * 2 + 0] * data[i * 2 + 0] + data[i * 2 + 1] * data[i * 2 + 1])/N);
- }
-
- // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/4 samples
- dsps_view(data, length/2, 64, 10, -120, 40, '|');
-}
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "*** Start Example. ***");
- ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- // Generate Hann window
- dsps_wind_hann_f32(wind, N);
-
- ESP_LOGI(TAG, "*** Multiply tone signal with Hann window by standard C loop. ***");
- // Generate input signal
- dsps_tone_gen_f32(x1, N, 1., 0.2, 0);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = x1[i]*wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGI(TAG, "*** Multiply tone signal with Hann window by esp-dsp basic math functions. ***");
- // Convert two input vectors to one complex vector with basic functions
- dsps_mul_f32(x1, wind, y_cf, N, 1, 1, 2); // Multiply input array with window and store as real part
- dsps_mulc_f32(&y_cf[1], &y_cf[1], N, 0, 2, 2); // Clear imaginary part of the complex signal
- process_and_show(y_cf, N);
- ESP_LOGI(TAG, "*** End Example. ***");
-}
\ No newline at end of file
diff --git a/components/esp-dsp/examples/dotprod/CMakeLists.txt b/components/esp-dsp/examples/dotprod/CMakeLists.txt
deleted file mode 100644
index 17124ef..0000000
--- a/components/esp-dsp/examples/dotprod/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../..")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(dotprod)
diff --git a/components/esp-dsp/examples/dotprod/Makefile b/components/esp-dsp/examples/dotprod/Makefile
deleted file mode 100644
index 51fb024..0000000
--- a/components/esp-dsp/examples/dotprod/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := dotprod
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/dotprod/README.md b/components/esp-dsp/examples/dotprod/README.md
deleted file mode 100644
index 492845b..0000000
--- a/components/esp-dsp/examples/dotprod/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Dot Product Calculation Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use dotprod dsps_dotprod_f32 from esp-dsp library. Example does the following steps:
-
-1. Initialize the input arrays
-2. Calculate dot product of two arrays
-3. Compare results and calculate execution time in cycles.
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (55) main: Start Example.
-I (55) main: The sum of 101 elements from 0..100 = 5050.000000
-I (55) main: Operation for 101 samples took 1381 cycles
-I (65) main: End Example.
-```
diff --git a/components/esp-dsp/examples/dotprod/main/CMakeLists.txt b/components/esp-dsp/examples/dotprod/main/CMakeLists.txt
deleted file mode 100644
index 82b2817..0000000
--- a/components/esp-dsp/examples/dotprod/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_dotproduct_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/dotprod/main/component.mk b/components/esp-dsp/examples/dotprod/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/dotprod/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/dotprod/main/dsps_dotproduct_main.c b/components/esp-dsp/examples/dotprod/main/dsps_dotproduct_main.c
deleted file mode 100644
index 3c4e0c3..0000000
--- a/components/esp-dsp/examples/dotprod/main/dsps_dotproduct_main.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use dsps_dotprod_f32 and dsps_dotprode_f32 functions
-
-#define N_SAMPLES 256
-int N = N_SAMPLES;
-float input1[N_SAMPLES];
-float input2[N_SAMPLES];
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "Start Example.");
-
- // The example will calculate n!
- //Initialize an input arrays
- for (int i=0 ; i< N ; i++)
- {
- input1[i] = 1;
- input2[i] = i;
- }
- float result1 = 0;
- unsigned int start_b = xthal_get_ccount();
- ret = dsps_dotprod_f32(input1, input2, &result1, 101);
- unsigned int end_b = xthal_get_ccount();
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Operation error = %i", ret);
- }
- ESP_LOGI(TAG, "The sum of 101 elements from 0..100 = %f", result1);
- ESP_LOGI(TAG, "Operation for 101 samples take %i cycles", end_b - start_b);
-
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/examples/fft/CMakeLists.txt b/components/esp-dsp/examples/fft/CMakeLists.txt
deleted file mode 100644
index ffa3b20..0000000
--- a/components/esp-dsp/examples/fft/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(fft2r)
diff --git a/components/esp-dsp/examples/fft/Makefile b/components/esp-dsp/examples/fft/Makefile
deleted file mode 100644
index 9148b9d..0000000
--- a/components/esp-dsp/examples/fft/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := fft2r
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/fft/README.md b/components/esp-dsp/examples/fft/README.md
deleted file mode 100644
index a8da2c4..0000000
--- a/components/esp-dsp/examples/fft/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-# FFT Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use FFT functionality from esp-dsp library. Example does the following steps:
-
-1. Initialize the library
-2. Initialize input signals with 1024 samples: one 0 dB, second with -20 dB
-3. Combine two signals as one complex input signal and apply window to input signals paar.
-4. Calculate FFT for 1024 complex samples
-5. Apply bit reverse operation for output complex vector
-6. Split one complex FFT output spectrum to two real signal spectrums
-7. Show results on the plots
-8. Show execution time of FFT
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (59) main: Start Example.
-W (89) main: Signal x1
-I (89) view: Data min[495] = -162.760925, Data max[164] = 23.938747
- ________________________________________________________________
-0 |
-1 | |
-2 | |
-3 | |
-4 | |
-5 | |
-6 | | |
-7 | | |
-8 || || |
-9|||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (159) view: Plot: Length=512, min=-60.000000, max=40.000000
-W (169) main: Signal x2
-I (169) view: Data min[502] = -164.545135, Data max[205] = 3.857752
- ________________________________________________________________
-0 |
-1 |
-2 |
-3 | |
-4 | |
-5 | |
-6 | |
-7 || |
-8 | | |
-9|||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (249) view: Plot: Length=512, min=-60.000000, max=40.000000
-W (249) main: Signals x1 and x2 on one plot
-I (259) view: Data min[505] = -159.215271, Data max[164] = 23.938747
- ________________________________________________________________
-0 |
-1 | |
-2 | |
-3 | | |
-4 | | |
-5 | | |
-6 | | | |
-7 | | || |
-8 || || | | |
-9|||||||||||||||||| | ||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (339) view: Plot: Length=512, min=-60.000000, max=40.000000
-I (339) main: FFT for 1024 complex points take 140472 cycles
-I (349) main: End Example.
-```
diff --git a/components/esp-dsp/examples/fft/main/CMakeLists.txt b/components/esp-dsp/examples/fft/main/CMakeLists.txt
deleted file mode 100644
index f8c3849..0000000
--- a/components/esp-dsp/examples/fft/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_fft_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/fft/main/component.mk b/components/esp-dsp/examples/fft/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/fft/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/fft/main/dsps_fft_main.c b/components/esp-dsp/examples/fft/main/dsps_fft_main.c
deleted file mode 100644
index 2dc0d39..0000000
--- a/components/esp-dsp/examples/fft/main/dsps_fft_main.c
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-#include
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use FFT from esp-dsp library
-
-#define N_SAMPLES 1024
-int N = N_SAMPLES;
-// Input test array
-float x1[N_SAMPLES];
-float x2[N_SAMPLES];
-// Window coefficients
-float wind[N_SAMPLES];
-// working complex array
-float y_cf[N_SAMPLES*2];
-// Pointers to result arrays
-float* y1_cf = &y_cf[0];
-float* y2_cf = &y_cf[N_SAMPLES];
-
-// Sum of y1 and y2
-float sum_y[N_SAMPLES/2];
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "Start Example.");
- ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- // Generate hann window
- dsps_wind_hann_f32(wind, N);
- // Generate input signal for x1 A=1 , F=0.1
- dsps_tone_gen_f32(x1, N, 1.0, 0.16, 0);
- // Generate input signal for x2 A=0.1,F=0.2
- dsps_tone_gen_f32(x2, N, 0.1, 0.2, 0);
-
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = x1[i] * wind[i];
- y_cf[i*2 + 1] = x2[i] * wind[i];
- }
- // FFT
- unsigned int start_b = xthal_get_ccount();
- dsps_fft2r_fc32(y_cf, N);
- unsigned int end_b = xthal_get_ccount();
- // Bit reverse
- dsps_bit_rev_fc32(y_cf, N);
- // Convert one complex vector to two complex vectors
- dsps_cplx2reC_fc32(y_cf, N);
-
- for (int i = 0 ; i < N/2 ; i++) {
- y1_cf[i] = 10 * log10f((y1_cf[i * 2 + 0] * y1_cf[i * 2 + 0] + y1_cf[i * 2 + 1] * y1_cf[i * 2 + 1])/N);
- y2_cf[i] = 10 * log10f((y2_cf[i * 2 + 0] * y2_cf[i * 2 + 0] + y2_cf[i * 2 + 1] * y2_cf[i * 2 + 1])/N);
- // Simple way to show two power spectrums as one plot
- sum_y[i] = fmax(y1_cf[i], y2_cf[i]);
- }
-
- // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/4 samples
- ESP_LOGW(TAG, "Signal x1");
- dsps_view(y1_cf, N/2, 64, 10, -60, 40, '|');
- ESP_LOGW(TAG, "Signal x2");
- dsps_view(y2_cf, N/2, 64, 10, -60, 40, '|');
- ESP_LOGW(TAG, "Signals x1 and x2 on one plot");
- dsps_view(sum_y, N/2, 64, 10, -60, 40, '|');
- ESP_LOGI(TAG, "FFT for %i complex points take %i cycles", N, end_b - start_b);
-
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/examples/fft4real/CMakeLists.txt b/components/esp-dsp/examples/fft4real/CMakeLists.txt
deleted file mode 100644
index 06eec85..0000000
--- a/components/esp-dsp/examples/fft4real/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(fft4real)
diff --git a/components/esp-dsp/examples/fft4real/Makefile b/components/esp-dsp/examples/fft4real/Makefile
deleted file mode 100644
index 39c7030..0000000
--- a/components/esp-dsp/examples/fft4real/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := fft4real
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/fft4real/README.md b/components/esp-dsp/examples/fft4real/README.md
deleted file mode 100644
index e61930e..0000000
--- a/components/esp-dsp/examples/fft4real/README.md
+++ /dev/null
@@ -1,99 +0,0 @@
-# FFT 4 Real Input Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use FFT functionality from esp-dsp library. Example does the following steps:
-
-1. Initialize the library
-2. Initialize input signals with 1024 samples: one 0 dB, second with -20 dB
-4. Calculate FFT Radix-2 for 1024 complex samples
-4. Calculate FFT Radix-4 for 1024 complex samples
-5. Apply bit reverse operation for output complex vectors
-7. Show results on the plots
-8. Show execution time of FFTs
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (344) main: Start Example.
-W (424) main: Signal x1
-I (424) view: Data min[673] = -103.113297, Data max[328] = 20.490950
- ________________________________________________________________
-0 |
-1 | |
-2 | |
-3 | |
-4 | |
-5 | |
-6 | |
-7 | | |
-8 | | |
-9||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (494) view: Plot: Length=1024, min=-60.000000, max=40.000000
-W (504) main: Signal x2
-I (504) view: Data min[582] = -103.113297, Data max[328] = 20.490950
- ________________________________________________________________
-0 |
-1 | |
-2 | |
-3 | |
-4 | |
-5 | |
-6 | |
-7 | | |
-8 | | |
-9||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (584) view: Plot: Length=1024, min=-60.000000, max=40.000000
-W (593) main: Difference between signals x1 and x2 on one plot
-I (594) view: Data min[0] = 0.000000, Data max[392] = 0.313019
- ________________________________________________________________
-0 |
-1 |
-2 |
-3 |
-4 |
-5 |
-6 |
-7 |
-8----------------------------------------------------------------|
-9 |
- 0123456789012345678901234567890123456789012345678901234567890123
-I (674) view: Plot: Length=1024, min=0.000000, max=40.000000
-I (674) main: FFT Radix 2 for 1024 complex points take 168652 cycles
-I (684) main: FFT Radix 4 for 1024 complex points take 104665 cycles
-I (694) main: End Example.
-```
diff --git a/components/esp-dsp/examples/fft4real/main/CMakeLists.txt b/components/esp-dsp/examples/fft4real/main/CMakeLists.txt
deleted file mode 100644
index 45a4a10..0000000
--- a/components/esp-dsp/examples/fft4real/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_fft4real_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/fft4real/main/component.mk b/components/esp-dsp/examples/fft4real/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/fft4real/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/fft4real/main/dsps_fft4real_main.c b/components/esp-dsp/examples/fft4real/main/dsps_fft4real_main.c
deleted file mode 100644
index 8680a5a..0000000
--- a/components/esp-dsp/examples/fft4real/main/dsps_fft4real_main.c
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-#include
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use FFT from esp-dsp library
-
-#define N_SAMPLES 2048 // Amount of real input samples
-int N = N_SAMPLES;
-// Input test array
-float x1[N_SAMPLES];
-float x2[N_SAMPLES];
-// Window coefficients
-float wind[N_SAMPLES];
-// Pointers to result arrays
-float* y1_cf = &x1[0];
-float* y2_cf = &x2[0];
-
-// diff of y1 and y2
-float diff_y[N_SAMPLES/2];
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "Start Example.");
- ret = dsps_fft2r_init_fc32(NULL, N>>1);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT2R. Error = %i", ret);
- return;
- }
-
- ret = dsps_fft4r_init_fc32(NULL, N >> 1);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT4R. Error = %i", ret);
- return;
- }
-
- // Generate hann window
- dsps_wind_hann_f32(wind, N);
- // Generate input signal for x1 A=1 , F=0.1
- dsps_tone_gen_f32(x1, N, 1.0, 0.16, 0);
-
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- x1[i] = x1[i] * wind[i];
- x2[i] = x1[i];
- }
- // FFT Radix-2
- unsigned int start_r2 = xthal_get_ccount();
- dsps_fft2r_fc32(x1, N>>1);
- // Bit reverse
- dsps_bit_rev2r_fc32(x1, N>>1);
- // Convert one complex vector with length N/2 to one real spectrum vector with length N/2
- dsps_cplx2real_fc32(x1, N>>1);
- unsigned int end_r2 = xthal_get_ccount();
-
- // FFT Radix-4
- unsigned int start_r4 = xthal_get_ccount();
- dsps_fft4r_fc32(x2, N>>1);
- // Bit reverse
- dsps_bit_rev4r_fc32(x2, N>>1);
- // Convert one complex vector with length N/2 to one real spectrum vector with length N/2
- dsps_cplx2real_fc32(x2, N>>1);
- unsigned int end_r4 = xthal_get_ccount();
-
- for (int i = 0 ; i < N/2 ; i++) {
- x1[i] = 10 * log10f((x1[i * 2 + 0] * x1[i * 2 + 0] + x1[i * 2 + 1] * x1[i * 2 + 1] + 0.0000001)/N);
- x2[i] = 10 * log10f((x2[i * 2 + 0] * x2[i * 2 + 0] + x2[i * 2 + 1] * x2[i * 2 + 1] + 0.0000001)/N);
- // Simple way to show two power spectrums as one plot
- diff_y[i] = fabs(x1[i] - x2[i]);
- }
-
- // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/4 samples
- ESP_LOGW(TAG, "Signal x1");
- dsps_view(x1, N/2, 64, 10, -60, 40, '|');
- ESP_LOGW(TAG, "Signal x2");
- dsps_view(x2, N/2, 64, 10, -60, 40, '|');
- ESP_LOGW(TAG, "Difference between signals x1 and x2 on one plot");
- dsps_view(diff_y, N/2, 64, 10, 0, 40, '-');
- ESP_LOGI(TAG, "FFT Radix 2 for %i complex points take %i cycles", N/2, end_r2 - start_r2);
- ESP_LOGI(TAG, "FFT Radix 4 for %i complex points take %i cycles", N/2, end_r4 - start_r4);
-
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/examples/fft4real/main/linker.ld b/components/esp-dsp/examples/fft4real/main/linker.ld
deleted file mode 100644
index c5aacfa..0000000
--- a/components/esp-dsp/examples/fft4real/main/linker.ld
+++ /dev/null
@@ -1,9 +0,0 @@
-[mapping:dsp]
-archive: libdsp.a
-entries:
- * (noflash)
-
-[mapping:esp-dsp]
-archive: libesp-dsp.a
-entries:
- * (noflash)
diff --git a/components/esp-dsp/examples/fft_window/CMakeLists.txt b/components/esp-dsp/examples/fft_window/CMakeLists.txt
deleted file mode 100644
index cceb451..0000000
--- a/components/esp-dsp/examples/fft_window/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(fft_window)
diff --git a/components/esp-dsp/examples/fft_window/Makefile b/components/esp-dsp/examples/fft_window/Makefile
deleted file mode 100644
index 8c3810a..0000000
--- a/components/esp-dsp/examples/fft_window/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := fft_window
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/fft_window/README.md b/components/esp-dsp/examples/fft_window/README.md
deleted file mode 100644
index 7f013fd..0000000
--- a/components/esp-dsp/examples/fft_window/README.md
+++ /dev/null
@@ -1,142 +0,0 @@
-# FFT Window Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use Window and FFT functionality from esp-dsp library. Example does the following steps:
-
-1. Initialize the library
-2. Initialize input signals with 1024 samples
-3. Apply window to input signal.
-4. Calculate FFT for 1024 complex samples
-5. Apply bit reverse operation for output complex vector
-6. Split one complex FFT output spectrum to two real signal spectrums
-7. Show results on the plots
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (128) main: Start Example.
-W (128) main: Hann Window
-I (128) view: Data min[256] = -inf, Data max[1] = 24.086628
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5 | |
-6 | |
-7 ||||| |
-8 ||||||||||||||| |
-9 ||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (138) view: Plot: Length=512, min=-120.000000, max=40.000000
-W (138) main: Blackman Window
-I (148) view: Data min[355] = -165.295654, Data max[1] = 24.083012
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5| |
-6 | |
-7 ||| |
-8 ||||||||| |
-9 |||||||||||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (158) view: Plot: Length=512, min=-120.000000, max=40.000000
-W (158) main: Blackman-Harris Window
-I (168) view: Data min[128] = -inf, Data max[1] = 23.874702
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5| |
-6| |
-7|| |
-8| |||| |
-9 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (178) view: Plot: Length=512, min=-120.000000, max=40.000000
-W (178) main: Blackman-Nuttall Window
-I (188) view: Data min[128] = -inf, Data max[1] = 23.890663
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5| |
-6| |
-7 || |
-8 |||| | |
-9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (198) view: Plot: Length=512, min=-120.000000, max=40.000000
-W (198) main: Nuttall Window
-I (208) view: Data min[203] = -175.147400, Data max[1] = 23.858671
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5| |
-6| |
-7|| |
-8 ||| |
-9 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (218) view: Plot: Length=512, min=-120.000000, max=40.000000
-W (218) main: Flat-Top Window
-I (228) view: Data min[256] = -inf, Data max[1] = 22.490753
- ________________________________________________________________
-0| |
-1| |
-2| |
-3| |
-4| |
-5| |
-6| |
-7 || |
-8 ||||| |
-9 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- 0123456789012345678901234567890123456789012345678901234567890123
-I (238) view: Plot: Length=512, min=-120.000000, max=40.000000
-I (238) main: End Example.
-```
diff --git a/components/esp-dsp/examples/fft_window/main/CMakeLists.txt b/components/esp-dsp/examples/fft_window/main/CMakeLists.txt
deleted file mode 100644
index fecbfaf..0000000
--- a/components/esp-dsp/examples/fft_window/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_window_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/fft_window/main/component.mk b/components/esp-dsp/examples/fft_window/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/fft_window/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/fft_window/main/dsps_window_main.c b/components/esp-dsp/examples/fft_window/main/dsps_window_main.c
deleted file mode 100644
index 1d196d2..0000000
--- a/components/esp-dsp/examples/fft_window/main/dsps_window_main.c
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-#include
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use FFT from esp-dsp library
-
-#define N_SAMPLES 1024
-int N = N_SAMPLES;
-// Input test array
-float x1[N_SAMPLES];
-// Window coefficients
-float wind[N_SAMPLES];
-// working complex array
-float y_cf[N_SAMPLES*2];
-// Pointers to result arrays
-float* y1_cf = &y_cf[0];
-
-void process_and_show(float* data, int length)
-{
- dsps_fft2r_fc32(data, length);
- // Bit reverse
- dsps_bit_rev_fc32(data, length);
- // Convert one complex vector to two complex vectors
- dsps_cplx2reC_fc32(data, length);
-
- for (int i = 0 ; i < length/2 ; i++) {
- data[i] = 10 * log10f((data[i * 2 + 0] * data[i * 2 + 0] + data[i * 2 + 1] * data[i * 2 + 1])/N);
- }
-
- // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/4 samples
- dsps_view(data, length/2, 64, 10, -120, 40, '|');
-
-}
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "Start Example.");
- ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- ESP_LOGW(TAG, "Hann Window");
- // Generate Hann window
- dsps_wind_hann_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGW(TAG, "Blackman Window");
- // Generate Blackman window
- dsps_wind_blackman_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGW(TAG, "Blackman-Harris Window");
- // Generate Blackman-Harris window
- dsps_wind_blackman_harris_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGW(TAG, "Blackman-Nuttall Window");
- // Generate Blackman-Nuttall window
- dsps_wind_blackman_nuttall_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGW(TAG, "Nuttall Window");
- // Generate Nuttall window
- dsps_wind_nuttall_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGW(TAG, "Flat-Top Window");
- // Generate Flat-Top window
- dsps_wind_flat_top_f32(wind, N);
- // Convert two input vectors to one complex vector
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = wind[i];
- y_cf[i*2 + 1] = 0;
- }
- process_and_show(y_cf, N);
-
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/examples/iir/CMakeLists.txt b/components/esp-dsp/examples/iir/CMakeLists.txt
deleted file mode 100644
index a71cf9c..0000000
--- a/components/esp-dsp/examples/iir/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(iir)
diff --git a/components/esp-dsp/examples/iir/Makefile b/components/esp-dsp/examples/iir/Makefile
deleted file mode 100644
index bf57023..0000000
--- a/components/esp-dsp/examples/iir/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := iir
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/iir/README.md b/components/esp-dsp/examples/iir/README.md
deleted file mode 100644
index ff4936a..0000000
--- a/components/esp-dsp/examples/iir/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# IIR Filter Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use IIR filters functionality from esp-dsp library. Example does the following steps:
-
-1. Initialize the library
-2. Initialize input signal
-3. Show LPF filter with Q factor 1
- * Calculate iir filter coefficients
- * Filter the input test signal (delta function)
- * Shows impulse response on the plot
- * Shows frequency response on the plot
- * Calculate execution performance
-4. The same for LPF filter with Q factor 10
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (58) main: Start Example.
-I (58) main: Impulse response of IIR filter with F=0.100000, qFactor=1.000000
-I (68) view: Data min[8] = -0.060052, Data max[2] = 0.333517
- ________________________________________________________________
-0 |
-1 |
-2 - |
-3- - |
-4 -------------------------------------------------------------|
-5 |
-6 |
-7 |
-8 |
-9 |
- 0123456789012345678901234567890123456789012345678901234567890123
-I (138) view: Plot: Length=128, min=-1.000000, max=1.000000
-I (148) view: Data min[511] = -149.983795, Data max[0] = 0.000000
- ________________________________________________________________
-0 |
-1 |
-2----------------- |
-3 ---------- |
-4 ------------- |
-5 ---------- |
-6 ------- |
-7 --- |
-8 -- |
-9 --|
- 0123456789012345678901234567890123456789012345678901234567890123
-I (228) view: Plot: Length=512, min=-100.000000, max=0.000000
-I (228) main: IIR for 1024 samples take 20276 cycles
-I (238) main: Impulse response of IIR filter with F=0.100000, qFactor=10.000000
-I (248) view: Data min[7] = -0.453739, Data max[2] = 0.526114
- ________________________________________________________________
-0 |
-1 |
-2 - - |
-3- - - - --- --- - - |
-4- - - - - ---- -------------------------------------|
-5 -- -- -- -- |
-6 |
-7 |
-8 |
-9 |
- 0123456789012345678901234567890123456789012345678901234567890123
-I (318) view: Plot: Length=128, min=-1.000000, max=1.000000
-I (328) view: Data min[511] = -149.480377, Data max[0] = 0.000000
- ________________________________________________________________
-0 -- |
-1 -- - |
-2---------- ----- |
-3 -------- |
-4 ------------ |
-5 ---------- |
-6 ------- |
-7 --- |
-8 -- |
-9 --|
- 0123456789012345678901234567890123456789012345678901234567890123
-I (408) view: Plot: Length=512, min=-100.000000, max=0.000000
-I (408) main: IIR for 1024 samples take 17456 cycles
-I (418) main: End Example.
-
-```
diff --git a/components/esp-dsp/examples/iir/main/CMakeLists.txt b/components/esp-dsp/examples/iir/main/CMakeLists.txt
deleted file mode 100644
index 0b1886f..0000000
--- a/components/esp-dsp/examples/iir/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dsps_iir_main.c")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/iir/main/component.mk b/components/esp-dsp/examples/iir/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/iir/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/iir/main/dsps_iir_main.c b/components/esp-dsp/examples/iir/main/dsps_iir_main.c
deleted file mode 100644
index 4866f32..0000000
--- a/components/esp-dsp/examples/iir/main/dsps_iir_main.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "esp_system.h"
-#include "driver/spi_master.h"
-#include "soc/gpio_struct.h"
-#include "driver/gpio.h"
-#include "driver/uart.h"
-#include "soc/uart_struct.h"
-#include
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use iir filters from esp-dsp library
-
-#define N_SAMPLES 1024
-int N = N_SAMPLES;
-// Input test array
-float d[N_SAMPLES];
-// output array
-float y[N_SAMPLES];
-float y_cf[N_SAMPLES*2];
-
-// Function shows result of IIR filter
-void ShowIIRfilter(float freq, float qFactor)
-{
- esp_err_t ret = ESP_OK;
- float coeffs_lpf[5];
- float w_lpf[5] = {0,0};
- // Calculate iir filter coefficients
- ret = dsps_biquad_gen_lpf_f32(coeffs_lpf, freq, qFactor);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Operation error = %i", ret);
- return;
- }
- // Process input signal
- unsigned int start_b = xthal_get_ccount();
- ret = dsps_biquad_f32(d, y, N, coeffs_lpf, w_lpf);
- unsigned int end_b = xthal_get_ccount();
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Operation error = %i", ret);
- return;
- }
-
- // Show result as a plot
- ESP_LOGI(TAG, "Impulse response of IIR filter with F=%f, qFactor=%f", freq, qFactor);
- dsps_view(y, 128, 64, 10, -1, 1, '-');
-
- // Show result as frequency responce on the plot
- for (int i=0 ; i< N ; i++)
- {
- y_cf[i*2 + 0] = y[i];
- y_cf[i*2 + 1] = 0;
- }
-
- // We making FFT transform
- dsps_fft2r_fc32_ansi(y_cf, N);
- // Bit reverse
- dsps_bit_rev_fc32_ansi(y_cf, N);
- // Calculating power of spectrum in dB
- for (int i = 0 ; i < N/2 ; i++) {
- y_cf[i] = 10 * log10f((y_cf[i * 2 + 0] * y_cf[i * 2 + 0] + y_cf[i * 2 + 1] * y_cf[i * 2 + 1])/N);
- }
- // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/2 samples
- dsps_view(y_cf, N/2, 64, 10, -100, 0, '-');
- ESP_LOGI(TAG, "IIR for %i samples take %i cycles", N, end_b - start_b);
-}
-
-void app_main()
-{
- esp_err_t ret;
- ESP_LOGI(TAG, "Start Example.");
- // If user don't care about buffer allocation, the defalt
- // initialization could be used as shown here:
- ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- // Initialize input signal
- // Generate d function as input signal
- dsps_d_gen_f32(d, N, 0);
-
- // Show filter with Q factor 1
- ShowIIRfilter(0.1, 1);
- // Show filter with Q factor 10
- ShowIIRfilter(0.1, 10);
-
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/examples/matrix/CMakeLists.txt b/components/esp-dsp/examples/matrix/CMakeLists.txt
deleted file mode 100644
index bc757fc..0000000
--- a/components/esp-dsp/examples/matrix/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# The following lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.5)
-
-set(EXTRA_COMPONENT_DIRS "../../")
-set(IDF_EXCLUDE_COMPONENTS test test_app)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(matrix)
diff --git a/components/esp-dsp/examples/matrix/Makefile b/components/esp-dsp/examples/matrix/Makefile
deleted file mode 100644
index 1af63f7..0000000
--- a/components/esp-dsp/examples/matrix/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This is a project Makefile. It is assumed the directory this Makefile resides in is a
-# project subdirectory.
-#
-
-PROJECT_NAME := matrix
-
-# This line has to be included into the make file
-# to include components that are located somewhere
-# but not in "component" directory
-
-EXTRA_COMPONENT_DIRS := $(realpath ../..)
-EXCLUDE_COMPONENTS := test
-
-include $(IDF_PATH)/make/project.mk
-
diff --git a/components/esp-dsp/examples/matrix/README.md b/components/esp-dsp/examples/matrix/README.md
deleted file mode 100644
index b074246..0000000
--- a/components/esp-dsp/examples/matrix/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# Matrix Operations Example
-
-(See the README.md file in the upper level 'examples' directory for more information about examples.)
-
-This example demonstrates how to use Mat class functionality from esp-dsp library. Example does the following steps:
-
-1. Initialize a matrix A and matirx x
-2. Calculate matrix b: b = A*x
-3. Find roots x1_: A*x1_ = b, with different methods
-4. Print result
-
-## How to use example
-
-### Hardware required
-
-This example does not require any special hardware, and can be run on any common development board.
-
-### Configure the project
-
-If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
-If using CMake based build system, no configuration is required.
-Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
-
-### Build and flash
-
-Build the project and flash it to the board, then run monitor tool to view serial output:
-
-```
-make -j4 flash monitor
-```
-
-Or, for CMake based build system (replace PORT with serial port name):
-
-```
-idf.py -p PORT flash monitor
-```
-
-(To exit the serial monitor, type ``Ctrl-]``.)
-
-See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
-
-## Example output
-
-Here is an typical example console output.
-
-```
-I (215) main: Start Example.
-I (215) main: Original vector x:
-0
-1
-2
-I (215) main: Solve result:
-0
-1
-2
-I (215) main: Roots result:
-0
-1
-2
-I (215) main: End Example.
-
-```
diff --git a/components/esp-dsp/examples/matrix/main/CMakeLists.txt b/components/esp-dsp/examples/matrix/main/CMakeLists.txt
deleted file mode 100644
index 4c83db3..0000000
--- a/components/esp-dsp/examples/matrix/main/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(COMPONENT_SRCS "dspm_matrix_main.cpp")
-set(COMPONENT_ADD_INCLUDEDIRS "")
-
-register_component()
\ No newline at end of file
diff --git a/components/esp-dsp/examples/matrix/main/component.mk b/components/esp-dsp/examples/matrix/main/component.mk
deleted file mode 100644
index 5d85ad3..0000000
--- a/components/esp-dsp/examples/matrix/main/component.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Main component makefile.
-#
-# This Makefile can be left empty. By default, it will take the sources in the
-# src/ directory, compile them and link them into lib(subdirectory_name).a
-# in the build directory. This behaviour is entirely configurable,
-# please read the ESP-IDF documents if you need to do this.
-#
diff --git a/components/esp-dsp/examples/matrix/main/dspm_matrix_main.cpp b/components/esp-dsp/examples/matrix/main/dspm_matrix_main.cpp
deleted file mode 100644
index 3b5ea10..0000000
--- a/components/esp-dsp/examples/matrix/main/dspm_matrix_main.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "esp_dsp.h"
-
-static const char *TAG = "main";
-
-// This example shows how to use Mat class from esp-dsp library.
-//
-// First we create matix A and x, and then calculating matrix b as result
-// A*x = b
-// Then we can find x as roots of matrices X and b
-//
-extern "C" void app_main();
-
-void app_main()
-{
- ESP_LOGI(TAG, "Start Example.");
- int M = 3;
- int N = 3;
- dspm::Mat A(M, N);
- dspm::Mat x(N, 1);
- for (int m = 0 ; m < M ; m++) {
- for (int n = 0 ; n < N ; n++) {
- A(m, n) = N * m + n;
- }
- x(m, 0) = m;
- }
- A(0, 0) = 10;
- A(0, 1) = 11;
-
- dspm::Mat b = A * x;
- // Gaussian method
- dspm::Mat x1_ = dspm::Mat::solve(A, b);
- // Non Gaussian method
- dspm::Mat x2_ = dspm::Mat::roots(A, b);
-
- ESP_LOGI(TAG, "Original vector x:");
- std::cout << x;
- ESP_LOGI(TAG, "Solve result:");
- std::cout << x1_;
- ESP_LOGI(TAG, "Roots result:");
- std::cout << x2_;
- ESP_LOGI(TAG, "End Example.");
-}
diff --git a/components/esp-dsp/modules/common/include/dsp_common.h b/components/esp-dsp/modules/common/include/dsp_common.h
deleted file mode 100644
index a2b43cb..0000000
--- a/components/esp-dsp/modules/common/include/dsp_common.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsp_common_H_
-#define _dsp_common_H_
-#include
-#include
-#include "dsp_err.h"
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @brief check power of two
- * The function check if the argument is power of 2.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @return
- * - true if x is power of two
- * - false if no
- */
-bool dsp_is_power_of_two(int x);
-
-
-/**
- * @brief Power of two
- * The function return power of 2 for values 2^N.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @return
- * - power of two
- */
-int dsp_power_of_two(int x);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _dsp_common_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/include/dsp_err.h b/components/esp-dsp/modules/common/include/dsp_err.h
deleted file mode 100644
index d769664..0000000
--- a/components/esp-dsp/modules/common/include/dsp_err.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#ifndef _DSP_ERR_H_
-#define _DSP_ERR_H_
-
-#include "stdint.h"
-#include "esp_err.h"
-#include "dsp_err_codes.h"
-
-#endif // _DSP_ERR_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/include/dsp_err_codes.h b/components/esp-dsp/modules/common/include/dsp_err_codes.h
deleted file mode 100644
index c882778..0000000
--- a/components/esp-dsp/modules/common/include/dsp_err_codes.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsp_error_codes_H_
-#define _dsp_error_codes_H_
-
-#define DSP_OK 0 // For internal use only. Please use ESP_OK instead
-#define ESP_ERR_DSP_BASE 0x70000
-#define ESP_ERR_DSP_INVALID_LENGTH (ESP_ERR_DSP_BASE + 1)
-#define ESP_ERR_DSP_INVALID_PARAM (ESP_ERR_DSP_BASE + 2)
-#define ESP_ERR_DSP_PARAM_OUTOFRANGE (ESP_ERR_DSP_BASE + 3)
-#define ESP_ERR_DSP_UNINITIALIZED (ESP_ERR_DSP_BASE + 4)
-#define ESP_ERR_DSP_REINITIALIZED (ESP_ERR_DSP_BASE + 5)
-
-
-#endif // _dsp_error_codes_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/include/dsp_platform.h b/components/esp-dsp/modules/common/include/dsp_platform.h
deleted file mode 100644
index d04f9dc..0000000
--- a/components/esp-dsp/modules/common/include/dsp_platform.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#ifndef dsp_platform_h_
-#define dsp_platform_h_
-#include "soc/cpu.h"
-
-#include "freertos/FreeRTOS.h"
-#include "freertos/portable.h"
-#include "freertos/task.h"
-#include "freertos/semphr.h"
-
-#endif // dsp_platform_h_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/include/dsp_tests.h b/components/esp-dsp/modules/common/include/dsp_tests.h
deleted file mode 100644
index 3042c2d..0000000
--- a/components/esp-dsp/modules/common/include/dsp_tests.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _DSP_TESTS_H_
-#define _DSP_TESTS_H_
-
-#define TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, actual) \
- if (actual >= max_exec) { \
- ESP_LOGE("", "Time error. Expected max: %i, reached: %i", (int)max_exec, (int)actual);\
- TEST_ASSERT_MESSAGE (false, "Exec time takes more than expected! ");\
- }\
- if (actual < min_exec) {\
- ESP_LOGE("", "Time error. Expected min: %i, reached: %i", (int)min_exec, (int)actual);\
- TEST_ASSERT_MESSAGE (false, "Exec time takes less then expected!");\
- }
-
-
-#endif // _DSP_TESTS_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/include/esp_dsp.h b/components/esp-dsp/modules/common/include/esp_dsp.h
deleted file mode 100644
index 61f991f..0000000
--- a/components/esp-dsp/modules/common/include/esp_dsp.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _esp_dsp_H_
-#define _esp_dsp_H_
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-// Common includes
-#include "dsp_common.h"
-
-// Signal processing
-#include "dsps_dotprod.h"
-#include "dsps_math.h"
-#include "dsps_fir.h"
-#include "dsps_biquad.h"
-#include "dsps_biquad_gen.h"
-#include "dsps_wind.h"
-#include "dsps_conv.h"
-#include "dsps_corr.h"
-
-#include "dsps_d_gen.h"
-#include "dsps_h_gen.h"
-#include "dsps_tone_gen.h"
-#include "dsps_snr.h"
-#include "dsps_sfdr.h"
-
-#include "dsps_fft2r.h"
-#include "dsps_fft4r.h"
-#include "dsps_dct.h"
-
-// Matrix operations
-#include "dspm_mult.h"
-
-// Support functions
-#include "dsps_view.h"
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-#include "mat.h"
-#endif
-
-#endif // _esp_dsp_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/misc/dsps_pwroftwo.cpp b/components/esp-dsp/modules/common/misc/dsps_pwroftwo.cpp
deleted file mode 100644
index 9c51f6b..0000000
--- a/components/esp-dsp/modules/common/misc/dsps_pwroftwo.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsp_common.h"
-
-bool dsp_is_power_of_two(int x)
-{
- return (x != 0) && ((x & (x - 1)) == 0);
-}
-
-int dsp_power_of_two(int x)
-{
- for (size_t i = 0; i < 16; i++)
- {
- x = x >> 1;
- if(0 == x) return i;
- }
- return 0;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/common/private_include/dsp_types.h b/components/esp-dsp/modules/common/private_include/dsp_types.h
deleted file mode 100644
index 02d725f..0000000
--- a/components/esp-dsp/modules/common/private_include/dsp_types.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _dsp_types_H_
-#define _dsp_types_H_
-#include
-#include
-
-// union to simplify access to the 16 bit data
-typedef union sc16_u
-{
- struct
- {
- int16_t re;
- int16_t im;
- };
- uint32_t data;
-}sc16_t;
-
-typedef union fc32_u
-{
- struct
- {
- float re;
- float im;
- };
- uint64_t data;
-}fc32_t;
-
-#endif // _dsp_types_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ae32.S b/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ae32.S
deleted file mode 100644
index a3d594f..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ae32.S
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_conv_platform.h"
-#if (dsps_ccorr_f32_ae32_enabled == 1)
-
-#include "dsps_conv_f32_m_ae32.S"
-
-// This is dot product function for ESP32 processor.
- .text
- .align 4
- .global dsps_ccorr_f32_ae32
- .type dsps_ccorr_f32_ae32,@function
-// The function implements the C code from dsps_ccorr_f32_ansi:
-//esp_err_t dsps_ccorr_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *corrout);
-//
-dsps_ccorr_f32_ae32:
-// Signal - a2
-// siglen - a3
-// Kernel - a4
-// kernlen - a5
-// corrout - a6
-//
-// a11 - loop length
-
- entry a1, 16
- // Array increment for floating point data should be 4
- sub a10, a3, a5
- bgez a10, dsps_ccorr_positive
- addi a10, a2, 0
- addi a2, a4, 0
- addi a4, a10, 0
-
- addi a10, a3, 0
- addi a3, a5, 0
- addi a5, a10, 0
-
-dsps_ccorr_positive:
- movi.n a8, 4
- addi a11, a5, 0 // lkern - loop counter
- movi.n a14, 0
- addi a9, a14, 1
-
- movi.n a7, 4
- movi.n a8, -4
-
- mull a13, a5, a7 // a13 - kernlen*4
- add a13, a13, a4 // a13 - Kernel[kernlen]
- addi a13, a13, -4 // a13 - Kernel[kernlen - 1]
-ccorr_loop1:
- // Clear initial state of the result register
- addi a10, a13, 0 // a10 - Kernel
- addi a12, a2, 0 // a12 - Signal
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[0]
- // a10 - kern[n];
- // a9 - n+1
- // a7 - 4,
- // a8 - -4,
- conv_f32_ae32 a12, a10, a9, a7, a7, loop1
-
- addi a9, a9, 1 // (n+1)++
- addi a13, a13, -4 // kern[n] - a4--
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a11, a11, -1
- bnez a11, ccorr_loop1
-
- // a11 - loop counter = siglen - kernlen - 1
- addi a9, a2, 4 // sig[1] - sig[kmin]
- addi a13, a5, 0
-
- // skip loop if 0
- sub a11, a3, a5 // a11 - loop counter
- beqz a11, skip_ccorr_loop2
-
-ccorr_loop2:
-
- // Clear initial state of the result register
- addi a12, a9, 0 // a12 - Signal[kmin]
- addi a10, a4, 0 // a10 - Kernel
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[kmin]
- // a10 - kern[0];
- // a11 - kernlen
- // a7 - 4,
- conv_f32_ae32 a12, a10, a13, a7, a7, loop2
-
- addi a9, a9, 4 // in1++
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a11, a11, -1
- bnez a11, ccorr_loop2
-
-
-skip_ccorr_loop2:
-
- // a9 - the same
- addi a11, a5, -1
- addi a13, a5, -1
-ccorr_loop3:
-
- // Clear initial state of the result register
- addi a12, a9, 0 // a12 - Signal[kmin]
- addi a10, a4, 0 // a10 - Kernel
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[kmin]
- // a10 - kern[n - kmin];
- // a11 - length
- // a7 - 4,
- // a8 - -4,
- conv_f32_ae32 a12, a10, a11, a7, a7, loop3
-
- addi a9, a9, 4 // n++
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a11, a11, -1
- bnez a11, ccorr_loop3
-skip_ccorr_loop3:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_ccorr_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ansi.c b/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ansi.c
deleted file mode 100644
index 9120ff6..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_ccorr_f32_ansi.c
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_conv.h"
-#include "esp_log.h"
-
-static const char *TAG = "dsps_conv";
-
-esp_err_t dsps_ccorr_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *corrvout)
-{
- if (NULL == Signal) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == Kernel) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == corrvout) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
-
- float *sig = (float *)Signal;
- float *kern = (float *)Kernel;
- int lsig = siglen;
- int lkern = kernlen;
-
- if (siglen < kernlen) {
- sig = (float *)Kernel;
- kern = (float *)Signal;
- lsig = kernlen;
- lkern = siglen;
- }
-
- for (int n = 0; n < lkern; n++) {
- size_t k;
- size_t kmin = lkern - 1 - n;
- corrvout[n] = 0;
-
- for (k = 0; k <= n; k++) {
- corrvout[n] += sig[k] * kern[kmin + k];
- }
- ESP_LOGV(TAG, "L1 k = %i, n = %i , kmin= %i, kmax= %i", 0, n, kmin, kmin + n);
- }
- for (int n = lkern; n < lsig; n++) {
- size_t kmin, kmax, k;
-
- corrvout[n] = 0;
-
- kmin = n - lkern + 1;
- kmax = n;
- for (k = kmin; k <= kmax; k++) {
- corrvout[n] += sig[k] * kern[k - kmin];
- }
- ESP_LOGV(TAG, "L2 n=%i, kmin = %i, kmax = %i , k-kmin = %i", n, kmin, kmax, 0);
- }
-
- for (int n = lsig; n < lsig + lkern - 1; n++) {
- size_t kmin, kmax, k;
-
- corrvout[n] = 0;
-
- kmin = n - lkern + 1;
- kmax = lsig - 1;
-
- for (k = kmin; k <= kmax; k++) {
- corrvout[n] += sig[k] * kern[k - kmin];
- }
- ESP_LOGV(TAG, "L3 n=%i, kmin = %i, kmax = %i , k - kmin = %i", n, kmin, kmax, kmax - kmin);
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_conv_f32_ae32.S b/components/esp-dsp/modules/conv/float/dsps_conv_f32_ae32.S
deleted file mode 100644
index 6939794..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_conv_f32_ae32.S
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_conv_platform.h"
-#if (dsps_conv_f32_ae32_enabled == 1)
-
-#include "dsps_conv_f32_m_ae32.S"
-
-// This is dot product function for ESP32 processor.
- .text
- .align 4
- .global dsps_conv_f32_ae32
- .type dsps_conv_f32_ae32,@function
-// The function implements the C code from dsps_conv_f32_ansi:
-//esp_err_t dsps_conv_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout);
-//
-dsps_conv_f32_ae32:
-// Signal - a2
-// siglen - a3
-// Kernel - a4
-// kernlen - a5
-// convout - a6
-//
-// a11 - loop length
-
- entry a1, 16
- // Array increment for floating point data should be 4
- sub a10, a3, a5
- bgez a10, dsps_conv_positive
- addi a10, a2, 0
- addi a2, a4, 0
- addi a4, a10, 0
-
- addi a10, a3, 0
- addi a3, a5, 0
- addi a5, a10, 0
-
-dsps_conv_positive:
- movi.n a8, 4
- addi a11, a5, 0 // lkern - loop counter
- movi.n a14, 0
- addi a9, a14, 1
-
- movi.n a7, 4
- movi.n a8, -4
-
-conv_loop1:
- // Clear initial state of the result register
- addi a10, a4, 0 // a10 - Kernel
- addi a12, a2, 0 // a12 - Signal
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[0]
- // a10 - kern[n];
- // a9 - n+1
- // a7 - 4,
- // a8 - -4,
- conv_f32_ae32 a12, a10, a9, a7, a8, loop1
-
- addi a9, a9, 1 // (n+1)++
- addi a4, a4, 4 // kern[n] - a4++
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a11, a11, -1
- bnez a11, conv_loop1
-
-
- // a11 - loop counter = siglen - kernlen - 1
- addi a9, a2, 0 // sig[1] - sig[kmin]
- addi a13, a5, 0
-
- // skip loop if 0
- sub a11, a3, a5 // a11 - loop counter
- beqz a11, skip_conv_loop2
-
-conv_loop2:
-
- // Clear initial state of the result register
- addi a12, a9, 4 // a12 - Signal[kmin]
- addi a10, a4, -4 // a10 - Kernel
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[kmin]
- // a10 - kern[n - kmin];
- // a11 - length
- // a7 - 4,
- // a8 - -4,
- conv_f32_ae32 a12, a10, a13, a7, a8, loop2
-
- addi a9, a9, 4 // (n+1)++
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a11, a11, -1
- bnez a11, conv_loop2
-
-skip_conv_loop2:
-
-// sub a11, a3, a5 // a11 - loop counter
-// beqz a11, skip_conv_loop3
- // a9 - the same
- addi a11, a5, -1
- addi a13, a5, -1
-// beqz a11, skip_conv_loop3
-conv_loop3:
-
- // Clear initial state of the result register
- addi a12, a9, 4 // a12 - Signal[kmin]
- addi a10, a4, -4 // a10 - Kernel
- wfr f1, a14 // clear output: convout[n] = 0;
-
- // a12 - sig[kmin]
- // a10 - kern[n - kmin];
- // a11 - length
- // a7 - 4,
- // a8 - -4,
- conv_f32_ae32 a12, a10, a13, a7, a8, loop3
-
- addi a9, a9, 4 // (n+1)++
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // convout++ - increment output pointer
-
- addi a13, a13, -1
-
- addi a11, a11, -1
- bnez a11, conv_loop3
-skip_conv_loop3:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_conv_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_conv_f32_ansi.c b/components/esp-dsp/modules/conv/float/dsps_conv_f32_ansi.c
deleted file mode 100644
index 66ca2c6..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_conv_f32_ansi.c
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_conv.h"
-#include "esp_log.h"
-
-static const char *TAG = "dsps_conv";
-
-esp_err_t dsps_conv_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout)
-{
- if (NULL == Signal) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == Kernel) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == convout) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
-
- float *sig = (float *)Signal;
- float *kern = (float *)Kernel;
- int lsig = siglen;
- int lkern = kernlen;
-
- if (siglen < kernlen) {
- sig = (float *)Kernel;
- kern = (float *)Signal;
- lsig = kernlen;
- lkern = siglen;
- }
-
- for (int n = 0; n < lkern; n++) {
- size_t k;
-
- convout[n] = 0;
-
- for (k = 0; k <= n; k++) {
- convout[n] += sig[k] * kern[n - k];
- }
- ESP_LOGV(TAG,"L1 kmin = %i, kmax = %i , n-kmin = %i", 0, n, n);
- }
- for (int n = lkern; n < lsig; n++) {
- size_t kmin, kmax, k;
-
- convout[n] = 0;
-
- kmin = n - lkern + 1;
- kmax = n;
- ESP_LOGV(TAG,"L2 n=%i, kmin = %i, kmax = %i , n-kmin = %i", n, kmin, kmax, n-kmin);
- for (k = kmin; k <= kmax; k++) {
- convout[n] += sig[k] * kern[n - k];
- }
- }
-
- for (int n = lsig; n < lsig + lkern - 1; n++) {
- size_t kmin, kmax, k;
-
- convout[n] = 0;
-
- kmin = n - lkern + 1;
- kmax = lsig - 1;
-
- for (k = kmin; k <= kmax; k++) {
- convout[n] += sig[k] * kern[n - k];
- }
- ESP_LOGV(TAG,"L3 n=%i, kmin = %i, kmax = %i , n-kmin = %i", n, kmin, kmax, n-kmin);
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_conv_f32_m_ae32.S b/components/esp-dsp/modules/conv/float/dsps_conv_f32_m_ae32.S
deleted file mode 100644
index 354c051..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_conv_f32_m_ae32.S
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro conv_f32_ae32 x1 x2 count step1 step2 name
-// This macro calculates floating point dot product for count float samples
-// x1, x2 - input arrays
-// count - amount of samples
-// step1 - start step
-//,step2 - A register for array step increment. (should be divided by 4)
-// f1 - contains initial value
-//
-// result in f1
-//
-// Macros body:
-// f1 += x1[]*x2[]; i: 0..counter-1
-// affected: f0, f1, f2
-// Example: conv_f32_ae32 a2 a3 a5 a8 a9
-// a8 == 4, step is 4 bytes
-// a5 == 32, length of array is 32
-//
- lsxp f0, \x2, \step2
- loopnez \count, loop_mac_end_m_ae32\name
- lsxp f2, \x1, \step1
- madd.s f1, f2, f0
- lsxp f0, \x2, \step2
- loop_mac_end_m_ae32\name:
-.endm
diff --git a/components/esp-dsp/modules/conv/float/dsps_corr_f32_ae32.S b/components/esp-dsp/modules/conv/float/dsps_corr_f32_ae32.S
deleted file mode 100644
index cb36acc..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_corr_f32_ae32.S
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_conv_platform.h"
-#if (dsps_corr_f32_ae32_enabled == 1)
-
-#include "dsps_dotprod_f32_m_ae32.S"
-
-// This is dot product function for ESP32 processor.
- .text
- .align 4
- .global dsps_corr_f32_ae32
- .type dsps_corr_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_corr_f32_ansi(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest)
-//{
-// for (size_t n = 0; n < (siglen - patlen); n++) {
-// float k_corr = 0;
-// for (size_t m = 0; m < patlen; m++) {
-// k_corr += Signal[n + m] * Pattern[m];
-// }
-// dest[n] = k_corr;
-// }
-// return ESP_OK;
-//}
-
-dsps_corr_f32_ae32:
-// Signal - a2
-// siglen - a3
-// Pattern - a4
-// patlen - a5
-// dest - a6
-// a11 - loop length
-
- entry a1, 16
- // Array increment for floating point data should be 4
- movi.n a8, 4
- movi.n a13, 4
- sub a11, a3, a5 // a11 = loop length
- addi a12, a2, 0 // move input pointer to the a12
- movi.n a9, 0
- movi.n a14, 0
-
-corr_loop:
- // Clear initial state of the result register
- addi a10, a4, 0 // a10 - pattern
- movi.n a9, 0 // clear a9
- wfr f1, a9 // clrar f1
- // a12 - input1
- // a10 - input2
- // a5 - length
- // a8 - 4, step in arrays
- // a9 - 0
- dotprod_f32_ae32 a12, a10, a5, a9, a8;
-
- ssi f1, a6, 0 // Store result from f1 to memory at a6
- addi a6, a6, 4 // y++ - increment output pointer
- addi a12, a12, 4 // Signal++
- addi a11, a11, -1
- bnez a11, corr_loop
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_corr_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/float/dsps_corr_f32_ansi.c b/components/esp-dsp/modules/conv/float/dsps_corr_f32_ansi.c
deleted file mode 100644
index 5256a7a..0000000
--- a/components/esp-dsp/modules/conv/float/dsps_corr_f32_ansi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_corr.h"
-
-esp_err_t dsps_corr_f32_ansi(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest)
-{
- if (NULL == Signal) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == Pattern) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == dest) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (siglen < patlen) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
-
- for (size_t n = 0; n < (siglen - patlen); n++) {
- float k_corr = 0;
- for (size_t m = 0; m < patlen; m++) {
- k_corr += Signal[n + m] * Pattern[m];
- }
- dest[n] = k_corr;
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/include/dsps_ccorr.h b/components/esp-dsp/modules/conv/include/dsps_ccorr.h
deleted file mode 100644
index 9d838e5..0000000
--- a/components/esp-dsp/modules/conv/include/dsps_ccorr.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_ccorr_H_
-#define _dsps_ccorr_H_
-#include "dsp_err.h"
-
-#include "dsps_conv_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief Cross correlation
- *
- * The function make cross correlate between two ignals.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] Signal1: input array with input 1 signal values
- * @param[in] siglen1: length of the input 1 signal array
- * @param[in] Signal2: input array with input 2 signal values
- * @param[in] siglen2: length of the input signal array
- * @param corrout: output array with result of cross correlation. The size of dest array must be (siglen1 + siglen2 - 1) !!!
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library (one of the input array are NULL, or if (siglen < patlen))
- */
-esp_err_t dsps_ccorr_f32_ansi(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *corrout);
-esp_err_t dsps_ccorr_f32_ae32(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *corrout);
-/**}@*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#ifdef CONFIG_DSP_OPTIMIZED
-#if (dsps_ccorr_f32_ae32_enabled == 1)
-#define dsps_ccorr_f32 dsps_ccorr_f32_ae32
-#else
-#define dsps_ccorr_f32 dsps_ccorr_f32_ansi
-#endif // dsps_ccorr_f32_ae32_enabled
-#else
-#define dsps_ccorr_f32 dsps_ccorr_f32_ansi
-#endif
-
-#endif // _dsps_conv_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/include/dsps_conv.h b/components/esp-dsp/modules/conv/include/dsps_conv.h
deleted file mode 100644
index 7dc9e51..0000000
--- a/components/esp-dsp/modules/conv/include/dsps_conv.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_conv_H_
-#define _dsps_conv_H_
-#include "dsp_err.h"
-
-#include "dsps_conv_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief Convolution
- *
- * The function convolve Signal array with Kernel array.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] Signal: input array with signal
- * @param[in] siglen: length of the input signal
- * @param[in] Kernel: input array with convolution kernel
- * @param[in] kernlen: length of the Kernel array
- * @param convout: output array with convolution result length of (siglen + Kernel -1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_conv_f32_ae32(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout);
-esp_err_t dsps_conv_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout);
-/**}@*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#ifdef CONFIG_DSP_OPTIMIZED
-
-#if (dsps_conv_f32_ae32_enabled == 1)
-#define dsps_conv_f32 dsps_conv_f32_ae32
-#else
-#define dsps_conv_f32 dsps_conv_f32_ansi
-#endif // dsps_conv_f32_ae32_enabled
-
-#else
-#define dsps_conv_f32 dsps_conv_f32_ansi
-#endif
-
-#endif // _dsps_conv_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/include/dsps_conv_platform.h b/components/esp-dsp/modules/conv/include/dsps_conv_platform.h
deleted file mode 100644
index 0a10195..0000000
--- a/components/esp-dsp/modules/conv/include/dsps_conv_platform.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _dsps_conv_platform_H_
-#define _dsps_conv_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_conv_f32_ae32_enabled 1
-#define dsps_ccorr_f32_ae32_enabled 1
-#define dsps_corr_f32_ae32_enabled 1
-
-#endif
-
-#endif // _dsps_conv_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/include/dsps_corr.h b/components/esp-dsp/modules/conv/include/dsps_corr.h
deleted file mode 100644
index 7104d30..0000000
--- a/components/esp-dsp/modules/conv/include/dsps_corr.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_corr_H_
-#define _dsps_corr_H_
-#include "dsp_err.h"
-
-#include "dsps_conv_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief Correlation with pattern
- *
- * The function correlate input sigla array with pattern array.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] Signal: input array with signal values
- * @param[in] siglen: length of the signal array
- * @param[in] Pattern: input array with pattern values
- * @param[in] patlen: length of the pattern array. The siglen must be bigger then patlen!
- * @param dest: output array with result of correlation
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library (one of the input array are NULL, or if (siglen < patlen))
- */
-esp_err_t dsps_corr_f32_ansi(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest);
-esp_err_t dsps_corr_f32_ae32(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest);
-/**}@*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#ifdef CONFIG_DSP_OPTIMIZED
-#if (dsps_corr_f32_ae32_enabled == 1)
-#define dsps_corr_f32 dsps_corr_f32_ae32
-#else
-#define dsps_corr_f32 dsps_corr_f32_ansi
-#endif // dsps_corr_f32_ae32_enabled
-#else
-#define dsps_corr_f32 dsps_corr_f32_ansi
-#endif
-
-#endif // _dsps_corr_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ae32.c b/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ae32.c
deleted file mode 100644
index fcb9ced..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ae32.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_ccorr.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_ccorr";
-
-#define lenA 8
-#define lenB 4
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output[lenA + lenB - 1 + 2];
-static float output_ref[lenA + lenB - 1 + 2];
-
-TEST_CASE("dsps_ccorr_f32_ae32 functionality", "[dsps]")
-{
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = i + 3;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = i + 10;
- }
- for (int i = 0 ; i < (lenA + lenB + 2 - 1); i++) {
- output[i] = -1;
- output_ref[i] = -1;
- }
- dsps_ccorr_f32_ae32(inputA, lenA, inputB, lenB, &output[0]);
- dsps_ccorr_f32_ansi(inputA, lenA, inputB, lenB, &output_ref[0]);
- for (size_t i = 0; i < (lenA + lenB - 1) + 2; i++) {
- ESP_LOGI(TAG, "Data[%i] = %2.2f, expected = %2.2f", i, output[i], output_ref[i]);
- }
- for (size_t i = 0; i < (lenA + lenB - 1) + 2; i++) {
- TEST_ASSERT_EQUAL(output_ref[i], output[i]);
- }
-}
-
-TEST_CASE("dsps_ccorr_f32_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
- int ccorr_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N + ccorr_size - 1) * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_ccorr_f32_ae32(x, max_N, y, ccorr_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_ccorr_f32_ae32 - %f cycles for signal %i and pattern %i", cycles, max_N, ccorr_size);
- free(x);
- free(y);
- free(z);
-
-}
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ansi.c b/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ansi.c
deleted file mode 100644
index 406bd95..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_ccorr_f32_ansi.c
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_ccorr.h"
-#include "esp_attr.h"
-#include "esp_dsp.h"
-
-static const char *TAG = "dsps_ccorr";
-
-#define lenA 20
-#define lenB 20
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output_fwd[lenA + lenB - 1 + 2];
-static float output_back[lenA + lenB - 1 + 2];
-
-TEST_CASE("dsps_ccorr_f32_ansi functionality", "[dsps]")
-{
- for (size_t la = 1; la < lenA; la++) {
- for (size_t lb = 1; lb < lenB; lb++) {
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < (lenA + lenB - 1 + 2); i++) {
- output_fwd[i] = -1;
- output_back[i] = -1;
- }
- dsps_ccorr_f32_ansi(inputA, la, inputB, lb, &output_fwd[1]);
- dsps_ccorr_f32_ansi(inputB, lb, inputA, la, &output_back[1]);
- TEST_ASSERT_EQUAL(output_fwd[0], -1);
- TEST_ASSERT_EQUAL(output_fwd[la + lb], -1);
- TEST_ASSERT_EQUAL(output_back[0], -1);
- TEST_ASSERT_EQUAL(output_back[la + lb], -1);
- }
- }
-}
-
-TEST_CASE("dsps_ccorr_f32_ansi draw", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N * 2 + 1) * sizeof(float));
- int l1 = 8;
- int l2 = 4;
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 0;
- z[i] = 0;
- }
- x[0] = 20;
- x[7] = 30;
- y[0] = 10;
- y[3] = 8;
- dsps_ccorr_f32_ansi(x, l1, y, l2, &z[0]);
-
- dsps_view(z, l1 + l2, l1 + l2, 10, -1, 400, '+');
- for (int i = 0 ; i < (l1 + l2 - 1) ; i++) {
- ESP_LOGI(TAG, "Z[%i] = %2.2f", i, z[i]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_ccorr_f32_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
- int conv_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N * 2 + 1) * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_ccorr_f32_ansi(x, max_N, y, conv_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_conv_f32_ansi - %f cycles for signal %i and pattern %i", cycles, max_N, conv_size);
- free(x);
- free(y);
- free(z);
-}
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ae32.c b/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ae32.c
deleted file mode 100644
index 9be2ddf..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ae32.c
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_conv.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_conv";
-
-#define lenA 30
-#define lenB 30
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output_ref[lenA + lenB - 1 + 2];
-static float output_fwd[lenA + lenB - 1 + 2];
-static float output_back[lenA + lenB - 1 + 2];
-
-TEST_CASE("dsps_conv_f32_ae32 test output", "[dsps]")
-{
- int la = 3;
- int lb = 2;
-
- for (int i = 0; i < lenA; i++) {
- inputA[i] = 10 + i;
- }
- for (int i = 0; i < lenB; i++) {
- inputB[i] = 20 + i;
- }
- for (int i = 0; i < (lenA + lenB - 1 + 2); i++) {
- output_ref[i] = -1;
- output_fwd[i] = -1;
- output_back[i] = -1;
- }
- dsps_conv_f32_ansi(inputA, la, inputB, lb, &output_ref[1]);
- dsps_conv_f32_ae32(inputA, la, inputB, lb, &output_fwd[1]);
-
- for (size_t i = 0; i < (la + lb + 1); i++) {
- ESP_LOGD(TAG, "la=%i, lb=%i, i=%i, ref=%2.3f, fwd=%2.3f", la, lb, i, output_ref[i], output_fwd[i]);
- }
- float max_eps = 0.000001;
- for (size_t i = 0; i < (la + lb + 1); i++) {
- if (abs(output_ref[i] - output_fwd[i]) > max_eps) {
- ESP_LOGE(TAG, "la=%i, lb=%i, i=%i, ref=%2.3f, fwd=%2.3f", la, lb, i, output_ref[i], output_fwd[i]);
- }
- TEST_ASSERT_EQUAL(output_ref[i], output_fwd[i]);
- }
-}
-
-TEST_CASE("dsps_conv_f32_ae32 functionality", "[dsps]")
-{
- for (size_t la = 2; la < lenA; la++) {
- for (size_t lb = 2; lb < lenB; lb++) {
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < (lenA + lenB - 1 + 2); i++) {
- output_ref[i] = -1;
- output_fwd[i] = -1;
- output_back[i] = -1;
- }
- dsps_conv_f32_ansi(inputA, la, inputB, lb, &output_ref[1]);
- dsps_conv_f32_ae32(inputA, la, inputB, lb, &output_fwd[1]);
- dsps_conv_f32_ae32(inputB, lb, inputA, la, &output_back[1]);
- float max_eps = 0.000001;
- for (size_t i = 0; i < (la + lb + 1); i++) {
- if ((abs(output_ref[i] - output_fwd[i]) > max_eps) || (abs(output_ref[i] - output_back[i]) > max_eps) || (abs(output_back[i] - output_fwd[i]) > max_eps)) {
- ESP_LOGE(TAG, "la=%i, lb=%i, i=%i, ref=%2.3f, fwd=%2.3f, back=%2.3f", la, lb, i, output_ref[i], output_fwd[i], output_back[i]);
- }
- TEST_ASSERT_EQUAL(output_ref[i], output_fwd[i]);
- TEST_ASSERT_EQUAL(output_ref[i], output_back[i]);
- TEST_ASSERT_EQUAL(output_back[i], output_fwd[i]);
- }
- }
- }
-}
-
-
-TEST_CASE("dsps_conv_f32_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
- int conv_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N * 2 + 1) * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_conv_f32_ae32(x, max_N, y, conv_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_conv_f32_ae32 - %f cycles for signal %i and pattern %i", cycles, max_N, conv_size);
- free(x);
- free(y);
- free(z);
-}
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ansi.c b/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ansi.c
deleted file mode 100644
index 561dce1..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_conv_f32_ansi.c
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_conv.h"
-#include "esp_attr.h"
-#include "esp_dsp.h"
-
-static const char *TAG = "dsps_conv";
-
-#define lenA 20
-#define lenB 20
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output_ref[lenA + lenB - 1 + 2];
-static float output_fwd[lenA + lenB - 1 + 2];
-static float output_back[lenA + lenB - 1 + 2];
-
-
-esp_err_t dsps_conv_f32_ref(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout)
-{
- if (NULL == Signal) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == Kernel) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (NULL == convout) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
-
-
- for (int n = 0; n < siglen + kernlen - 1; n++) {
- size_t kmin, kmax, k;
-
- convout[n] = 0;
-
- kmin = (n >= kernlen - 1) ? n - (kernlen - 1) : 0;
- kmax = (n < siglen - 1) ? n : siglen - 1;
-
- for (k = kmin; k <= kmax; k++) {
- convout[n] += Signal[k] * Kernel[n - k];
- }
- }
- return ESP_OK;
-}
-
-TEST_CASE("dsps_conv_f32_ansi functionality", "[dsps]")
-{
- for (size_t la = 1; la < lenA; la++) {
- for (size_t lb = 1; lb < lenB; lb++) {
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = (float)rand() / INT32_MAX;
- }
- for (int i = 0 ; i < (lenA + lenB - 1 + 2); i++) {
- output_ref[i] = -1;
- output_fwd[i] = -1;
- output_back[i] = -1;
- }
- dsps_conv_f32_ref(inputA, la, inputB, lb, &output_ref[1]);
- dsps_conv_f32_ansi(inputA, la, inputB, lb, &output_fwd[1]);
- dsps_conv_f32_ansi(inputB, lb, inputA, la, &output_back[1]);
- float max_eps = 0.000001;
- for (size_t i = 0; i < (la + lb + 1); i++) {
- if ((fabs(output_ref[i] - output_fwd[i]) > max_eps) || (fabs(output_ref[i] - output_back[i]) > max_eps) || (fabs(output_back[i] - output_fwd[i]) > max_eps)) {
- ESP_LOGE(TAG, "la=%i, lb=%i, i=%i, ref=%2.3f, fwd=%2.3f, back=%2.3f", la, lb, i, output_ref[i], output_fwd[i], output_back[i]);
- }
- TEST_ASSERT_EQUAL(output_ref[i], output_fwd[i]);
- TEST_ASSERT_EQUAL(output_ref[i], output_back[i]);
- TEST_ASSERT_EQUAL(output_back[i], output_fwd[i]);
- }
- }
- }
-}
-
-TEST_CASE("dsps_conv_f32_ansi draw", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N * 2 + 1) * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 10;
- y[i] = 20;
- z[i] = 0;
- }
-
- dsps_conv_f32_ansi(x, 32, y, 16, &z[0]);
-
- dsps_view(z, 32 + 16, 32 + 16, 10, -1, 4000, '+');
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_conv_f32_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
- int conv_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc((max_N * 2 + 1) * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_conv_f32_ansi(x, max_N, y, conv_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_conv_f32_ansi - %f cycles for signal %i and pattern %i", cycles, max_N, conv_size);
- free(x);
- free(y);
- free(z);
-}
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ae32.c b/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ae32.c
deleted file mode 100644
index 2514edf..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ae32.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_corr.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_corr";
-
-#define lenA 15
-#define lenB 10
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output[lenA + lenB - 1 + 2];
-static float output_ref[lenA + lenB - 1 + 2];
-
-TEST_CASE("dsps_corr_f32_ae32 functionality", "[dsps]")
-{
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = i;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = 10 + i;
- }
- for (int i = 0 ; i < (lenA - lenB + 2); i++) {
- output[i] = -1;
- output_ref[i] = -1;
- }
- inputB[0] = 1;
- dsps_corr_f32_ae32(inputA, lenA, inputB, lenB, &output[1]);
- dsps_corr_f32_ansi(inputA, lenA, inputB, lenB, &output_ref[1]);
- for (size_t i = 0; i < (lenA - lenB) + 2; i++) {
- ESP_LOGD(TAG, "Data[%i] = %2.2f, expected = %2.2f", i, output[i], output_ref[i]);
- }
- for (size_t i = 0; i < (lenA - lenB) + 2; i++) {
- TEST_ASSERT_EQUAL(output_ref[i], output[i]);
- }
-}
-
-TEST_CASE("dsps_corr_f32_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
- int corr_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_corr_f32_ae32(x, max_N, y, corr_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_corr_f32_ae32 - %f cycles for signal %i and pattern %i", cycles, max_N, corr_size);
- free(x);
- free(y);
- free(z);
-
-}
diff --git a/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ansi.c b/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ansi.c
deleted file mode 100644
index 9c95e3a..0000000
--- a/components/esp-dsp/modules/conv/test/test_dsps_corr_f32_ansi.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_corr.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_corr";
-
-#define lenA 15
-#define lenB 10
-
-static float inputA[lenA];
-static float inputB[lenB];
-static float output[lenA + lenB - 1 + 2];
-
-TEST_CASE("dsps_corr_f32_ansi functionality", "[dsps]")
-{
- for (int i = 0 ; i < lenA ; i++) {
- inputA[i] = i;
- }
- for (int i = 0 ; i < lenB ; i++) {
- inputB[i] = 0;
- }
- for (int i = 0 ; i < (lenA - lenB + 2); i++) {
- output[i] = -1;
- }
- inputB[0] = 1;
- dsps_corr_f32_ansi(inputA, lenA, inputB, lenB, &output[1]);
- for (size_t i = 0; i < lenA + lenB; i++) {
- ESP_LOGD(TAG, "output[%i] = %2.2f", i, output[i]);
- }
-
- TEST_ASSERT_EQUAL(output[0], -1);
- TEST_ASSERT_EQUAL(output[lenA - lenB + 1], -1);
- for (size_t i = 0; i < (lenA - lenB); i++) {
- TEST_ASSERT_EQUAL(output[i + 1], i);
- }
-}
-
-TEST_CASE("dsps_corr_f32_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
- int corr_size = 64;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- dsps_corr_f32_ansi(x, max_N, y, corr_size, &z[0]);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_corr_f32_ansi - %f cycles for signal %i and pattern %i", cycles, max_N, corr_size);
- free(x);
- free(y);
- free(z);
-
-}
diff --git a/components/esp-dsp/modules/dct/float/dsps_dct_f32.c b/components/esp-dsp/modules/dct/float/dsps_dct_f32.c
deleted file mode 100644
index 599800e..0000000
--- a/components/esp-dsp/modules/dct/float/dsps_dct_f32.c
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsp_common.h"
-#include
-
-#include "dsps_dct.h"
-#include "dsps_fft2r.h"
-
-esp_err_t dsps_dct_f32_ref(float *data, int N, float *result)
-{
- float factor = M_PI / N;
- for (size_t i = 0; i < N; i++) {
- float sum = 0;
- for (size_t j = 0; j < N; j++) {
- sum += data[j] * cosf((j + 0.5) * i * factor);
- }
- result[i] = sum;
- }
- return ESP_OK;
-}
-
-esp_err_t dsps_dct_inverce_f32_ref(float *data, int N, float *result)
-{
- float factor = M_PI / N;
- for (size_t i = 0; i < N; i++) {
- float sum = data[0] / 2;
- for (size_t j = 0; j < N; j++) {
- sum += data[j] * cosf(j * (i + 0.5) * factor);
- }
- result[i] = sum;
- }
- return ESP_OK;
-}
-
-esp_err_t dsps_dct_f32(float *data, int N)
-{
- esp_err_t ret = ESP_OK;
- if (dsps_fft2r_initialized == 0) {
- return ESP_ERR_DSP_REINITIALIZED;
- }
-
- for (int i = 0; i < N / 2; i++) {
- data[(N - 1 - i) * 2] = data[i * 2 + 1];
- data[i * 2 + 1] = 0;
- data[N + i * 2 + 1] = 0;
- }
-
- ret = dsps_fft2r_fc32(data, N);
-
- // // The follows code do the same as this one:
- // //
- // float factor = M_PI / (N * 2);
- // ret = dsps_bit_rev_fc32(data, N);
- // for (int i = 0; i < N; i++) {
- // float temp = i * factor;
- // data[i] = data[i*2] * cosf(temp) + data[i*2 + 1] * sinf(temp);
- // }
- int table_step = 2;
- for (int i = 0; i < N; i++) {
- float c = dsps_fft_w_table_fc32[i * 2 * table_step];
- float s = dsps_fft_w_table_fc32[i * 2 * table_step + 1];
- data[i * 2] = data[i * 2] * c;
- data[i * 2 + 1] = data[i * 2 + 1] * s;
- }
- ret = dsps_bit_rev_fc32(data, N);
- for (int i = 0; i < N; i++) {
- data[i] = data[i * 2] + data[i * 2 + 1];
- }
-
- return ret;
-}
-
-esp_err_t dsps_dct_inv_f32(float *data, int N)
-{
- esp_err_t ret = ESP_OK;
- if (dsps_fft2r_initialized == 0) {
- return ESP_ERR_DSP_REINITIALIZED;
- }
-
- float factor = M_PI / (N * 2);
- data[0] *= 0.5;
- for (int i = N - 1; i >= 0; i--) {
- float temp = i * factor;
- data[i * 2] = data[i] * cosf(temp);
- data[i * 2 + 1] = data[i] * -sinf(temp);
- }
- ret = dsps_fft2r_fc32(data, N);
- ret = dsps_bit_rev_fc32(data, N);
- for (size_t i = 0; i < N / 2; i++) {
- data[i * 2 + 1] = data[(N - 1 - i) * 2];
- }
-
- return ret;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dct/include/dsps_dct.h b/components/esp-dsp/modules/dct/include/dsps_dct.h
deleted file mode 100644
index bc0f415..0000000
--- a/components/esp-dsp/modules/dct/include/dsps_dct.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_dct_H_
-#define _dsps_dct_H_
-#include "dsp_err.h"
-#include "sdkconfig.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**@{*/
-/**
- * @brief DCT of radix 2, unscaled
- *
- * DCT type II of radix 2, unscaled
- * Function is FFT based
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[inout] data: input/output array with size of N*2. An elements located: Re[0],Re[1], , ... Re[N-1], any data... up to N*2
- * result of DCT will be stored to this array from 0...N-1.
- * Size of data array must be N*2!!!
- * @param[in] N: Size of DCT transform. Size of data array must be N*2!!!
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dct_f32(float *data, int N);
-
-/**@}*/
-
-/**@{*/
-/**
- * @brief Inverce DCT of radix 2
- *
- * Inverce DCT type III of radix 2, unscaled
- * Function is FFT based
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[inout] data: input/output array with size of N*2. An elements located: Re[0],Re[1], , ... Re[N-1], any data... up to N*2
- * result of DCT will be stored to this array from 0...N-1.
- * Size of data array must be N*2!!!
- * @param[in] N: Size of DCT transform. Size of data array must be N*2!!!
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dct_inv_f32(float *data, int N);
-
-/**@}*/
-
-/**@{*/
-/**
- * @brief DCTs
- *
- * Direct DCT type II and Inverce DCT type III, unscaled
- * These functions used as a reference for general purpose. These functions are not optimyzed!
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] data: input/output array with size of N. An elements located: Re[0],Re[1], , ... Re[N-1]
- * @param[in] N: Size of DCT transform. Size of data array must be N*2!!!
- * @param[out] result: output result array with size of N.
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dct_f32_ref(float *data, int N, float *result);
-esp_err_t dsps_dct_inverce_f32_ref(float *data, int N, float *result);
-/**@}*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _dsps_dct_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dct/test/test_dsps_dct_f32.c b/components/esp-dsp/modules/dct/test/test_dsps_dct_f32.c
deleted file mode 100644
index 1dadcb1..0000000
--- a/components/esp-dsp/modules/dct/test/test_dsps_dct_f32.c
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2018-2020 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_dct.h"
-#include "dsps_fft2r.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_dct";
-
-TEST_CASE("dsps_dct_f32 functionality", "[dsps]")
-{
- float* data = calloc(1024*2, sizeof(float));
- float* data_ref = calloc(1024*2, sizeof(float));
- float* data_fft = calloc(1024*2, sizeof(float));
-
- int N = 64;
- int check_bin = 4;
- for (int i = 0 ; i < N ; i++) {
- data[i] = 2 * sin(M_PI / N * check_bin * 2 * i);
- data_ref[i] = data[i];
- data_fft[i] = data[i];
- data[i + N] = 0;
- data_ref[i + N] = 0;
- data_fft[i + N] = 0;
- }
-
- dsps_dct_f32_ref(data, N, &data[N]);
- dsps_view(&data[N], 32, 32, 10, -2, 2, '.');
-
- dsps_dct_inverce_f32_ref(&data[N], N, data);
- dsps_view(&data[0], 32, 32, 10, -2, 2, '.');
-
- for (size_t i = 0; i < N; i++) {
- ESP_LOGD(TAG, "DCT data[%i] = %2.3f\n", i, data[N + i]);
- }
- float abs_tol = 1e-5;
- for (size_t i = 0; i < N; i++) {
- ESP_LOGD(TAG, "data[%i] = %f, ref_data = %f\n", i, data[i], data_ref[i]*N / 2);
- float error = abs(data[i] - data_ref[i] * N / 2);
- if (error > abs_tol) {
- ESP_LOGE(TAG, "data[%i] = %f, ref_data = %f, error= %f\n", i, data[i], data_ref[i]*N / 2, error);
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
- }
-
- free(data);
- free(data_ref);
- free(data_fft);
-
-}
-
-TEST_CASE("dsps_dct_f32 functionality Fast DCT", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK) {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- float* data = calloc(1024*2, sizeof(float));
- float* data_ref = calloc(1024*2, sizeof(float));
- float* data_fft = calloc(1024*2, sizeof(float));
-
- int N = 64;
- int check_bin = 4;
- for (int i = 0 ; i < N ; i++) {
- data[i] = 2 * sin(M_PI / N * check_bin * 2 * i);
- data_ref[i] = data[i];
- data_fft[i] = data[i];
- data[i + N] = 0;
- data_ref[i + N] = 0;
- data_fft[i + N] = 0;
- }
-
- dsps_dct_f32_ref(data, N, &data[N]);
- ret = dsps_dct_f32(data_fft, N);
-
- if (ret != ESP_OK) {
- ESP_LOGE(TAG, "Error!");
- return;
- }
- float abs_tol = 1e-5;
- for (size_t i = 0; i < N; i++) {
- ESP_LOGD(TAG, "DCT data[%i] = %2.3f, data_fft = %2.3f\n", i, data[N + i], data_fft[i]);
- float error = abs(data[N + i] - data_fft[i]);
- if (error > abs_tol) {
- ESP_LOGE(TAG, "DCT data[%i] = %f, data_fft = %f, error = %f\n", i, data[N + i], data_fft[i], error);
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
- }
-
- dsps_dct_inv_f32(data_fft, N);
-
- for (size_t i = 0; i < N; i++) {
- ESP_LOGD(TAG, "IDCT data[%i] = %2.3f, data_fft = %2.3f\n", i, data[i], data_fft[i] / N * 2);
- float error = abs(data[i] - data_fft[i] / N * 2);
- if (error > abs_tol) {
- ESP_LOGE(TAG, "IDCT data[%i] = %f, data_fft = %f, error = %f\n", i, data[i], data_fft[i] / N * 2, error);
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
- }
- dsps_fft2r_deinit_fc32();
- free(data);
- free(data_ref);
- free(data_fft);
-}
-
-TEST_CASE("dsps_dct_f32 benchmark", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK) {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- float* data = calloc(1024*2, sizeof(float));
- float* data_ref = calloc(1024*2, sizeof(float));
- float* data_fft = calloc(1024*2, sizeof(float));
-
- int N = 64;
- int check_bin = 4;
- for (int i = 0 ; i < N ; i++) {
- data[i] = 2 * sin(M_PI / N * check_bin * 2 * i);
- data[i + N] = 0;
- }
-
- unsigned int start_b = xthal_get_ccount();
- ret = dsps_dct_f32(data, N);
- unsigned int end_b = xthal_get_ccount();
-
- if (ret != ESP_OK) {
- TEST_ASSERT_MESSAGE (false, "Error!\n");
- return;
- }
-
- float total_b = end_b - start_b;
- float cycles = total_b;
- ESP_LOGI(TAG, "Benchmark dsps_dct_f32 - %6i cycles for %6i DCT points FFT.", (int)cycles, N);
- dsps_fft2r_deinit_fc32();
- free(data);
- free(data_ref);
- free(data_fft);
-}
diff --git a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ae32.S b/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ae32.S
deleted file mode 100644
index 2eff255..0000000
--- a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ae32.S
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod_platform.h"
-#if (dsps_dotprod_s16_ae32_enabled == 1)
-#include "dsps_dotprod_s16_m_ae32.S"
-#include "dsp_err_codes.h"
-
- .text
- .align 4
- .global dsps_dotprod_s16_ae32
- .type dsps_dotprod_s16_ae32,@function
-
-
-//esp_err_t dsps_dotprod_s16_ae32(const int16_t* src1, const int16_t* src2, int16_t* dest, int len, int8_t shift);
-dsps_dotprod_s16_ae32:
-// src1 - a2
-// src2 - a3
-// dest - a4
-// len - a5
-// shift - a6
-
- entry a1, 16
-
- // Check minimum length
- movi a8, 4
- blt a5, a8, dsps_dotprod_s16_ae32_error
-
- // Clear accumulator
- movi a8, 0
- wsr a8, acchi
-
- // Prepare and load round value
- movi a8, 0x7fff
- ssr a6
- srl a8, a8
- wsr a8, acclo // initialize acc with shifted round value
-
- // Compensate for pre-increment
- // Right shift to 16 bits
- // RS = -shift + 15
- neg a6, a6
- addi a6, a6, 15
-
- /* number of loop iterations (see below):
- * a7 = count / 4 - 1
- */
-
- srli a7, a5, 2
- addi a7, a7, -1
-
- movi.n a10, 0 // load 0 to the a10 to increment second array
-
- dotprod_s16_ae32_full a2, a3, a7, a5
-
- /* Get accumulator */
- ssr a6
- rsr a2, acchi
- rsr a3, acclo
- src a2, a2, a3
-
- s16i a2, a4, 0
- movi.n a2, 0
- retw.n
-dsps_dotprod_s16_ae32_error:
- movi.n a2, ESP_ERR_DSP_INVALID_LENGTH
- retw.n
-
-#endif // dsps_dotprod_s16_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ansi.c b/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ansi.c
deleted file mode 100644
index 838ce30..0000000
--- a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ansi.c
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod.h"
-
-esp_err_t dsps_dotprod_s16_ansi(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift)
-{
- // To make correct round operation we have to shift round value
- long long acc = 0x7fff >> shift;
-
- for (int i = 0 ; i < len ; i++) {
- acc += (int32_t)src1[i] * (int32_t)src2[i];
- }
-
- int final_shift = shift - 15;
- if (final_shift > 0) {
- *dest = (acc << final_shift);
- } else {
- *dest = (acc >> (-final_shift));
- }
- return ESP_OK;
-}
-
diff --git a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_m_ae32.S b/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_m_ae32.S
deleted file mode 100644
index 795c85d..0000000
--- a/components/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_m_ae32.S
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro dotprod_s16_ae32 x1, x2, count
-// This macro calculates fixed point dot product for ((count + 1)*4) int16 samples
-// x1 - input array1 register (for example a2)
-// x2 - input array2 register (for example a3)
-// count - counter register (for example a7)
-// count - samples_count / 4 - 1
-// acc += x1[i + 0]*x2[i + 0] + x1[i + 1]*x2[i + 1] + x1[i + 2]*x2[i + 2] + x1[i + 3]*x2[i + 3]; i: 0..count
-// acchi, and acclo have to be initialize before
-// Result - acchi || acclo
-// Modifies:
-// m0, m1, m2, m3
-// acchi || acclo - must be loaded before (for example 0x3fff to acclo).
-
- /*
- * Data schedule. Each line represents instruction, columns represent
- * register contents. Last column (MUL) shows the multiplication which
- * takes place. Values loaded in the given cycle are shown in square brackets.
- *
- * m0 m1 m2 m3 MUL
- * --------- pre-load ------------
- *[x0 x1] (no MULs in the first 3 instructions)
- * x0 x1 [y0 y1]
- * x0 x1 [x2 x3] y0 y1
- * x0 x1 x2 x3 y0 y1 [y2 y3] x0*y0
- * ---------- loop -------------- (the following 4 instructions are
- *[x4 x5] x2 x3 y0 y1 y2 y3 x1*y1 repeated as much as needed)
- * x4 x5 x2 x3 [y4 y5] y2 y3 x2*y2
- * x4 x5 [x6 x7] y4 y5 y2 y3 x3*y3
- * x4 x5 x6 x7 y4 y5 [y6 y7] x4*y4
- * --------- finalize ------------
- * x4 x5 x6 x7 y4 y5 y6 y7 x5*y5 (nothing is load)
- * x4 x5 x6 x7 y4 y5 y6 y7 x6*y6
- * x4 x5 x6 x7 y4 y5 y6 y7 x7*y7
- */
-
- addi \x1, \x1, -4 // To arrange fist pointer
- addi \x2, \x2, -4 // To arrange fist pointer
- //lddec m0, \x1
- //lddec m2, \x2 // To arrange fist pointer
-
- ldinc m0, \x1
- ldinc m2, \x2
- ldinc m1, \x1
-
- mula.dd.ll.ldinc m3, \x2, m0, m2
- loopnez \count, .loop_end
- .loop:
- mula.dd.hh.ldinc m0, \x1, m0, m2
- mula.dd.ll.ldinc m2, \x2, m1, m3
- mula.dd.hh.ldinc m1, \x1, m1, m3
- mula.dd.ll.ldinc m3, \x2, m0, m2
- .loop_end:
-
- mula.dd.hh m0, m2
- mula.dd.ll m1, m3
- mula.dd.hh m1, m3
-
-.endm // dotprod_s16_ae32
-
-
-.macro dotprod_s16_ae32_full x1, x2, count, full_count
-// This macro calculates fixed point dot product for ((count + 1)*4) int16 samples
-// x1 - input array1 register (for example a2)
-// x2 - input array2 register (for example a3)
-// count - counter register (for example a7)
-// count - samples_count / 4 - 1
-// full_count - samples_count
-// acc += x1[i + 0]*x2[i + 0] + x1[i + 1]*x2[i + 1] + x1[i + 2]*x2[i + 2] + x1[i + 3]*x2[i + 3]; i: 0..count
-// acchi, and acclo have to be initialize before
-// Result - acchi || acclo
-// Modifies:
-// m0, m1, m2, m3
-// acchi || acclo - must be loaded before (for example 0x3fff to acclo).
-
- dotprod_s16_ae32 \x1, \x2, \count
-
- bbci \full_count, 1, .mod2chk
- ldinc m0, \x1
- ldinc m2, \x2
- mula.dd.hh m0, m2
- mula.dd.ll m0, m2
- .mod2chk:
- bbci \full_count, 0, .mod1chk
- ldinc m0, \x1
- ldinc m2, \x2
- mula.dd.ll m0, m2
- .mod1chk:
-
-.endm // dotprod_s16_ae32_full
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ae32.S b/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ae32.S
deleted file mode 100644
index 0c14c81..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ae32.S
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod_platform.h"
-#if (dotprod_f32_ae32_enabled == 1)
-
-#include "dsps_dotprod_f32_m_ae32.S"
-
-// This is dot product function for ESP32 processor.
- .text
- .align 4
- .global dsps_dotprod_f32_ae32
- .type dsps_dotprod_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_dotprod_f32_ae32(const float* src1, const float* src2, float* dest, int len)
-//{
-// float acc = 0;
-// for (int i=0 ; i< len ; i++)
-// {
-// acc += src1[i]*src2[i];
-// }
-// *dest = acc;
-// return ESP_OK;
-//}
-
-dsps_dotprod_f32_ae32:
-// src1 - a2
-// src2 - a3
-// dest - a4
-// len - a5
-
- entry a1, 16
- // Array increment for floating point data should be 4
- movi.n a8, 4
- // Clear initial state of the result register
- movi.n a9, 0
- wfr f1, a9
- // a2 - input1
- // a3 - input2
- // a5 - length
- // a8 - 4, step in arrays
- dotprod_f32_ae32 a2, a3, a5, a9, a8;
-
- ssi f1, a4, 0 // Store result from f1 to memory at a4
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dotprode_f32_ae32_enabled
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ansi.c b/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ansi.c
deleted file mode 100644
index ec260e6..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ansi.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod.h"
-
-esp_err_t dsps_dotprod_f32_ansi(const float *src1, const float *src2, float *dest, int len)
-{
- float acc = 0;
- for (int i = 0 ; i < len ; i++) {
- acc += src1[i] * src2[i];
- }
- *dest = acc;
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_m_ae32.S b/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_m_ae32.S
deleted file mode 100644
index facafc6..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_m_ae32.S
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro dotprod_f32_ae32 x1 x2 count step1 step2
-// This macro calculates floating point dot product for count float samples
-// x1, x2 - input arrays
-// count - amount of samples
-// step1 - start step
-//,step2 - A register for array step increment. (should be divided by 4)
-// f1 - contains initial value
-//
-// result in f1
-//
-// Macros body:
-// f1 += x1[i*step1]*x2[i*step2]; i: 0..counter-1
-// affected: f0, f1, f2
-// Example: dotprod_f32_ae32 a2 a3 a5 a8 a9
-// a8 == 4, step is 4 bytes
-// a5 == 32, length of array is 32
-//
-// mov \step1, \step2
- lsx f0, \x2, \step1
-// sub \x1, \x1, \step1 // To compensate first increment
- loopnez \count, loop_mac_end_m_ae32
- lsx f2, \x1, \step1
- madd.s f1, f2, f0
- add.n \step1, \step1, \step2
- lsx f0, \x2, \step1
- loop_mac_end_m_ae32:
-.endm
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ae32.S b/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ae32.S
deleted file mode 100644
index b16245c..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ae32.S
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod_platform.h"
-#if (dotprode_f32_ae32_enabled == 1)
-
-#include "dsps_dotprode_f32_m_ae32.S"
-
-// This is dot product function for ESP32 processor.
- .text
- .align 4
- .global dsps_dotprode_f32_ae32
- .type dsps_dotprode_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_dotprod_f32_ae32(const float* src1, const float* src2, float* dest, int len)
-//{
-// float acc = 0;
-// for (int i=0 ; i< len ; i++)
-// {
-// acc += src1[i]*src2[i];
-// }
-// *dest = acc;
-// return ESP_OK;
-//}
-
-dsps_dotprode_f32_ae32:
-// src1 - a2
-// src2 - a3
-// dest - a4
-// len - a5
-// step1- a6
-// step2- a7
-
- entry a1, 16
- // Array increment for floating point data should be 4
-
- slli a6,a6, 2
- slli a7,a7, 2
- // Clear initial state of the result register
- movi.n a9, 0
- wfr f1, a9
- // a2 - input1
- // a3 - input2
- // a5 - length
- // a6,a7, step in arrays
- dotprode_f32_ae32 a2, a3, a5, a6, a7;
-
- ssi f1, a4, 0 // Store result from f1 to memory at a4
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //dotprode_f32_ae32_enabled
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ansi.c b/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ansi.c
deleted file mode 100644
index 531c74e..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ansi.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod.h"
-
-esp_err_t dsps_dotprode_f32_ansi(const float *src1, const float *src2, float *dest, int len, int step1, int step2)
-{
- float acc = 0;
- for (int i = 0 ; i < len ; i++) {
- acc += src1[i * step1] * src2[i * step2];
- }
- *dest = acc;
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_m_ae32.S b/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_m_ae32.S
deleted file mode 100644
index b2ea4f7..0000000
--- a/components/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_m_ae32.S
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro dotprode_f32_ae32 x1 x2 count step1 step2
-// This macro calculates floating point dot product for count float samples
-// x1, x2 - input arrays
-// count - amount of samples
-// step1,step2 - A register for array step. (should be divided by 4)
-// f1 - contains initial value
-//
-// result in f1
-//
-// Macros body:
-// f1 += x1[i*step1]*x2[i*step2]; i: 0..counter-1
-// affected: f0, f1, f2
-// Example: dotprod_f32_ae32 a2 a3 a5 a8 a9
-// a8 == 4, step is 4 bytes
-// a5 == 32, length of array is 32
-//
- lsi f0, \x2, 0
- sub \x1, \x1, \step1 // To compensate first increment
- loopnez \count, loop_mace_end_m_ae32
- add.n \x1, \x1, \step1
- lsi f2, \x1, 0
- madd.s f1, f2, f0
- add.n \x2, \x2, \step2
- lsi f0, \x2, 0
- loop_mace_end_m_ae32:
-.endm
diff --git a/components/esp-dsp/modules/dotprod/include/dsps_dotprod.h b/components/esp-dsp/modules/dotprod/include/dsps_dotprod.h
deleted file mode 100644
index ae2e919..0000000
--- a/components/esp-dsp/modules/dotprod/include/dsps_dotprod.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _DSPI_DOTPROD_H_
-#define _DSPI_DOTPROD_H_
-
-#include "esp_log.h"
-#include "dsp_err.h"
-
-#include "dsps_dotprod_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-// These functions calculates dotproduct of two vectors.
-
-/**@{*/
-/**
- * @brief dot product of two 16 bit vectors
- * Dot product calculation for two signed 16 bit arrays: *dest += (src1[i] * src2[i]) >> (15-shift); i= [0..N)
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] src1 source array 1
- * @param[in] src2 source array 2
- * @param dest destination pointer
- * @param[in] len length of input arrays
- * @param[in] shift shift of the result.
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dotprod_s16_ansi(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift);
-esp_err_t dsps_dotprod_s16_ae32(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift);
-/**@}*/
-
-
-/**@{*/
-/**
- * @brief dot product of two float vectors
- * Dot product calculation for two floating point arrays: *dest += (src1[i] * src2[i]); i= [0..N)
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] src1 source array 1
- * @param[in] src2 source array 2
- * @param dest destination pointer
- * @param[in] len length of input arrays
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dotprod_f32_ansi(const float *src1, const float *src2, float *dest, int len);
-esp_err_t dsps_dotprod_f32_ae32(const float *src1, const float *src2, float *dest, int len);
-/**@}*/
-
-/**@{*/
-/**
- * @brief dot product of two float vectors with step
- * Dot product calculation for two floating point arrays: *dest += (src1[i*step1] * src2[i*step2]); i= [0..N)
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] src1 source array 1
- * @param[in] src2 source array 2
- * @param dest destination pointer
- * @param[in] len length of input arrays
- * @param[in] step1 step over elements in first array
- * @param[in] step2 step over elements in second array
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_dotprode_f32_ansi(const float *src1, const float *src2, float *dest, int len, int step1, int step2);
-esp_err_t dsps_dotprode_f32_ae32(const float *src1, const float *src2, float *dest, int len, int step1, int step2);
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_dotprod_s16_ae32_enabled == 1)
-#define dsps_dotprod_s16 dsps_dotprod_s16_ae32
-#else
-#define dsps_dotprod_s16 dsps_dotprod_s16_ansi
-#endif // dsps_dotprod_s16_ae32_enabled
-#if (dsps_dotprod_f32_ae32_enabled == 1)
-#define dsps_dotprod_f32 dsps_dotprod_f32_ae32
-#else
-#define dsps_dotprod_f32 dsps_dotprod_f32_ansi
-#endif // dsps_dotprod_f32_ae32_enabled
-#if (dsps_dotprode_f32_ae32_enabled == 1)
-#define dsps_dotprode_f32 dsps_dotprode_f32_ae32
-#else
-#define dsps_dotprode_f32 dsps_dotprode_f32_ansi
-#endif // dsps_dotprode_f32_ae32_enabled
-
-#else // CONFIG_DSP_OPTIMIZED
-#define dsps_dotprod_s16 dsps_dotprod_s16_ansi
-#define dsps_dotprod_f32 dsps_dotprod_f32_ansi
-#define dsps_dotprode_f32 dsps_dotprode_f32_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-#endif // _DSPI_DOTPROD_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dotprod/include/dsps_dotprod_platform.h b/components/esp-dsp/modules/dotprod/include/dsps_dotprod_platform.h
deleted file mode 100644
index 83bbafb..0000000
--- a/components/esp-dsp/modules/dotprod/include/dsps_dotprod_platform.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _dsps_dotprod_platform_H_
-#define _dsps_dotprod_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dotprod_f32_ae32_enabled 1
-#define dotprode_f32_ae32_enabled 1
-
-#endif //
-
-#if ((XCHAL_HAVE_LOOPS == 1) && (XCHAL_HAVE_MAC16 == 1))
-
-#define dsps_dotprod_s16_ae32_enabled 1
-
-#endif //
-
-#endif // _dsps_dotprod_platform_H_
diff --git a/components/esp-dsp/modules/dotprod/test/test_dotprod_f32.c b/components/esp-dsp/modules/dotprod/test/test_dotprod_f32.c
deleted file mode 100644
index d3304bf..0000000
--- a/components/esp-dsp/modules/dotprod/test/test_dotprod_f32.c
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_dotprod.h"
-#include "dsp_tests.h"
-
-TEST_CASE("dsps_dotprod_f32_ae32 functionality", "[dsps]")
-{
- float check_value = 1235;
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_f32_ae32(x, y, &z[1], i);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 1;
- y[i] = 3;
- }
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_f32_ae32(x, y, &z[1], i);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(i * 3, z[1]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_dotprod_f32_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprod_f32_ae32(x, y, &z[1], 1024);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprod_f32_ae32 - %f per sample + overhead.\n", cycles);
- float min_exec = 3;
- float max_exec = 6;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
-
-
-TEST_CASE("dsps_dotprod_f32_ansi functionality", "[dsps]")
-{
- float check_value = 1235;
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_f32_ansi(x, y, &z[1], i);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 1;
- y[i] = 3;
- }
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_f32_ansi(x, y, &z[1], i);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(i * 3, z[1]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_dotprod_f32_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprod_f32_ansi(x, y, &z[1], 1024);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprod_f32_ansi - %f per sample + overhead.\n", cycles);
- float min_exec = 4;
- float max_exec = 20;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/dotprod/test/test_dotprod_s16.c b/components/esp-dsp/modules/dotprod/test/test_dotprod_s16.c
deleted file mode 100644
index dad753d..0000000
--- a/components/esp-dsp/modules/dotprod/test/test_dotprod_s16.c
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_dotprod.h"
-#include "dsp_tests.h"
-
-// Test dsps_dotprod_s16_ansi function
-TEST_CASE("dsps_dotprod_s16_ansi functionality", "[dsps]")
-{
- int16_t check_value = 1235;
- int max_N = 1024;
- int16_t *x = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *y = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *z = (int16_t *)malloc(max_N * sizeof(int16_t));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- // Check result == 0
- for (int i = 1; i < 1024; i++) {
- esp_err_t status = dsps_dotprod_s16_ansi(x, y, &z[1], i, 0);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
-
- int16_t val_x = 0x080;
- int16_t val_y = 0x100;
- int16_t val_shift = 0;
-
- for (int i = 0; i < max_N; i++) {
- x[i] = val_x;
- y[i] = val_y;
- }
-
- // We check that dotproduct working with shift = 0;
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_s16_ansi(x, y, &z[1], i, val_shift);
-
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL((i * (val_x * val_y) + (0x7fff >> val_shift)) >> (15 - val_shift), z[1]);
- }
- val_shift = 2;
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_s16_ansi(x, y, &z[1], i, val_shift);
-
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(((long long)i * ((long long)val_x * (long long)val_y) + ((long long)0x7fff >> val_shift)) >> (15 - val_shift), z[1]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-// Test dsps_dotprod_s16_ansi function
-TEST_CASE("dsps_dotprod_s16_ae32 functionality", "[dsps]")
-{
- int16_t check_value = 1235;
- int max_N = 1024;
- int16_t *x = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *y = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *z = (int16_t *)malloc(max_N * sizeof(int16_t));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- // Check result == 0
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_s16_ae32(x, y, &z[1], i, 0);
- if (i < 4) {
- TEST_ASSERT_EQUAL(status, ESP_ERR_DSP_INVALID_LENGTH);
- } else {
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
- }
-
- int16_t val_x = 0x080;
- int16_t val_y = 0x100;
- int16_t val_shift = 0;
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = val_x;
- y[i] = val_y;
- }
- // We check that dotproduct working with shift = 0;
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_s16_ae32(x, y, &z[1], i, val_shift);
- if (i < 4) {
- TEST_ASSERT_EQUAL(status, ESP_ERR_DSP_INVALID_LENGTH);
- } else {
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL((i * (val_x * val_y) + (0x7fff >> val_shift)) >> (15 - val_shift), z[1]);
- }
- }
- val_shift = 2;
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprod_s16_ae32(x, y, &z[1], i, val_shift);
- if (i < 4) {
- TEST_ASSERT_EQUAL(status, ESP_ERR_DSP_INVALID_LENGTH);
- } else {
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL((i * (val_x * val_y) + ((int)0x7fff >> val_shift)) >> (15 - val_shift), z[1]);
- }
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-static portMUX_TYPE testnlock = portMUX_INITIALIZER_UNLOCKED;
-TEST_CASE("dsps_dotprod_s16_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
-
- int16_t *x = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *y = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *z = (int16_t *)malloc(max_N * sizeof(int16_t));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0x100;
- y[i] = 0x200;
- }
- // Disable interrupt to get exect count
-
- portENTER_CRITICAL(&testnlock);
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprod_s16_ae32(x, y, &z[1], 1024, 0);
- }
- unsigned int end_b = xthal_get_ccount();
- portEXIT_CRITICAL(&testnlock);
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprod_s16 - %f per sample + overhead. Result = %08x\n", cycles, z[1]);
- float min_exec = 1.5;
- float max_exec = 1.6;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_dotprod_s16_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
-
- int16_t *x = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *y = (int16_t *)malloc(max_N * sizeof(int16_t));
- int16_t *z = (int16_t *)malloc(max_N * sizeof(int16_t));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0x100;
- y[i] = 0x200;
- }
- // Disable interrupt to get exect count
-
- portENTER_CRITICAL(&testnlock);
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprod_s16_ansi(x, y, &z[1], 1024, 0);
- }
- unsigned int end_b = xthal_get_ccount();
- portEXIT_CRITICAL(&testnlock);
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprod_s16 - %f per sample + overhead. Result = %08x\n", cycles, z[1]);
- float min_exec = 10;
- float max_exec = 30;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
diff --git a/components/esp-dsp/modules/dotprod/test/test_dotprode_f32.c b/components/esp-dsp/modules/dotprod/test/test_dotprode_f32.c
deleted file mode 100644
index d9cdf01..0000000
--- a/components/esp-dsp/modules/dotprod/test/test_dotprode_f32.c
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_dotprod.h"
-#include "dsp_tests.h"
-
-TEST_CASE("dsps_dotprode_f32_ae32 functionality", "[dsps]")
-{
- float check_value = 1235;
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprode_f32_ae32(x, y, &z[1], i, 1, 1);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 1;
- y[i] = 3;
- }
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprode_f32_ae32(x, y, &z[1], i, 1, 1);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(i * 3, z[1]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_dotprode_f32_ae32 benchmark", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprode_f32_ae32(x, y, &z[1], 1024, 1, 1);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprode_f32_ae32 - %f per sample + overhead.\n", cycles);
- float min_exec = 3;
- float max_exec = 6;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
-
-
-TEST_CASE("dsps_dotprode_f32_ansi functionality", "[dsps]")
-{
- float check_value = 1235;
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- z[0] = check_value;
- z[2] = check_value + 1;
-
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprode_f32_ansi(x, y, &z[1], i, 1, 1);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(0, z[1]);
- }
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 1;
- y[i] = 3;
- }
- for (int i = 1 ; i < 1024 ; i++) {
- esp_err_t status = dsps_dotprode_f32_ansi(x, y, &z[1], i, 1, 1);
- TEST_ASSERT_EQUAL(status, ESP_OK);
- TEST_ASSERT_EQUAL(check_value, z[0]);
- TEST_ASSERT_EQUAL(check_value + 1, z[2]);
- TEST_ASSERT_EQUAL(i * 3, z[1]);
- }
-
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_dotprode_f32_ansi benchmark", "[dsps]")
-{
- int max_N = 1024;
- float *x = (float *)malloc(max_N * sizeof(float));
- float *y = (float *)malloc(max_N * sizeof(float));
- float *z = (float *)malloc(max_N * sizeof(float));
-
- for (int i = 0 ; i < max_N ; i++) {
- x[i] = 0;
- y[i] = 1000;
- }
-
- unsigned int start_b = xthal_get_ccount();
- int repeat_count = 1024;
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_dotprode_f32_ansi(x, y, &z[1], 1024, 1, 1);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (1024 * repeat_count);
- printf("Benchmark dsps_dotprode_f32_ansi - %f per sample + overhead.\n", cycles);
- float min_exec = 10;
- float max_exec = 25;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-
- free(x);
- free(y);
- free(z);
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ae32.S b/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ae32.S
deleted file mode 100644
index 3ad400b..0000000
--- a/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ae32.S
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r_platform.h"
-#if (dsps_fft2r_sc16_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dsps_fft2r_sc16_ae32_
- .type dsps_fft2r_sc16_ae32_,@function
-
- .global dsps_fft_w_table_sc16;
-
-//The function implements the following C code:
-//esp_err_t dsps_fft2r_sc16_ansi(int16_t *data, int N)
-//{
-// esp_err_t result = ESP_OK;
-// uint32_t *w = (uint32_t*)dsps_fft_w_table_sc16;
-// uint32_t *in_data = (uint32_t *)data;
-// int ie, ia, m;
-// sc16_t temp;
-// sc16_t cs;// c - re, s - im
-// sc16_t m_data;
-// sc16_t a_data;
-
-// ie = 1;
-// for (int N2 = N / 2; N2 > 0; N2 >>= 1) {
-// ia = 0;
-// for (int j = 0; j < ie; j++) {
-// cs.data = w[j];
-// //c = w[2 * j];
-// //s = w[2 * j + 1];
-// for (int i = 0; i < N2; i++) {
-// m = ia + N2;
-// m_data.data = in_data[m];
-// a_data.data = in_data[ia];
-// sc16_t m1;
-// m1.re = xtfixed_bf_1(a_data.re, cs.re, m_data.re, cs.im, m_data.im, 16);//(a_data.re - temp.re + shift_const) >> 1;
-// m1.im = xtfixed_bf_2(a_data.im, cs.re, m_data.im, cs.im, m_data.re, 16);//(a_data.im - temp.im + shift_const) >> 1;
-// in_data[m] = m1.data;
-// sc16_t m2;
-// m2.re = xtfixed_bf_3(a_data.re, cs.re, m_data.re, cs.im, m_data.im, 16);//(a_data.re + temp.re + shift_const) >> 1;
-// m2.im = xtfixed_bf_4(a_data.im, cs.re, m_data.im, cs.im, m_data.re, 16);//(a_data.im + temp.im + shift_const)>>1;
-// in_data[ia] = m2.data;
-// ia++;
-// }
-// ia += N2;
-// }
-// ie <<= 1;
-// }
-// return result;
-// }
-
-dsps_fft2r_sc16_ae32_:
-//esp_err_t dsps_fft2r_sc16_ansi(float *data, int N, float* dsps_fft_w_table_sc16)
-
- entry a1, 16
- // Array increment for floating point data should be 4
-// data - a2
-// N - a3
-// dsps_fft_w_table_sc16 - a4 - for now
-
-// a5 - 1, used to initialize acc
-// a6 - k, main loop counter; N2 - for (int N2 = N/2; N2 > 0; N2 >>= 1)
-// a7 - ie
-// a8 - j
-// a9 - test
-// a10 - (j)<<2, or a10 - j<<2
-// a11 - ia
-// a12 - m
-// a13 - ia pointer
-// a14 - m pointer
-// a15 - used to shift result
-
- // This instruction are not working. Have to be fixed!!!
- // For now theres no solution...
-// l32r a4, dsps_fft_w_table_sc16_ae32
- // To use ldinc operation we have to prepare a4:
- addi a4, a4, -4
- addi a9, a2, -4 // prepare input pointer for ldinc operation
-
- ldinc m1, a4 // Load [0x7fff j0] value to the m1
- addi a4, a4, -4
-
- // a5 used to load 0x7fff and clear acch/l
- movi.n a5, 1 // a5 = 1;
-
- srli a6, a3, 1 // a6 = N2 = N/2
-
- // Load shift register
- movi a7, 16
- ssr a7
-
- movi a7, 1 // a7 - ie
-
-fft2r_l1:
- movi a8, 0 // a8 - j
- movi a11,0 // a11 = ia = 0;
-
-fft2r_l2: // loop for j, a8 - j
- slli a10, a8, 2 // a10 = j<<2 (4 bytes per address) // shift for cs.data = w[j];
- add.n a10, a10, a4 // a10 - pointer to w tables
- ldinc m0, a10 // cs.data = w[j];
- // here we have m0 and m1
-
- loopnez a6, fft2r_l3
- add.n a12, a11, a6 // a12 = m = ia + N2
-
- slli a14, a12, 2 // a14 - pointer for m, m_data.data = in_data[m];
- slli a13, a11, 2 // a13 - pointer for ia, a_data.data = in_data[ia];
- add.n a14, a14, a9 // pointers to data arrays
- add.n a13, a13, a9 // These pointers are -4 from expected values...
-
- ldinc m2, a14 // m_data, a14 += 4; The pointers ready to store data
- mul.da.ll m1, a5 // acc = 0x7fff*1
- ldinc m3, a13 // ai_data a13 += 4;
- // re - l, im - h
- muls.dd.ll m0, m2 // acc -= cs.re*m_data.re
- mula.dd.ll m1, m3 // acc += 0x7fff*a_data.re
- muls.dd.hh m0, m2 // acc -= cs.im*m_data.im
- // result in acclo in_data[m].re
- rsr a15, acclo
- mul.da.ll m1, a5 // acc = 0x7fff*1
- sra a15, a15
- muls.dd.lh m0, m2 // acc -= cs.re*m_data.im
- s16i a15, a14, 0
- mula.dd.lh m1, m3 // acc += 0x7fff*a_data.im
- mula.dd.hl m0, m2 // acc += cs.im*m_data.re
- // result in acclo in_data[m].im
- rsr a15, acclo
- mul.da.ll m1, a5 // acc = 0x7fff*1
- sra a15, a15
- mula.dd.ll m0, m2 // acc += cs.re*m_data.re
- s16i a15, a14, 2
- mula.dd.ll m1, m3 // acc += 0x7fff*a_data.re
- mula.dd.hh m0, m2 // acc += cs.im*m_data.im
- // result in acclo // in_data[ia].re
- rsr a15, acclo
- mul.da.ll m1, a5 // acc = 0x7fff*1
-
- sra a15, a15
- mula.dd.lh m0, m2 // acc += cs.re*m_data.im
- s16i a15, a13, 0
-
- mula.dd.lh m1, m3 // acc += 0x7fff*a_data.im
- muls.dd.hl m0, m2 // acc -= cs.im*m_data.re
- // result in acclo // in_data[ia].im
- rsr a15, acclo
-
- sra a15, a15
- s16i a15, a13, 2
-
- // Here we have m0 - w, m2 - m_data, m3 - ai_data,
- addi a11, a11, 1// ia++
-fft2r_l3:
- add a11, a11, a6
-
- addi a8, a8, 1 // j++
- BNE a8, a7, fft2r_l2 //
- slli a7, a7, 1 // ie = ie<<1
-// main loop: for (int k = N/2; k > 0; k >>= 1)
- srli a6, a6, 1 // a6 = a6>>1
- BNEZ a6, fft2r_l1// Jump if > 0
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_fft2r_sc16_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ansi.c b/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ansi.c
deleted file mode 100644
index 244b065..0000000
--- a/components/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ansi.c
+++ /dev/null
@@ -1,320 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r.h"
-#include "dsp_common.h"
-#include "dsp_types.h"
-#include
-#include "esp_attr.h"
-
-int16_t* dsps_fft_w_table_sc16;
-int dsps_fft_w_table_sc16_size;
-uint8_t dsps_fft2r_sc16_initialized = 0;
-uint8_t dsps_fft2r_sc16_mem_allocated = 0;
-
-unsigned short reverse(unsigned short x, unsigned short N, int order);
-
-static const int add_rount_mult = 0x7fff;
-static const int mult_shift_const = 0x7fff; // Used to shift data << 15
-
-static inline int16_t xtfixed_bf_1(int16_t a0, int16_t a1, int16_t a2, int16_t a3, int16_t a4, int result_shift)
-{
- int result = a0*mult_shift_const;
- result -= (int32_t)a1*(int32_t)a2 + (int32_t)a3*(int32_t)a4;
- result += add_rount_mult;
- result = result >> result_shift;
- return (int16_t)result;
-}
-
-static inline int16_t xtfixed_bf_2(int16_t a0, int16_t a1, int16_t a2, int16_t a3, int16_t a4, int result_shift)
-{
- int result = a0 *mult_shift_const;
- result -= ((int32_t)a1*(int32_t)a2 - (int32_t)a3*(int32_t)a4);
- result += add_rount_mult;
- result = result >> result_shift;
- return (int16_t)result;
-}
-
-static inline int16_t xtfixed_bf_3(int16_t a0, int16_t a1, int16_t a2, int16_t a3, int16_t a4, int result_shift)
-{
- int result = a0 *mult_shift_const;
- result += (int32_t)a1*(int32_t)a2 + (int32_t)a3*(int32_t)a4;
- result += add_rount_mult;
- result = result >> result_shift;
- return (int16_t)result;
-}
-
-static inline int16_t xtfixed_bf_4(int16_t a0, int16_t a1, int16_t a2, int16_t a3, int16_t a4, int result_shift)
-{
- int result = a0 *mult_shift_const;
- result += (int32_t)a1*(int32_t)a2 - (int32_t)a3*(int32_t)a4;
- result += add_rount_mult;
- result = result >> result_shift;
- return (int16_t)result;
-}
-
-esp_err_t dsps_fft2r_init_sc16(int16_t* fft_table_buff, int table_size)
-{
- esp_err_t result = ESP_OK;
- if (dsps_fft2r_sc16_initialized != 0) {
- return result;
- }
- if (table_size > CONFIG_DSP_MAX_FFT_SIZE)
- {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (table_size == 0){
- return result;
- }
- if (fft_table_buff != NULL)
- {
- if (dsps_fft2r_sc16_mem_allocated)
- {
- return ESP_ERR_DSP_REINITIALIZED;
- }
- dsps_fft_w_table_sc16 = fft_table_buff;
- dsps_fft_w_table_sc16_size = table_size;
- } else
- {
- if (!dsps_fft2r_sc16_mem_allocated)
- {
- dsps_fft_w_table_sc16 = (int16_t*)malloc(CONFIG_DSP_MAX_FFT_SIZE*sizeof(int16_t));
- }
- dsps_fft_w_table_sc16_size = CONFIG_DSP_MAX_FFT_SIZE;
- dsps_fft2r_sc16_mem_allocated = 1;
- }
-
- result = dsps_gen_w_r2_sc16(dsps_fft_w_table_sc16, dsps_fft_w_table_sc16_size);
- if (result != ESP_OK) {
- return result;
- }
- result = dsps_bit_rev_sc16_ansi(dsps_fft_w_table_sc16, dsps_fft_w_table_sc16_size >> 1);
- if (result != ESP_OK) {
- return result;
- }
- dsps_fft2r_sc16_initialized = 1;
- return ESP_OK;
-}
-
-void dsps_fft2r_deinit_sc16()
-{
- if (dsps_fft2r_sc16_mem_allocated)
- {
- free(dsps_fft_w_table_sc16);
- }
- dsps_fft2r_sc16_mem_allocated = 0;
- dsps_fft2r_sc16_initialized = 0;
-}
-
-esp_err_t dsps_fft2r_sc16_ansi_(int16_t *data, int N, int16_t* sc_table)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- if (!dsps_fft2r_sc16_initialized) {
- return ESP_ERR_DSP_UNINITIALIZED;
- }
-
- esp_err_t result = ESP_OK;
-
- uint32_t *w = (uint32_t*)sc_table;
- uint32_t *in_data = (uint32_t *)data;
-
- int ie, ia, m;
- sc16_t cs;// c - re, s - im
- sc16_t m_data;
- sc16_t a_data;
-
- ie = 1;
- for (int N2 = N / 2; N2 > 0; N2 >>= 1) {
- ia = 0;
- for (int j = 0; j < ie; j++) {
- cs.data = w[j];
- //c = w[2 * j];
- //s = w[2 * j + 1];
- for (int i = 0; i < N2; i++) {
- m = ia + N2;
- m_data.data = in_data[m];
- a_data.data = in_data[ia];
- //data[2 * m] = data[2 * ia] - re_temp;
- //data[2 * m + 1] = data[2 * ia + 1] - im_temp;
- sc16_t m1;
- m1.re = xtfixed_bf_1(a_data.re, cs.re, m_data.re, cs.im, m_data.im, 16);//(a_data.re - temp.re + shift_const) >> 1;
- m1.im = xtfixed_bf_2(a_data.im, cs.re, m_data.im, cs.im, m_data.re, 16);//(a_data.im - temp.im + shift_const) >> 1;
- in_data[m] = m1.data;
-
- //data[2 * ia] = data[2 * ia] + re_temp;
- //data[2 * ia + 1] = data[2 * ia + 1] + im_temp;
- sc16_t m2;
- m2.re = xtfixed_bf_3(a_data.re, cs.re, m_data.re, cs.im, m_data.im, 16);//(a_data.re + temp.re + shift_const) >> 1;
- m2.im = xtfixed_bf_4(a_data.im, cs.re, m_data.im, cs.im, m_data.re, 16);//(a_data.im + temp.im + shift_const)>>1;
- in_data[ia] = m2.data;
- ia++;
- }
- ia += N2;
- }
- ie <<= 1;
- }
- return result;
-}
-
-
-static inline unsigned short reverse_sc16(unsigned short x, unsigned short N, int order)
-{
- unsigned short b = x;
-
- b = (b & 0xff00) >> 8 | (b & 0x00fF) << 8;
- b = (b & 0xf0F0) >> 4 | (b & 0x0f0F) << 4;
- b = (b & 0xCCCC) >> 2 | (b & 0x3333) << 2;
- b = (b & 0xAAAA) >> 1 | (b & 0x5555) << 1;
- return b >> (16 - order);
-}
-
-esp_err_t dsps_bit_rev_sc16_ansi(int16_t *data, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- esp_err_t result = ESP_OK;
-
- int j, k;
- uint32_t temp;
- uint32_t* in_data = (uint32_t*)data;
- j = 0;
- for (int i = 1; i < (N - 1); i++) {
- k = N >> 1;
- while (k <= j) {
- j -= k;
- k >>= 1;
- }
- j += k;
- if (i < j)
- {
- temp = in_data[j];
- in_data[j] = in_data[i];
- in_data[i] = temp;
- }
- }
- return result;
-}
-
-esp_err_t dsps_gen_w_r2_sc16(int16_t *w, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- esp_err_t result = ESP_OK;
-
- int i;
- float e = M_PI * 2.0 / N;
-
- for (i = 0; i < (N >> 1); i++) {
- w[2 * i] = (int16_t)(INT16_MAX * cosf(i * e));
- w[2 * i + 1] = (int16_t)(INT16_MAX * sinf(i * e));
- }
-
- return result;
-}
-
-esp_err_t dsps_cplx2reC_sc16(int16_t *data, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- esp_err_t result = ESP_OK;
-
- int i;
- int n2 = N << (1 + 1); // we will operate with int32 indexes
- uint32_t* in_data = (uint32_t*)data;
-
- sc16_t kl;
- sc16_t kh;
- sc16_t nl;
- sc16_t nh;
-
- for (i = 0; i < (N / 4); i++) {
- kl.data = in_data[i + 1];
- nl.data = in_data[n2 - i - 1];
- kh.data = in_data[i + 1 + N/2];
- nh.data = data[n2 - i - 1 - N/2];
-
- data[i * 2 + 0 + 2] = kl.re + nl.re;
- data[i * 2 + 1 + 2] = kl.im - nl.im;
-
- data[n2 - i * 2 - 1 - N] = kh.re + nh.re;
- data[n2 - i * 2 - 2 - N] = kh.im - nh.im;
-
- data[i * 2 + 0 + 2 + N] = kl.im + nl.im;
- data[i * 2 + 1 + 2 + N] = kl.re - nl.re;
-
- data[n2 - i * 2 - 1] = kh.im + nh.im;
- data[n2 - i * 2 - 2] = kh.re - nh.re;
- }
- data[N] = data[1];
- data[1] = 0;
- data[N + 1] = 0;
-
- return result;
-}
-
-esp_err_t dsps_cplx2real_sc16_ansi(int16_t *data, int N)
-{
-
- int order = dsp_power_of_two(N);
- sc16_t* table = (sc16_t*)dsps_fft_w_table_sc16;
- sc16_t* result = (sc16_t*)data;
- // Original formula...
- // result[0].re = result[0].re + result[0].im;
- // result[N].re = result[0].re - result[0].im;
- // result[0].im = 0;
- // result[N].im = 0;
- // Optimized one:
- int16_t tmp_re = result[0].re;
- result[0].re = (tmp_re + result[0].im)>>1;
- result[0].im = (tmp_re - result[0].im)>>1;
-
- sc16_t f1k, f2k;
- for (int k=1;k <= N/2 ; ++k )
- {
- sc16_t fpk = result[k];
- sc16_t fpnk;
- fpnk.re = result[N - k].re;
- fpnk.im = result[N - k].im;
- f1k.re = fpk.re + fpnk.re;
- f1k.im = fpk.im - fpnk.im;
- f2k.re = fpk.re - fpnk.re;
- f2k.im = fpk.im + fpnk.im;
-
- int table_index = reverse(k, N, order);
-
- // float c = -dsps_fft_w_table_fc32[table_index*2+1];
- // float s = -dsps_fft_w_table_fc32[table_index*2+0];
- sc16_t w = table[table_index];
-
- sc16_t tw;
- {
- int re = (w.re*f2k.im - w.im*f2k.re)>>15;
- int im = (+w.re*f2k.re + w.im*f2k.im)>>15;
- tw.re = re;
- tw.im = im;
- }
-
- result[k].re = (f1k.re + tw.re)>>2;
- result[k].im = (f1k.im - tw.im)>>2;
- result[N - k].re = (f1k.re - tw.re)>>2;
- result[N - k].im = -(f1k.im + tw.im)>>2;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft2r_bitrev_tables_fc32.c b/components/esp-dsp/modules/fft/float/dsps_fft2r_bitrev_tables_fc32.c
deleted file mode 100644
index 527ce4a..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft2r_bitrev_tables_fc32.c
+++ /dev/null
@@ -1,590 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include "dsps_fft_tables.h"
-
-
-const uint16_t bitrev2r_table_16_fc32[] = {
- 8, 64, 16, 32, 24, 96, 40, 80, 56, 112, 88, 104,
-};
-
-const uint16_t bitrev2r_table_32_fc32[] = {
- 8, 128, 16, 64, 24, 192, 40, 160, 48, 96, 56, 224, 72, 144, 88, 208,
- 104, 176, 120, 240, 152, 200, 184, 232,
-};
-
-const uint16_t bitrev2r_table_64_fc32[] = {
- 8, 256, 16, 128, 24, 384, 32, 64, 40, 320, 48, 192, 56, 448, 72, 288,
- 80, 160, 88, 416, 104, 352, 112, 224, 120, 480, 136, 272, 152, 400, 168, 336,
- 176, 208, 184, 464, 200, 304, 216, 432, 232, 368, 248, 496, 280, 392, 296, 328,
- 312, 456, 344, 424, 376, 488, 440, 472,
-};
-
-const uint16_t bitrev2r_table_128_fc32[] = {
- 8, 512, 16, 256, 24, 768, 32, 128, 40, 640, 48, 384, 56, 896, 72, 576,
- 80, 320, 88, 832, 96, 192, 104, 704, 112, 448, 120, 960, 136, 544, 144, 288,
- 152, 800, 168, 672, 176, 416, 184, 928, 200, 608, 208, 352, 216, 864, 232, 736,
- 240, 480, 248, 992, 264, 528, 280, 784, 296, 656, 304, 400, 312, 912, 328, 592,
- 344, 848, 360, 720, 368, 464, 376, 976, 392, 560, 408, 816, 424, 688, 440, 944,
- 456, 624, 472, 880, 488, 752, 504, 1008, 536, 776, 552, 648, 568, 904, 600, 840,
- 616, 712, 632, 968, 664, 808, 696, 936, 728, 872, 760, 1000, 824, 920, 888, 984,
-};
-
-const uint16_t bitrev2r_table_256_fc32[] = {
- 8, 1024, 16, 512, 24, 1536, 32, 256, 40, 1280, 48, 768, 56, 1792, 64, 128,
- 72, 1152, 80, 640, 88, 1664, 96, 384, 104, 1408, 112, 896, 120, 1920, 136, 1088,
- 144, 576, 152, 1600, 160, 320, 168, 1344, 176, 832, 184, 1856, 200, 1216, 208, 704,
- 216, 1728, 224, 448, 232, 1472, 240, 960, 248, 1984, 264, 1056, 272, 544, 280, 1568,
- 296, 1312, 304, 800, 312, 1824, 328, 1184, 336, 672, 344, 1696, 352, 416, 360, 1440,
- 368, 928, 376, 1952, 392, 1120, 400, 608, 408, 1632, 424, 1376, 432, 864, 440, 1888,
- 456, 1248, 464, 736, 472, 1760, 488, 1504, 496, 992, 504, 2016, 520, 1040, 536, 1552,
- 552, 1296, 560, 784, 568, 1808, 584, 1168, 592, 656, 600, 1680, 616, 1424, 624, 912,
- 632, 1936, 648, 1104, 664, 1616, 680, 1360, 688, 848, 696, 1872, 712, 1232, 728, 1744,
- 744, 1488, 752, 976, 760, 2000, 776, 1072, 792, 1584, 808, 1328, 824, 1840, 840, 1200,
- 856, 1712, 872, 1456, 880, 944, 888, 1968, 904, 1136, 920, 1648, 936, 1392, 952, 1904,
- 968, 1264, 984, 1776, 1000, 1520, 1016, 2032, 1048, 1544, 1064, 1288, 1080, 1800, 1096, 1160,
- 1112, 1672, 1128, 1416, 1144, 1928, 1176, 1608, 1192, 1352, 1208, 1864, 1240, 1736, 1256, 1480,
- 1272, 1992, 1304, 1576, 1336, 1832, 1368, 1704, 1384, 1448, 1400, 1960, 1432, 1640, 1464, 1896,
- 1496, 1768, 1528, 2024, 1592, 1816, 1624, 1688, 1656, 1944, 1720, 1880, 1784, 2008, 1912, 1976,
-};
-
-const uint16_t bitrev2r_table_512_fc32[] = {
- 8, 2048, 16, 1024, 24, 3072, 32, 512, 40, 2560, 48, 1536, 56, 3584, 64, 256,
- 72, 2304, 80, 1280, 88, 3328, 96, 768, 104, 2816, 112, 1792, 120, 3840, 136, 2176,
- 144, 1152, 152, 3200, 160, 640, 168, 2688, 176, 1664, 184, 3712, 192, 384, 200, 2432,
- 208, 1408, 216, 3456, 224, 896, 232, 2944, 240, 1920, 248, 3968, 264, 2112, 272, 1088,
- 280, 3136, 288, 576, 296, 2624, 304, 1600, 312, 3648, 328, 2368, 336, 1344, 344, 3392,
- 352, 832, 360, 2880, 368, 1856, 376, 3904, 392, 2240, 400, 1216, 408, 3264, 416, 704,
- 424, 2752, 432, 1728, 440, 3776, 456, 2496, 464, 1472, 472, 3520, 480, 960, 488, 3008,
- 496, 1984, 504, 4032, 520, 2080, 528, 1056, 536, 3104, 552, 2592, 560, 1568, 568, 3616,
- 584, 2336, 592, 1312, 600, 3360, 608, 800, 616, 2848, 624, 1824, 632, 3872, 648, 2208,
- 656, 1184, 664, 3232, 680, 2720, 688, 1696, 696, 3744, 712, 2464, 720, 1440, 728, 3488,
- 736, 928, 744, 2976, 752, 1952, 760, 4000, 776, 2144, 784, 1120, 792, 3168, 808, 2656,
- 816, 1632, 824, 3680, 840, 2400, 848, 1376, 856, 3424, 872, 2912, 880, 1888, 888, 3936,
- 904, 2272, 912, 1248, 920, 3296, 936, 2784, 944, 1760, 952, 3808, 968, 2528, 976, 1504,
- 984, 3552, 1000, 3040, 1008, 2016, 1016, 4064, 1032, 2064, 1048, 3088, 1064, 2576, 1072, 1552,
- 1080, 3600, 1096, 2320, 1104, 1296, 1112, 3344, 1128, 2832, 1136, 1808, 1144, 3856, 1160, 2192,
- 1176, 3216, 1192, 2704, 1200, 1680, 1208, 3728, 1224, 2448, 1232, 1424, 1240, 3472, 1256, 2960,
- 1264, 1936, 1272, 3984, 1288, 2128, 1304, 3152, 1320, 2640, 1328, 1616, 1336, 3664, 1352, 2384,
- 1368, 3408, 1384, 2896, 1392, 1872, 1400, 3920, 1416, 2256, 1432, 3280, 1448, 2768, 1456, 1744,
- 1464, 3792, 1480, 2512, 1496, 3536, 1512, 3024, 1520, 2000, 1528, 4048, 1544, 2096, 1560, 3120,
- 1576, 2608, 1592, 3632, 1608, 2352, 1624, 3376, 1640, 2864, 1648, 1840, 1656, 3888, 1672, 2224,
- 1688, 3248, 1704, 2736, 1720, 3760, 1736, 2480, 1752, 3504, 1768, 2992, 1776, 1968, 1784, 4016,
- 1800, 2160, 1816, 3184, 1832, 2672, 1848, 3696, 1864, 2416, 1880, 3440, 1896, 2928, 1912, 3952,
- 1928, 2288, 1944, 3312, 1960, 2800, 1976, 3824, 1992, 2544, 2008, 3568, 2024, 3056, 2040, 4080,
- 2072, 3080, 2088, 2568, 2104, 3592, 2120, 2312, 2136, 3336, 2152, 2824, 2168, 3848, 2200, 3208,
- 2216, 2696, 2232, 3720, 2248, 2440, 2264, 3464, 2280, 2952, 2296, 3976, 2328, 3144, 2344, 2632,
- 2360, 3656, 2392, 3400, 2408, 2888, 2424, 3912, 2456, 3272, 2472, 2760, 2488, 3784, 2520, 3528,
- 2536, 3016, 2552, 4040, 2584, 3112, 2616, 3624, 2648, 3368, 2664, 2856, 2680, 3880, 2712, 3240,
- 2744, 3752, 2776, 3496, 2792, 2984, 2808, 4008, 2840, 3176, 2872, 3688, 2904, 3432, 2936, 3944,
- 2968, 3304, 3000, 3816, 3032, 3560, 3064, 4072, 3128, 3608, 3160, 3352, 3192, 3864, 3256, 3736,
- 3288, 3480, 3320, 3992, 3384, 3672, 3448, 3928, 3512, 3800, 3576, 4056, 3704, 3896, 3832, 4024,
-};
-
-const uint16_t bitrev2r_table_1024_fc32[] = {
- 8, 4096, 16, 2048, 24, 6144, 32, 1024, 40, 5120, 48, 3072, 56, 7168, 64, 512,
- 72, 4608, 80, 2560, 88, 6656, 96, 1536, 104, 5632, 112, 3584, 120, 7680, 128, 256,
- 136, 4352, 144, 2304, 152, 6400, 160, 1280, 168, 5376, 176, 3328, 184, 7424, 192, 768,
- 200, 4864, 208, 2816, 216, 6912, 224, 1792, 232, 5888, 240, 3840, 248, 7936, 264, 4224,
- 272, 2176, 280, 6272, 288, 1152, 296, 5248, 304, 3200, 312, 7296, 320, 640, 328, 4736,
- 336, 2688, 344, 6784, 352, 1664, 360, 5760, 368, 3712, 376, 7808, 392, 4480, 400, 2432,
- 408, 6528, 416, 1408, 424, 5504, 432, 3456, 440, 7552, 448, 896, 456, 4992, 464, 2944,
- 472, 7040, 480, 1920, 488, 6016, 496, 3968, 504, 8064, 520, 4160, 528, 2112, 536, 6208,
- 544, 1088, 552, 5184, 560, 3136, 568, 7232, 584, 4672, 592, 2624, 600, 6720, 608, 1600,
- 616, 5696, 624, 3648, 632, 7744, 648, 4416, 656, 2368, 664, 6464, 672, 1344, 680, 5440,
- 688, 3392, 696, 7488, 704, 832, 712, 4928, 720, 2880, 728, 6976, 736, 1856, 744, 5952,
- 752, 3904, 760, 8000, 776, 4288, 784, 2240, 792, 6336, 800, 1216, 808, 5312, 816, 3264,
- 824, 7360, 840, 4800, 848, 2752, 856, 6848, 864, 1728, 872, 5824, 880, 3776, 888, 7872,
- 904, 4544, 912, 2496, 920, 6592, 928, 1472, 936, 5568, 944, 3520, 952, 7616, 968, 5056,
- 976, 3008, 984, 7104, 992, 1984, 1000, 6080, 1008, 4032, 1016, 8128, 1032, 4128, 1040, 2080,
- 1048, 6176, 1064, 5152, 1072, 3104, 1080, 7200, 1096, 4640, 1104, 2592, 1112, 6688, 1120, 1568,
- 1128, 5664, 1136, 3616, 1144, 7712, 1160, 4384, 1168, 2336, 1176, 6432, 1184, 1312, 1192, 5408,
- 1200, 3360, 1208, 7456, 1224, 4896, 1232, 2848, 1240, 6944, 1248, 1824, 1256, 5920, 1264, 3872,
- 1272, 7968, 1288, 4256, 1296, 2208, 1304, 6304, 1320, 5280, 1328, 3232, 1336, 7328, 1352, 4768,
- 1360, 2720, 1368, 6816, 1376, 1696, 1384, 5792, 1392, 3744, 1400, 7840, 1416, 4512, 1424, 2464,
- 1432, 6560, 1448, 5536, 1456, 3488, 1464, 7584, 1480, 5024, 1488, 2976, 1496, 7072, 1504, 1952,
- 1512, 6048, 1520, 4000, 1528, 8096, 1544, 4192, 1552, 2144, 1560, 6240, 1576, 5216, 1584, 3168,
- 1592, 7264, 1608, 4704, 1616, 2656, 1624, 6752, 1640, 5728, 1648, 3680, 1656, 7776, 1672, 4448,
- 1680, 2400, 1688, 6496, 1704, 5472, 1712, 3424, 1720, 7520, 1736, 4960, 1744, 2912, 1752, 7008,
- 1760, 1888, 1768, 5984, 1776, 3936, 1784, 8032, 1800, 4320, 1808, 2272, 1816, 6368, 1832, 5344,
- 1840, 3296, 1848, 7392, 1864, 4832, 1872, 2784, 1880, 6880, 1896, 5856, 1904, 3808, 1912, 7904,
- 1928, 4576, 1936, 2528, 1944, 6624, 1960, 5600, 1968, 3552, 1976, 7648, 1992, 5088, 2000, 3040,
- 2008, 7136, 2024, 6112, 2032, 4064, 2040, 8160, 2056, 4112, 2072, 6160, 2088, 5136, 2096, 3088,
- 2104, 7184, 2120, 4624, 2128, 2576, 2136, 6672, 2152, 5648, 2160, 3600, 2168, 7696, 2184, 4368,
- 2192, 2320, 2200, 6416, 2216, 5392, 2224, 3344, 2232, 7440, 2248, 4880, 2256, 2832, 2264, 6928,
- 2280, 5904, 2288, 3856, 2296, 7952, 2312, 4240, 2328, 6288, 2344, 5264, 2352, 3216, 2360, 7312,
- 2376, 4752, 2384, 2704, 2392, 6800, 2408, 5776, 2416, 3728, 2424, 7824, 2440, 4496, 2456, 6544,
- 2472, 5520, 2480, 3472, 2488, 7568, 2504, 5008, 2512, 2960, 2520, 7056, 2536, 6032, 2544, 3984,
- 2552, 8080, 2568, 4176, 2584, 6224, 2600, 5200, 2608, 3152, 2616, 7248, 2632, 4688, 2648, 6736,
- 2664, 5712, 2672, 3664, 2680, 7760, 2696, 4432, 2712, 6480, 2728, 5456, 2736, 3408, 2744, 7504,
- 2760, 4944, 2768, 2896, 2776, 6992, 2792, 5968, 2800, 3920, 2808, 8016, 2824, 4304, 2840, 6352,
- 2856, 5328, 2864, 3280, 2872, 7376, 2888, 4816, 2904, 6864, 2920, 5840, 2928, 3792, 2936, 7888,
- 2952, 4560, 2968, 6608, 2984, 5584, 2992, 3536, 3000, 7632, 3016, 5072, 3032, 7120, 3048, 6096,
- 3056, 4048, 3064, 8144, 3080, 4144, 3096, 6192, 3112, 5168, 3128, 7216, 3144, 4656, 3160, 6704,
- 3176, 5680, 3184, 3632, 3192, 7728, 3208, 4400, 3224, 6448, 3240, 5424, 3248, 3376, 3256, 7472,
- 3272, 4912, 3288, 6960, 3304, 5936, 3312, 3888, 3320, 7984, 3336, 4272, 3352, 6320, 3368, 5296,
- 3384, 7344, 3400, 4784, 3416, 6832, 3432, 5808, 3440, 3760, 3448, 7856, 3464, 4528, 3480, 6576,
- 3496, 5552, 3512, 7600, 3528, 5040, 3544, 7088, 3560, 6064, 3568, 4016, 3576, 8112, 3592, 4208,
- 3608, 6256, 3624, 5232, 3640, 7280, 3656, 4720, 3672, 6768, 3688, 5744, 3704, 7792, 3720, 4464,
- 3736, 6512, 3752, 5488, 3768, 7536, 3784, 4976, 3800, 7024, 3816, 6000, 3824, 3952, 3832, 8048,
- 3848, 4336, 3864, 6384, 3880, 5360, 3896, 7408, 3912, 4848, 3928, 6896, 3944, 5872, 3960, 7920,
- 3976, 4592, 3992, 6640, 4008, 5616, 4024, 7664, 4040, 5104, 4056, 7152, 4072, 6128, 4088, 8176,
- 4120, 6152, 4136, 5128, 4152, 7176, 4168, 4616, 4184, 6664, 4200, 5640, 4216, 7688, 4232, 4360,
- 4248, 6408, 4264, 5384, 4280, 7432, 4296, 4872, 4312, 6920, 4328, 5896, 4344, 7944, 4376, 6280,
- 4392, 5256, 4408, 7304, 4424, 4744, 4440, 6792, 4456, 5768, 4472, 7816, 4504, 6536, 4520, 5512,
- 4536, 7560, 4552, 5000, 4568, 7048, 4584, 6024, 4600, 8072, 4632, 6216, 4648, 5192, 4664, 7240,
- 4696, 6728, 4712, 5704, 4728, 7752, 4760, 6472, 4776, 5448, 4792, 7496, 4808, 4936, 4824, 6984,
- 4840, 5960, 4856, 8008, 4888, 6344, 4904, 5320, 4920, 7368, 4952, 6856, 4968, 5832, 4984, 7880,
- 5016, 6600, 5032, 5576, 5048, 7624, 5080, 7112, 5096, 6088, 5112, 8136, 5144, 6184, 5176, 7208,
- 5208, 6696, 5224, 5672, 5240, 7720, 5272, 6440, 5288, 5416, 5304, 7464, 5336, 6952, 5352, 5928,
- 5368, 7976, 5400, 6312, 5432, 7336, 5464, 6824, 5480, 5800, 5496, 7848, 5528, 6568, 5560, 7592,
- 5592, 7080, 5608, 6056, 5624, 8104, 5656, 6248, 5688, 7272, 5720, 6760, 5752, 7784, 5784, 6504,
- 5816, 7528, 5848, 7016, 5864, 5992, 5880, 8040, 5912, 6376, 5944, 7400, 5976, 6888, 6008, 7912,
- 6040, 6632, 6072, 7656, 6104, 7144, 6136, 8168, 6200, 7192, 6232, 6680, 6264, 7704, 6296, 6424,
- 6328, 7448, 6360, 6936, 6392, 7960, 6456, 7320, 6488, 6808, 6520, 7832, 6584, 7576, 6616, 7064,
- 6648, 8088, 6712, 7256, 6776, 7768, 6840, 7512, 6872, 7000, 6904, 8024, 6968, 7384, 7032, 7896,
- 7096, 7640, 7160, 8152, 7288, 7736, 7352, 7480, 7416, 7992, 7544, 7864, 7672, 8120, 7928, 8056,
-};
-
-const uint16_t bitrev2r_table_2048_fc32[] = {
- 8, 8192, 16, 4096, 24, 12288, 32, 2048, 40, 10240, 48, 6144, 56, 14336, 64, 1024,
- 72, 9216, 80, 5120, 88, 13312, 96, 3072, 104, 11264, 112, 7168, 120, 15360, 128, 512,
- 136, 8704, 144, 4608, 152, 12800, 160, 2560, 168, 10752, 176, 6656, 184, 14848, 192, 1536,
- 200, 9728, 208, 5632, 216, 13824, 224, 3584, 232, 11776, 240, 7680, 248, 15872, 264, 8448,
- 272, 4352, 280, 12544, 288, 2304, 296, 10496, 304, 6400, 312, 14592, 320, 1280, 328, 9472,
- 336, 5376, 344, 13568, 352, 3328, 360, 11520, 368, 7424, 376, 15616, 384, 768, 392, 8960,
- 400, 4864, 408, 13056, 416, 2816, 424, 11008, 432, 6912, 440, 15104, 448, 1792, 456, 9984,
- 464, 5888, 472, 14080, 480, 3840, 488, 12032, 496, 7936, 504, 16128, 520, 8320, 528, 4224,
- 536, 12416, 544, 2176, 552, 10368, 560, 6272, 568, 14464, 576, 1152, 584, 9344, 592, 5248,
- 600, 13440, 608, 3200, 616, 11392, 624, 7296, 632, 15488, 648, 8832, 656, 4736, 664, 12928,
- 672, 2688, 680, 10880, 688, 6784, 696, 14976, 704, 1664, 712, 9856, 720, 5760, 728, 13952,
- 736, 3712, 744, 11904, 752, 7808, 760, 16000, 776, 8576, 784, 4480, 792, 12672, 800, 2432,
- 808, 10624, 816, 6528, 824, 14720, 832, 1408, 840, 9600, 848, 5504, 856, 13696, 864, 3456,
- 872, 11648, 880, 7552, 888, 15744, 904, 9088, 912, 4992, 920, 13184, 928, 2944, 936, 11136,
- 944, 7040, 952, 15232, 960, 1920, 968, 10112, 976, 6016, 984, 14208, 992, 3968, 1000, 12160,
- 1008, 8064, 1016, 16256, 1032, 8256, 1040, 4160, 1048, 12352, 1056, 2112, 1064, 10304, 1072, 6208,
- 1080, 14400, 1096, 9280, 1104, 5184, 1112, 13376, 1120, 3136, 1128, 11328, 1136, 7232, 1144, 15424,
- 1160, 8768, 1168, 4672, 1176, 12864, 1184, 2624, 1192, 10816, 1200, 6720, 1208, 14912, 1216, 1600,
- 1224, 9792, 1232, 5696, 1240, 13888, 1248, 3648, 1256, 11840, 1264, 7744, 1272, 15936, 1288, 8512,
- 1296, 4416, 1304, 12608, 1312, 2368, 1320, 10560, 1328, 6464, 1336, 14656, 1352, 9536, 1360, 5440,
- 1368, 13632, 1376, 3392, 1384, 11584, 1392, 7488, 1400, 15680, 1416, 9024, 1424, 4928, 1432, 13120,
- 1440, 2880, 1448, 11072, 1456, 6976, 1464, 15168, 1472, 1856, 1480, 10048, 1488, 5952, 1496, 14144,
- 1504, 3904, 1512, 12096, 1520, 8000, 1528, 16192, 1544, 8384, 1552, 4288, 1560, 12480, 1568, 2240,
- 1576, 10432, 1584, 6336, 1592, 14528, 1608, 9408, 1616, 5312, 1624, 13504, 1632, 3264, 1640, 11456,
- 1648, 7360, 1656, 15552, 1672, 8896, 1680, 4800, 1688, 12992, 1696, 2752, 1704, 10944, 1712, 6848,
- 1720, 15040, 1736, 9920, 1744, 5824, 1752, 14016, 1760, 3776, 1768, 11968, 1776, 7872, 1784, 16064,
- 1800, 8640, 1808, 4544, 1816, 12736, 1824, 2496, 1832, 10688, 1840, 6592, 1848, 14784, 1864, 9664,
- 1872, 5568, 1880, 13760, 1888, 3520, 1896, 11712, 1904, 7616, 1912, 15808, 1928, 9152, 1936, 5056,
- 1944, 13248, 1952, 3008, 1960, 11200, 1968, 7104, 1976, 15296, 1992, 10176, 2000, 6080, 2008, 14272,
- 2016, 4032, 2024, 12224, 2032, 8128, 2040, 16320, 2056, 8224, 2064, 4128, 2072, 12320, 2088, 10272,
- 2096, 6176, 2104, 14368, 2120, 9248, 2128, 5152, 2136, 13344, 2144, 3104, 2152, 11296, 2160, 7200,
- 2168, 15392, 2184, 8736, 2192, 4640, 2200, 12832, 2208, 2592, 2216, 10784, 2224, 6688, 2232, 14880,
- 2248, 9760, 2256, 5664, 2264, 13856, 2272, 3616, 2280, 11808, 2288, 7712, 2296, 15904, 2312, 8480,
- 2320, 4384, 2328, 12576, 2344, 10528, 2352, 6432, 2360, 14624, 2376, 9504, 2384, 5408, 2392, 13600,
- 2400, 3360, 2408, 11552, 2416, 7456, 2424, 15648, 2440, 8992, 2448, 4896, 2456, 13088, 2464, 2848,
- 2472, 11040, 2480, 6944, 2488, 15136, 2504, 10016, 2512, 5920, 2520, 14112, 2528, 3872, 2536, 12064,
- 2544, 7968, 2552, 16160, 2568, 8352, 2576, 4256, 2584, 12448, 2600, 10400, 2608, 6304, 2616, 14496,
- 2632, 9376, 2640, 5280, 2648, 13472, 2656, 3232, 2664, 11424, 2672, 7328, 2680, 15520, 2696, 8864,
- 2704, 4768, 2712, 12960, 2728, 10912, 2736, 6816, 2744, 15008, 2760, 9888, 2768, 5792, 2776, 13984,
- 2784, 3744, 2792, 11936, 2800, 7840, 2808, 16032, 2824, 8608, 2832, 4512, 2840, 12704, 2856, 10656,
- 2864, 6560, 2872, 14752, 2888, 9632, 2896, 5536, 2904, 13728, 2912, 3488, 2920, 11680, 2928, 7584,
- 2936, 15776, 2952, 9120, 2960, 5024, 2968, 13216, 2984, 11168, 2992, 7072, 3000, 15264, 3016, 10144,
- 3024, 6048, 3032, 14240, 3040, 4000, 3048, 12192, 3056, 8096, 3064, 16288, 3080, 8288, 3088, 4192,
- 3096, 12384, 3112, 10336, 3120, 6240, 3128, 14432, 3144, 9312, 3152, 5216, 3160, 13408, 3176, 11360,
- 3184, 7264, 3192, 15456, 3208, 8800, 3216, 4704, 3224, 12896, 3240, 10848, 3248, 6752, 3256, 14944,
- 3272, 9824, 3280, 5728, 3288, 13920, 3296, 3680, 3304, 11872, 3312, 7776, 3320, 15968, 3336, 8544,
- 3344, 4448, 3352, 12640, 3368, 10592, 3376, 6496, 3384, 14688, 3400, 9568, 3408, 5472, 3416, 13664,
- 3432, 11616, 3440, 7520, 3448, 15712, 3464, 9056, 3472, 4960, 3480, 13152, 3496, 11104, 3504, 7008,
- 3512, 15200, 3528, 10080, 3536, 5984, 3544, 14176, 3552, 3936, 3560, 12128, 3568, 8032, 3576, 16224,
- 3592, 8416, 3600, 4320, 3608, 12512, 3624, 10464, 3632, 6368, 3640, 14560, 3656, 9440, 3664, 5344,
- 3672, 13536, 3688, 11488, 3696, 7392, 3704, 15584, 3720, 8928, 3728, 4832, 3736, 13024, 3752, 10976,
- 3760, 6880, 3768, 15072, 3784, 9952, 3792, 5856, 3800, 14048, 3816, 12000, 3824, 7904, 3832, 16096,
- 3848, 8672, 3856, 4576, 3864, 12768, 3880, 10720, 3888, 6624, 3896, 14816, 3912, 9696, 3920, 5600,
- 3928, 13792, 3944, 11744, 3952, 7648, 3960, 15840, 3976, 9184, 3984, 5088, 3992, 13280, 4008, 11232,
- 4016, 7136, 4024, 15328, 4040, 10208, 4048, 6112, 4056, 14304, 4072, 12256, 4080, 8160, 4088, 16352,
- 4104, 8208, 4120, 12304, 4136, 10256, 4144, 6160, 4152, 14352, 4168, 9232, 4176, 5136, 4184, 13328,
- 4200, 11280, 4208, 7184, 4216, 15376, 4232, 8720, 4240, 4624, 4248, 12816, 4264, 10768, 4272, 6672,
- 4280, 14864, 4296, 9744, 4304, 5648, 4312, 13840, 4328, 11792, 4336, 7696, 4344, 15888, 4360, 8464,
- 4376, 12560, 4392, 10512, 4400, 6416, 4408, 14608, 4424, 9488, 4432, 5392, 4440, 13584, 4456, 11536,
- 4464, 7440, 4472, 15632, 4488, 8976, 4496, 4880, 4504, 13072, 4520, 11024, 4528, 6928, 4536, 15120,
- 4552, 10000, 4560, 5904, 4568, 14096, 4584, 12048, 4592, 7952, 4600, 16144, 4616, 8336, 4632, 12432,
- 4648, 10384, 4656, 6288, 4664, 14480, 4680, 9360, 4688, 5264, 4696, 13456, 4712, 11408, 4720, 7312,
- 4728, 15504, 4744, 8848, 4760, 12944, 4776, 10896, 4784, 6800, 4792, 14992, 4808, 9872, 4816, 5776,
- 4824, 13968, 4840, 11920, 4848, 7824, 4856, 16016, 4872, 8592, 4888, 12688, 4904, 10640, 4912, 6544,
- 4920, 14736, 4936, 9616, 4944, 5520, 4952, 13712, 4968, 11664, 4976, 7568, 4984, 15760, 5000, 9104,
- 5016, 13200, 5032, 11152, 5040, 7056, 5048, 15248, 5064, 10128, 5072, 6032, 5080, 14224, 5096, 12176,
- 5104, 8080, 5112, 16272, 5128, 8272, 5144, 12368, 5160, 10320, 5168, 6224, 5176, 14416, 5192, 9296,
- 5208, 13392, 5224, 11344, 5232, 7248, 5240, 15440, 5256, 8784, 5272, 12880, 5288, 10832, 5296, 6736,
- 5304, 14928, 5320, 9808, 5328, 5712, 5336, 13904, 5352, 11856, 5360, 7760, 5368, 15952, 5384, 8528,
- 5400, 12624, 5416, 10576, 5424, 6480, 5432, 14672, 5448, 9552, 5464, 13648, 5480, 11600, 5488, 7504,
- 5496, 15696, 5512, 9040, 5528, 13136, 5544, 11088, 5552, 6992, 5560, 15184, 5576, 10064, 5584, 5968,
- 5592, 14160, 5608, 12112, 5616, 8016, 5624, 16208, 5640, 8400, 5656, 12496, 5672, 10448, 5680, 6352,
- 5688, 14544, 5704, 9424, 5720, 13520, 5736, 11472, 5744, 7376, 5752, 15568, 5768, 8912, 5784, 13008,
- 5800, 10960, 5808, 6864, 5816, 15056, 5832, 9936, 5848, 14032, 5864, 11984, 5872, 7888, 5880, 16080,
- 5896, 8656, 5912, 12752, 5928, 10704, 5936, 6608, 5944, 14800, 5960, 9680, 5976, 13776, 5992, 11728,
- 6000, 7632, 6008, 15824, 6024, 9168, 6040, 13264, 6056, 11216, 6064, 7120, 6072, 15312, 6088, 10192,
- 6104, 14288, 6120, 12240, 6128, 8144, 6136, 16336, 6152, 8240, 6168, 12336, 6184, 10288, 6200, 14384,
- 6216, 9264, 6232, 13360, 6248, 11312, 6256, 7216, 6264, 15408, 6280, 8752, 6296, 12848, 6312, 10800,
- 6320, 6704, 6328, 14896, 6344, 9776, 6360, 13872, 6376, 11824, 6384, 7728, 6392, 15920, 6408, 8496,
- 6424, 12592, 6440, 10544, 6456, 14640, 6472, 9520, 6488, 13616, 6504, 11568, 6512, 7472, 6520, 15664,
- 6536, 9008, 6552, 13104, 6568, 11056, 6576, 6960, 6584, 15152, 6600, 10032, 6616, 14128, 6632, 12080,
- 6640, 7984, 6648, 16176, 6664, 8368, 6680, 12464, 6696, 10416, 6712, 14512, 6728, 9392, 6744, 13488,
- 6760, 11440, 6768, 7344, 6776, 15536, 6792, 8880, 6808, 12976, 6824, 10928, 6840, 15024, 6856, 9904,
- 6872, 14000, 6888, 11952, 6896, 7856, 6904, 16048, 6920, 8624, 6936, 12720, 6952, 10672, 6968, 14768,
- 6984, 9648, 7000, 13744, 7016, 11696, 7024, 7600, 7032, 15792, 7048, 9136, 7064, 13232, 7080, 11184,
- 7096, 15280, 7112, 10160, 7128, 14256, 7144, 12208, 7152, 8112, 7160, 16304, 7176, 8304, 7192, 12400,
- 7208, 10352, 7224, 14448, 7240, 9328, 7256, 13424, 7272, 11376, 7288, 15472, 7304, 8816, 7320, 12912,
- 7336, 10864, 7352, 14960, 7368, 9840, 7384, 13936, 7400, 11888, 7408, 7792, 7416, 15984, 7432, 8560,
- 7448, 12656, 7464, 10608, 7480, 14704, 7496, 9584, 7512, 13680, 7528, 11632, 7544, 15728, 7560, 9072,
- 7576, 13168, 7592, 11120, 7608, 15216, 7624, 10096, 7640, 14192, 7656, 12144, 7664, 8048, 7672, 16240,
- 7688, 8432, 7704, 12528, 7720, 10480, 7736, 14576, 7752, 9456, 7768, 13552, 7784, 11504, 7800, 15600,
- 7816, 8944, 7832, 13040, 7848, 10992, 7864, 15088, 7880, 9968, 7896, 14064, 7912, 12016, 7928, 16112,
- 7944, 8688, 7960, 12784, 7976, 10736, 7992, 14832, 8008, 9712, 8024, 13808, 8040, 11760, 8056, 15856,
- 8072, 9200, 8088, 13296, 8104, 11248, 8120, 15344, 8136, 10224, 8152, 14320, 8168, 12272, 8184, 16368,
- 8216, 12296, 8232, 10248, 8248, 14344, 8264, 9224, 8280, 13320, 8296, 11272, 8312, 15368, 8328, 8712,
- 8344, 12808, 8360, 10760, 8376, 14856, 8392, 9736, 8408, 13832, 8424, 11784, 8440, 15880, 8472, 12552,
- 8488, 10504, 8504, 14600, 8520, 9480, 8536, 13576, 8552, 11528, 8568, 15624, 8584, 8968, 8600, 13064,
- 8616, 11016, 8632, 15112, 8648, 9992, 8664, 14088, 8680, 12040, 8696, 16136, 8728, 12424, 8744, 10376,
- 8760, 14472, 8776, 9352, 8792, 13448, 8808, 11400, 8824, 15496, 8856, 12936, 8872, 10888, 8888, 14984,
- 8904, 9864, 8920, 13960, 8936, 11912, 8952, 16008, 8984, 12680, 9000, 10632, 9016, 14728, 9032, 9608,
- 9048, 13704, 9064, 11656, 9080, 15752, 9112, 13192, 9128, 11144, 9144, 15240, 9160, 10120, 9176, 14216,
- 9192, 12168, 9208, 16264, 9240, 12360, 9256, 10312, 9272, 14408, 9304, 13384, 9320, 11336, 9336, 15432,
- 9368, 12872, 9384, 10824, 9400, 14920, 9416, 9800, 9432, 13896, 9448, 11848, 9464, 15944, 9496, 12616,
- 9512, 10568, 9528, 14664, 9560, 13640, 9576, 11592, 9592, 15688, 9624, 13128, 9640, 11080, 9656, 15176,
- 9672, 10056, 9688, 14152, 9704, 12104, 9720, 16200, 9752, 12488, 9768, 10440, 9784, 14536, 9816, 13512,
- 9832, 11464, 9848, 15560, 9880, 13000, 9896, 10952, 9912, 15048, 9944, 14024, 9960, 11976, 9976, 16072,
- 10008, 12744, 10024, 10696, 10040, 14792, 10072, 13768, 10088, 11720, 10104, 15816, 10136, 13256, 10152, 11208,
- 10168, 15304, 10200, 14280, 10216, 12232, 10232, 16328, 10264, 12328, 10296, 14376, 10328, 13352, 10344, 11304,
- 10360, 15400, 10392, 12840, 10408, 10792, 10424, 14888, 10456, 13864, 10472, 11816, 10488, 15912, 10520, 12584,
- 10552, 14632, 10584, 13608, 10600, 11560, 10616, 15656, 10648, 13096, 10664, 11048, 10680, 15144, 10712, 14120,
- 10728, 12072, 10744, 16168, 10776, 12456, 10808, 14504, 10840, 13480, 10856, 11432, 10872, 15528, 10904, 12968,
- 10936, 15016, 10968, 13992, 10984, 11944, 11000, 16040, 11032, 12712, 11064, 14760, 11096, 13736, 11112, 11688,
- 11128, 15784, 11160, 13224, 11192, 15272, 11224, 14248, 11240, 12200, 11256, 16296, 11288, 12392, 11320, 14440,
- 11352, 13416, 11384, 15464, 11416, 12904, 11448, 14952, 11480, 13928, 11496, 11880, 11512, 15976, 11544, 12648,
- 11576, 14696, 11608, 13672, 11640, 15720, 11672, 13160, 11704, 15208, 11736, 14184, 11752, 12136, 11768, 16232,
- 11800, 12520, 11832, 14568, 11864, 13544, 11896, 15592, 11928, 13032, 11960, 15080, 11992, 14056, 12024, 16104,
- 12056, 12776, 12088, 14824, 12120, 13800, 12152, 15848, 12184, 13288, 12216, 15336, 12248, 14312, 12280, 16360,
- 12344, 14360, 12376, 13336, 12408, 15384, 12440, 12824, 12472, 14872, 12504, 13848, 12536, 15896, 12600, 14616,
- 12632, 13592, 12664, 15640, 12696, 13080, 12728, 15128, 12760, 14104, 12792, 16152, 12856, 14488, 12888, 13464,
- 12920, 15512, 12984, 15000, 13016, 13976, 13048, 16024, 13112, 14744, 13144, 13720, 13176, 15768, 13240, 15256,
- 13272, 14232, 13304, 16280, 13368, 14424, 13432, 15448, 13496, 14936, 13528, 13912, 13560, 15960, 13624, 14680,
- 13688, 15704, 13752, 15192, 13784, 14168, 13816, 16216, 13880, 14552, 13944, 15576, 14008, 15064, 14072, 16088,
- 14136, 14808, 14200, 15832, 14264, 15320, 14328, 16344, 14456, 15416, 14520, 14904, 14584, 15928, 14712, 15672,
- 14776, 15160, 14840, 16184, 14968, 15544, 15096, 16056, 15224, 15800, 15352, 16312, 15608, 15992, 15864, 16248,
-};
-
-const uint16_t bitrev2r_table_4096_fc32[] = {
- 8, 16384, 16, 8192, 24, 24576, 32, 4096, 40, 20480, 48, 12288, 56, 28672, 64, 2048,
- 72, 18432, 80, 10240, 88, 26624, 96, 6144, 104, 22528, 112, 14336, 120, 30720, 128, 1024,
- 136, 17408, 144, 9216, 152, 25600, 160, 5120, 168, 21504, 176, 13312, 184, 29696, 192, 3072,
- 200, 19456, 208, 11264, 216, 27648, 224, 7168, 232, 23552, 240, 15360, 248, 31744, 256, 512,
- 264, 16896, 272, 8704, 280, 25088, 288, 4608, 296, 20992, 304, 12800, 312, 29184, 320, 2560,
- 328, 18944, 336, 10752, 344, 27136, 352, 6656, 360, 23040, 368, 14848, 376, 31232, 384, 1536,
- 392, 17920, 400, 9728, 408, 26112, 416, 5632, 424, 22016, 432, 13824, 440, 30208, 448, 3584,
- 456, 19968, 464, 11776, 472, 28160, 480, 7680, 488, 24064, 496, 15872, 504, 32256, 520, 16640,
- 528, 8448, 536, 24832, 544, 4352, 552, 20736, 560, 12544, 568, 28928, 576, 2304, 584, 18688,
- 592, 10496, 600, 26880, 608, 6400, 616, 22784, 624, 14592, 632, 30976, 640, 1280, 648, 17664,
- 656, 9472, 664, 25856, 672, 5376, 680, 21760, 688, 13568, 696, 29952, 704, 3328, 712, 19712,
- 720, 11520, 728, 27904, 736, 7424, 744, 23808, 752, 15616, 760, 32000, 776, 17152, 784, 8960,
- 792, 25344, 800, 4864, 808, 21248, 816, 13056, 824, 29440, 832, 2816, 840, 19200, 848, 11008,
- 856, 27392, 864, 6912, 872, 23296, 880, 15104, 888, 31488, 896, 1792, 904, 18176, 912, 9984,
- 920, 26368, 928, 5888, 936, 22272, 944, 14080, 952, 30464, 960, 3840, 968, 20224, 976, 12032,
- 984, 28416, 992, 7936, 1000, 24320, 1008, 16128, 1016, 32512, 1032, 16512, 1040, 8320, 1048, 24704,
- 1056, 4224, 1064, 20608, 1072, 12416, 1080, 28800, 1088, 2176, 1096, 18560, 1104, 10368, 1112, 26752,
- 1120, 6272, 1128, 22656, 1136, 14464, 1144, 30848, 1160, 17536, 1168, 9344, 1176, 25728, 1184, 5248,
- 1192, 21632, 1200, 13440, 1208, 29824, 1216, 3200, 1224, 19584, 1232, 11392, 1240, 27776, 1248, 7296,
- 1256, 23680, 1264, 15488, 1272, 31872, 1288, 17024, 1296, 8832, 1304, 25216, 1312, 4736, 1320, 21120,
- 1328, 12928, 1336, 29312, 1344, 2688, 1352, 19072, 1360, 10880, 1368, 27264, 1376, 6784, 1384, 23168,
- 1392, 14976, 1400, 31360, 1408, 1664, 1416, 18048, 1424, 9856, 1432, 26240, 1440, 5760, 1448, 22144,
- 1456, 13952, 1464, 30336, 1472, 3712, 1480, 20096, 1488, 11904, 1496, 28288, 1504, 7808, 1512, 24192,
- 1520, 16000, 1528, 32384, 1544, 16768, 1552, 8576, 1560, 24960, 1568, 4480, 1576, 20864, 1584, 12672,
- 1592, 29056, 1600, 2432, 1608, 18816, 1616, 10624, 1624, 27008, 1632, 6528, 1640, 22912, 1648, 14720,
- 1656, 31104, 1672, 17792, 1680, 9600, 1688, 25984, 1696, 5504, 1704, 21888, 1712, 13696, 1720, 30080,
- 1728, 3456, 1736, 19840, 1744, 11648, 1752, 28032, 1760, 7552, 1768, 23936, 1776, 15744, 1784, 32128,
- 1800, 17280, 1808, 9088, 1816, 25472, 1824, 4992, 1832, 21376, 1840, 13184, 1848, 29568, 1856, 2944,
- 1864, 19328, 1872, 11136, 1880, 27520, 1888, 7040, 1896, 23424, 1904, 15232, 1912, 31616, 1928, 18304,
- 1936, 10112, 1944, 26496, 1952, 6016, 1960, 22400, 1968, 14208, 1976, 30592, 1984, 3968, 1992, 20352,
- 2000, 12160, 2008, 28544, 2016, 8064, 2024, 24448, 2032, 16256, 2040, 32640, 2056, 16448, 2064, 8256,
- 2072, 24640, 2080, 4160, 2088, 20544, 2096, 12352, 2104, 28736, 2120, 18496, 2128, 10304, 2136, 26688,
- 2144, 6208, 2152, 22592, 2160, 14400, 2168, 30784, 2184, 17472, 2192, 9280, 2200, 25664, 2208, 5184,
- 2216, 21568, 2224, 13376, 2232, 29760, 2240, 3136, 2248, 19520, 2256, 11328, 2264, 27712, 2272, 7232,
- 2280, 23616, 2288, 15424, 2296, 31808, 2312, 16960, 2320, 8768, 2328, 25152, 2336, 4672, 2344, 21056,
- 2352, 12864, 2360, 29248, 2368, 2624, 2376, 19008, 2384, 10816, 2392, 27200, 2400, 6720, 2408, 23104,
- 2416, 14912, 2424, 31296, 2440, 17984, 2448, 9792, 2456, 26176, 2464, 5696, 2472, 22080, 2480, 13888,
- 2488, 30272, 2496, 3648, 2504, 20032, 2512, 11840, 2520, 28224, 2528, 7744, 2536, 24128, 2544, 15936,
- 2552, 32320, 2568, 16704, 2576, 8512, 2584, 24896, 2592, 4416, 2600, 20800, 2608, 12608, 2616, 28992,
- 2632, 18752, 2640, 10560, 2648, 26944, 2656, 6464, 2664, 22848, 2672, 14656, 2680, 31040, 2696, 17728,
- 2704, 9536, 2712, 25920, 2720, 5440, 2728, 21824, 2736, 13632, 2744, 30016, 2752, 3392, 2760, 19776,
- 2768, 11584, 2776, 27968, 2784, 7488, 2792, 23872, 2800, 15680, 2808, 32064, 2824, 17216, 2832, 9024,
- 2840, 25408, 2848, 4928, 2856, 21312, 2864, 13120, 2872, 29504, 2888, 19264, 2896, 11072, 2904, 27456,
- 2912, 6976, 2920, 23360, 2928, 15168, 2936, 31552, 2952, 18240, 2960, 10048, 2968, 26432, 2976, 5952,
- 2984, 22336, 2992, 14144, 3000, 30528, 3008, 3904, 3016, 20288, 3024, 12096, 3032, 28480, 3040, 8000,
- 3048, 24384, 3056, 16192, 3064, 32576, 3080, 16576, 3088, 8384, 3096, 24768, 3104, 4288, 3112, 20672,
- 3120, 12480, 3128, 28864, 3144, 18624, 3152, 10432, 3160, 26816, 3168, 6336, 3176, 22720, 3184, 14528,
- 3192, 30912, 3208, 17600, 3216, 9408, 3224, 25792, 3232, 5312, 3240, 21696, 3248, 13504, 3256, 29888,
- 3272, 19648, 3280, 11456, 3288, 27840, 3296, 7360, 3304, 23744, 3312, 15552, 3320, 31936, 3336, 17088,
- 3344, 8896, 3352, 25280, 3360, 4800, 3368, 21184, 3376, 12992, 3384, 29376, 3400, 19136, 3408, 10944,
- 3416, 27328, 3424, 6848, 3432, 23232, 3440, 15040, 3448, 31424, 3464, 18112, 3472, 9920, 3480, 26304,
- 3488, 5824, 3496, 22208, 3504, 14016, 3512, 30400, 3520, 3776, 3528, 20160, 3536, 11968, 3544, 28352,
- 3552, 7872, 3560, 24256, 3568, 16064, 3576, 32448, 3592, 16832, 3600, 8640, 3608, 25024, 3616, 4544,
- 3624, 20928, 3632, 12736, 3640, 29120, 3656, 18880, 3664, 10688, 3672, 27072, 3680, 6592, 3688, 22976,
- 3696, 14784, 3704, 31168, 3720, 17856, 3728, 9664, 3736, 26048, 3744, 5568, 3752, 21952, 3760, 13760,
- 3768, 30144, 3784, 19904, 3792, 11712, 3800, 28096, 3808, 7616, 3816, 24000, 3824, 15808, 3832, 32192,
- 3848, 17344, 3856, 9152, 3864, 25536, 3872, 5056, 3880, 21440, 3888, 13248, 3896, 29632, 3912, 19392,
- 3920, 11200, 3928, 27584, 3936, 7104, 3944, 23488, 3952, 15296, 3960, 31680, 3976, 18368, 3984, 10176,
- 3992, 26560, 4000, 6080, 4008, 22464, 4016, 14272, 4024, 30656, 4040, 20416, 4048, 12224, 4056, 28608,
- 4064, 8128, 4072, 24512, 4080, 16320, 4088, 32704, 4104, 16416, 4112, 8224, 4120, 24608, 4136, 20512,
- 4144, 12320, 4152, 28704, 4168, 18464, 4176, 10272, 4184, 26656, 4192, 6176, 4200, 22560, 4208, 14368,
- 4216, 30752, 4232, 17440, 4240, 9248, 4248, 25632, 4256, 5152, 4264, 21536, 4272, 13344, 4280, 29728,
- 4296, 19488, 4304, 11296, 4312, 27680, 4320, 7200, 4328, 23584, 4336, 15392, 4344, 31776, 4360, 16928,
- 4368, 8736, 4376, 25120, 4384, 4640, 4392, 21024, 4400, 12832, 4408, 29216, 4424, 18976, 4432, 10784,
- 4440, 27168, 4448, 6688, 4456, 23072, 4464, 14880, 4472, 31264, 4488, 17952, 4496, 9760, 4504, 26144,
- 4512, 5664, 4520, 22048, 4528, 13856, 4536, 30240, 4552, 20000, 4560, 11808, 4568, 28192, 4576, 7712,
- 4584, 24096, 4592, 15904, 4600, 32288, 4616, 16672, 4624, 8480, 4632, 24864, 4648, 20768, 4656, 12576,
- 4664, 28960, 4680, 18720, 4688, 10528, 4696, 26912, 4704, 6432, 4712, 22816, 4720, 14624, 4728, 31008,
- 4744, 17696, 4752, 9504, 4760, 25888, 4768, 5408, 4776, 21792, 4784, 13600, 4792, 29984, 4808, 19744,
- 4816, 11552, 4824, 27936, 4832, 7456, 4840, 23840, 4848, 15648, 4856, 32032, 4872, 17184, 4880, 8992,
- 4888, 25376, 4904, 21280, 4912, 13088, 4920, 29472, 4936, 19232, 4944, 11040, 4952, 27424, 4960, 6944,
- 4968, 23328, 4976, 15136, 4984, 31520, 5000, 18208, 5008, 10016, 5016, 26400, 5024, 5920, 5032, 22304,
- 5040, 14112, 5048, 30496, 5064, 20256, 5072, 12064, 5080, 28448, 5088, 7968, 5096, 24352, 5104, 16160,
- 5112, 32544, 5128, 16544, 5136, 8352, 5144, 24736, 5160, 20640, 5168, 12448, 5176, 28832, 5192, 18592,
- 5200, 10400, 5208, 26784, 5216, 6304, 5224, 22688, 5232, 14496, 5240, 30880, 5256, 17568, 5264, 9376,
- 5272, 25760, 5288, 21664, 5296, 13472, 5304, 29856, 5320, 19616, 5328, 11424, 5336, 27808, 5344, 7328,
- 5352, 23712, 5360, 15520, 5368, 31904, 5384, 17056, 5392, 8864, 5400, 25248, 5416, 21152, 5424, 12960,
- 5432, 29344, 5448, 19104, 5456, 10912, 5464, 27296, 5472, 6816, 5480, 23200, 5488, 15008, 5496, 31392,
- 5512, 18080, 5520, 9888, 5528, 26272, 5536, 5792, 5544, 22176, 5552, 13984, 5560, 30368, 5576, 20128,
- 5584, 11936, 5592, 28320, 5600, 7840, 5608, 24224, 5616, 16032, 5624, 32416, 5640, 16800, 5648, 8608,
- 5656, 24992, 5672, 20896, 5680, 12704, 5688, 29088, 5704, 18848, 5712, 10656, 5720, 27040, 5728, 6560,
- 5736, 22944, 5744, 14752, 5752, 31136, 5768, 17824, 5776, 9632, 5784, 26016, 5800, 21920, 5808, 13728,
- 5816, 30112, 5832, 19872, 5840, 11680, 5848, 28064, 5856, 7584, 5864, 23968, 5872, 15776, 5880, 32160,
- 5896, 17312, 5904, 9120, 5912, 25504, 5928, 21408, 5936, 13216, 5944, 29600, 5960, 19360, 5968, 11168,
- 5976, 27552, 5984, 7072, 5992, 23456, 6000, 15264, 6008, 31648, 6024, 18336, 6032, 10144, 6040, 26528,
- 6056, 22432, 6064, 14240, 6072, 30624, 6088, 20384, 6096, 12192, 6104, 28576, 6112, 8096, 6120, 24480,
- 6128, 16288, 6136, 32672, 6152, 16480, 6160, 8288, 6168, 24672, 6184, 20576, 6192, 12384, 6200, 28768,
- 6216, 18528, 6224, 10336, 6232, 26720, 6248, 22624, 6256, 14432, 6264, 30816, 6280, 17504, 6288, 9312,
- 6296, 25696, 6312, 21600, 6320, 13408, 6328, 29792, 6344, 19552, 6352, 11360, 6360, 27744, 6368, 7264,
- 6376, 23648, 6384, 15456, 6392, 31840, 6408, 16992, 6416, 8800, 6424, 25184, 6440, 21088, 6448, 12896,
- 6456, 29280, 6472, 19040, 6480, 10848, 6488, 27232, 6496, 6752, 6504, 23136, 6512, 14944, 6520, 31328,
- 6536, 18016, 6544, 9824, 6552, 26208, 6568, 22112, 6576, 13920, 6584, 30304, 6600, 20064, 6608, 11872,
- 6616, 28256, 6624, 7776, 6632, 24160, 6640, 15968, 6648, 32352, 6664, 16736, 6672, 8544, 6680, 24928,
- 6696, 20832, 6704, 12640, 6712, 29024, 6728, 18784, 6736, 10592, 6744, 26976, 6760, 22880, 6768, 14688,
- 6776, 31072, 6792, 17760, 6800, 9568, 6808, 25952, 6824, 21856, 6832, 13664, 6840, 30048, 6856, 19808,
- 6864, 11616, 6872, 28000, 6880, 7520, 6888, 23904, 6896, 15712, 6904, 32096, 6920, 17248, 6928, 9056,
- 6936, 25440, 6952, 21344, 6960, 13152, 6968, 29536, 6984, 19296, 6992, 11104, 7000, 27488, 7016, 23392,
- 7024, 15200, 7032, 31584, 7048, 18272, 7056, 10080, 7064, 26464, 7080, 22368, 7088, 14176, 7096, 30560,
- 7112, 20320, 7120, 12128, 7128, 28512, 7136, 8032, 7144, 24416, 7152, 16224, 7160, 32608, 7176, 16608,
- 7184, 8416, 7192, 24800, 7208, 20704, 7216, 12512, 7224, 28896, 7240, 18656, 7248, 10464, 7256, 26848,
- 7272, 22752, 7280, 14560, 7288, 30944, 7304, 17632, 7312, 9440, 7320, 25824, 7336, 21728, 7344, 13536,
- 7352, 29920, 7368, 19680, 7376, 11488, 7384, 27872, 7400, 23776, 7408, 15584, 7416, 31968, 7432, 17120,
- 7440, 8928, 7448, 25312, 7464, 21216, 7472, 13024, 7480, 29408, 7496, 19168, 7504, 10976, 7512, 27360,
- 7528, 23264, 7536, 15072, 7544, 31456, 7560, 18144, 7568, 9952, 7576, 26336, 7592, 22240, 7600, 14048,
- 7608, 30432, 7624, 20192, 7632, 12000, 7640, 28384, 7648, 7904, 7656, 24288, 7664, 16096, 7672, 32480,
- 7688, 16864, 7696, 8672, 7704, 25056, 7720, 20960, 7728, 12768, 7736, 29152, 7752, 18912, 7760, 10720,
- 7768, 27104, 7784, 23008, 7792, 14816, 7800, 31200, 7816, 17888, 7824, 9696, 7832, 26080, 7848, 21984,
- 7856, 13792, 7864, 30176, 7880, 19936, 7888, 11744, 7896, 28128, 7912, 24032, 7920, 15840, 7928, 32224,
- 7944, 17376, 7952, 9184, 7960, 25568, 7976, 21472, 7984, 13280, 7992, 29664, 8008, 19424, 8016, 11232,
- 8024, 27616, 8040, 23520, 8048, 15328, 8056, 31712, 8072, 18400, 8080, 10208, 8088, 26592, 8104, 22496,
- 8112, 14304, 8120, 30688, 8136, 20448, 8144, 12256, 8152, 28640, 8168, 24544, 8176, 16352, 8184, 32736,
- 8200, 16400, 8216, 24592, 8232, 20496, 8240, 12304, 8248, 28688, 8264, 18448, 8272, 10256, 8280, 26640,
- 8296, 22544, 8304, 14352, 8312, 30736, 8328, 17424, 8336, 9232, 8344, 25616, 8360, 21520, 8368, 13328,
- 8376, 29712, 8392, 19472, 8400, 11280, 8408, 27664, 8424, 23568, 8432, 15376, 8440, 31760, 8456, 16912,
- 8464, 8720, 8472, 25104, 8488, 21008, 8496, 12816, 8504, 29200, 8520, 18960, 8528, 10768, 8536, 27152,
- 8552, 23056, 8560, 14864, 8568, 31248, 8584, 17936, 8592, 9744, 8600, 26128, 8616, 22032, 8624, 13840,
- 8632, 30224, 8648, 19984, 8656, 11792, 8664, 28176, 8680, 24080, 8688, 15888, 8696, 32272, 8712, 16656,
- 8728, 24848, 8744, 20752, 8752, 12560, 8760, 28944, 8776, 18704, 8784, 10512, 8792, 26896, 8808, 22800,
- 8816, 14608, 8824, 30992, 8840, 17680, 8848, 9488, 8856, 25872, 8872, 21776, 8880, 13584, 8888, 29968,
- 8904, 19728, 8912, 11536, 8920, 27920, 8936, 23824, 8944, 15632, 8952, 32016, 8968, 17168, 8984, 25360,
- 9000, 21264, 9008, 13072, 9016, 29456, 9032, 19216, 9040, 11024, 9048, 27408, 9064, 23312, 9072, 15120,
- 9080, 31504, 9096, 18192, 9104, 10000, 9112, 26384, 9128, 22288, 9136, 14096, 9144, 30480, 9160, 20240,
- 9168, 12048, 9176, 28432, 9192, 24336, 9200, 16144, 9208, 32528, 9224, 16528, 9240, 24720, 9256, 20624,
- 9264, 12432, 9272, 28816, 9288, 18576, 9296, 10384, 9304, 26768, 9320, 22672, 9328, 14480, 9336, 30864,
- 9352, 17552, 9368, 25744, 9384, 21648, 9392, 13456, 9400, 29840, 9416, 19600, 9424, 11408, 9432, 27792,
- 9448, 23696, 9456, 15504, 9464, 31888, 9480, 17040, 9496, 25232, 9512, 21136, 9520, 12944, 9528, 29328,
- 9544, 19088, 9552, 10896, 9560, 27280, 9576, 23184, 9584, 14992, 9592, 31376, 9608, 18064, 9616, 9872,
- 9624, 26256, 9640, 22160, 9648, 13968, 9656, 30352, 9672, 20112, 9680, 11920, 9688, 28304, 9704, 24208,
- 9712, 16016, 9720, 32400, 9736, 16784, 9752, 24976, 9768, 20880, 9776, 12688, 9784, 29072, 9800, 18832,
- 9808, 10640, 9816, 27024, 9832, 22928, 9840, 14736, 9848, 31120, 9864, 17808, 9880, 26000, 9896, 21904,
- 9904, 13712, 9912, 30096, 9928, 19856, 9936, 11664, 9944, 28048, 9960, 23952, 9968, 15760, 9976, 32144,
- 9992, 17296, 10008, 25488, 10024, 21392, 10032, 13200, 10040, 29584, 10056, 19344, 10064, 11152, 10072, 27536,
- 10088, 23440, 10096, 15248, 10104, 31632, 10120, 18320, 10136, 26512, 10152, 22416, 10160, 14224, 10168, 30608,
- 10184, 20368, 10192, 12176, 10200, 28560, 10216, 24464, 10224, 16272, 10232, 32656, 10248, 16464, 10264, 24656,
- 10280, 20560, 10288, 12368, 10296, 28752, 10312, 18512, 10328, 26704, 10344, 22608, 10352, 14416, 10360, 30800,
- 10376, 17488, 10392, 25680, 10408, 21584, 10416, 13392, 10424, 29776, 10440, 19536, 10448, 11344, 10456, 27728,
- 10472, 23632, 10480, 15440, 10488, 31824, 10504, 16976, 10520, 25168, 10536, 21072, 10544, 12880, 10552, 29264,
- 10568, 19024, 10576, 10832, 10584, 27216, 10600, 23120, 10608, 14928, 10616, 31312, 10632, 18000, 10648, 26192,
- 10664, 22096, 10672, 13904, 10680, 30288, 10696, 20048, 10704, 11856, 10712, 28240, 10728, 24144, 10736, 15952,
- 10744, 32336, 10760, 16720, 10776, 24912, 10792, 20816, 10800, 12624, 10808, 29008, 10824, 18768, 10840, 26960,
- 10856, 22864, 10864, 14672, 10872, 31056, 10888, 17744, 10904, 25936, 10920, 21840, 10928, 13648, 10936, 30032,
- 10952, 19792, 10960, 11600, 10968, 27984, 10984, 23888, 10992, 15696, 11000, 32080, 11016, 17232, 11032, 25424,
- 11048, 21328, 11056, 13136, 11064, 29520, 11080, 19280, 11096, 27472, 11112, 23376, 11120, 15184, 11128, 31568,
- 11144, 18256, 11160, 26448, 11176, 22352, 11184, 14160, 11192, 30544, 11208, 20304, 11216, 12112, 11224, 28496,
- 11240, 24400, 11248, 16208, 11256, 32592, 11272, 16592, 11288, 24784, 11304, 20688, 11312, 12496, 11320, 28880,
- 11336, 18640, 11352, 26832, 11368, 22736, 11376, 14544, 11384, 30928, 11400, 17616, 11416, 25808, 11432, 21712,
- 11440, 13520, 11448, 29904, 11464, 19664, 11480, 27856, 11496, 23760, 11504, 15568, 11512, 31952, 11528, 17104,
- 11544, 25296, 11560, 21200, 11568, 13008, 11576, 29392, 11592, 19152, 11608, 27344, 11624, 23248, 11632, 15056,
- 11640, 31440, 11656, 18128, 11672, 26320, 11688, 22224, 11696, 14032, 11704, 30416, 11720, 20176, 11728, 11984,
- 11736, 28368, 11752, 24272, 11760, 16080, 11768, 32464, 11784, 16848, 11800, 25040, 11816, 20944, 11824, 12752,
- 11832, 29136, 11848, 18896, 11864, 27088, 11880, 22992, 11888, 14800, 11896, 31184, 11912, 17872, 11928, 26064,
- 11944, 21968, 11952, 13776, 11960, 30160, 11976, 19920, 11992, 28112, 12008, 24016, 12016, 15824, 12024, 32208,
- 12040, 17360, 12056, 25552, 12072, 21456, 12080, 13264, 12088, 29648, 12104, 19408, 12120, 27600, 12136, 23504,
- 12144, 15312, 12152, 31696, 12168, 18384, 12184, 26576, 12200, 22480, 12208, 14288, 12216, 30672, 12232, 20432,
- 12248, 28624, 12264, 24528, 12272, 16336, 12280, 32720, 12296, 16432, 12312, 24624, 12328, 20528, 12344, 28720,
- 12360, 18480, 12376, 26672, 12392, 22576, 12400, 14384, 12408, 30768, 12424, 17456, 12440, 25648, 12456, 21552,
- 12464, 13360, 12472, 29744, 12488, 19504, 12504, 27696, 12520, 23600, 12528, 15408, 12536, 31792, 12552, 16944,
- 12568, 25136, 12584, 21040, 12592, 12848, 12600, 29232, 12616, 18992, 12632, 27184, 12648, 23088, 12656, 14896,
- 12664, 31280, 12680, 17968, 12696, 26160, 12712, 22064, 12720, 13872, 12728, 30256, 12744, 20016, 12760, 28208,
- 12776, 24112, 12784, 15920, 12792, 32304, 12808, 16688, 12824, 24880, 12840, 20784, 12856, 28976, 12872, 18736,
- 12888, 26928, 12904, 22832, 12912, 14640, 12920, 31024, 12936, 17712, 12952, 25904, 12968, 21808, 12976, 13616,
- 12984, 30000, 13000, 19760, 13016, 27952, 13032, 23856, 13040, 15664, 13048, 32048, 13064, 17200, 13080, 25392,
- 13096, 21296, 13112, 29488, 13128, 19248, 13144, 27440, 13160, 23344, 13168, 15152, 13176, 31536, 13192, 18224,
- 13208, 26416, 13224, 22320, 13232, 14128, 13240, 30512, 13256, 20272, 13272, 28464, 13288, 24368, 13296, 16176,
- 13304, 32560, 13320, 16560, 13336, 24752, 13352, 20656, 13368, 28848, 13384, 18608, 13400, 26800, 13416, 22704,
- 13424, 14512, 13432, 30896, 13448, 17584, 13464, 25776, 13480, 21680, 13496, 29872, 13512, 19632, 13528, 27824,
- 13544, 23728, 13552, 15536, 13560, 31920, 13576, 17072, 13592, 25264, 13608, 21168, 13624, 29360, 13640, 19120,
- 13656, 27312, 13672, 23216, 13680, 15024, 13688, 31408, 13704, 18096, 13720, 26288, 13736, 22192, 13744, 14000,
- 13752, 30384, 13768, 20144, 13784, 28336, 13800, 24240, 13808, 16048, 13816, 32432, 13832, 16816, 13848, 25008,
- 13864, 20912, 13880, 29104, 13896, 18864, 13912, 27056, 13928, 22960, 13936, 14768, 13944, 31152, 13960, 17840,
- 13976, 26032, 13992, 21936, 14008, 30128, 14024, 19888, 14040, 28080, 14056, 23984, 14064, 15792, 14072, 32176,
- 14088, 17328, 14104, 25520, 14120, 21424, 14136, 29616, 14152, 19376, 14168, 27568, 14184, 23472, 14192, 15280,
- 14200, 31664, 14216, 18352, 14232, 26544, 14248, 22448, 14264, 30640, 14280, 20400, 14296, 28592, 14312, 24496,
- 14320, 16304, 14328, 32688, 14344, 16496, 14360, 24688, 14376, 20592, 14392, 28784, 14408, 18544, 14424, 26736,
- 14440, 22640, 14456, 30832, 14472, 17520, 14488, 25712, 14504, 21616, 14520, 29808, 14536, 19568, 14552, 27760,
- 14568, 23664, 14576, 15472, 14584, 31856, 14600, 17008, 14616, 25200, 14632, 21104, 14648, 29296, 14664, 19056,
- 14680, 27248, 14696, 23152, 14704, 14960, 14712, 31344, 14728, 18032, 14744, 26224, 14760, 22128, 14776, 30320,
- 14792, 20080, 14808, 28272, 14824, 24176, 14832, 15984, 14840, 32368, 14856, 16752, 14872, 24944, 14888, 20848,
- 14904, 29040, 14920, 18800, 14936, 26992, 14952, 22896, 14968, 31088, 14984, 17776, 15000, 25968, 15016, 21872,
- 15032, 30064, 15048, 19824, 15064, 28016, 15080, 23920, 15088, 15728, 15096, 32112, 15112, 17264, 15128, 25456,
- 15144, 21360, 15160, 29552, 15176, 19312, 15192, 27504, 15208, 23408, 15224, 31600, 15240, 18288, 15256, 26480,
- 15272, 22384, 15288, 30576, 15304, 20336, 15320, 28528, 15336, 24432, 15344, 16240, 15352, 32624, 15368, 16624,
- 15384, 24816, 15400, 20720, 15416, 28912, 15432, 18672, 15448, 26864, 15464, 22768, 15480, 30960, 15496, 17648,
- 15512, 25840, 15528, 21744, 15544, 29936, 15560, 19696, 15576, 27888, 15592, 23792, 15608, 31984, 15624, 17136,
- 15640, 25328, 15656, 21232, 15672, 29424, 15688, 19184, 15704, 27376, 15720, 23280, 15736, 31472, 15752, 18160,
- 15768, 26352, 15784, 22256, 15800, 30448, 15816, 20208, 15832, 28400, 15848, 24304, 15856, 16112, 15864, 32496,
- 15880, 16880, 15896, 25072, 15912, 20976, 15928, 29168, 15944, 18928, 15960, 27120, 15976, 23024, 15992, 31216,
- 16008, 17904, 16024, 26096, 16040, 22000, 16056, 30192, 16072, 19952, 16088, 28144, 16104, 24048, 16120, 32240,
- 16136, 17392, 16152, 25584, 16168, 21488, 16184, 29680, 16200, 19440, 16216, 27632, 16232, 23536, 16248, 31728,
- 16264, 18416, 16280, 26608, 16296, 22512, 16312, 30704, 16328, 20464, 16344, 28656, 16360, 24560, 16376, 32752,
- 16408, 24584, 16424, 20488, 16440, 28680, 16456, 18440, 16472, 26632, 16488, 22536, 16504, 30728, 16520, 17416,
- 16536, 25608, 16552, 21512, 16568, 29704, 16584, 19464, 16600, 27656, 16616, 23560, 16632, 31752, 16648, 16904,
- 16664, 25096, 16680, 21000, 16696, 29192, 16712, 18952, 16728, 27144, 16744, 23048, 16760, 31240, 16776, 17928,
- 16792, 26120, 16808, 22024, 16824, 30216, 16840, 19976, 16856, 28168, 16872, 24072, 16888, 32264, 16920, 24840,
- 16936, 20744, 16952, 28936, 16968, 18696, 16984, 26888, 17000, 22792, 17016, 30984, 17032, 17672, 17048, 25864,
- 17064, 21768, 17080, 29960, 17096, 19720, 17112, 27912, 17128, 23816, 17144, 32008, 17176, 25352, 17192, 21256,
- 17208, 29448, 17224, 19208, 17240, 27400, 17256, 23304, 17272, 31496, 17288, 18184, 17304, 26376, 17320, 22280,
- 17336, 30472, 17352, 20232, 17368, 28424, 17384, 24328, 17400, 32520, 17432, 24712, 17448, 20616, 17464, 28808,
- 17480, 18568, 17496, 26760, 17512, 22664, 17528, 30856, 17560, 25736, 17576, 21640, 17592, 29832, 17608, 19592,
- 17624, 27784, 17640, 23688, 17656, 31880, 17688, 25224, 17704, 21128, 17720, 29320, 17736, 19080, 17752, 27272,
- 17768, 23176, 17784, 31368, 17800, 18056, 17816, 26248, 17832, 22152, 17848, 30344, 17864, 20104, 17880, 28296,
- 17896, 24200, 17912, 32392, 17944, 24968, 17960, 20872, 17976, 29064, 17992, 18824, 18008, 27016, 18024, 22920,
- 18040, 31112, 18072, 25992, 18088, 21896, 18104, 30088, 18120, 19848, 18136, 28040, 18152, 23944, 18168, 32136,
- 18200, 25480, 18216, 21384, 18232, 29576, 18248, 19336, 18264, 27528, 18280, 23432, 18296, 31624, 18328, 26504,
- 18344, 22408, 18360, 30600, 18376, 20360, 18392, 28552, 18408, 24456, 18424, 32648, 18456, 24648, 18472, 20552,
- 18488, 28744, 18520, 26696, 18536, 22600, 18552, 30792, 18584, 25672, 18600, 21576, 18616, 29768, 18632, 19528,
- 18648, 27720, 18664, 23624, 18680, 31816, 18712, 25160, 18728, 21064, 18744, 29256, 18760, 19016, 18776, 27208,
- 18792, 23112, 18808, 31304, 18840, 26184, 18856, 22088, 18872, 30280, 18888, 20040, 18904, 28232, 18920, 24136,
- 18936, 32328, 18968, 24904, 18984, 20808, 19000, 29000, 19032, 26952, 19048, 22856, 19064, 31048, 19096, 25928,
- 19112, 21832, 19128, 30024, 19144, 19784, 19160, 27976, 19176, 23880, 19192, 32072, 19224, 25416, 19240, 21320,
- 19256, 29512, 19288, 27464, 19304, 23368, 19320, 31560, 19352, 26440, 19368, 22344, 19384, 30536, 19400, 20296,
- 19416, 28488, 19432, 24392, 19448, 32584, 19480, 24776, 19496, 20680, 19512, 28872, 19544, 26824, 19560, 22728,
- 19576, 30920, 19608, 25800, 19624, 21704, 19640, 29896, 19672, 27848, 19688, 23752, 19704, 31944, 19736, 25288,
- 19752, 21192, 19768, 29384, 19800, 27336, 19816, 23240, 19832, 31432, 19864, 26312, 19880, 22216, 19896, 30408,
- 19912, 20168, 19928, 28360, 19944, 24264, 19960, 32456, 19992, 25032, 20008, 20936, 20024, 29128, 20056, 27080,
- 20072, 22984, 20088, 31176, 20120, 26056, 20136, 21960, 20152, 30152, 20184, 28104, 20200, 24008, 20216, 32200,
- 20248, 25544, 20264, 21448, 20280, 29640, 20312, 27592, 20328, 23496, 20344, 31688, 20376, 26568, 20392, 22472,
- 20408, 30664, 20440, 28616, 20456, 24520, 20472, 32712, 20504, 24616, 20536, 28712, 20568, 26664, 20584, 22568,
- 20600, 30760, 20632, 25640, 20648, 21544, 20664, 29736, 20696, 27688, 20712, 23592, 20728, 31784, 20760, 25128,
- 20776, 21032, 20792, 29224, 20824, 27176, 20840, 23080, 20856, 31272, 20888, 26152, 20904, 22056, 20920, 30248,
- 20952, 28200, 20968, 24104, 20984, 32296, 21016, 24872, 21048, 28968, 21080, 26920, 21096, 22824, 21112, 31016,
- 21144, 25896, 21160, 21800, 21176, 29992, 21208, 27944, 21224, 23848, 21240, 32040, 21272, 25384, 21304, 29480,
- 21336, 27432, 21352, 23336, 21368, 31528, 21400, 26408, 21416, 22312, 21432, 30504, 21464, 28456, 21480, 24360,
- 21496, 32552, 21528, 24744, 21560, 28840, 21592, 26792, 21608, 22696, 21624, 30888, 21656, 25768, 21688, 29864,
- 21720, 27816, 21736, 23720, 21752, 31912, 21784, 25256, 21816, 29352, 21848, 27304, 21864, 23208, 21880, 31400,
- 21912, 26280, 21928, 22184, 21944, 30376, 21976, 28328, 21992, 24232, 22008, 32424, 22040, 25000, 22072, 29096,
- 22104, 27048, 22120, 22952, 22136, 31144, 22168, 26024, 22200, 30120, 22232, 28072, 22248, 23976, 22264, 32168,
- 22296, 25512, 22328, 29608, 22360, 27560, 22376, 23464, 22392, 31656, 22424, 26536, 22456, 30632, 22488, 28584,
- 22504, 24488, 22520, 32680, 22552, 24680, 22584, 28776, 22616, 26728, 22648, 30824, 22680, 25704, 22712, 29800,
- 22744, 27752, 22760, 23656, 22776, 31848, 22808, 25192, 22840, 29288, 22872, 27240, 22888, 23144, 22904, 31336,
- 22936, 26216, 22968, 30312, 23000, 28264, 23016, 24168, 23032, 32360, 23064, 24936, 23096, 29032, 23128, 26984,
- 23160, 31080, 23192, 25960, 23224, 30056, 23256, 28008, 23272, 23912, 23288, 32104, 23320, 25448, 23352, 29544,
- 23384, 27496, 23416, 31592, 23448, 26472, 23480, 30568, 23512, 28520, 23528, 24424, 23544, 32616, 23576, 24808,
- 23608, 28904, 23640, 26856, 23672, 30952, 23704, 25832, 23736, 29928, 23768, 27880, 23800, 31976, 23832, 25320,
- 23864, 29416, 23896, 27368, 23928, 31464, 23960, 26344, 23992, 30440, 24024, 28392, 24040, 24296, 24056, 32488,
- 24088, 25064, 24120, 29160, 24152, 27112, 24184, 31208, 24216, 26088, 24248, 30184, 24280, 28136, 24312, 32232,
- 24344, 25576, 24376, 29672, 24408, 27624, 24440, 31720, 24472, 26600, 24504, 30696, 24536, 28648, 24568, 32744,
- 24632, 28696, 24664, 26648, 24696, 30744, 24728, 25624, 24760, 29720, 24792, 27672, 24824, 31768, 24856, 25112,
- 24888, 29208, 24920, 27160, 24952, 31256, 24984, 26136, 25016, 30232, 25048, 28184, 25080, 32280, 25144, 28952,
- 25176, 26904, 25208, 31000, 25240, 25880, 25272, 29976, 25304, 27928, 25336, 32024, 25400, 29464, 25432, 27416,
- 25464, 31512, 25496, 26392, 25528, 30488, 25560, 28440, 25592, 32536, 25656, 28824, 25688, 26776, 25720, 30872,
- 25784, 29848, 25816, 27800, 25848, 31896, 25912, 29336, 25944, 27288, 25976, 31384, 26008, 26264, 26040, 30360,
- 26072, 28312, 26104, 32408, 26168, 29080, 26200, 27032, 26232, 31128, 26296, 30104, 26328, 28056, 26360, 32152,
- 26424, 29592, 26456, 27544, 26488, 31640, 26552, 30616, 26584, 28568, 26616, 32664, 26680, 28760, 26744, 30808,
- 26808, 29784, 26840, 27736, 26872, 31832, 26936, 29272, 26968, 27224, 27000, 31320, 27064, 30296, 27096, 28248,
- 27128, 32344, 27192, 29016, 27256, 31064, 27320, 30040, 27352, 27992, 27384, 32088, 27448, 29528, 27512, 31576,
- 27576, 30552, 27608, 28504, 27640, 32600, 27704, 28888, 27768, 30936, 27832, 29912, 27896, 31960, 27960, 29400,
- 28024, 31448, 28088, 30424, 28120, 28376, 28152, 32472, 28216, 29144, 28280, 31192, 28344, 30168, 28408, 32216,
- 28472, 29656, 28536, 31704, 28600, 30680, 28664, 32728, 28792, 30776, 28856, 29752, 28920, 31800, 28984, 29240,
- 29048, 31288, 29112, 30264, 29176, 32312, 29304, 31032, 29368, 30008, 29432, 32056, 29560, 31544, 29624, 30520,
- 29688, 32568, 29816, 30904, 29944, 31928, 30072, 31416, 30136, 30392, 30200, 32440, 30328, 31160, 30456, 32184,
- 30584, 31672, 30712, 32696, 30968, 31864, 31096, 31352, 31224, 32376, 31480, 32120, 31736, 32632, 32248, 32504,
-};
-
-void dsps_fft2r_rev_tables_init_fc32(void)
-{
- dsps_fft2r_rev_tables_fc32[0] = (uint16_t *)bitrev2r_table_16_fc32;
- dsps_fft2r_rev_tables_fc32[1] = (uint16_t *)bitrev2r_table_32_fc32;
- dsps_fft2r_rev_tables_fc32[2] = (uint16_t *)bitrev2r_table_64_fc32;
- dsps_fft2r_rev_tables_fc32[3] = (uint16_t *)bitrev2r_table_128_fc32;
- dsps_fft2r_rev_tables_fc32[4] = (uint16_t *)bitrev2r_table_256_fc32;
- dsps_fft2r_rev_tables_fc32[5] = (uint16_t *)bitrev2r_table_512_fc32;
- dsps_fft2r_rev_tables_fc32[6] = (uint16_t *)bitrev2r_table_1024_fc32;
- dsps_fft2r_rev_tables_fc32[7] = (uint16_t *)bitrev2r_table_2048_fc32;
- dsps_fft2r_rev_tables_fc32[8] = (uint16_t *)bitrev2r_table_4096_fc32;
-
-}
-
-uint16_t *dsps_fft2r_rev_tables_fc32[] = {
- (uint16_t *)bitrev2r_table_16_fc32,
- (uint16_t *)bitrev2r_table_32_fc32,
- (uint16_t *)bitrev2r_table_64_fc32,
- (uint16_t *)bitrev2r_table_128_fc32,
- (uint16_t *)bitrev2r_table_256_fc32,
- (uint16_t *)bitrev2r_table_512_fc32,
- (uint16_t *)bitrev2r_table_1024_fc32,
- (uint16_t *)bitrev2r_table_2048_fc32,
- (uint16_t *)bitrev2r_table_4096_fc32,
-};
-
-const uint16_t bitrev2r_table_16_fc32_size = 6;
-const uint16_t bitrev2r_table_32_fc32_size = 12;
-const uint16_t bitrev2r_table_64_fc32_size = 28;
-const uint16_t bitrev2r_table_128_fc32_size = 56;
-const uint16_t bitrev2r_table_256_fc32_size = 120;
-const uint16_t bitrev2r_table_512_fc32_size = 240;
-const uint16_t bitrev2r_table_1024_fc32_size = 496;
-const uint16_t bitrev2r_table_2048_fc32_size = 992;
-const uint16_t bitrev2r_table_4096_fc32_size = 2016;
-
-const uint16_t dsps_fft2r_rev_tables_fc32_size[] = {
- (const uint16_t)6, // bitrev2r_table_16_fc32_size,
- (const uint16_t)12, // bitrev2r_table_32_fc32_size,
- (const uint16_t)28, // bitrev2r_table_64_fc32_size,
- (const uint16_t)56, // bitrev2r_table_128_fc32_size,
- (const uint16_t)120, // bitrev2r_table_256_fc32_size,
- (const uint16_t)240, // bitrev2r_table_512_fc32_size,
- (const uint16_t)496, // bitrev2r_table_1024_fc32_size,
- (const uint16_t)992, // bitrev2r_table_2048_fc32_size,
- (const uint16_t)2016,// bitrev2r_table_4096_fc32_size,
-};
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32.c b/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32.c
deleted file mode 100644
index 1d7fc78..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r.h"
-#include "dsp_common.h"
-#include "dsp_types.h"
-#include
-#include "esp_attr.h"
-#include "dsps_fft2r_platform.h"
-
-#if (dsps_bit_rev_lookup_fc32_ae32_enabled == 1)
-
-esp_err_t dsps_bit_rev_lookup_fc32_ae32(float *data, int reverse_size, uint16_t *reverse_tab)
-{
- int idx_0, idx_1;
- int idx_2, idx_3;
-
- float *data_i;
-
- asm volatile ("addi %0, %1, 4" : "=a" (data_i) : "a" (data)); ///data_i = &data[1];
- asm volatile ("srli %0, %0, 1" : "+a" (reverse_size)); /// reverse_size >>= 1;
- asm volatile ("loopnez %0, __loop_end_radix2_reorder_lookup_table" :: "a" (reverse_size)); ///for (i = 0; i < reverse_size; i++) {
- asm volatile ("l16ui %0, %1, 0" : "=a" (idx_0) : "a" (reverse_tab)); //idx_0 = *(reverse_tab + 0); ///idx_0 = reverse_tab[i * 2 + 0];
- asm volatile ("l16ui %0, %1, 2" : "=a" (idx_1) : "a" (reverse_tab)); //idx_1 = *(reverse_tab + 1); ///idx_1 = reverse_tab[i * 2 + 1];
- asm volatile ("l16ui %0, %1, 4" : "=a" (idx_2) : "a" (reverse_tab)); //idx_2 = *(reverse_tab + 2); ///idx_2 = reverse_tab[i * 2 + 2];
- asm volatile ("l16ui %0, %1, 6" : "=a" (idx_3) : "a" (reverse_tab)); //idx_3 = *(reverse_tab + 3); ///idx_3 = reverse_tab[i * 2 + 3];
- asm volatile ("addi %0, %0, 8" : "+a" (reverse_tab)); // reverse_tab += 4;
-
- asm volatile ("lsx f0, %0, %1" :: "a" (data), "a" (idx_0)); // f0 = *(data + idx_0); //f0 = data[idx_0 + 0];
- asm volatile ("lsx f2, %0, %1" :: "a" (data_i), "a" (idx_0)); // f2 = *(data_i + idx_0); //f2 = data[idx_0 + 1];
- asm volatile ("lsx f1, %0, %1" :: "a" (data), "a" (idx_1)); //f1 = *(data + idx_1); //f1 = data[idx_1 + 0];
- asm volatile ("lsx f3, %0, %1" :: "a" (data_i), "a" (idx_1)); //f3 = *(data_i + idx_1); //f3 = data[idx_1 + 1];
-
- asm volatile ("ssx f0, %0, %1" :: "a" (data), "a" (idx_1)); //*(data + idx_1) = f0; //data[idx_1 + 0] = f0;
- asm volatile ("ssx f2, %0, %1" :: "a" (data_i), "a" (idx_1)); //*(data_i + idx_1) = f2; //data[idx_1 + 1] = f2;
- asm volatile ("ssx f1, %0, %1" :: "a" (data), "a" (idx_0)); //*(data + idx_0) = f1; //data[idx_0 + 0] = f1;
- asm volatile ("ssx f3, %0, %1" :: "a" (data_i), "a" (idx_0)); //*(data_i + idx_0) = f3;//data[idx_0 + 1] = f3;
-
- asm volatile ("lsx f0, %0, %1" :: "a" (data), "a" (idx_2)); // f0 = *(data + idx_2); //f0 = data[idx_2 + 0];
- asm volatile ("lsx f2, %0, %1" :: "a" (data_i), "a" (idx_2)); // f2 = *(data_i + idx_2); //f2 = data[idx_2 + 1];
- asm volatile ("lsx f1, %0, %1" :: "a" (data), "a" (idx_3)); //f1 = *(data + idx_3); //f1 = data[idx_3 + 0];
- asm volatile ("lsx f3, %0, %1" :: "a" (data_i), "a" (idx_3)); //f3 = *(data_i + idx_3); //f3 = data[idx_3 + 1];
-
- asm volatile ("ssx f0, %0, %1" :: "a" (data), "a" (idx_3)); //*(data + idx_3) = f0; //data[idx_3 + 0] = f0;
- asm volatile ("ssx f2, %0, %1" :: "a" (data_i), "a" (idx_3)); //*(data_i + idx_3) = f2; //data[idx_3 + 1] = f2;
- asm volatile ("ssx f1, %0, %1" :: "a" (data), "a" (idx_2)); //*(data + idx_2) = f1; //data[idx_2 + 0] = f1;
- asm volatile ("ssx f3, %0, %1" :: "a" (data_i), "a" (idx_2)); //*(data_i + idx_2) = f3; //data[idx_2 + 1] = f3;
- //}
- asm volatile("__loop_end_radix2_reorder_lookup_table: nop");
- return ESP_OK;
-}
-#endif // dsps_bit_rev_lookup_fc32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32_.S b/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32_.S
deleted file mode 100644
index bf27a64..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ae32_.S
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r_platform.h"
-#if (dsps_fft2r_fc32_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dsps_fft2r_fc32_ae32_
- .type dsps_fft2r_fc32_ae32_,@function
-
-// .extern dsps_fft_w_table_fc32;
- .global dsps_fft_w_table_fc32;
-
-// The function implements the following C code:
-//esp_err_t dsps_fft2r_fc32_ansi(float *data, int N)
-//{
-// float *w = dsps_fft_w_table_fc32;
-//
-// int ie, ia, m;
-// float re_temp, im_temp;
-// float c, s;
-// int N2 = N;
-// ie = 1;
-// for (int N2 = N/2; N2 > 0; N2 >>= 1) {
-// ia = 0;
-// for (int j = 0; j < ie; j++) {
-// c = w[2 * j];
-// s = w[2 * j + 1];
-// for (int i = 0; i < N2; i++) {
-// m = ia + N2;
-// re_temp = c * data[2 * m] + s * data[2 * m + 1];
-// im_temp = c * data[2 * m + 1] - s * data[2 * m];
-// data[2 * m] = data[2 * ia] - re_temp;
-// data[2 * m + 1] = data[2 * ia + 1] - im_temp;
-// data[2 * ia] = data[2 * ia] + re_temp;
-// data[2 * ia + 1] = data[2 * ia + 1] + im_temp;
-// ia++;
-// }
-// ia += N2;
-// }
-// ie <<= 1;
-// }
-// return result;
-//}
-
-
-dsps_fft2r_fc32_ae32_:
-//esp_err_t dsps_fft2r_fc32_ansi(float *data, int N, float* dsps_fft_w_table_fc32)
-
- entry a1, 16
- // Array increment for floating point data should be 4
-// data - a2
-// N - a3
-// dsps_fft_w_table_fc32 - a4 - for now
-
-// a6 - k, main loop counter; N2 - for (int N2 = N/2; N2 > 0; N2 >>= 1)
-// a7 - ie
-// a8 - j
-// a9 - test
-// a10 - (j*2)<<2, or a10 - j<<3
-// f0 - c or w[2 * j]
-// f1 - s or w[2 * j + 1]
-// a11 - ia
-// a12 - m
-// a13 - ia pointer
-// a14 - m pointer
-// f6 - re_temp
-// f7 - im_temp
-
-// a15 - debug
-
- // This instruction are not working. Have to be fixed!!!
- // For now theres no solution...
-// l32r a4, dsps_fft_w_table_fc32_ae32
-
- // Load shift register with 1
- movi.n a5, 1 // a5 = 1;
- ssr a5 // load shift register with 1
-
- srli a6, a3, 1 // a6 = N2 = N/2
- movi a7, 1 // a7 - ie
-
-fft2r_l1:
- movi a8, 0 // a8 - j
- movi a11,0 // a11 = ia = 0;
-
-fft2r_l2: // loop for j, a8 - j
- slli a10, a8, 3 // a10 = j<<3 // shift for cos () -- c = w[2 * j];
- add.n a10, a10, a4 // a10 - pointer to cos
- lsi f0, a10, 0
- lsi f1, a10, 4
-
- movi a9, 0 // just for debug
- loopnez a6, fft2r_l3
- add.n a12, a11, a6 // a12 = m = ia + N2
-
- slli a14, a12, 3 // a14 - pointer for m*2
- slli a13, a11, 3 // a13 - pointer for ia*2
- add.n a14, a14, a2 // pointers to data arrays
- add.n a13, a13, a2 //
-
- lsi f4, a14, 0 // data[2 * m]
- mul.s f6, f0, f4 // re_temp = c * data[2 * m]
- lsi f5, a14, 4 // data[2 * m + 1]
- mul.s f7, f0, f5 // im_temp = c * data[2 * m + 1]
-
- lsi f2, a13, 0 // data[2 * ia]
- madd.s f6, f1, f5 // re_temp += s * data[2 * m + 1];
- lsi f3, a13, 4 // data[2 * ia + 1]
- msub.s f7, f1, f4 // im_temp -= s * data[2 * m];
-
- sub.s f8, f2, f6 // = data[2 * ia] - re_temp;
- sub.s f9, f3, f7 // = data[2 * ia + 1] - im_temp;
-
- add.s f10, f2, f6 // = data[2 * ia] + re_temp;
- ssi f8, a14, 0
- add.s f11, f3, f7 // = data[2 * ia + 1] + im_temp;
- ssi f9, a14, 4
-
- ssi f10, a13, 0
- addi a11, a11, 1// ia++
- ssi f11, a13, 4
-fft2r_l3:
- add a11, a11, a6
-
- addi a8, a8, 1 // j++
- BNE a8, a7, fft2r_l2 //
- slli a7, a7, 1 // ie = ie<<1
-// main loop: for (int k = N/2; k > 0; k >>= 1)
- srli a6, a6, 1 // a6 = a6>>1
- BNEZ a6, fft2r_l1// Jump if > 0
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_fft2r_fc32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ansi.c b/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ansi.c
deleted file mode 100644
index 90a1aae..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ansi.c
+++ /dev/null
@@ -1,346 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r.h"
-#include "dsp_common.h"
-#include "dsp_types.h"
-#include
-#include "esp_attr.h"
-#include "esp_log.h"
-#include
-
-static const char *TAG = "fftr2_ansi";
-
-float *dsps_fft_w_table_fc32;
-int dsps_fft_w_table_size;
-uint8_t dsps_fft2r_initialized = 0;
-uint8_t dsps_fft2r_mem_allocated = 0;
-
-uint16_t *dsps_fft2r_ram_rev_table = NULL;
-
-unsigned short reverse(unsigned short x, unsigned short N, int order);
-
-esp_err_t dsps_fft2r_init_fc32(float *fft_table_buff, int table_size)
-{
- esp_err_t result = ESP_OK;
- if (dsps_fft2r_initialized != 0) {
- return result;
- }
- if (table_size > CONFIG_DSP_MAX_FFT_SIZE) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (table_size == 0) {
- return result;
- }
- if (fft_table_buff != NULL) {
- if (dsps_fft2r_mem_allocated) {
- return ESP_ERR_DSP_REINITIALIZED;
- }
- dsps_fft_w_table_fc32 = fft_table_buff;
- dsps_fft_w_table_size = table_size;
- } else {
- if (!dsps_fft2r_mem_allocated) {
- dsps_fft_w_table_fc32 = (float *)malloc(table_size * sizeof(float));
- if (dsps_fft_w_table_fc32 == NULL) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- }
- dsps_fft_w_table_size = table_size;
- dsps_fft2r_mem_allocated = 1;
-
- }
-
- // FFT ram_rev table allocated
- int pow = dsp_power_of_two(table_size);
- if ((pow > 3) && (pow < 13)) {
- dsps_fft2r_ram_rev_table = (uint16_t *)malloc(2 * dsps_fft2r_rev_tables_fc32_size[pow - 4] * sizeof(uint16_t));
- if (dsps_fft2r_ram_rev_table == NULL) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- memcpy(dsps_fft2r_ram_rev_table, dsps_fft2r_rev_tables_fc32[pow - 4], 2 * dsps_fft2r_rev_tables_fc32_size[pow - 4] * sizeof(uint16_t));
- dsps_fft2r_rev_tables_fc32[pow - 4] = dsps_fft2r_ram_rev_table;
- }
-
- result = dsps_gen_w_r2_fc32(dsps_fft_w_table_fc32, dsps_fft_w_table_size);
- if (result != ESP_OK) {
- return result;
- }
- result = dsps_bit_rev_fc32_ansi(dsps_fft_w_table_fc32, dsps_fft_w_table_size >> 1);
- if (result != ESP_OK) {
- return result;
- }
- dsps_fft2r_initialized = 1;
-
- return ESP_OK;
-}
-
-void dsps_fft2r_deinit_fc32()
-{
- if (dsps_fft2r_mem_allocated) {
- free(dsps_fft_w_table_fc32);
- }
- if (dsps_fft2r_ram_rev_table != NULL) {
- free(dsps_fft2r_ram_rev_table);
- dsps_fft2r_ram_rev_table = NULL;
- }
- // Re init bitrev table for next use
- dsps_fft2r_rev_tables_init_fc32();
- dsps_fft2r_mem_allocated = 0;
- dsps_fft2r_initialized = 0;
-}
-
-esp_err_t dsps_fft2r_fc32_ansi_(float *data, int N, float *w)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- if (!dsps_fft2r_initialized) {
- return ESP_ERR_DSP_UNINITIALIZED;
- }
-
- esp_err_t result = ESP_OK;
-
- int ie, ia, m;
- float re_temp, im_temp;
- float c, s;
- ie = 1;
- for (int N2 = N / 2; N2 > 0; N2 >>= 1) {
- ia = 0;
- for (int j = 0; j < ie; j++) {
- c = w[2 * j];
- s = w[2 * j + 1];
- for (int i = 0; i < N2; i++) {
- m = ia + N2;
- re_temp = c * data[2 * m] + s * data[2 * m + 1];
- im_temp = c * data[2 * m + 1] - s * data[2 * m];
- data[2 * m] = data[2 * ia] - re_temp;
- data[2 * m + 1] = data[2 * ia + 1] - im_temp;
- data[2 * ia] = data[2 * ia] + re_temp;
- data[2 * ia + 1] = data[2 * ia + 1] + im_temp;
- ia++;
- }
- ia += N2;
- }
- ie <<= 1;
- }
- return result;
-}
-
-
-unsigned short reverse(unsigned short x, unsigned short N, int order)
-{
- unsigned short b = x;
-
- b = (b & 0xff00) >> 8 | (b & 0x00fF) << 8;
- b = (b & 0xf0F0) >> 4 | (b & 0x0f0F) << 4;
- b = (b & 0xCCCC) >> 2 | (b & 0x3333) << 2;
- b = (b & 0xAAAA) >> 1 | (b & 0x5555) << 1;
- return b >> (16 - order);
-}
-
-esp_err_t dsps_bit_rev_fc32_ansi(float *data, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- esp_err_t result = ESP_OK;
-
- int j, k;
- float r_temp, i_temp;
- j = 0;
- for (int i = 1; i < (N - 1); i++) {
- k = N >> 1;
- while (k <= j) {
- j -= k;
- k >>= 1;
- }
- j += k;
- if (i < j) {
- r_temp = data[j * 2];
- data[j * 2] = data[i * 2];
- data[i * 2] = r_temp;
- i_temp = data[j * 2 + 1];
- data[j * 2 + 1] = data[i * 2 + 1];
- data[i * 2 + 1] = i_temp;
- }
- }
- return result;
-}
-
-esp_err_t dsps_gen_w_r2_fc32(float *w, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- esp_err_t result = ESP_OK;
-
- int i;
- float e = M_PI * 2.0 / N;
-
- for (i = 0; i < (N >> 1); i++) {
- w[2 * i] = cosf(i * e);
- w[2 * i + 1] = sinf(i * e);
- }
-
- return result;
-}
-
-esp_err_t dsps_cplx2reC_fc32_ansi(float *data, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- esp_err_t result = ESP_OK;
-
- int i;
- int n2 = N << 1;
-
- float rkl = 0;
- float rkh = 0;
- float rnl = 0;
- float rnh = 0;
- float ikl = 0;
- float ikh = 0;
- float inl = 0;
- float inh = 0;
-
- for (i = 0; i < (N / 4); i++) {
- rkl = data[i * 2 + 0 + 2];
- ikl = data[i * 2 + 1 + 2];
- rnl = data[n2 - i * 2 - 2];
- inl = data[n2 - i * 2 - 1];
-
- rkh = data[i * 2 + 0 + 2 + N];
- ikh = data[i * 2 + 1 + 2 + N];
- rnh = data[n2 - i * 2 - 2 - N];
- inh = data[n2 - i * 2 - 1 - N];
-
- data[i * 2 + 0 + 2] = rkl + rnl;
- data[i * 2 + 1 + 2] = ikl - inl;
-
- data[n2 - i * 2 - 1 - N] = rkh + rnh;
- data[n2 - i * 2 - 2 - N] = ikh - inh;
-
- data[i * 2 + 0 + 2 + N] = ikl + inl;
- data[i * 2 + 1 + 2 + N] = rkl - rnl;
-
- data[n2 - i * 2 - 1] = ikh + inh;
- data[n2 - i * 2 - 2] = rkh - rnh;
- }
- data[N] = data[1];
- data[1] = 0;
- data[N + 1] = 0;
-
- return result;
-}
-
-esp_err_t dsps_gen_bitrev2r_table(int N, int step, char *name_ext)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- int j, k;
- j = 0;
- int items_count = 0;
- ESP_LOGD(TAG, "const uint16_t bitrev2r_table_%i_%s[] = { ", N, name_ext);
- for (int i = 1; i < (N - 1); i++) {
- k = N >> 1;
- while (k <= j) {
- j -= k;
- k >>= 1;
- }
- j += k;
- if (i < j) {
- ESP_LOGD(TAG, "%i, %i, ", i * step, j * step);
- items_count++;
- if ((items_count % 8) == 0) {
- ESP_LOGD(TAG, " ");
- }
- }
- }
- ESP_LOGD(TAG, "};");
- ESP_LOGD(TAG, "const uint16_t bitrev2r_table_%i_%s_size = %i;\n", N, name_ext, items_count);
-
- ESP_LOGD(TAG, "extern const uint16_t bitrev2r_table_%i_%s[];", N, name_ext);
- ESP_LOGD(TAG, "extern const uint16_t bitrev2r_table_%i_%s_size;\n", N, name_ext);
- return ESP_OK;
-}
-
-esp_err_t dsps_bit_rev2r_fc32(float *data, int N)
-{
- uint16_t *table;
- uint16_t table_size;
- switch (N) {
- case 16:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[0];
- table_size = dsps_fft2r_rev_tables_fc32_size[0];
- break;
- case 32:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[1];
- table_size = dsps_fft2r_rev_tables_fc32_size[1];
- break;
- case 64:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[2];
- table_size = dsps_fft2r_rev_tables_fc32_size[2];
- break;
- case 128:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[3];
- table_size = dsps_fft2r_rev_tables_fc32_size[3];
- break;
- case 256:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[4];
- table_size = dsps_fft2r_rev_tables_fc32_size[4];
- break;
- case 512:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[5];
- table_size = dsps_fft2r_rev_tables_fc32_size[5];
- break;
- case 1024:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[6];
- table_size = dsps_fft2r_rev_tables_fc32_size[6];
- break;
- case 2048:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[7];
- table_size = dsps_fft2r_rev_tables_fc32_size[7];
- break;
- case 4096:
- table = (uint16_t *)dsps_fft2r_rev_tables_fc32[8];
- table_size = dsps_fft2r_rev_tables_fc32_size[8];
- break;
-
- default:
- return dsps_bit_rev_fc32(data, N);
- break;
- }
- return dsps_bit_rev_lookup_fc32(data, table_size, table);
-}
-
-esp_err_t dsps_bit_rev_lookup_fc32_ansi(float *data, int reverse_size, uint16_t *reverse_tab)
-{
- float r_temp, i_temp;
- for (int n = 0 ; n < reverse_size ; n++) {
- uint16_t i = reverse_tab[n * 2 + 0] >> 2;
- uint16_t j = reverse_tab[n * 2 + 1] >> 2;
- r_temp = data[j];
- data[j] = data[i];
- data[i] = r_temp;
- i_temp = data[j + 1];
- data[j + 1] = data[i + 1];
- data[i + 1] = i_temp;
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft4r_bitrev_tables_fc32.c b/components/esp-dsp/modules/fft/float/dsps_fft4r_bitrev_tables_fc32.c
deleted file mode 100644
index d91d65a..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft4r_bitrev_tables_fc32.c
+++ /dev/null
@@ -1,407 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include
-#include "dsps_fft_tables.h"
-
-
-const uint16_t bitrev4r_table_16_fc32[] = {
- 8, 32, 16, 64, 24, 96, 48, 72, 56, 104, 88, 112,
-};
-extern const uint16_t bitrev4r_table_16_fc32[];
-extern const uint16_t bitrev4r_table_16_fc32_size;
-
-const uint16_t bitrev4r_table_64_fc32[] = {
- 8, 128, 16, 256, 24, 384, 40, 160, 48, 288, 56, 416, 72, 192, 80, 320,
- 88, 448, 104, 224, 112, 352, 120, 480, 144, 264, 152, 392, 176, 296, 184, 424,
- 208, 328, 216, 456, 240, 360, 248, 488, 280, 400, 312, 432, 344, 464, 376, 496,
-};
-extern const uint16_t bitrev4r_table_64_fc32[];
-extern const uint16_t bitrev4r_table_64_fc32_size;
-
-const uint16_t bitrev4r_table_256_fc32[] = {
- 8, 512, 16, 1024, 24, 1536, 32, 128, 40, 640, 48, 1152, 56, 1664, 64, 256,
- 72, 768, 80, 1280, 88, 1792, 96, 384, 104, 896, 112, 1408, 120, 1920, 136, 544,
- 144, 1056, 152, 1568, 168, 672, 176, 1184, 184, 1696, 192, 288, 200, 800, 208, 1312,
- 216, 1824, 224, 416, 232, 928, 240, 1440, 248, 1952, 264, 576, 272, 1088, 280, 1600,
- 296, 704, 304, 1216, 312, 1728, 328, 832, 336, 1344, 344, 1856, 352, 448, 360, 960,
- 368, 1472, 376, 1984, 392, 608, 400, 1120, 408, 1632, 424, 736, 432, 1248, 440, 1760,
- 456, 864, 464, 1376, 472, 1888, 488, 992, 496, 1504, 504, 2016, 528, 1032, 536, 1544,
- 552, 648, 560, 1160, 568, 1672, 584, 776, 592, 1288, 600, 1800, 616, 904, 624, 1416,
- 632, 1928, 656, 1064, 664, 1576, 688, 1192, 696, 1704, 712, 808, 720, 1320, 728, 1832,
- 744, 936, 752, 1448, 760, 1960, 784, 1096, 792, 1608, 816, 1224, 824, 1736, 848, 1352,
- 856, 1864, 872, 968, 880, 1480, 888, 1992, 912, 1128, 920, 1640, 944, 1256, 952, 1768,
- 976, 1384, 984, 1896, 1008, 1512, 1016, 2024, 1048, 1552, 1072, 1168, 1080, 1680, 1104, 1296,
- 1112, 1808, 1136, 1424, 1144, 1936, 1176, 1584, 1208, 1712, 1232, 1328, 1240, 1840, 1264, 1456,
- 1272, 1968, 1304, 1616, 1336, 1744, 1368, 1872, 1392, 1488, 1400, 2000, 1432, 1648, 1464, 1776,
- 1496, 1904, 1528, 2032, 1592, 1688, 1624, 1816, 1656, 1944, 1752, 1848, 1784, 1976, 1912, 2008,
-};
-extern const uint16_t bitrev4r_table_256_fc32[];
-extern const uint16_t bitrev4r_table_256_fc32_size;
-
-const uint16_t bitrev4r_table_1024_fc32[] = {
- 8, 2048, 16, 4096, 24, 6144, 32, 512, 40, 2560, 48, 4608, 56, 6656, 64, 1024,
- 72, 3072, 80, 5120, 88, 7168, 96, 1536, 104, 3584, 112, 5632, 120, 7680, 136, 2176,
- 144, 4224, 152, 6272, 160, 640, 168, 2688, 176, 4736, 184, 6784, 192, 1152, 200, 3200,
- 208, 5248, 216, 7296, 224, 1664, 232, 3712, 240, 5760, 248, 7808, 264, 2304, 272, 4352,
- 280, 6400, 288, 768, 296, 2816, 304, 4864, 312, 6912, 320, 1280, 328, 3328, 336, 5376,
- 344, 7424, 352, 1792, 360, 3840, 368, 5888, 376, 7936, 392, 2432, 400, 4480, 408, 6528,
- 416, 896, 424, 2944, 432, 4992, 440, 7040, 448, 1408, 456, 3456, 464, 5504, 472, 7552,
- 480, 1920, 488, 3968, 496, 6016, 504, 8064, 520, 2080, 528, 4128, 536, 6176, 552, 2592,
- 560, 4640, 568, 6688, 576, 1056, 584, 3104, 592, 5152, 600, 7200, 608, 1568, 616, 3616,
- 624, 5664, 632, 7712, 648, 2208, 656, 4256, 664, 6304, 680, 2720, 688, 4768, 696, 6816,
- 704, 1184, 712, 3232, 720, 5280, 728, 7328, 736, 1696, 744, 3744, 752, 5792, 760, 7840,
- 776, 2336, 784, 4384, 792, 6432, 808, 2848, 816, 4896, 824, 6944, 832, 1312, 840, 3360,
- 848, 5408, 856, 7456, 864, 1824, 872, 3872, 880, 5920, 888, 7968, 904, 2464, 912, 4512,
- 920, 6560, 936, 2976, 944, 5024, 952, 7072, 960, 1440, 968, 3488, 976, 5536, 984, 7584,
- 992, 1952, 1000, 4000, 1008, 6048, 1016, 8096, 1032, 2112, 1040, 4160, 1048, 6208, 1064, 2624,
- 1072, 4672, 1080, 6720, 1096, 3136, 1104, 5184, 1112, 7232, 1120, 1600, 1128, 3648, 1136, 5696,
- 1144, 7744, 1160, 2240, 1168, 4288, 1176, 6336, 1192, 2752, 1200, 4800, 1208, 6848, 1224, 3264,
- 1232, 5312, 1240, 7360, 1248, 1728, 1256, 3776, 1264, 5824, 1272, 7872, 1288, 2368, 1296, 4416,
- 1304, 6464, 1320, 2880, 1328, 4928, 1336, 6976, 1352, 3392, 1360, 5440, 1368, 7488, 1376, 1856,
- 1384, 3904, 1392, 5952, 1400, 8000, 1416, 2496, 1424, 4544, 1432, 6592, 1448, 3008, 1456, 5056,
- 1464, 7104, 1480, 3520, 1488, 5568, 1496, 7616, 1504, 1984, 1512, 4032, 1520, 6080, 1528, 8128,
- 1544, 2144, 1552, 4192, 1560, 6240, 1576, 2656, 1584, 4704, 1592, 6752, 1608, 3168, 1616, 5216,
- 1624, 7264, 1640, 3680, 1648, 5728, 1656, 7776, 1672, 2272, 1680, 4320, 1688, 6368, 1704, 2784,
- 1712, 4832, 1720, 6880, 1736, 3296, 1744, 5344, 1752, 7392, 1768, 3808, 1776, 5856, 1784, 7904,
- 1800, 2400, 1808, 4448, 1816, 6496, 1832, 2912, 1840, 4960, 1848, 7008, 1864, 3424, 1872, 5472,
- 1880, 7520, 1896, 3936, 1904, 5984, 1912, 8032, 1928, 2528, 1936, 4576, 1944, 6624, 1960, 3040,
- 1968, 5088, 1976, 7136, 1992, 3552, 2000, 5600, 2008, 7648, 2024, 4064, 2032, 6112, 2040, 8160,
- 2064, 4104, 2072, 6152, 2088, 2568, 2096, 4616, 2104, 6664, 2120, 3080, 2128, 5128, 2136, 7176,
- 2152, 3592, 2160, 5640, 2168, 7688, 2192, 4232, 2200, 6280, 2216, 2696, 2224, 4744, 2232, 6792,
- 2248, 3208, 2256, 5256, 2264, 7304, 2280, 3720, 2288, 5768, 2296, 7816, 2320, 4360, 2328, 6408,
- 2344, 2824, 2352, 4872, 2360, 6920, 2376, 3336, 2384, 5384, 2392, 7432, 2408, 3848, 2416, 5896,
- 2424, 7944, 2448, 4488, 2456, 6536, 2472, 2952, 2480, 5000, 2488, 7048, 2504, 3464, 2512, 5512,
- 2520, 7560, 2536, 3976, 2544, 6024, 2552, 8072, 2576, 4136, 2584, 6184, 2608, 4648, 2616, 6696,
- 2632, 3112, 2640, 5160, 2648, 7208, 2664, 3624, 2672, 5672, 2680, 7720, 2704, 4264, 2712, 6312,
- 2736, 4776, 2744, 6824, 2760, 3240, 2768, 5288, 2776, 7336, 2792, 3752, 2800, 5800, 2808, 7848,
- 2832, 4392, 2840, 6440, 2864, 4904, 2872, 6952, 2888, 3368, 2896, 5416, 2904, 7464, 2920, 3880,
- 2928, 5928, 2936, 7976, 2960, 4520, 2968, 6568, 2992, 5032, 3000, 7080, 3016, 3496, 3024, 5544,
- 3032, 7592, 3048, 4008, 3056, 6056, 3064, 8104, 3088, 4168, 3096, 6216, 3120, 4680, 3128, 6728,
- 3152, 5192, 3160, 7240, 3176, 3656, 3184, 5704, 3192, 7752, 3216, 4296, 3224, 6344, 3248, 4808,
- 3256, 6856, 3280, 5320, 3288, 7368, 3304, 3784, 3312, 5832, 3320, 7880, 3344, 4424, 3352, 6472,
- 3376, 4936, 3384, 6984, 3408, 5448, 3416, 7496, 3432, 3912, 3440, 5960, 3448, 8008, 3472, 4552,
- 3480, 6600, 3504, 5064, 3512, 7112, 3536, 5576, 3544, 7624, 3560, 4040, 3568, 6088, 3576, 8136,
- 3600, 4200, 3608, 6248, 3632, 4712, 3640, 6760, 3664, 5224, 3672, 7272, 3696, 5736, 3704, 7784,
- 3728, 4328, 3736, 6376, 3760, 4840, 3768, 6888, 3792, 5352, 3800, 7400, 3824, 5864, 3832, 7912,
- 3856, 4456, 3864, 6504, 3888, 4968, 3896, 7016, 3920, 5480, 3928, 7528, 3952, 5992, 3960, 8040,
- 3984, 4584, 3992, 6632, 4016, 5096, 4024, 7144, 4048, 5608, 4056, 7656, 4080, 6120, 4088, 8168,
- 4120, 6160, 4144, 4624, 4152, 6672, 4176, 5136, 4184, 7184, 4208, 5648, 4216, 7696, 4248, 6288,
- 4272, 4752, 4280, 6800, 4304, 5264, 4312, 7312, 4336, 5776, 4344, 7824, 4376, 6416, 4400, 4880,
- 4408, 6928, 4432, 5392, 4440, 7440, 4464, 5904, 4472, 7952, 4504, 6544, 4528, 5008, 4536, 7056,
- 4560, 5520, 4568, 7568, 4592, 6032, 4600, 8080, 4632, 6192, 4664, 6704, 4688, 5168, 4696, 7216,
- 4720, 5680, 4728, 7728, 4760, 6320, 4792, 6832, 4816, 5296, 4824, 7344, 4848, 5808, 4856, 7856,
- 4888, 6448, 4920, 6960, 4944, 5424, 4952, 7472, 4976, 5936, 4984, 7984, 5016, 6576, 5048, 7088,
- 5072, 5552, 5080, 7600, 5104, 6064, 5112, 8112, 5144, 6224, 5176, 6736, 5208, 7248, 5232, 5712,
- 5240, 7760, 5272, 6352, 5304, 6864, 5336, 7376, 5360, 5840, 5368, 7888, 5400, 6480, 5432, 6992,
- 5464, 7504, 5488, 5968, 5496, 8016, 5528, 6608, 5560, 7120, 5592, 7632, 5616, 6096, 5624, 8144,
- 5656, 6256, 5688, 6768, 5720, 7280, 5752, 7792, 5784, 6384, 5816, 6896, 5848, 7408, 5880, 7920,
- 5912, 6512, 5944, 7024, 5976, 7536, 6008, 8048, 6040, 6640, 6072, 7152, 6104, 7664, 6136, 8176,
- 6200, 6680, 6232, 7192, 6264, 7704, 6328, 6808, 6360, 7320, 6392, 7832, 6456, 6936, 6488, 7448,
- 6520, 7960, 6584, 7064, 6616, 7576, 6648, 8088, 6744, 7224, 6776, 7736, 6872, 7352, 6904, 7864,
- 7000, 7480, 7032, 7992, 7128, 7608, 7160, 8120, 7288, 7768, 7416, 7896, 7544, 8024, 7672, 8152,
-};
-extern const uint16_t bitrev4r_table_1024_fc32[];
-extern const uint16_t bitrev4r_table_1024_fc32_size;
-
-const uint16_t bitrev4r_table_4096_fc32[] = {
- 8, 8192, 16, 16384, 24, 24576, 32, 2048, 40, 10240, 48, 18432, 56, 26624, 64, 4096,
- 72, 12288, 80, 20480, 88, 28672, 96, 6144, 104, 14336, 112, 22528, 120, 30720, 128, 512,
- 136, 8704, 144, 16896, 152, 25088, 160, 2560, 168, 10752, 176, 18944, 184, 27136, 192, 4608,
- 200, 12800, 208, 20992, 216, 29184, 224, 6656, 232, 14848, 240, 23040, 248, 31232, 256, 1024,
- 264, 9216, 272, 17408, 280, 25600, 288, 3072, 296, 11264, 304, 19456, 312, 27648, 320, 5120,
- 328, 13312, 336, 21504, 344, 29696, 352, 7168, 360, 15360, 368, 23552, 376, 31744, 384, 1536,
- 392, 9728, 400, 17920, 408, 26112, 416, 3584, 424, 11776, 432, 19968, 440, 28160, 448, 5632,
- 456, 13824, 464, 22016, 472, 30208, 480, 7680, 488, 15872, 496, 24064, 504, 32256, 520, 8320,
- 528, 16512, 536, 24704, 544, 2176, 552, 10368, 560, 18560, 568, 26752, 576, 4224, 584, 12416,
- 592, 20608, 600, 28800, 608, 6272, 616, 14464, 624, 22656, 632, 30848, 648, 8832, 656, 17024,
- 664, 25216, 672, 2688, 680, 10880, 688, 19072, 696, 27264, 704, 4736, 712, 12928, 720, 21120,
- 728, 29312, 736, 6784, 744, 14976, 752, 23168, 760, 31360, 768, 1152, 776, 9344, 784, 17536,
- 792, 25728, 800, 3200, 808, 11392, 816, 19584, 824, 27776, 832, 5248, 840, 13440, 848, 21632,
- 856, 29824, 864, 7296, 872, 15488, 880, 23680, 888, 31872, 896, 1664, 904, 9856, 912, 18048,
- 920, 26240, 928, 3712, 936, 11904, 944, 20096, 952, 28288, 960, 5760, 968, 13952, 976, 22144,
- 984, 30336, 992, 7808, 1000, 16000, 1008, 24192, 1016, 32384, 1032, 8448, 1040, 16640, 1048, 24832,
- 1056, 2304, 1064, 10496, 1072, 18688, 1080, 26880, 1088, 4352, 1096, 12544, 1104, 20736, 1112, 28928,
- 1120, 6400, 1128, 14592, 1136, 22784, 1144, 30976, 1160, 8960, 1168, 17152, 1176, 25344, 1184, 2816,
- 1192, 11008, 1200, 19200, 1208, 27392, 1216, 4864, 1224, 13056, 1232, 21248, 1240, 29440, 1248, 6912,
- 1256, 15104, 1264, 23296, 1272, 31488, 1288, 9472, 1296, 17664, 1304, 25856, 1312, 3328, 1320, 11520,
- 1328, 19712, 1336, 27904, 1344, 5376, 1352, 13568, 1360, 21760, 1368, 29952, 1376, 7424, 1384, 15616,
- 1392, 23808, 1400, 32000, 1408, 1792, 1416, 9984, 1424, 18176, 1432, 26368, 1440, 3840, 1448, 12032,
- 1456, 20224, 1464, 28416, 1472, 5888, 1480, 14080, 1488, 22272, 1496, 30464, 1504, 7936, 1512, 16128,
- 1520, 24320, 1528, 32512, 1544, 8576, 1552, 16768, 1560, 24960, 1568, 2432, 1576, 10624, 1584, 18816,
- 1592, 27008, 1600, 4480, 1608, 12672, 1616, 20864, 1624, 29056, 1632, 6528, 1640, 14720, 1648, 22912,
- 1656, 31104, 1672, 9088, 1680, 17280, 1688, 25472, 1696, 2944, 1704, 11136, 1712, 19328, 1720, 27520,
- 1728, 4992, 1736, 13184, 1744, 21376, 1752, 29568, 1760, 7040, 1768, 15232, 1776, 23424, 1784, 31616,
- 1800, 9600, 1808, 17792, 1816, 25984, 1824, 3456, 1832, 11648, 1840, 19840, 1848, 28032, 1856, 5504,
- 1864, 13696, 1872, 21888, 1880, 30080, 1888, 7552, 1896, 15744, 1904, 23936, 1912, 32128, 1928, 10112,
- 1936, 18304, 1944, 26496, 1952, 3968, 1960, 12160, 1968, 20352, 1976, 28544, 1984, 6016, 1992, 14208,
- 2000, 22400, 2008, 30592, 2016, 8064, 2024, 16256, 2032, 24448, 2040, 32640, 2056, 8224, 2064, 16416,
- 2072, 24608, 2088, 10272, 2096, 18464, 2104, 26656, 2112, 4128, 2120, 12320, 2128, 20512, 2136, 28704,
- 2144, 6176, 2152, 14368, 2160, 22560, 2168, 30752, 2184, 8736, 2192, 16928, 2200, 25120, 2208, 2592,
- 2216, 10784, 2224, 18976, 2232, 27168, 2240, 4640, 2248, 12832, 2256, 21024, 2264, 29216, 2272, 6688,
- 2280, 14880, 2288, 23072, 2296, 31264, 2312, 9248, 2320, 17440, 2328, 25632, 2336, 3104, 2344, 11296,
- 2352, 19488, 2360, 27680, 2368, 5152, 2376, 13344, 2384, 21536, 2392, 29728, 2400, 7200, 2408, 15392,
- 2416, 23584, 2424, 31776, 2440, 9760, 2448, 17952, 2456, 26144, 2464, 3616, 2472, 11808, 2480, 20000,
- 2488, 28192, 2496, 5664, 2504, 13856, 2512, 22048, 2520, 30240, 2528, 7712, 2536, 15904, 2544, 24096,
- 2552, 32288, 2568, 8352, 2576, 16544, 2584, 24736, 2600, 10400, 2608, 18592, 2616, 26784, 2624, 4256,
- 2632, 12448, 2640, 20640, 2648, 28832, 2656, 6304, 2664, 14496, 2672, 22688, 2680, 30880, 2696, 8864,
- 2704, 17056, 2712, 25248, 2728, 10912, 2736, 19104, 2744, 27296, 2752, 4768, 2760, 12960, 2768, 21152,
- 2776, 29344, 2784, 6816, 2792, 15008, 2800, 23200, 2808, 31392, 2824, 9376, 2832, 17568, 2840, 25760,
- 2848, 3232, 2856, 11424, 2864, 19616, 2872, 27808, 2880, 5280, 2888, 13472, 2896, 21664, 2904, 29856,
- 2912, 7328, 2920, 15520, 2928, 23712, 2936, 31904, 2952, 9888, 2960, 18080, 2968, 26272, 2976, 3744,
- 2984, 11936, 2992, 20128, 3000, 28320, 3008, 5792, 3016, 13984, 3024, 22176, 3032, 30368, 3040, 7840,
- 3048, 16032, 3056, 24224, 3064, 32416, 3080, 8480, 3088, 16672, 3096, 24864, 3112, 10528, 3120, 18720,
- 3128, 26912, 3136, 4384, 3144, 12576, 3152, 20768, 3160, 28960, 3168, 6432, 3176, 14624, 3184, 22816,
- 3192, 31008, 3208, 8992, 3216, 17184, 3224, 25376, 3240, 11040, 3248, 19232, 3256, 27424, 3264, 4896,
- 3272, 13088, 3280, 21280, 3288, 29472, 3296, 6944, 3304, 15136, 3312, 23328, 3320, 31520, 3336, 9504,
- 3344, 17696, 3352, 25888, 3368, 11552, 3376, 19744, 3384, 27936, 3392, 5408, 3400, 13600, 3408, 21792,
- 3416, 29984, 3424, 7456, 3432, 15648, 3440, 23840, 3448, 32032, 3464, 10016, 3472, 18208, 3480, 26400,
- 3488, 3872, 3496, 12064, 3504, 20256, 3512, 28448, 3520, 5920, 3528, 14112, 3536, 22304, 3544, 30496,
- 3552, 7968, 3560, 16160, 3568, 24352, 3576, 32544, 3592, 8608, 3600, 16800, 3608, 24992, 3624, 10656,
- 3632, 18848, 3640, 27040, 3648, 4512, 3656, 12704, 3664, 20896, 3672, 29088, 3680, 6560, 3688, 14752,
- 3696, 22944, 3704, 31136, 3720, 9120, 3728, 17312, 3736, 25504, 3752, 11168, 3760, 19360, 3768, 27552,
- 3776, 5024, 3784, 13216, 3792, 21408, 3800, 29600, 3808, 7072, 3816, 15264, 3824, 23456, 3832, 31648,
- 3848, 9632, 3856, 17824, 3864, 26016, 3880, 11680, 3888, 19872, 3896, 28064, 3904, 5536, 3912, 13728,
- 3920, 21920, 3928, 30112, 3936, 7584, 3944, 15776, 3952, 23968, 3960, 32160, 3976, 10144, 3984, 18336,
- 3992, 26528, 4008, 12192, 4016, 20384, 4024, 28576, 4032, 6048, 4040, 14240, 4048, 22432, 4056, 30624,
- 4064, 8096, 4072, 16288, 4080, 24480, 4088, 32672, 4104, 8256, 4112, 16448, 4120, 24640, 4136, 10304,
- 4144, 18496, 4152, 26688, 4168, 12352, 4176, 20544, 4184, 28736, 4192, 6208, 4200, 14400, 4208, 22592,
- 4216, 30784, 4232, 8768, 4240, 16960, 4248, 25152, 4264, 10816, 4272, 19008, 4280, 27200, 4288, 4672,
- 4296, 12864, 4304, 21056, 4312, 29248, 4320, 6720, 4328, 14912, 4336, 23104, 4344, 31296, 4360, 9280,
- 4368, 17472, 4376, 25664, 4392, 11328, 4400, 19520, 4408, 27712, 4416, 5184, 4424, 13376, 4432, 21568,
- 4440, 29760, 4448, 7232, 4456, 15424, 4464, 23616, 4472, 31808, 4488, 9792, 4496, 17984, 4504, 26176,
- 4520, 11840, 4528, 20032, 4536, 28224, 4544, 5696, 4552, 13888, 4560, 22080, 4568, 30272, 4576, 7744,
- 4584, 15936, 4592, 24128, 4600, 32320, 4616, 8384, 4624, 16576, 4632, 24768, 4648, 10432, 4656, 18624,
- 4664, 26816, 4680, 12480, 4688, 20672, 4696, 28864, 4704, 6336, 4712, 14528, 4720, 22720, 4728, 30912,
- 4744, 8896, 4752, 17088, 4760, 25280, 4776, 10944, 4784, 19136, 4792, 27328, 4808, 12992, 4816, 21184,
- 4824, 29376, 4832, 6848, 4840, 15040, 4848, 23232, 4856, 31424, 4872, 9408, 4880, 17600, 4888, 25792,
- 4904, 11456, 4912, 19648, 4920, 27840, 4928, 5312, 4936, 13504, 4944, 21696, 4952, 29888, 4960, 7360,
- 4968, 15552, 4976, 23744, 4984, 31936, 5000, 9920, 5008, 18112, 5016, 26304, 5032, 11968, 5040, 20160,
- 5048, 28352, 5056, 5824, 5064, 14016, 5072, 22208, 5080, 30400, 5088, 7872, 5096, 16064, 5104, 24256,
- 5112, 32448, 5128, 8512, 5136, 16704, 5144, 24896, 5160, 10560, 5168, 18752, 5176, 26944, 5192, 12608,
- 5200, 20800, 5208, 28992, 5216, 6464, 5224, 14656, 5232, 22848, 5240, 31040, 5256, 9024, 5264, 17216,
- 5272, 25408, 5288, 11072, 5296, 19264, 5304, 27456, 5320, 13120, 5328, 21312, 5336, 29504, 5344, 6976,
- 5352, 15168, 5360, 23360, 5368, 31552, 5384, 9536, 5392, 17728, 5400, 25920, 5416, 11584, 5424, 19776,
- 5432, 27968, 5448, 13632, 5456, 21824, 5464, 30016, 5472, 7488, 5480, 15680, 5488, 23872, 5496, 32064,
- 5512, 10048, 5520, 18240, 5528, 26432, 5544, 12096, 5552, 20288, 5560, 28480, 5568, 5952, 5576, 14144,
- 5584, 22336, 5592, 30528, 5600, 8000, 5608, 16192, 5616, 24384, 5624, 32576, 5640, 8640, 5648, 16832,
- 5656, 25024, 5672, 10688, 5680, 18880, 5688, 27072, 5704, 12736, 5712, 20928, 5720, 29120, 5728, 6592,
- 5736, 14784, 5744, 22976, 5752, 31168, 5768, 9152, 5776, 17344, 5784, 25536, 5800, 11200, 5808, 19392,
- 5816, 27584, 5832, 13248, 5840, 21440, 5848, 29632, 5856, 7104, 5864, 15296, 5872, 23488, 5880, 31680,
- 5896, 9664, 5904, 17856, 5912, 26048, 5928, 11712, 5936, 19904, 5944, 28096, 5960, 13760, 5968, 21952,
- 5976, 30144, 5984, 7616, 5992, 15808, 6000, 24000, 6008, 32192, 6024, 10176, 6032, 18368, 6040, 26560,
- 6056, 12224, 6064, 20416, 6072, 28608, 6088, 14272, 6096, 22464, 6104, 30656, 6112, 8128, 6120, 16320,
- 6128, 24512, 6136, 32704, 6152, 8288, 6160, 16480, 6168, 24672, 6184, 10336, 6192, 18528, 6200, 26720,
- 6216, 12384, 6224, 20576, 6232, 28768, 6248, 14432, 6256, 22624, 6264, 30816, 6280, 8800, 6288, 16992,
- 6296, 25184, 6312, 10848, 6320, 19040, 6328, 27232, 6344, 12896, 6352, 21088, 6360, 29280, 6368, 6752,
- 6376, 14944, 6384, 23136, 6392, 31328, 6408, 9312, 6416, 17504, 6424, 25696, 6440, 11360, 6448, 19552,
- 6456, 27744, 6472, 13408, 6480, 21600, 6488, 29792, 6496, 7264, 6504, 15456, 6512, 23648, 6520, 31840,
- 6536, 9824, 6544, 18016, 6552, 26208, 6568, 11872, 6576, 20064, 6584, 28256, 6600, 13920, 6608, 22112,
- 6616, 30304, 6624, 7776, 6632, 15968, 6640, 24160, 6648, 32352, 6664, 8416, 6672, 16608, 6680, 24800,
- 6696, 10464, 6704, 18656, 6712, 26848, 6728, 12512, 6736, 20704, 6744, 28896, 6760, 14560, 6768, 22752,
- 6776, 30944, 6792, 8928, 6800, 17120, 6808, 25312, 6824, 10976, 6832, 19168, 6840, 27360, 6856, 13024,
- 6864, 21216, 6872, 29408, 6888, 15072, 6896, 23264, 6904, 31456, 6920, 9440, 6928, 17632, 6936, 25824,
- 6952, 11488, 6960, 19680, 6968, 27872, 6984, 13536, 6992, 21728, 7000, 29920, 7008, 7392, 7016, 15584,
- 7024, 23776, 7032, 31968, 7048, 9952, 7056, 18144, 7064, 26336, 7080, 12000, 7088, 20192, 7096, 28384,
- 7112, 14048, 7120, 22240, 7128, 30432, 7136, 7904, 7144, 16096, 7152, 24288, 7160, 32480, 7176, 8544,
- 7184, 16736, 7192, 24928, 7208, 10592, 7216, 18784, 7224, 26976, 7240, 12640, 7248, 20832, 7256, 29024,
- 7272, 14688, 7280, 22880, 7288, 31072, 7304, 9056, 7312, 17248, 7320, 25440, 7336, 11104, 7344, 19296,
- 7352, 27488, 7368, 13152, 7376, 21344, 7384, 29536, 7400, 15200, 7408, 23392, 7416, 31584, 7432, 9568,
- 7440, 17760, 7448, 25952, 7464, 11616, 7472, 19808, 7480, 28000, 7496, 13664, 7504, 21856, 7512, 30048,
- 7528, 15712, 7536, 23904, 7544, 32096, 7560, 10080, 7568, 18272, 7576, 26464, 7592, 12128, 7600, 20320,
- 7608, 28512, 7624, 14176, 7632, 22368, 7640, 30560, 7648, 8032, 7656, 16224, 7664, 24416, 7672, 32608,
- 7688, 8672, 7696, 16864, 7704, 25056, 7720, 10720, 7728, 18912, 7736, 27104, 7752, 12768, 7760, 20960,
- 7768, 29152, 7784, 14816, 7792, 23008, 7800, 31200, 7816, 9184, 7824, 17376, 7832, 25568, 7848, 11232,
- 7856, 19424, 7864, 27616, 7880, 13280, 7888, 21472, 7896, 29664, 7912, 15328, 7920, 23520, 7928, 31712,
- 7944, 9696, 7952, 17888, 7960, 26080, 7976, 11744, 7984, 19936, 7992, 28128, 8008, 13792, 8016, 21984,
- 8024, 30176, 8040, 15840, 8048, 24032, 8056, 32224, 8072, 10208, 8080, 18400, 8088, 26592, 8104, 12256,
- 8112, 20448, 8120, 28640, 8136, 14304, 8144, 22496, 8152, 30688, 8168, 16352, 8176, 24544, 8184, 32736,
- 8208, 16392, 8216, 24584, 8232, 10248, 8240, 18440, 8248, 26632, 8264, 12296, 8272, 20488, 8280, 28680,
- 8296, 14344, 8304, 22536, 8312, 30728, 8328, 8712, 8336, 16904, 8344, 25096, 8360, 10760, 8368, 18952,
- 8376, 27144, 8392, 12808, 8400, 21000, 8408, 29192, 8424, 14856, 8432, 23048, 8440, 31240, 8456, 9224,
- 8464, 17416, 8472, 25608, 8488, 11272, 8496, 19464, 8504, 27656, 8520, 13320, 8528, 21512, 8536, 29704,
- 8552, 15368, 8560, 23560, 8568, 31752, 8584, 9736, 8592, 17928, 8600, 26120, 8616, 11784, 8624, 19976,
- 8632, 28168, 8648, 13832, 8656, 22024, 8664, 30216, 8680, 15880, 8688, 24072, 8696, 32264, 8720, 16520,
- 8728, 24712, 8744, 10376, 8752, 18568, 8760, 26760, 8776, 12424, 8784, 20616, 8792, 28808, 8808, 14472,
- 8816, 22664, 8824, 30856, 8848, 17032, 8856, 25224, 8872, 10888, 8880, 19080, 8888, 27272, 8904, 12936,
- 8912, 21128, 8920, 29320, 8936, 14984, 8944, 23176, 8952, 31368, 8968, 9352, 8976, 17544, 8984, 25736,
- 9000, 11400, 9008, 19592, 9016, 27784, 9032, 13448, 9040, 21640, 9048, 29832, 9064, 15496, 9072, 23688,
- 9080, 31880, 9096, 9864, 9104, 18056, 9112, 26248, 9128, 11912, 9136, 20104, 9144, 28296, 9160, 13960,
- 9168, 22152, 9176, 30344, 9192, 16008, 9200, 24200, 9208, 32392, 9232, 16648, 9240, 24840, 9256, 10504,
- 9264, 18696, 9272, 26888, 9288, 12552, 9296, 20744, 9304, 28936, 9320, 14600, 9328, 22792, 9336, 30984,
- 9360, 17160, 9368, 25352, 9384, 11016, 9392, 19208, 9400, 27400, 9416, 13064, 9424, 21256, 9432, 29448,
- 9448, 15112, 9456, 23304, 9464, 31496, 9488, 17672, 9496, 25864, 9512, 11528, 9520, 19720, 9528, 27912,
- 9544, 13576, 9552, 21768, 9560, 29960, 9576, 15624, 9584, 23816, 9592, 32008, 9608, 9992, 9616, 18184,
- 9624, 26376, 9640, 12040, 9648, 20232, 9656, 28424, 9672, 14088, 9680, 22280, 9688, 30472, 9704, 16136,
- 9712, 24328, 9720, 32520, 9744, 16776, 9752, 24968, 9768, 10632, 9776, 18824, 9784, 27016, 9800, 12680,
- 9808, 20872, 9816, 29064, 9832, 14728, 9840, 22920, 9848, 31112, 9872, 17288, 9880, 25480, 9896, 11144,
- 9904, 19336, 9912, 27528, 9928, 13192, 9936, 21384, 9944, 29576, 9960, 15240, 9968, 23432, 9976, 31624,
- 10000, 17800, 10008, 25992, 10024, 11656, 10032, 19848, 10040, 28040, 10056, 13704, 10064, 21896, 10072, 30088,
- 10088, 15752, 10096, 23944, 10104, 32136, 10128, 18312, 10136, 26504, 10152, 12168, 10160, 20360, 10168, 28552,
- 10184, 14216, 10192, 22408, 10200, 30600, 10216, 16264, 10224, 24456, 10232, 32648, 10256, 16424, 10264, 24616,
- 10288, 18472, 10296, 26664, 10312, 12328, 10320, 20520, 10328, 28712, 10344, 14376, 10352, 22568, 10360, 30760,
- 10384, 16936, 10392, 25128, 10408, 10792, 10416, 18984, 10424, 27176, 10440, 12840, 10448, 21032, 10456, 29224,
- 10472, 14888, 10480, 23080, 10488, 31272, 10512, 17448, 10520, 25640, 10536, 11304, 10544, 19496, 10552, 27688,
- 10568, 13352, 10576, 21544, 10584, 29736, 10600, 15400, 10608, 23592, 10616, 31784, 10640, 17960, 10648, 26152,
- 10664, 11816, 10672, 20008, 10680, 28200, 10696, 13864, 10704, 22056, 10712, 30248, 10728, 15912, 10736, 24104,
- 10744, 32296, 10768, 16552, 10776, 24744, 10800, 18600, 10808, 26792, 10824, 12456, 10832, 20648, 10840, 28840,
- 10856, 14504, 10864, 22696, 10872, 30888, 10896, 17064, 10904, 25256, 10928, 19112, 10936, 27304, 10952, 12968,
- 10960, 21160, 10968, 29352, 10984, 15016, 10992, 23208, 11000, 31400, 11024, 17576, 11032, 25768, 11048, 11432,
- 11056, 19624, 11064, 27816, 11080, 13480, 11088, 21672, 11096, 29864, 11112, 15528, 11120, 23720, 11128, 31912,
- 11152, 18088, 11160, 26280, 11176, 11944, 11184, 20136, 11192, 28328, 11208, 13992, 11216, 22184, 11224, 30376,
- 11240, 16040, 11248, 24232, 11256, 32424, 11280, 16680, 11288, 24872, 11312, 18728, 11320, 26920, 11336, 12584,
- 11344, 20776, 11352, 28968, 11368, 14632, 11376, 22824, 11384, 31016, 11408, 17192, 11416, 25384, 11440, 19240,
- 11448, 27432, 11464, 13096, 11472, 21288, 11480, 29480, 11496, 15144, 11504, 23336, 11512, 31528, 11536, 17704,
- 11544, 25896, 11568, 19752, 11576, 27944, 11592, 13608, 11600, 21800, 11608, 29992, 11624, 15656, 11632, 23848,
- 11640, 32040, 11664, 18216, 11672, 26408, 11688, 12072, 11696, 20264, 11704, 28456, 11720, 14120, 11728, 22312,
- 11736, 30504, 11752, 16168, 11760, 24360, 11768, 32552, 11792, 16808, 11800, 25000, 11824, 18856, 11832, 27048,
- 11848, 12712, 11856, 20904, 11864, 29096, 11880, 14760, 11888, 22952, 11896, 31144, 11920, 17320, 11928, 25512,
- 11952, 19368, 11960, 27560, 11976, 13224, 11984, 21416, 11992, 29608, 12008, 15272, 12016, 23464, 12024, 31656,
- 12048, 17832, 12056, 26024, 12080, 19880, 12088, 28072, 12104, 13736, 12112, 21928, 12120, 30120, 12136, 15784,
- 12144, 23976, 12152, 32168, 12176, 18344, 12184, 26536, 12208, 20392, 12216, 28584, 12232, 14248, 12240, 22440,
- 12248, 30632, 12264, 16296, 12272, 24488, 12280, 32680, 12304, 16456, 12312, 24648, 12336, 18504, 12344, 26696,
- 12368, 20552, 12376, 28744, 12392, 14408, 12400, 22600, 12408, 30792, 12432, 16968, 12440, 25160, 12464, 19016,
- 12472, 27208, 12488, 12872, 12496, 21064, 12504, 29256, 12520, 14920, 12528, 23112, 12536, 31304, 12560, 17480,
- 12568, 25672, 12592, 19528, 12600, 27720, 12616, 13384, 12624, 21576, 12632, 29768, 12648, 15432, 12656, 23624,
- 12664, 31816, 12688, 17992, 12696, 26184, 12720, 20040, 12728, 28232, 12744, 13896, 12752, 22088, 12760, 30280,
- 12776, 15944, 12784, 24136, 12792, 32328, 12816, 16584, 12824, 24776, 12848, 18632, 12856, 26824, 12880, 20680,
- 12888, 28872, 12904, 14536, 12912, 22728, 12920, 30920, 12944, 17096, 12952, 25288, 12976, 19144, 12984, 27336,
- 13008, 21192, 13016, 29384, 13032, 15048, 13040, 23240, 13048, 31432, 13072, 17608, 13080, 25800, 13104, 19656,
- 13112, 27848, 13128, 13512, 13136, 21704, 13144, 29896, 13160, 15560, 13168, 23752, 13176, 31944, 13200, 18120,
- 13208, 26312, 13232, 20168, 13240, 28360, 13256, 14024, 13264, 22216, 13272, 30408, 13288, 16072, 13296, 24264,
- 13304, 32456, 13328, 16712, 13336, 24904, 13360, 18760, 13368, 26952, 13392, 20808, 13400, 29000, 13416, 14664,
- 13424, 22856, 13432, 31048, 13456, 17224, 13464, 25416, 13488, 19272, 13496, 27464, 13520, 21320, 13528, 29512,
- 13544, 15176, 13552, 23368, 13560, 31560, 13584, 17736, 13592, 25928, 13616, 19784, 13624, 27976, 13648, 21832,
- 13656, 30024, 13672, 15688, 13680, 23880, 13688, 32072, 13712, 18248, 13720, 26440, 13744, 20296, 13752, 28488,
- 13768, 14152, 13776, 22344, 13784, 30536, 13800, 16200, 13808, 24392, 13816, 32584, 13840, 16840, 13848, 25032,
- 13872, 18888, 13880, 27080, 13904, 20936, 13912, 29128, 13928, 14792, 13936, 22984, 13944, 31176, 13968, 17352,
- 13976, 25544, 14000, 19400, 14008, 27592, 14032, 21448, 14040, 29640, 14056, 15304, 14064, 23496, 14072, 31688,
- 14096, 17864, 14104, 26056, 14128, 19912, 14136, 28104, 14160, 21960, 14168, 30152, 14184, 15816, 14192, 24008,
- 14200, 32200, 14224, 18376, 14232, 26568, 14256, 20424, 14264, 28616, 14288, 22472, 14296, 30664, 14312, 16328,
- 14320, 24520, 14328, 32712, 14352, 16488, 14360, 24680, 14384, 18536, 14392, 26728, 14416, 20584, 14424, 28776,
- 14448, 22632, 14456, 30824, 14480, 17000, 14488, 25192, 14512, 19048, 14520, 27240, 14544, 21096, 14552, 29288,
- 14568, 14952, 14576, 23144, 14584, 31336, 14608, 17512, 14616, 25704, 14640, 19560, 14648, 27752, 14672, 21608,
- 14680, 29800, 14696, 15464, 14704, 23656, 14712, 31848, 14736, 18024, 14744, 26216, 14768, 20072, 14776, 28264,
- 14800, 22120, 14808, 30312, 14824, 15976, 14832, 24168, 14840, 32360, 14864, 16616, 14872, 24808, 14896, 18664,
- 14904, 26856, 14928, 20712, 14936, 28904, 14960, 22760, 14968, 30952, 14992, 17128, 15000, 25320, 15024, 19176,
- 15032, 27368, 15056, 21224, 15064, 29416, 15088, 23272, 15096, 31464, 15120, 17640, 15128, 25832, 15152, 19688,
- 15160, 27880, 15184, 21736, 15192, 29928, 15208, 15592, 15216, 23784, 15224, 31976, 15248, 18152, 15256, 26344,
- 15280, 20200, 15288, 28392, 15312, 22248, 15320, 30440, 15336, 16104, 15344, 24296, 15352, 32488, 15376, 16744,
- 15384, 24936, 15408, 18792, 15416, 26984, 15440, 20840, 15448, 29032, 15472, 22888, 15480, 31080, 15504, 17256,
- 15512, 25448, 15536, 19304, 15544, 27496, 15568, 21352, 15576, 29544, 15600, 23400, 15608, 31592, 15632, 17768,
- 15640, 25960, 15664, 19816, 15672, 28008, 15696, 21864, 15704, 30056, 15728, 23912, 15736, 32104, 15760, 18280,
- 15768, 26472, 15792, 20328, 15800, 28520, 15824, 22376, 15832, 30568, 15848, 16232, 15856, 24424, 15864, 32616,
- 15888, 16872, 15896, 25064, 15920, 18920, 15928, 27112, 15952, 20968, 15960, 29160, 15984, 23016, 15992, 31208,
- 16016, 17384, 16024, 25576, 16048, 19432, 16056, 27624, 16080, 21480, 16088, 29672, 16112, 23528, 16120, 31720,
- 16144, 17896, 16152, 26088, 16176, 19944, 16184, 28136, 16208, 21992, 16216, 30184, 16240, 24040, 16248, 32232,
- 16272, 18408, 16280, 26600, 16304, 20456, 16312, 28648, 16336, 22504, 16344, 30696, 16368, 24552, 16376, 32744,
- 16408, 24592, 16432, 18448, 16440, 26640, 16464, 20496, 16472, 28688, 16496, 22544, 16504, 30736, 16528, 16912,
- 16536, 25104, 16560, 18960, 16568, 27152, 16592, 21008, 16600, 29200, 16624, 23056, 16632, 31248, 16656, 17424,
- 16664, 25616, 16688, 19472, 16696, 27664, 16720, 21520, 16728, 29712, 16752, 23568, 16760, 31760, 16784, 17936,
- 16792, 26128, 16816, 19984, 16824, 28176, 16848, 22032, 16856, 30224, 16880, 24080, 16888, 32272, 16920, 24720,
- 16944, 18576, 16952, 26768, 16976, 20624, 16984, 28816, 17008, 22672, 17016, 30864, 17048, 25232, 17072, 19088,
- 17080, 27280, 17104, 21136, 17112, 29328, 17136, 23184, 17144, 31376, 17168, 17552, 17176, 25744, 17200, 19600,
- 17208, 27792, 17232, 21648, 17240, 29840, 17264, 23696, 17272, 31888, 17296, 18064, 17304, 26256, 17328, 20112,
- 17336, 28304, 17360, 22160, 17368, 30352, 17392, 24208, 17400, 32400, 17432, 24848, 17456, 18704, 17464, 26896,
- 17488, 20752, 17496, 28944, 17520, 22800, 17528, 30992, 17560, 25360, 17584, 19216, 17592, 27408, 17616, 21264,
- 17624, 29456, 17648, 23312, 17656, 31504, 17688, 25872, 17712, 19728, 17720, 27920, 17744, 21776, 17752, 29968,
- 17776, 23824, 17784, 32016, 17808, 18192, 17816, 26384, 17840, 20240, 17848, 28432, 17872, 22288, 17880, 30480,
- 17904, 24336, 17912, 32528, 17944, 24976, 17968, 18832, 17976, 27024, 18000, 20880, 18008, 29072, 18032, 22928,
- 18040, 31120, 18072, 25488, 18096, 19344, 18104, 27536, 18128, 21392, 18136, 29584, 18160, 23440, 18168, 31632,
- 18200, 26000, 18224, 19856, 18232, 28048, 18256, 21904, 18264, 30096, 18288, 23952, 18296, 32144, 18328, 26512,
- 18352, 20368, 18360, 28560, 18384, 22416, 18392, 30608, 18416, 24464, 18424, 32656, 18456, 24624, 18488, 26672,
- 18512, 20528, 18520, 28720, 18544, 22576, 18552, 30768, 18584, 25136, 18608, 18992, 18616, 27184, 18640, 21040,
- 18648, 29232, 18672, 23088, 18680, 31280, 18712, 25648, 18736, 19504, 18744, 27696, 18768, 21552, 18776, 29744,
- 18800, 23600, 18808, 31792, 18840, 26160, 18864, 20016, 18872, 28208, 18896, 22064, 18904, 30256, 18928, 24112,
- 18936, 32304, 18968, 24752, 19000, 26800, 19024, 20656, 19032, 28848, 19056, 22704, 19064, 30896, 19096, 25264,
- 19128, 27312, 19152, 21168, 19160, 29360, 19184, 23216, 19192, 31408, 19224, 25776, 19248, 19632, 19256, 27824,
- 19280, 21680, 19288, 29872, 19312, 23728, 19320, 31920, 19352, 26288, 19376, 20144, 19384, 28336, 19408, 22192,
- 19416, 30384, 19440, 24240, 19448, 32432, 19480, 24880, 19512, 26928, 19536, 20784, 19544, 28976, 19568, 22832,
- 19576, 31024, 19608, 25392, 19640, 27440, 19664, 21296, 19672, 29488, 19696, 23344, 19704, 31536, 19736, 25904,
- 19768, 27952, 19792, 21808, 19800, 30000, 19824, 23856, 19832, 32048, 19864, 26416, 19888, 20272, 19896, 28464,
- 19920, 22320, 19928, 30512, 19952, 24368, 19960, 32560, 19992, 25008, 20024, 27056, 20048, 20912, 20056, 29104,
- 20080, 22960, 20088, 31152, 20120, 25520, 20152, 27568, 20176, 21424, 20184, 29616, 20208, 23472, 20216, 31664,
- 20248, 26032, 20280, 28080, 20304, 21936, 20312, 30128, 20336, 23984, 20344, 32176, 20376, 26544, 20408, 28592,
- 20432, 22448, 20440, 30640, 20464, 24496, 20472, 32688, 20504, 24656, 20536, 26704, 20568, 28752, 20592, 22608,
- 20600, 30800, 20632, 25168, 20664, 27216, 20688, 21072, 20696, 29264, 20720, 23120, 20728, 31312, 20760, 25680,
- 20792, 27728, 20816, 21584, 20824, 29776, 20848, 23632, 20856, 31824, 20888, 26192, 20920, 28240, 20944, 22096,
- 20952, 30288, 20976, 24144, 20984, 32336, 21016, 24784, 21048, 26832, 21080, 28880, 21104, 22736, 21112, 30928,
- 21144, 25296, 21176, 27344, 21208, 29392, 21232, 23248, 21240, 31440, 21272, 25808, 21304, 27856, 21328, 21712,
- 21336, 29904, 21360, 23760, 21368, 31952, 21400, 26320, 21432, 28368, 21456, 22224, 21464, 30416, 21488, 24272,
- 21496, 32464, 21528, 24912, 21560, 26960, 21592, 29008, 21616, 22864, 21624, 31056, 21656, 25424, 21688, 27472,
- 21720, 29520, 21744, 23376, 21752, 31568, 21784, 25936, 21816, 27984, 21848, 30032, 21872, 23888, 21880, 32080,
- 21912, 26448, 21944, 28496, 21968, 22352, 21976, 30544, 22000, 24400, 22008, 32592, 22040, 25040, 22072, 27088,
- 22104, 29136, 22128, 22992, 22136, 31184, 22168, 25552, 22200, 27600, 22232, 29648, 22256, 23504, 22264, 31696,
- 22296, 26064, 22328, 28112, 22360, 30160, 22384, 24016, 22392, 32208, 22424, 26576, 22456, 28624, 22488, 30672,
- 22512, 24528, 22520, 32720, 22552, 24688, 22584, 26736, 22616, 28784, 22648, 30832, 22680, 25200, 22712, 27248,
- 22744, 29296, 22768, 23152, 22776, 31344, 22808, 25712, 22840, 27760, 22872, 29808, 22896, 23664, 22904, 31856,
- 22936, 26224, 22968, 28272, 23000, 30320, 23024, 24176, 23032, 32368, 23064, 24816, 23096, 26864, 23128, 28912,
- 23160, 30960, 23192, 25328, 23224, 27376, 23256, 29424, 23288, 31472, 23320, 25840, 23352, 27888, 23384, 29936,
- 23408, 23792, 23416, 31984, 23448, 26352, 23480, 28400, 23512, 30448, 23536, 24304, 23544, 32496, 23576, 24944,
- 23608, 26992, 23640, 29040, 23672, 31088, 23704, 25456, 23736, 27504, 23768, 29552, 23800, 31600, 23832, 25968,
- 23864, 28016, 23896, 30064, 23928, 32112, 23960, 26480, 23992, 28528, 24024, 30576, 24048, 24432, 24056, 32624,
- 24088, 25072, 24120, 27120, 24152, 29168, 24184, 31216, 24216, 25584, 24248, 27632, 24280, 29680, 24312, 31728,
- 24344, 26096, 24376, 28144, 24408, 30192, 24440, 32240, 24472, 26608, 24504, 28656, 24536, 30704, 24568, 32752,
- 24632, 26648, 24664, 28696, 24696, 30744, 24728, 25112, 24760, 27160, 24792, 29208, 24824, 31256, 24856, 25624,
- 24888, 27672, 24920, 29720, 24952, 31768, 24984, 26136, 25016, 28184, 25048, 30232, 25080, 32280, 25144, 26776,
- 25176, 28824, 25208, 30872, 25272, 27288, 25304, 29336, 25336, 31384, 25368, 25752, 25400, 27800, 25432, 29848,
- 25464, 31896, 25496, 26264, 25528, 28312, 25560, 30360, 25592, 32408, 25656, 26904, 25688, 28952, 25720, 31000,
- 25784, 27416, 25816, 29464, 25848, 31512, 25912, 27928, 25944, 29976, 25976, 32024, 26008, 26392, 26040, 28440,
- 26072, 30488, 26104, 32536, 26168, 27032, 26200, 29080, 26232, 31128, 26296, 27544, 26328, 29592, 26360, 31640,
- 26424, 28056, 26456, 30104, 26488, 32152, 26552, 28568, 26584, 30616, 26616, 32664, 26712, 28728, 26744, 30776,
- 26808, 27192, 26840, 29240, 26872, 31288, 26936, 27704, 26968, 29752, 27000, 31800, 27064, 28216, 27096, 30264,
- 27128, 32312, 27224, 28856, 27256, 30904, 27352, 29368, 27384, 31416, 27448, 27832, 27480, 29880, 27512, 31928,
- 27576, 28344, 27608, 30392, 27640, 32440, 27736, 28984, 27768, 31032, 27864, 29496, 27896, 31544, 27992, 30008,
- 28024, 32056, 28088, 28472, 28120, 30520, 28152, 32568, 28248, 29112, 28280, 31160, 28376, 29624, 28408, 31672,
- 28504, 30136, 28536, 32184, 28632, 30648, 28664, 32696, 28792, 30808, 28888, 29272, 28920, 31320, 29016, 29784,
- 29048, 31832, 29144, 30296, 29176, 32344, 29304, 30936, 29432, 31448, 29528, 29912, 29560, 31960, 29656, 30424,
- 29688, 32472, 29816, 31064, 29944, 31576, 30072, 32088, 30168, 30552, 30200, 32600, 30328, 31192, 30456, 31704,
- 30584, 32216, 30712, 32728, 30968, 31352, 31096, 31864, 31224, 32376, 31608, 31992, 31736, 32504, 32248, 32632,
-};
-extern const uint16_t bitrev4r_table_4096_fc32[];
-extern const uint16_t bitrev4r_table_4096_fc32_size;
-
-
-void dsps_fft4r_rev_tables_init_fc32(void)
-{
- dsps_fft4r_rev_tables_fc32[0] = (uint16_t *)bitrev4r_table_16_fc32;
- dsps_fft4r_rev_tables_fc32[1] = (uint16_t *)bitrev4r_table_64_fc32;
- dsps_fft4r_rev_tables_fc32[2] = (uint16_t *)bitrev4r_table_256_fc32;
- dsps_fft4r_rev_tables_fc32[3] = (uint16_t *)bitrev4r_table_1024_fc32;
- dsps_fft4r_rev_tables_fc32[4] = (uint16_t *)bitrev4r_table_4096_fc32;
-
-}
-
-uint16_t *dsps_fft4r_rev_tables_fc32[] = {
- (uint16_t *)bitrev4r_table_16_fc32,
- (uint16_t *)bitrev4r_table_64_fc32,
- (uint16_t *)bitrev4r_table_256_fc32,
- (uint16_t *)bitrev4r_table_1024_fc32,
- (uint16_t *)bitrev4r_table_4096_fc32,
-};
-
-const uint16_t bitrev4r_table_16_fc32_size = 6;
-const uint16_t bitrev4r_table_64_fc32_size = 24;
-const uint16_t bitrev4r_table_256_fc32_size = 120;
-const uint16_t bitrev4r_table_1024_fc32_size = 480;
-const uint16_t bitrev4r_table_4096_fc32_size = 2016;
-
-const uint16_t dsps_fft4r_rev_tables_fc32_size[] = {
- (const uint16_t)6, // bitrev4r_table_16_fc32_size,
- (const uint16_t)24, // bitrev4r_table_64_fc32_size,
- (const uint16_t)120, // bitrev4r_table_256_fc32_size,
- (const uint16_t)480, // bitrev4r_table_1024_fc32_size,
- (const uint16_t)2016,// bitrev4r_table_4096_fc32_size,
-};
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ae32.c b/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ae32.c
deleted file mode 100644
index 4868ca0..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ae32.c
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r.h"
-#include "dsps_fft4r.h"
-#include "dsp_common.h"
-#include "dsp_types.h"
-#include
-#include "esp_attr.h"
-
-#include "dsps_fft4r_platform.h"
-
-#if (dsps_fft4r_fc32_ae32_enabled == 1)
-esp_err_t dsps_fft4r_fc32_ae32_(float *data, int N, float *table, int table_size)
-{
- int log4N = dsp_power_of_two(N) / 2;
- int m = 2;
- int j;
- float *win = table;
-
- float *ptr0;
- float *ptr1;
- float *ptr2;
- float *ptr3;
- float *win0;
- float *win1;
- float *win2;
- int start_index;
- int wind_step = table_size >> (2 * log4N - 1);
-
- asm volatile ("mov %0, %1" : "=a" (ptr0) : "a" (data));
- asm volatile ("mov %0, %1" : "=a" (ptr1) : "a" (data));
- asm volatile ("mov %0, %1" : "=a" (ptr2) : "a" (data));
- asm volatile ("mov %0, %1" : "=a" (ptr3) : "a" (data));
- asm volatile ("mov %0, %1" : "=a" (win0) : "a" (win)); //win0 = win;
- asm volatile ("mov %0, %1" : "=a" (win1) : "a" (win)); //win1 = win;
- asm volatile ("mov %0, %1" : "=a" (win2) : "a" (win)); //win2 = win;
-
- //asm volatile ("slli %0, %0, 1" : "+a" (m)); ////m <<= 1;
-
- while (1) { ///radix 4
- if (log4N == 0) {
- break;
- }
- asm volatile ("srli %0, %0, 2" : "+a" (N)); //N = N >> 2;
- for (j = 0; j < m; j += 2) { // j: which FFT of this step
- asm volatile ("mul16u %0, %1, %2" : "=a" (start_index) : "a" (j), "a" (N)); ///int start_index = j * (N << 1); // N: N-point FFT
- asm volatile ("slli %0, %0, 1" : "+a" (start_index));
- asm volatile ("addx8 %0, %1, %2" : "+a" (ptr0) : "a" (start_index), "a" (data)); //ptr0 = data + (start_index << 1);
- asm volatile ("addx8 %0, %1, %2" : "+a" (ptr1) : "a" (N), "a" (ptr0)); //ptr1 = ptr0 + (N << 1);
- asm volatile ("addx8 %0, %1, %2" : "+a" (ptr2) : "a" (N), "a" (ptr1)); //ptr2 = ptr1 + (N << 1);
- asm volatile ("addx8 %0, %1, %2" : "+a" (ptr3) : "a" (N), "a" (ptr2)); //ptr3 = ptr2 + (N << 1);
-
- asm volatile ("loopnez %0, _loop_end_radix4_butterfly4_fft" :: "a"(N)); /// for (k = 0; k < N; k++) {
- asm volatile ("lsi f1, %0, 4" :: "a" (ptr0)); //f1 = *(ptr0 + 1);
- asm volatile ("lsi f3, %0, 4" :: "a" (ptr2)); //f3 = *(ptr2 + 1);
- asm volatile ("lsi f0, %0, 0" :: "a" (ptr0)); //f0 = *ptr0;
- asm volatile ("lsi f2, %0, 0" :: "a" (ptr2)); //f2 = *ptr2;
- asm volatile ("add.s f5, f1, f3"); //f5 = f1 + f3;
- asm volatile ("sub.s f7, f1, f3"); //f7 = f1 - f3;
- asm volatile ("lsi f1, %0, 4" :: "a" (ptr1)); //f1 = *(ptr1 + 1);
- asm volatile ("lsi f3, %0, 4" :: "a" (ptr3)); //f3 = *(ptr3 + 1);
-
- asm volatile ("add.s f4, f0, f2"); //f4 = f0 + f2;
- asm volatile ("sub.s f6, f0, f2"); //f6 = f0 - f2;
- asm volatile ("add.s f9, f1, f3"); //f9 = f1 + f3;
- asm volatile ("sub.s f11, f1, f3"); //f11 = f1 - f3;
-
- asm volatile ("lsi f0, %0, 0" :: "a" (ptr1)); //f0 = *ptr1;
- asm volatile ("lsi f2, %0, 0" :: "a" (ptr3)); //f2 = *ptr3;
-
- asm volatile ("lsi f12, %0, 0" :: "a" (win0)); //f12 = *win0; //f12 = win[k * 1 * m * 2 + 0];
- asm volatile ("lsi f13, %0, 0" :: "a" (win1)); //f13 = *win1; //f13 = win[k * 2 * m * 2 + 0];
- asm volatile ("add.s f8, f0, f2"); //f8 = f0 + f2;
- asm volatile ("sub.s f10, f0, f2"); //f10 = f0 - f2;
-
- asm volatile ("sub.s f1, f5, f9"); //f1 = f5 - f9;
- asm volatile ("add.s f5, f5, f9"); //f5 = f5 + f9;
- asm volatile ("add.s f2, f6, f11"); //f2 = f6 + f11; ///this fft & ifft is different
- asm volatile ("sub.s f6, f6, f11"); //f6 = f6 - f11; ///this fft & ifft is different
-
- asm volatile ("sub.s f0, f4, f8"); //f0 = f4 - f8;
- asm volatile ("add.s f4, f4, f8"); //f4 = f4 + f8;
- asm volatile ("sub.s f3, f7, f10"); //f3 = f7 - f10; ///this fft & ifft is different
- asm volatile ("add.s f7, f7, f10"); //f7 = f7 + f10; ///this fft & ifft is different
-
- asm volatile ("lsi f14, %0, 0" :: "a" (win2)); //f14 = *win2; //f14 = win[k * 3 * m * 2 + 0];
-
- asm volatile ("ssi f5, %0, 4" :: "a" (ptr0)); //*(ptr0 + 1) = f5;
- asm volatile ("ssip f4, %0, 8" :: "a" (ptr0)); //*ptr0 = f4; ptr0 += 2;
- asm volatile ("mul.s f5, f3, f12"); //f5 = f3 * f12;
- asm volatile ("mul.s f4, f2, f12"); //f4 = f2 * f12;
- asm volatile ("mul.s f9, f1, f13"); //f9 = f1 * f13;
- asm volatile ("mul.s f8, f0, f13"); //f8 = f0 * f13;
- asm volatile ("mul.s f11, f7, f14"); //f11 = f7 * f14;
- asm volatile ("mul.s f10, f6, f14"); //f10 = f6 * f14;
- asm volatile ("lsi f12, %0, 4" :: "a" (win0)); //f12 = *(win0 + 1); //f12 = win[k * 1 * m * 2 + 1];
- asm volatile ("lsi f13, %0, 4" :: "a" (win1)); //f13 = *(win1 + 1); //si2 = win[k * 2 * m * 2 + 1];
- asm volatile ("lsi f14, %0, 4" :: "a" (win2)); //f14 = *(win2 + 1); //si3 = win[k * 3 * m * 2 + 1]
-
- asm volatile ("addx4 %0, %1, %0" : "+a" (win0) : "a" (wind_step)); //win0 += 1 * m;
- asm volatile ("addx8 %0, %1, %0" : "+a" (win1) : "a" (wind_step)); //win1 += 2 * m;
- asm volatile ("addx8 %0, %1, %0" : "+a" (win2) : "a" (wind_step)); //win2 += 2 * m;
- asm volatile ("addx4 %0, %1, %0" : "+a" (win2) : "a" (wind_step)); //win2 += 1 * m;
- asm volatile ("msub.s f5, f2, f12"); //f5 -= f2 * f12;
- asm volatile ("madd.s f4, f3, f12"); //f4 += f3 * f12;
- asm volatile ("msub.s f9, f0, f13"); //f9 -= f0 * f13;
- asm volatile ("madd.s f8, f1, f13"); //f8 += f1 * f13;
- asm volatile ("msub.s f11, f6, f14"); //f11 -= f6 * f14;
- asm volatile ("madd.s f10, f7, f14"); //f10 += f7 * f14;
- asm volatile ("ssi f5, %0, 4" :: "a" (ptr1)); //*(ptr1 + 1) = f5;
- asm volatile ("ssip f4, %0, 8" :: "a" (ptr1)); //*ptr1 = f4; ptr1 += 2;
- asm volatile ("ssi f9, %0, 4" :: "a" (ptr2)); //*(ptr2 + 1) = f9;
- asm volatile ("ssip f8, %0, 8" :: "a" (ptr2)); //*ptr2 = f8; ptr2 += 2;
- asm volatile ("ssi f11, %0, 4" :: "a" (ptr3)); //*(ptr3 + 1) = f11;
- asm volatile ("ssip f10, %0, 8" :: "a" (ptr3)); //*ptr3 = f10; ptr3 += 2;
- //}
- asm volatile ("_loop_end_radix4_butterfly4_fft: mov %0, %1" : "=a" (win0) : "a" (win)); //win0 = win;
- asm volatile ("mov %0, %1" : "=a" (win0) : "a" (win)); //win0 = win;
- asm volatile ("mov %0, %1" : "=a" (win1) : "a" (win)); //win1 = win;
- asm volatile ("mov %0, %1" : "=a" (win2) : "a" (win)); //win2 = win;
- }
- asm volatile ("slli %0, %0, 2" : "+a" (m)); /// m = m << 2;
- asm volatile ("slli %0, %0, 2" : "+a" (wind_step)); /// m = m << 2;
- asm volatile ("addi %0, %0, -1" : "+a" (log4N)); ///log4N--;
- }
- return ESP_OK;
-}
-#endif // dsps_fft4r_fc32_ae32_enabled
-
-#if (dsps_cplx2real_fc32_ae32_enabled == 1)
-esp_err_t dsps_cplx2real_fc32_ae32_(float *data, int fft_points, float *table, int table_size)
-{
- float *ptr_inv;
-
- int wind_step = table_size / (fft_points);
-
- float *win0 = table + wind_step;
- float *win1 = table + wind_step * 2;
-
- ////0 & 1 => dc frequency
- ///fft_points * 2 + 0 & fft_points * 2 + 1 => Nyquist frequency
- asm volatile ("const.s f14, 0"); //f14 = 0f;
- asm volatile ("lsi f0, %0, 0" :: "a" (data)); //f0 = *data;
- asm volatile ("lsi f1, %0, 4" :: "a" (data)); //f1 = *(data + 1);
- asm volatile ("addx8 %0, %1, %2" : "=a" (ptr_inv) : "a" (fft_points), "a" (data)); //ptr_inv = data + fft_points * 2;
- asm volatile ("add.s f6, f0, f1"); //f6 = f0 + f1;
- asm volatile ("sub.s f7, f0, f1"); //f7 = f0 - f1;
-
- asm volatile ("srli %0, %0, 2" : "+a" (fft_points)); //fft_points >>= 2;
-
- asm volatile ("const.s f14, 3"); //f14 = 0.5f;, this is for multiply 0.5
- asm volatile ("neg.s f15, f14"); //f15 = -f14;
-
- asm volatile ("ssi f6, %0, 0" :: "a" (data)); //*data = f6;
- asm volatile ("ssi f7, %0, 4" :: "a" (data)); //*ptr_inv = f7;
- asm volatile ("addi %0, %0, -16" : "+a" (ptr_inv)); //ptr_inv -= 4; ///here increase address by -4 because float load/store not support negective immediate offset
-
- asm volatile ("loopnez %0, __loop_end_fftr_real_post_proc" :: "a" (fft_points)); //for (k = 0; k < fft_points; k++) {
- asm volatile ("lsi f1, %0, 12" :: "a" (data)); //f1 = *(data + 3);
- asm volatile ("lsi f3, %0, 12" :: "a" (ptr_inv)); //f3 = *(ptr_inv + 3);
- asm volatile ("lsi f0, %0, 8" :: "a" (data)); //f0 = *(data + 2);
- asm volatile ("lsi f2, %0, 8" :: "a" (ptr_inv)); //f2 = *(ptr_inv + 2);
-
- asm volatile ("lsi f7, %0, 20" :: "a" (data)); //f7 = *(data + 5);
- asm volatile ("lsi f9, %0, 4" :: "a" (ptr_inv)); //f9 = *(ptr_inv + 1);
-
- asm volatile ("lsi f6, %0, 16" :: "a" (data)); //f6 = *(data + 4);
- asm volatile ("lsi f8, %0, 0" :: "a" (ptr_inv)); //f8 = *ptr_inv;
- asm volatile ("sub.s f5, f1, f3"); //f5 = f1 - f3;
- asm volatile ("add.s f4, f0, f2"); //f4 = f0 + f2;
- asm volatile ("sub.s f11, f7, f9"); //f11 = f7 - f9;
- asm volatile ("add.s f10, f6, f8"); //f10 = f6 + f8;
-
- asm volatile ("add.s f1, f1, f3"); //f1 = f1 + f3;
- asm volatile ("sub.s f0, f0, f2"); //f0 = f0 - f2;
-
- asm volatile ("lsi f12, %0, 4" :: "a" (win0)); //f12 = *(win + 1);
- asm volatile ("add.s f7, f7, f9"); //f7 = f7 + f9;
- asm volatile ("sub.s f6, f6, f8"); //f6 = f6 - f8;
- asm volatile ("lsi f13, %0, 4" :: "a" (win1)); //f13 = *(win + 3);
-
- asm volatile ("mul.s f3, f1, f12"); //f3 = f1 * f12;
- asm volatile ("mul.s f2, f0, f12"); //f2 = f0 * f12;
- asm volatile ("lsi f12, %0, 0" :: "a" (win0)); //f12 = *(win + 0);
-
- asm volatile ("mul.s f9, f7, f13"); //f9 = f7 * f13;
- asm volatile ("mul.s f8, f6, f13"); //f8 = f6 * f13;
-
- asm volatile ("lsi f13, %0, 0" :: "a" (win1)); //f13 = *(win + 2);
-
- asm volatile ("madd.s f3, f0, f12"); //f3 += f0 * f12;
- asm volatile ("msub.s f2, f1, f12"); //f2 -= f1 * f12;
- asm volatile ("madd.s f9, f6, f13"); //f9 += f6 * f13;
- asm volatile ("msub.s f8, f7, f13"); //f8 -= f7 * f13;
- asm volatile ("addx8 %0, %1, %0" : "+a" (win0) : "a" (wind_step)); //win0 += 8 * wind_step;
- asm volatile ("addx8 %0, %1, %0" : "+a" (win1) : "a" (wind_step)); //win1 += 8 * wind_step;
- // Here we have tw1: f2,f3 and tw2: f8,f9
-
- asm volatile ("sub.s f1, f5, f3"); //f1 = f5 - f3;
- asm volatile ("sub.s f0, f4, f2"); //f0 = f4 - f2;
-
- asm volatile ("add.s f3, f3, f5"); //f3 = f3 + f5;
- asm volatile ("add.s f2, f4, f2"); //f2 = f4 + f2;
-
- asm volatile ("sub.s f7, f11, f9"); //f7 = f11 - f9;
- asm volatile ("sub.s f6, f10, f8"); //f6 = f10 - f8;
- asm volatile ("add.s f9, f9, f11"); //f9 = f9 + f11;
- asm volatile ("add.s f8, f10, f8"); //f8 = f10 + f8;
-
- asm volatile ("mul.s f1, f1, f14"); //f1 *= f14;
- asm volatile ("mul.s f0, f0, f14"); //f0 *= f14;
-
- asm volatile ("mul.s f3, f3, f15"); //f3 *= -f14;
- asm volatile ("mul.s f2, f2, f14"); //f2 *= f14;
-
- asm volatile ("mul.s f7, f7, f14"); //f7 *= f14;
- asm volatile ("mul.s f6, f6, f14"); //f6 *= f14;
- asm volatile ("mul.s f9, f9, f15"); //f9 *= -f14;
- asm volatile ("mul.s f8, f8, f14"); //f8 *= f14;
-
- asm volatile ("ssi f1, %0, 12" :: "a" (data)); //*(data + 3) = f1;
- asm volatile ("ssi f0, %0, 8" :: "a" (data)); //*(data + 2) = f0;
-
- asm volatile ("ssi f3, %0, 12" :: "a" (ptr_inv)); //*(ptr_inv + 3) = f3;
- asm volatile ("ssi f2, %0, 8" :: "a" (ptr_inv)); //*(ptr_inv + 2) = f2;
-
- asm volatile ("ssi f7, %0, 20" :: "a" (data)); //*(data + 5) = f7;
- asm volatile ("ssi f6, %0, 16" :: "a" (data)); //*(data + 4) = f6;
- asm volatile ("addi %0, %0, 16" : "+a" (data)); //data += 4;
-
- asm volatile ("ssi f9, %0, 4" :: "a" (ptr_inv)); //*(ptr_inv + 1) = f9;
- asm volatile ("ssi f8, %0, 0" :: "a" (ptr_inv)); //*ptr_inv = f8;
- asm volatile ("addi %0, %0, -16" : "+a" (ptr_inv)); //ptr_inv -= 4;
- //}
- asm volatile ("__loop_end_fftr_real_post_proc: nop");
-
- return ESP_OK;
-}
-#endif // dsps_cplx2real_fc32_ae32_enabled
diff --git a/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ansi.c b/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ansi.c
deleted file mode 100644
index 303e209..0000000
--- a/components/esp-dsp/modules/fft/float/dsps_fft4r_fc32_ansi.c
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fft2r.h"
-#include "dsps_fft4r.h"
-#include "dsp_common.h"
-#include "dsp_types.h"
-#include
-#include "esp_attr.h"
-#include "esp_log.h"
-#include
-
-static const char *TAG = "fftr4 ansi";
-
-float *dsps_fft4r_w_table_fc32;
-int dsps_fft4r_w_table_size;
-uint8_t dsps_fft4r_initialized = 0;
-uint8_t dsps_fft4r_mem_allocated = 0;
-//float* win2;
-uint16_t *dsps_fft4r_ram_rev_table = NULL;
-
-esp_err_t dsps_fft4r_init_fc32(float *fft_table_buff, int max_fft_size)
-{
- esp_err_t result = ESP_OK;
- if (dsps_fft4r_initialized != 0) {
- return result;
- }
- if (max_fft_size > CONFIG_DSP_MAX_FFT_SIZE) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- if (max_fft_size == 0) {
- return result;
- }
- if (fft_table_buff != NULL) {
- if (dsps_fft4r_mem_allocated) {
- return ESP_ERR_DSP_REINITIALIZED;
- }
- dsps_fft4r_w_table_fc32 = fft_table_buff;
- dsps_fft4r_w_table_size = max_fft_size * 2;
- } else {
- if (!dsps_fft4r_mem_allocated) {
- dsps_fft4r_w_table_fc32 = (float *)malloc(max_fft_size * sizeof(float) * 4);
- if (NULL == dsps_fft4r_w_table_fc32) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- }
- dsps_fft4r_w_table_size = max_fft_size * 2;
- dsps_fft4r_mem_allocated = 1;
- }
-
- // FFT ram_rev table allocated
- int pow = dsp_power_of_two(max_fft_size) >> 1;
- if ((pow >= 2) && (pow <= 6)) {
- dsps_fft4r_ram_rev_table = (uint16_t *)malloc(2 * dsps_fft4r_rev_tables_fc32_size[pow - 2] * sizeof(uint16_t));
- if (NULL == dsps_fft4r_ram_rev_table) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
- memcpy(dsps_fft4r_ram_rev_table, dsps_fft4r_rev_tables_fc32[pow - 2], 2 * dsps_fft4r_rev_tables_fc32_size[pow - 2] * sizeof(uint16_t));
- dsps_fft4r_rev_tables_fc32[pow - 2] = dsps_fft4r_ram_rev_table;
- }
-
- for (int i = 0; i < dsps_fft4r_w_table_size; i++) {
- float angle = 2 * M_PI * i / (float)dsps_fft4r_w_table_size;
- dsps_fft4r_w_table_fc32[2 * i + 0] = cosf(angle);
- dsps_fft4r_w_table_fc32[2 * i + 1] = sinf(angle);
- }
-
- dsps_fft4r_initialized = 1;
-
- return ESP_OK;
-}
-
-void dsps_fft4r_deinit_fc32()
-{
- if (dsps_fft4r_mem_allocated) {
- free(dsps_fft4r_w_table_fc32);
- }
- if (dsps_fft4r_ram_rev_table != NULL) {
- free(dsps_fft4r_ram_rev_table);
- dsps_fft4r_ram_rev_table = NULL;
- }
- // Re init bitrev table for next use
- dsps_fft4r_rev_tables_init_fc32();
-
- dsps_fft4r_mem_allocated = 0;
- dsps_fft4r_initialized = 0;
-}
-
-esp_err_t dsps_bit_rev4r_direct_fc32_ansi(float *data, int N)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- if (0 == dsps_fft4r_initialized) {
- return ESP_ERR_DSP_UNINITIALIZED;
- }
- esp_err_t result = ESP_OK;
- int log2N = dsp_power_of_two(N);
- int log4N = log2N >> 1;
- if ((log2N & 0x01) != 0) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
- float r_temp, i_temp;
- for (int i = 0; i < N; i++) {
- int cnt;
- int xx;
- int bits2;
- xx = 0;
- cnt = log4N;
- int j = i;
- while (cnt > 0) {
- bits2 = j & 0x3;
- xx = (xx << 2) + bits2;
- j = j >> 2;
- cnt--;
- }
- if (i < xx) {
- r_temp = data[i * 2 + 0];
- i_temp = data[i * 2 + 1];
- data[i * 2 + 0] = data[xx * 2 + 0];
- data[i * 2 + 1] = data[xx * 2 + 1];
- data[xx * 2 + 0] = r_temp;
- data[xx * 2 + 1] = i_temp;
- }
- }
- return result;
-}
-
-esp_err_t dsps_fft4r_fc32_ansi_(float *data, int length, float *table, int table_size)
-{
- if (0 == dsps_fft4r_initialized) {
- return ESP_ERR_DSP_UNINITIALIZED;
- }
-
- fc32_t bfly[4];
- int log2N = dsp_power_of_two(length);
- int log4N = log2N >> 1;
- if ((log2N & 0x01) != 0) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- int m = 2;
- int wind_step = table_size / length;
- while (1) { ///radix 4
- if (log4N == 0) {
- break;
- }
- length = length >> 2;
- for (int j = 0; j < m; j += 2) { // j: which FFT of this step
- int start_index = j * (length << 1); // n: n-point FFT
-
- fc32_t *ptrc0 = (fc32_t *)data + start_index;
- fc32_t *ptrc1 = ptrc0 + length;
- fc32_t *ptrc2 = ptrc1 + length;
- fc32_t *ptrc3 = ptrc2 + length;
-
- fc32_t *winc0 = (fc32_t *)table;
- fc32_t *winc1 = winc0;
- fc32_t *winc2 = winc0;
-
- for (int k = 0; k < length; k++) {
- fc32_t in0 = *ptrc0;
- fc32_t in2 = *ptrc2;
- fc32_t in1 = *ptrc1;
- fc32_t in3 = *ptrc3;
-
- bfly[0].re = in0.re + in2.re + in1.re + in3.re;
- bfly[0].im = in0.im + in2.im + in1.im + in3.im;
-
- bfly[1].re = in0.re - in2.re + in1.im - in3.im;
- bfly[1].im = in0.im - in2.im - in1.re + in3.re;
-
- bfly[2].re = in0.re + in2.re - in1.re - in3.re;
- bfly[2].im = in0.im + in2.im - in1.im - in3.im;
-
- bfly[3].re = in0.re - in2.re - in1.im + in3.im;
- bfly[3].im = in0.im - in2.im + in1.re - in3.re;
-
-
-
- *ptrc0 = bfly[0];
- ptrc1->re = bfly[1].re * winc0->re + bfly[1].im * winc0->im;
- ptrc1->im = bfly[1].im * winc0->re - bfly[1].re * winc0->im;
- ptrc2->re = bfly[2].re * winc1->re + bfly[2].im * winc1->im;
- ptrc2->im = bfly[2].im * winc1->re - bfly[2].re * winc1->im;
- ptrc3->re = bfly[3].re * winc2->re + bfly[3].im * winc2->im;
- ptrc3->im = bfly[3].im * winc2->re - bfly[3].re * winc2->im;
-
- winc0 += 1 * wind_step;
- winc1 += 2 * wind_step;
- winc2 += 3 * wind_step;
-
- ptrc0++;
- ptrc1++;
- ptrc2++;
- ptrc3++;
- }
- }
- m = m << 2;
- wind_step = wind_step << 2;
- log4N--;
- }
- return ESP_OK;
-}
-
-esp_err_t dsps_cplx2real_fc32_ansi_(float *data, int N, float *table, int table_size)
-{
- if (0 == dsps_fft4r_initialized) {
- return ESP_ERR_DSP_UNINITIALIZED;
- }
- int wind_step = table_size / (N);
- fc32_t *result = (fc32_t *)data;
- // Original formula...
- // result[0].re = result[0].re + result[0].im;
- // result[N].re = result[0].re - result[0].im;
- // result[0].im = 0;
- // result[N].im = 0;
- // Optimized one:
- float tmp_re = result[0].re;
- result[0].re = tmp_re + result[0].im;
- result[0].im = tmp_re - result[0].im;
-
- fc32_t f1k, f2k;
- for (int k = 1; k <= N / 2 ; k++ ) {
- fc32_t fpk = result[k];
- fc32_t fpnk = result[N - k];
- f1k.re = fpk.re + fpnk.re;
- f1k.im = fpk.im - fpnk.im;
- f2k.re = fpk.re - fpnk.re;
- f2k.im = fpk.im + fpnk.im;
-
- float c = -table[k * wind_step + 1];
- float s = -table[k * wind_step + 0];
- fc32_t tw;
- tw.re = c * f2k.re - s * f2k.im;
- tw.im = s * f2k.re + c * f2k.im;
-
- result[k].re = 0.5 * (f1k.re + tw.re);
- result[k].im = 0.5 * (f1k.im + tw.im);
- result[N - k].re = 0.5 * (f1k.re - tw.re);
- result[N - k].im = 0.5 * (tw.im - f1k.im);
- }
- return ESP_OK;
-}
-
-esp_err_t dsps_gen_bitrev4r_table(int N, int step, char *name_ext)
-{
- if (!dsp_is_power_of_two(N)) {
- return ESP_ERR_DSP_INVALID_LENGTH;
- }
-
- int items_count = 0;
- ESP_LOGD(TAG, "const uint16_t bitrev4r_table_%i_%s[] = { ", N, name_ext);
- int log2N = dsp_power_of_two(N);
- int log4N = log2N >> 1;
-
- for (int i = 1; i < N - 1; i++) {
- int cnt;
- int xx;
- int bits2;
- xx = 0;
- cnt = log4N;
- int j = i;
- while (cnt > 0) {
- bits2 = j & 0x3;
- xx = (xx << 2) + bits2;
- j = j >> 2;
- cnt--;
- }
- if (i < xx) {
- ESP_LOGD(TAG, "%i, %i, ", i * step, xx * step);
- items_count++;
- if ((items_count % 8) == 0) {
- ESP_LOGD(TAG, " ");
- }
- }
- }
-
- ESP_LOGD(TAG, "};");
- ESP_LOGD(TAG, "const uint16_t bitrev4r_table_%i_%s_size = %i;\n", N, name_ext, items_count);
-
- ESP_LOGD(TAG, "extern const uint16_t bitrev4r_table_%i_%s[];", N, name_ext);
- ESP_LOGD(TAG, "extern const uint16_t bitrev4r_table_%i_%s_size;\n", N, name_ext);
- return ESP_OK;
-}
-
-esp_err_t dsps_bit_rev4r_fc32(float *data, int N)
-{
- uint16_t *table;
- uint16_t table_size;
- switch (N) {
- case 16:
- table = (uint16_t *)dsps_fft4r_rev_tables_fc32[0];
- table_size = dsps_fft4r_rev_tables_fc32_size[0];
- break;
- case 64:
- table = (uint16_t *)dsps_fft4r_rev_tables_fc32[1];
- table_size = dsps_fft4r_rev_tables_fc32_size[1];
- break;
- case 256:
- table = (uint16_t *)dsps_fft4r_rev_tables_fc32[2];
- table_size = dsps_fft4r_rev_tables_fc32_size[2];
- break;
- case 1024:
- table = (uint16_t *)dsps_fft4r_rev_tables_fc32[3];
- table_size = dsps_fft4r_rev_tables_fc32_size[3];
- break;
- case 4096:
- table = (uint16_t *)dsps_fft4r_rev_tables_fc32[4];
- table_size = dsps_fft4r_rev_tables_fc32_size[4];
- break;
-
- default:
- return dsps_bit_rev4r_direct_fc32_ansi(data, N);
- break;
- }
-
- return dsps_bit_rev_lookup_fc32(data, table_size, table);
-}
-
diff --git a/components/esp-dsp/modules/fft/include/dsps_fft2r.h b/components/esp-dsp/modules/fft/include/dsps_fft2r.h
deleted file mode 100644
index 25f6fb8..0000000
--- a/components/esp-dsp/modules/fft/include/dsps_fft2r.h
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_fft2r_H_
-#define _dsps_fft2r_H_
-
-#include "dsp_err.h"
-#include "sdkconfig.h"
-#include "dsps_fft_tables.h"
-
-#ifndef CONFIG_DSP_MAX_FFT_SIZE
-#define CONFIG_DSP_MAX_FFT_SIZE 4096
-#endif // CONFIG_DSP_MAX_FFT_SIZE
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-extern float *dsps_fft_w_table_fc32;
-extern int dsps_fft_w_table_size;
-extern uint8_t dsps_fft2r_initialized;
-
-extern int16_t *dsps_fft_w_table_sc16;
-extern int dsps_fft_w_table_sc16_size;
-extern uint8_t dsps_fft2r_sc16_initialized;
-
-
-/**@{*/
-/**
- * @brief init fft tables
- *
- * Initialization of Complex FFT. This function initialize coefficients table.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] fft_table_buff: pointer to floating point buffer where sin/cos table will be stored
- * if this parameter set to NULL, and table_size value is more then 0, then
- * dsps_fft2r_init_fc32 will allocate buffer internally
- * @param[in] table_size: size of the buffer in float words
- * if fft_table_buff is NULL and table_size is not 0, buffer will be allocated internally.
- * If table_size is 0, buffer will not be allocated.
- *
- * @return
- * - ESP_OK on success
- * - ESP_ERR_DSP_PARAM_OUTOFRANGE if table_size > CONFIG_DSP_MAX_FFT_SIZE
- * - ESP_ERR_DSP_REINITIALIZED if buffer already allocated internally by other function
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fft2r_init_fc32(float *fft_table_buff, int table_size);
-esp_err_t dsps_fft2r_init_sc16(int16_t *fft_table_buff, int table_size);
-/**@}*/
-
-/**@{*/
-/**
- * @brief deinit fft tables
- *
- * Free resources of Complex FFT. This function delete coefficients table if it was allocated by dsps_fft2r_init_fc32.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- *
- * @return
- */
-void dsps_fft2r_deinit_fc32();
-void dsps_fft2r_deinit_sc16();
-/**@}*/
-
-/**@{*/
-/**
- * @brief complex FFT of radix 2
- *
- * Complex FFT of radix 2
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[inout] data: input/output complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1]
- * result of FFT will be stored to this array.
- * @param[in] N: Number of complex elements in input array
- * @param[in] w: pointer to the sin/cos table
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fft2r_fc32_ansi_(float *data, int N, float *w);
-esp_err_t dsps_fft2r_fc32_ae32_(float *data, int N, float *w);
-esp_err_t dsps_fft2r_sc16_ansi_(int16_t *data, int N, int16_t *w);
-esp_err_t dsps_fft2r_sc16_ae32_(int16_t *data, int N, int16_t *w);
-/**@}*/
-// This is workaround because linker generates permanent error when assembler uses
-// direct access to the table pointer
-#define dsps_fft2r_fc32_ae32(data, N) dsps_fft2r_fc32_ae32_(data, N, dsps_fft_w_table_fc32)
-#define dsps_fft2r_sc16_ae32(data, N) dsps_fft2r_sc16_ae32_(data, N, dsps_fft_w_table_sc16)
-#define dsps_fft2r_fc32_ansi(data, N) dsps_fft2r_fc32_ansi_(data, N, dsps_fft_w_table_fc32)
-#define dsps_fft2r_sc16_ansi(data, N) dsps_fft2r_sc16_ansi_(data, N, dsps_fft_w_table_sc16)
-
-
-/**@{*/
-/**
- * @brief bit reverse operation for the complex input array
- *
- * Bit reverse operation for the complex input array
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] data: input/ complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1]
- * result of FFT will be stored to this array.
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_bit_rev_fc32_ansi(float *data, int N);
-esp_err_t dsps_bit_rev_sc16_ansi(int16_t *data, int N);
-esp_err_t dsps_bit_rev2r_fc32(float *data, int N);
-
-/**@{*/
-
-esp_err_t dsps_bit_rev_lookup_fc32_ansi(float *data, int reverse_size, uint16_t *reverse_tab);
-esp_err_t dsps_bit_rev_lookup_fc32_ae32(float *data, int reverse_size, uint16_t *reverse_tab);
-
-/**
- * @brief Generate coefficients table for the FFT radix 2
- *
- * Generate coefficients table for the FFT radix 2. This function called inside init.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] w: memory location to store coefficients.
- * By default coefficients will be stored to the dsps_fft_w_table_fc32.
- * Maximum size of the FFT must be setup in menuconfig
- * @param[in] N: maximum size of the FFT that will be used
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_gen_w_r2_fc32(float *w, int N);
-esp_err_t dsps_gen_w_r2_sc16(int16_t *w, int N);
-/**@}*/
-
-/**@{*/
-/**
- * @brief Convert complex array to two real arrays
- *
- * Convert complex array to two real arrays in case if input was two real arrays.
- * This function have to be used if FFT used to process real data.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] data: Input complex array and result of FFT2R.
- * input has size of 2*N, because contains real and imaginary part.
- * result will be stored to the same array.
- * Input1: input[0..N-1], Input2: input[N..2*N-1]
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_cplx2reC_fc32_ansi(float *data, int N);
-esp_err_t dsps_cplx2reC_sc16(int16_t *data, int N);
-/**@}*/
-
-/**@{*/
-/**
- * @brief Convert complex FFT result to real array
- *
- * Convert FFT result of complex FFT for resl input to real array.
- * This function have to be used if FFT used to process real data.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] data: Input complex array and result of FFT2R.
- * input has size of 2*N, because contains real and imaginary part.
- * result will be stored to the same array.
- * Input1: input[0..N-1], Input2: input[N..2*N-1]
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_cplx2real_sc16_ansi(int16_t *data, int N);
-/**@}*/
-esp_err_t dsps_cplx2real256_fc32_ansi(float *data);
-
-esp_err_t dsps_gen_bitrev2r_table(int N, int step, char *name_ext);
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#define dsps_bit_rev_fc32 dsps_bit_rev_fc32_ansi
-#define dsps_cplx2reC_fc32 dsps_cplx2reC_fc32_ansi
-
-#if (dsps_fft2r_fc32_ae32_enabled == 1)
-#define dsps_fft2r_fc32 dsps_fft2r_fc32_ae32
-#else
-#define dsps_fft2r_fc32 dsps_fft2r_fc32_ansi
-#endif
-
-#if (dsps_fft2r_sc16_ae32_enabled == 1)
-#define dsps_fft2r_sc16 dsps_fft2r_sc16_ae32
-#else
-#define dsps_fft2r_sc16 dsps_fft2r_sc16_ansi
-#endif
-
-#if (dsps_bit_rev_lookup_fc32_ae32_enabled == 1)
-# define dsps_bit_rev_lookup_fc32 dsps_bit_rev_lookup_fc32_ae32
-#else
-#define dsps_bit_rev_lookup_fc32 dsps_bit_rev_lookup_fc32_ansi
-#endif
-
-#else // CONFIG_DSP_OPTIMIZED
-
-#define dsps_fft2r_fc32 dsps_fft2r_fc32_ansi
-#define dsps_bit_rev_fc32 dsps_bit_rev_fc32_ansi
-#define dsps_cplx2reC_fc32 dsps_cplx2reC_fc32_ansi
-#define dsps_bit_rev_sc16 dsps_bit_rev_sc16_ansi
-#define dsps_bit_rev_lookup_fc32 dsps_bit_rev_lookup_fc32_ansi
-
-#endif // CONFIG_DSP_OPTIMIZED
-
-#endif // _dsps_fft2r_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/include/dsps_fft2r_platform.h b/components/esp-dsp/modules/fft/include/dsps_fft2r_platform.h
deleted file mode 100644
index 90a67ff..0000000
--- a/components/esp-dsp/modules/fft/include/dsps_fft2r_platform.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _dsps_fft2r_platform_H_
-#define _dsps_fft2r_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_fft2r_fc32_ae32_enabled 1
-
-#endif //
-
-#if ((XCHAL_HAVE_LOOPS == 1) && (XCHAL_HAVE_MAC16 == 1))
-
-#define dsps_fft2r_sc16_ae32_enabled 1
-
-#endif //
-
-#if (XCHAL_HAVE_LOOPS == 1)
-
-#define dsps_bit_rev_lookup_fc32_ae32_enabled 1
-
-#endif //
-
-
-
-#endif // _dsps_fft2r_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/include/dsps_fft4r.h b/components/esp-dsp/modules/fft/include/dsps_fft4r.h
deleted file mode 100644
index 675e716..0000000
--- a/components/esp-dsp/modules/fft/include/dsps_fft4r.h
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_fft4r_H_
-#define _dsps_fft4r_H_
-#include "dsp_err.h"
-#include "sdkconfig.h"
-
-#include "dsps_fft_tables.h"
-#include "dsps_fft4r_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-extern float *dsps_fft4r_w_table_fc32;
-extern int dsps_fft4r_w_table_size;
-extern uint8_t dsps_fft4r_initialized;
-
-extern int16_t *dsps_fft4r_w_table_sc16;
-extern int dsps_fft4r_w_table_sc16_size;
-extern uint8_t dsps_fft4r_sc16_initialized;
-
-/**@{*/
-/**
- * @brief init fft tables
- *
- * Initialization of Complex FFT Radix-4. This function initialize coefficients table.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] fft_table_buff: pointer to floating point buffer where sin/cos table will be stored
- * if this parameter set to NULL, and table_size value is more then 0, then
- * dsps_fft4r_init_fc32 will allocate buffer internally
- * @param[in] max_fft_size: maximum fft size. The buffer for sin/cos table that will be used for radix-4 it's
- * four times maximum length of FFT.
- * if fft_table_buff is NULL and table_size is not 0, buffer will be allocated internally.
- * If table_size is 0, buffer will not be allocated.
- *
- * @return
- * - ESP_OK on success
- * - ESP_ERR_DSP_PARAM_OUTOFRANGE if table_size > CONFIG_DSP_MAX_FFT_SIZE
- * - ESP_ERR_DSP_REINITIALIZED if buffer already allocated internally by other function
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fft4r_init_fc32(float *fft_table_buff, int max_fft_size);
-/**@}*/
-
-/**@{*/
-/**
- * @brief deinit fft tables
- *
- * Free resources of Complex FFT Radix-4. This function delete coefficients table if it was allocated by dsps_fft4r_init_fc32.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- *
- * @return
- */
-void dsps_fft4r_deinit_fc32();
-/**@}*/
-
-/**@{*/
-/**
- * @brief complex FFT of radix 4
- *
- * Complex FFT of radix 4
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[inout] data: input/output complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1]
- * result of FFT will be stored to this array.
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fft4r_fc32_ansi_(float *data, int N, float *table, int table_size);
-esp_err_t dsps_fft4r_fc32_ae32_(float *data, int N, float *table, int table_size);
-/**@}*/
-// This is workaround because linker generates permanent error when assembler uses
-// direct access to the table pointer
-#define dsps_fft4r_fc32_ansi(data, N) dsps_fft4r_fc32_ansi_(data, N, dsps_fft4r_w_table_fc32, dsps_fft4r_w_table_size)
-#define dsps_fft4r_fc32_ae32(data, N) dsps_fft4r_fc32_ae32_(data, N, dsps_fft4r_w_table_fc32, dsps_fft4r_w_table_size)
-
-/**@{*/
-/**
- * @brief bit reverse operation for the complex input array radix-4
- *
- * Bit reverse operation for the complex input array
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] data: input/ complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1]
- * result of FFT will be stored to this array.
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_bit_rev4r_fc32(float *data, int N);
-esp_err_t dsps_bit_rev4r_fc32_ae32(float *data, int N);
-esp_err_t dsps_bit_rev4r_direct_fc32_ansi(float *data, int N);
-esp_err_t dsps_bit_rev4r_sc16_ansi(int16_t *data, int N);
-
-
-/**@{*/
-/**
- * @brief Convert complex FFT result to real array
- *
- * Convert FFT result of complex FFT for real input to real array.
- * This function have to be used if FFT used to process real data.
- * This function use tabels inside and can be used only it dsps_fft4r_init_fc32(...) was
- * called and FFT4 was initialized.
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[inout] data: Input complex array and result of FFT2R/FFT4R.
- * input has size of 2*N, because contains real and imaginary part.
- * result will be stored to the same array.
- * Input1: input[0..N-1], Input2: input[N..2*N-1]
- * @param[in] N: Number of complex elements in input array
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_cplx2real_fc32_ansi_(float *data, int N, float *table, int table_size);
-esp_err_t dsps_cplx2real_fc32_ae32_(float *data, int N, float *table, int table_size);
-/**@}*/
-#define dsps_cplx2real_fc32_ansi(data, N) dsps_cplx2real_fc32_ansi_(data, N, dsps_fft4r_w_table_fc32, dsps_fft4r_w_table_size)
-#define dsps_cplx2real_fc32_ae32(data, N) dsps_cplx2real_fc32_ae32_(data, N, dsps_fft4r_w_table_fc32, dsps_fft4r_w_table_size)
-
-
-esp_err_t dsps_gen_bitrev4r_table(int N, int step, char *name_ext);
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_fft4r_fc32_ae32_enabled == 1)
-#define dsps_fft4r_fc32 dsps_fft4r_fc32_ae32
-#else
-#define dsps_fft4r_fc32 dsps_fft4r_fc32_ansi
-#endif // dsps_fft4r_fc32_ae32_enabled
-
-#define dsps_fft4r_sc16 dsps_fft4r_sc16_ae32
-#define dsps_bit_rev4r_fc32 dsps_bit_rev4r_fc32_ae32
-
-#if (dsps_cplx2real_fc32_ae32_enabled == 1)
-#define dsps_cplx2real_fc32 dsps_cplx2real_fc32_ae32
-#else
-#define dsps_cplx2real_fc32 dsps_cplx2real_fc32_ansi
-#endif // dsps_cplx2real_fc32_ae32_enabled
-
-#else
-#define dsps_fft4r_fc32 dsps_fft4r_fc32_ansi
-#define dsps_fft4r_sc16 dsps_fft4r_sc16_ansi
-#define dsps_bit_rev4r_fc32 dsps_bit_rev4r_fc32_ansi
-#define dsps_cplx2real_fc32 dsps_cplx2real_fc32_ansi
-#endif
-
-#endif // _dsps_fft4r_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/include/dsps_fft4r_platform.h b/components/esp-dsp/modules/fft/include/dsps_fft4r_platform.h
deleted file mode 100644
index 0534492..0000000
--- a/components/esp-dsp/modules/fft/include/dsps_fft4r_platform.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _dsps_fft4r_platform_H_
-#define _dsps_fft4r_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_fft4r_fc32_ae32_enabled 1
-#define dsps_cplx2real_fc32_ae32_enabled 1
-
-#endif //
-
-
-#if ((XCHAL_HAVE_LOOPS == 1) && (XCHAL_HAVE_MAC16 == 1))
-
-#define dsps_fft2r_sc16_ae32_enabled 1
-
-#endif //
-
-#if (XCHAL_HAVE_LOOPS == 1)
-
-#define dsps_bit_rev_lookup_fc32_ae32_enabled 1
-
-#endif //
-
-
-
-#endif // _dsps_fft4r_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/include/dsps_fft_tables.h b/components/esp-dsp/modules/fft/include/dsps_fft_tables.h
deleted file mode 100644
index 94fbab5..0000000
--- a/components/esp-dsp/modules/fft/include/dsps_fft_tables.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_fft_tables_H_
-#define _dsps_fft_tables_H_
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-extern const uint16_t bitrev2r_table_16_fc32[];
-extern const uint16_t bitrev2r_table_16_fc32_size;
-
-extern const uint16_t bitrev2r_table_32_fc32[];
-extern const uint16_t bitrev2r_table_32_fc32_size;
-
-extern const uint16_t bitrev2r_table_64_fc32[];
-extern const uint16_t bitrev2r_table_64_fc32_size;
-
-extern const uint16_t bitrev2r_table_128_fc32[];
-extern const uint16_t bitrev2r_table_128_fc32_size;
-
-extern const uint16_t bitrev2r_table_256_fc32[];
-extern const uint16_t bitrev2r_table_256_fc32_size;
-
-extern const uint16_t bitrev2r_table_512_fc32[];
-extern const uint16_t bitrev2r_table_512_fc32_size;
-
-extern const uint16_t bitrev2r_table_1024_fc32[];
-extern const uint16_t bitrev2r_table_1024_fc32_size;
-
-extern const uint16_t bitrev2r_table_2048_fc32[];
-extern const uint16_t bitrev2r_table_2048_fc32_size;
-
-extern const uint16_t bitrev2r_table_4096_fc32[];
-extern const uint16_t bitrev2r_table_4096_fc32_size;
-
-void dsps_fft2r_rev_tables_init_fc32(void);
-extern uint16_t *dsps_fft2r_rev_tables_fc32[];
-extern const uint16_t dsps_fft2r_rev_tables_fc32_size[];
-
-extern const uint16_t bitrev4r_table_16_fc32[];
-extern const uint16_t bitrev4r_table_16_fc32_size;
-
-extern const uint16_t bitrev4r_table_32_fc32[];
-extern const uint16_t bitrev4r_table_32_fc32_size;
-
-extern const uint16_t bitrev4r_table_64_fc32[];
-extern const uint16_t bitrev4r_table_64_fc32_size;
-
-extern const uint16_t bitrev4r_table_128_fc32[];
-extern const uint16_t bitrev4r_table_128_fc32_size;
-
-extern const uint16_t bitrev4r_table_256_fc32[];
-extern const uint16_t bitrev4r_table_256_fc32_size;
-
-extern const uint16_t bitrev4r_table_512_fc32[];
-extern const uint16_t bitrev4r_table_512_fc32_size;
-
-extern const uint16_t bitrev4r_table_1024_fc32[];
-extern const uint16_t bitrev4r_table_1024_fc32_size;
-
-extern const uint16_t bitrev4r_table_2048_fc32[];
-extern const uint16_t bitrev4r_table_2048_fc32_size;
-
-extern const uint16_t bitrev4r_table_4096_fc32[];
-extern const uint16_t bitrev4r_table_4096_fc32_size;
-
-void dsps_fft4r_rev_tables_init_fc32(void);
-extern uint16_t *dsps_fft4r_rev_tables_fc32[];
-extern const uint16_t dsps_fft4r_rev_tables_fc32_size[];
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _dsps_fft_tables_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fft/test/test_dsps_fft2r_fc32_ae32.c b/components/esp-dsp/modules/fft/test/test_dsps_fft2r_fc32_ae32.c
deleted file mode 100644
index 7572244..0000000
--- a/components/esp-dsp/modules/fft/test/test_dsps_fft2r_fc32_ae32.c
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "fft2r_ae32";
-
-static float data[1024*2];
-static float check_data[1024*2];
-static float data_test[1024*2];
-
-TEST_CASE("dsps_fft2r_fc32_ae32 functionality", "[dsps]")
-{
- int N = sizeof(data) / sizeof(float) / 2;
- int check_bin = 32;
- float check_ampl = 2;
- for (int i = 0 ; i < N ; i++) {
- data[i * 2 + 0] = check_ampl * sinf(M_PI / N * check_bin * 2 * i) / (N / 2);
- data[i * 2 + 1] = 0;
- }
- for (int i = 0 ; i < N*2 ; i++) {
- check_data[i] = data[i];
- data_test[i] = -1;
- }
-
- // Init FFT tables
- esp_err_t ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = N;
-
- dsps_fft2r_fc32_ae32(data, N_check);
- dsps_fft2r_fc32_ansi(check_data, N_check);
-
- for (int i=0 ; i< N_check ; i++)
- {
- if (abs(check_data[i] - data[i]) == 0) ESP_LOGD(TAG, "Data[%i] =%8.4f, %8.4f, %8.4f", i, data[i], check_data[i], check_data[i] - data[i]);
- else ESP_LOGE(TAG, "Data[%i] =%f, %f, %f", i, data[i], check_data[i], check_data[i] - data[i]);
- }
-
- dsps_bit_rev_fc32_ansi(data, N);
-
- float min = 10000;
- float max = -10000;
- int max_pos = 0;
- for (int i = 0 ; i < N ; i++) {
- data[i] = 10 * log10f(data[i * 2 + 0] * data[i * 2 + 0] + data[i * 2 + 1] * data[i * 2 + 1]);
- if (data[i] < min) {
- min = data[i];
- }
- if (data[i] > max) {
- max = data[i];
- max_pos = i;
- }
- ESP_LOGD(TAG, "FFT Data[%i] =%8.4f dB", i, data[i]);
- }
- dsps_view_spectrum(data, 256, -160, 40);
-
- TEST_ASSERT_EQUAL( check_bin, max_pos);
- float round_pow = round(max * 10);
- TEST_ASSERT_EQUAL( 6 * 10, round_pow);
- ESP_LOGI(TAG, "Calculation error is less then 0.1 dB");
- dsps_fft2r_deinit_fc32();
-}
-
-TEST_CASE("dsps_fft2r_fc32_ae32 benchmark", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- for (int i= 5 ; i< 10 ; i++)
- {
- int N_check = 2<
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fft2r_ansi";
-
-TEST_CASE("dsps_fft2r_fc32_ansi functionality", "[dsps]")
-{
- float* data = (float*)malloc(2*4096*sizeof(float));
- float* check_data = (float*)malloc(2*4096*sizeof(float));
-
- int N = 1024;
- int check_bin = 32;
- for (int i = 0 ; i < N ; i++) {
- data[i * 2 + 0] = 2 * sinf(M_PI / N * check_bin * 2 * i) / (N / 2);
- data[i * 2 + 1] = 0;
- }
-
- float* fft_table_buff = (float*)malloc((N+2)*sizeof(float));
- fft_table_buff[0] = 1234;
- fft_table_buff[N+1] = 5678;
-
- esp_err_t ret = dsps_fft2r_init_fc32(&fft_table_buff[1], N);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- dsps_fft2r_fc32_ansi(data, N);
- unsigned int start_b = xthal_get_ccount();
- dsps_bit_rev_fc32_ansi(data, N);
- unsigned int end_b = xthal_get_ccount();
-
- float min = 10000;
- float max = -10000;
- int max_pos = 0;
- for (int i = 0 ; i < N ; i++) {
- data[i] = 10 * log10f(data[i * 2 + 0] * data[i * 2 + 0] + data[i * 2 + 1] * data[i * 2 + 1]);
- if (data[i] < min) {
- min = data[i];
- }
- if (data[i] > max) {
- max = data[i];
- max_pos = i;
- }
- ESP_LOGD(TAG, "FFT Data[%i] =%8.4f dB", i, data[i]);
- }
- dsps_view_spectrum(data, 256, -160, 40);
-
- TEST_ASSERT_EQUAL( check_bin, max_pos);
- float round_pow = round(max * 10);
- TEST_ASSERT_EQUAL( 6 * 10, round_pow);
- ESP_LOGI(TAG, "Calculation error is less then 0.1 dB");
- ESP_LOGI(TAG, "cycles - %i", end_b - start_b);
-
- ESP_LOGI(TAG, "fft_table_buff[0] = %f, fft_table_buff[N+1] = %f", fft_table_buff[0], fft_table_buff[N+1]);
- TEST_ASSERT_EQUAL( fft_table_buff[0], 1234);
- TEST_ASSERT_EQUAL( fft_table_buff[N+1], 5678);
- free(fft_table_buff);
-
- free(data);
- free(check_data);
- dsps_fft2r_deinit_fc32();
-}
-
-TEST_CASE("dsps_fft2r_fc32_ansi benchmark", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- float* data = (float*)malloc(2*4096*sizeof(float));
- float* check_data = (float*)malloc(2*4096*sizeof(float));
- for (int i= 5 ; i< 10 ; i++)
- {
- int N_check = 2<
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fft2r_ae32_s16";
-
-static int16_t data[1024*2];
-static int16_t check_data[1024*2];
-static float result_data[1024*2];
-
-TEST_CASE("dsps_fft2r_sc16_ae32 functionality", "[dsps]")
-{
- int N = sizeof(data) / sizeof(float) / 2;
- N = 1024;
- int check_bin = 64;
- for (int i = 0 ; i < N ; i++) {
- data[i * 2 + 0] = (INT16_MAX)*sin(M_PI / N * check_bin *2* i)*0.5 * (1 - cosf(i * 2 * M_PI / (float)(N-1)));
- data[i * 2 + 1] = 0;
- }
-
- esp_err_t ret = dsps_fft2r_init_sc16(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- dsps_fft2r_sc16_ae32(data, N);
- unsigned int start_b = xthal_get_ccount();
- dsps_bit_rev_sc16_ansi(data, N);
- unsigned int end_b = xthal_get_ccount();
-
-
- for (int i=0 ; i< N ; i++)
- {
- ESP_LOGD(TAG, "Data[%i] %04x\n", i/2, data[i]);
- }
-
- float min = 10000;
- float max = -10000;
- int max_pos = 0;
- for (int i = 0 ; i < (N*2) ; i++)
- {
- result_data[i] = data[i];
- result_data[i] = result_data[i]/INT16_MAX;
- }
-
- for (int i = 0 ; i < N ; i++) {
- result_data[i] = 10 * log10f(0.0000000000001 + result_data[i * 2 + 0] * result_data[i * 2 + 0] + result_data[i * 2 + 1] * result_data[i * 2 + 1]);
- if (result_data[i] < min) {
- min = result_data[i];
- }
- if (result_data[i] > max) {
- max = result_data[i];
- max_pos = i;
- }
- ESP_LOGD(TAG, "FFT Data[%i] =%8.4f dB", i, result_data[i]);
- }
- dsps_view_spectrum(result_data, N, -100, 0);
- float round_pow = round(max*5);
-
- ESP_LOGI(TAG, "max_bin=%i, check_bin=%i, round_pow=%f\n", max_pos, check_bin, round_pow);
-
- if (max_pos < N/2) TEST_ASSERT_EQUAL( check_bin, max_pos);
- else TEST_ASSERT_EQUAL( N - check_bin, max_pos);
- TEST_ASSERT_EQUAL( -12*5, round_pow);
- ESP_LOGI(TAG, "Calculation error is less then 0.2 dB");
- ESP_LOGI(TAG, "cycles - %i", end_b - start_b);
- dsps_fft2r_deinit_sc16();
-}
-
-
-TEST_CASE("dsps_fft2r_sc16_ae32 overflow check", "[dsps]")
-{
- int N = sizeof(data) / sizeof(float) / 2;
- N = 1024;
- int check_bin = 32;
- int bins_count = 4;
- for (int i = 0 ; i < N ; i++) {
- data[i * 2 + 0] = 0;
- data[i * 2 + 1] = 0;
- for (int n=1; n<=bins_count ; n++ )
- {
- data[i * 2 + 0] += (INT16_MAX)*cos(M_PI / N * check_bin *2* i*n)/bins_count;
- data[i * 2 + 1] += (INT16_MAX)*sin(M_PI / N * check_bin *2* i*n)/bins_count;
- }
- }
-
- esp_err_t ret = dsps_fft2r_init_sc16(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- dsps_fft2r_sc16_ae32(data, N);
- unsigned int start_b = xthal_get_ccount();
- dsps_bit_rev_sc16_ansi(data, N);
- unsigned int end_b = xthal_get_ccount();
-
-
- for (int i=0 ; i< N ; i++)
- {
- ESP_LOGD(TAG, "Data[%i] %04x\n", i/2, data[i]);
- }
-
- float min = 10000;
- float max = -10000;
- int max_pos = 0;
- for (int i = 0 ; i < (N*2) ; i++)
- {
- result_data[i] = data[i];
- result_data[i] = result_data[i]/INT16_MAX;
- }
-
- for (int i = 0 ; i < N ; i++) {
- result_data[i] = 10 * log10f(0.0000000000001 + result_data[i * 2 + 0] * result_data[i * 2 + 0] + result_data[i * 2 + 1] * result_data[i * 2 + 1]);
- if (result_data[i] < min) {
- min = result_data[i];
- }
- if (result_data[i] > max) {
- max = result_data[i];
- max_pos = i;
- }
- ESP_LOGD(TAG, "FFT Data[%i] =%8.4f dB", i, result_data[i]);
- }
- dsps_view_spectrum(result_data, N, -100, 0);
- float round_pow = round(max*5);
-
- float noise_pow = -100;
- for (int i=(bins_count*check_bin + 10) ; i< N ; i++)
- {
- if (result_data[i] > noise_pow)
- {
- noise_pow = result_data[i];
- }
- }
- ESP_LOGI(TAG, "max_bin=%i, check_bin=%i, round_pow=%f, noise power=%f\n", max_pos, check_bin, round_pow, noise_pow);
-
- if (noise_pow > (-65))
- {
- TEST_ASSERT_MESSAGE (false, "Exec time takes more than expected!");
- }
-
- ESP_LOGI(TAG, "cycles - %i", end_b - start_b);
- dsps_fft2r_deinit_sc16();
-}
-
-TEST_CASE("dsps_fft2r_sc16_ae32 benchmark", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_sc16(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- for (int i= 5 ; i< 10 ; i++)
- {
- int N_check = 2<
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fft2r_ansi_s16";
-
-static int16_t data[1024*2];
-static float result_data[1024*2];
-
-TEST_CASE("dsps_fft2r_sc16_ansi functionality", "[dsps]")
-{
- int N = sizeof(data) / sizeof(float) / 2;
- N = 1024;
- int check_bin = 64;
- for (int i = 0 ; i < N ; i++) {
- data[i * 2 + 0] = (INT16_MAX)*sin(M_PI / N * check_bin *2* i)*0.5 * (1 - cosf(i * 2 * M_PI / (float)(N-1)));
- data[i * 2 + 1] = 0;
- }
- int16_t* fft_table_buff = (int16_t*)malloc((N+2)*sizeof(int16_t));
- fft_table_buff[0] = 1234;
- fft_table_buff[N+1] = 5678;
- esp_err_t ret = dsps_fft2r_init_sc16(&fft_table_buff[1], N);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = 0x%8.8x", ret);
- return;
- }
-
- dsps_fft2r_sc16_ansi(data, N);
- unsigned int start_b = xthal_get_ccount();
- dsps_bit_rev_sc16_ansi(data, N);
- unsigned int end_b = xthal_get_ccount();
-
-
- for (int i=0 ; i< N ; i++)
- {
- ESP_LOGD(TAG, "Data[%i] %i\n", i/2, data[i]);
- }
-
- float min = 10000;
- float max = -10000;
- int max_pos = 0;
- for (int i = 0 ; i < (N*2) ; i++)
- {
- result_data[i] = data[i];
- result_data[i] = result_data[i]/INT16_MAX;
- }
-
- for (int i = 0 ; i < N ; i++) {
- result_data[i] = 10 * log10f(0.0000000000001 + result_data[i * 2 + 0] * result_data[i * 2 + 0] + result_data[i * 2 + 1] * result_data[i * 2 + 1]);
- if (result_data[i] < min) {
- min = result_data[i];
- }
- if (result_data[i] > max) {
- max = result_data[i];
- max_pos = i;
- }
- ESP_LOGD(TAG, "FFT Data[%i] =%8.4f dB", i, result_data[i]);
- }
- dsps_view_spectrum(result_data, N, -100, 0);
- float round_pow = round(max*5);
-
- ESP_LOGI(TAG, "max_bin=%i, check_bin=%i, round_pow=%f\n", max_pos, check_bin, round_pow);
-
- if (max_pos < N/2) TEST_ASSERT_EQUAL( check_bin, max_pos);
- else TEST_ASSERT_EQUAL( N - check_bin, max_pos);
- TEST_ASSERT_EQUAL( -12*5, round_pow);
- ESP_LOGI(TAG, "Calculation error is less then 0.2 dB");
- ESP_LOGI(TAG, "cycles - %i", end_b - start_b);
- // Check if we not out of range
- ESP_LOGI(TAG, "fft_table_buff[0] = %i, fft_table_buff[N+1] = %i", fft_table_buff[0], fft_table_buff[N+1]);
- TEST_ASSERT_EQUAL( fft_table_buff[0], 1234);
- TEST_ASSERT_EQUAL( fft_table_buff[N+1], 5678);
- free(fft_table_buff);
- dsps_fft2r_deinit_sc16();
-}
-
-TEST_CASE("dsps_fft2r_sc16_ansi benchmark", "[dsps]")
-{
- esp_err_t ret = dsps_fft2r_init_sc16(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- for (int i= 5 ; i< 10 ; i++)
- {
- int N_check = 2<
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsps_fft4r.h"
-#include "dsp_tests.h"
-
-
-static const char *TAG = "dsps_fft4r_ae32";
-
-TEST_CASE("dsps_fft4r_fc32_ae32 functionality", "[dsps]")
-{
- float* data = (float*)malloc(sizeof(float) * 4096*2);
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
- if (data == NULL)
- {
- ESP_LOGE(TAG, "Not possible to allocate data.");
- return;
- }
- if (check_data_fft == NULL)
- {
- ESP_LOGE(TAG, "Not possible to allocate check_data_fft.");
- return;
- }
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 2; pow < 7; pow++)
- {
- N_check = 1<< (pow*2);
- for (size_t i = 0; i < N_check; i++)
- {
- data[i*2] = cosf(2*M_PI*4/256*i);
- data[i*2+1] = sinf(2*M_PI*18/256*i);
-
- check_data_fft[i*2] = data[i*2];
- check_data_fft[i*2+1] = data[i*2 + 1];
- }
-
- dsps_fft4r_fc32_ansi(data, N_check);
- dsps_bit_rev4r_fc32(data, N_check);
-
- dsps_fft4r_fc32_ae32(check_data_fft, N_check);
- dsps_bit_rev4r_fc32(check_data_fft, N_check);
- float diff = 0;
- for (size_t i = 0; i < N_check*2; i++)
- {
- diff += fabs(data[i] - check_data_fft[i]);
- }
- diff = diff/N_check;
- if (diff > 0.00001)
- {
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
- ESP_LOGI(TAG, "diff[%i] = %f\n", N_check, diff);
- }
-
- dsps_view(data, N_check*2, 128, 16, -256, 256, '.');
- dsps_view(check_data_fft, N_check*2, 128, 16, -256, 256, '.');
-
- dsps_fft2r_deinit_fc32();
- dsps_fft4r_deinit_fc32();
- free(data);
- free(check_data_fft);
-}
-
-static portMUX_TYPE testnlock = portMUX_INITIALIZER_UNLOCKED;
-
-TEST_CASE("dsps_fft4r_fc32_ae32 benchmark", "[dsps]")
-{
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
-
- unsigned int start_b;
- float cycles;
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 2; pow < 7; pow++)
- {
- N_check = 1<< (pow*2);
- for (size_t i = 0; i < N_check; i++)
- {
- check_data_fft[i*2] = cosf(2*M_PI*4/256*i);
- check_data_fft[i*2+1] = sinf(2*M_PI*18/256*i);
- }
-
- portENTER_CRITICAL(&testnlock);
- start_b = xthal_get_ccount();
- dsps_fft4r_fc32_ae32(check_data_fft, N_check);
- dsps_bit_rev4r_fc32(check_data_fft, N_check);
- cycles = xthal_get_ccount() - start_b;
- portEXIT_CRITICAL(&testnlock);
-
- ESP_LOGI(TAG, "Benchmark dsps_fft4r_fc32_ae32 - %6i cycles for %6i points FFT.", (int)cycles, N_check);
- }
-
- dsps_fft4r_deinit_fc32();
- free(check_data_fft);
-}
-
-TEST_CASE("dsps_cplx2real_fc32_ae32 benchmark", "[dsps]")
-{
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
-
- unsigned int start_b;
- float cycles;
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 4; pow < 13; pow++)
- {
- N_check = 1<< (pow);
- for (size_t i = 0; i < N_check; i++)
- {
- check_data_fft[i*2] = cosf(2*M_PI*4/256*i);
- check_data_fft[i*2+1] = sinf(2*M_PI*18/256*i);
- }
-
- portENTER_CRITICAL(&testnlock);
- start_b = xthal_get_ccount();
- dsps_cplx2real_fc32_ae32(check_data_fft, N_check);
- cycles = xthal_get_ccount() - start_b;
- portEXIT_CRITICAL(&testnlock);
-
- ESP_LOGI(TAG, "Benchmark dsps_cplx2real_fc32_ae32 - %6i cycles for %6i points FFT.", (int)cycles, N_check);
- }
-
- dsps_fft4r_deinit_fc32();
- free(check_data_fft);
-}
-
-TEST_CASE("dsps_bit_rev4r_fc32_ansi benchmark", "[dsps]")
-{
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
-
- unsigned int start_b;
- float cycles;
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 3; pow < 7; pow++)
- {
- N_check = 1<< (2*pow);
- for (size_t i = 0; i < N_check; i++)
- {
- check_data_fft[i*2] = cosf(2*M_PI*4/256*i);
- check_data_fft[i*2+1] = sinf(2*M_PI*18/256*i);
- }
-
- portENTER_CRITICAL(&testnlock);
- start_b = xthal_get_ccount();
- dsps_bit_rev4r_fc32(check_data_fft, N_check);
- cycles = xthal_get_ccount() - start_b;
- portEXIT_CRITICAL(&testnlock);
-
- ESP_LOGI(TAG, "Benchmark dsps_bit_rev4r_fc32_ansi - %6i cycles for %6i points FFT.", (int)cycles, N_check);
- }
-
- dsps_fft4r_deinit_fc32();
- free(check_data_fft);
-}
-
diff --git a/components/esp-dsp/modules/fft/test/test_dsps_fft4r_fc32_ansi.c b/components/esp-dsp/modules/fft/test/test_dsps_fft4r_fc32_ansi.c
deleted file mode 100644
index da3fcea..0000000
--- a/components/esp-dsp/modules/fft/test/test_dsps_fft4r_fc32_ansi.c
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_view.h"
-#include "dsps_fft2r.h"
-#include "dsps_fft4r.h"
-#include "dsp_tests.h"
-
-
-static const char *TAG = "dsps_fft4r_ansi";
-
-TEST_CASE("dsps_fft4r_fc32_ansi functionality", "[dsps]")
-{
- float* data = (float*)malloc(sizeof(float) * 1024*2);
- float* check_data_fft = (float*)malloc(sizeof(float) * 1024*2);
- esp_err_t ret;
- ret = dsps_fft2r_init_fc32(NULL, 1024);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT2R. Error = %i", ret);
- return;
- }
- ret = dsps_fft4r_init_fc32(NULL, 1024);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT4R. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 2; pow < 6; pow++)
- {
- N_check = 1<< (pow*2);
- for (size_t i = 0; i < N_check; i++)
- {
- data[i*2] = cosf(2*M_PI*4/256*i);
- data[i*2+1] = sinf(2*M_PI*18/256*i);
-
- check_data_fft[i*2] = data[i*2];
- check_data_fft[i*2+1] = data[i*2 + 1];
- }
-
- dsps_fft2r_fc32_ansi(data, N_check);
- dsps_bit_rev_fc32_ansi(data, N_check);
-
- dsps_fft4r_fc32_ansi(check_data_fft, N_check);
- dsps_bit_rev4r_fc32(check_data_fft, N_check);
-
- float diff = 0;
- for (size_t i = 0; i < N_check*2; i++)
- {
- diff += fabs(data[i] - check_data_fft[i]);
- }
- diff = diff/N_check;
- ESP_LOGI(TAG, "diff[%i] = %f\n", N_check, diff);
- if (diff > 0.00001)
- {
- dsps_view(data, N_check*2, 128, 16, -N_check, N_check, '.');
- dsps_view(check_data_fft, N_check*2, 128, 16, -N_check, N_check, '.');
-
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
- }
-
- dsps_view(data, N_check*2, 128, 16, -N_check, N_check, '.');
- dsps_view(check_data_fft, N_check*2, 128, 16, -N_check, N_check, '.');
-
- dsps_fft2r_deinit_fc32();
- dsps_fft4r_deinit_fc32();
- free(data);
- free(check_data_fft);
-}
-
-TEST_CASE("dsps_fft4r_fc32_ansi benchmark", "[dsps]")
-{
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
-
- unsigned int start_b;
- float cycles;
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 2; pow < 7; pow++)
- {
- N_check = 1<< (pow*2);
- for (size_t i = 0; i < N_check; i++)
- {
- check_data_fft[i*2] = cosf(2*M_PI*4/256*i);
- check_data_fft[i*2+1] = sinf(2*M_PI*18/256*i);
- }
-
- start_b = xthal_get_ccount();
- dsps_fft4r_fc32_ansi(check_data_fft, N_check);
- dsps_bit_rev4r_fc32(check_data_fft, N_check);
- cycles = xthal_get_ccount() - start_b;
-
- ESP_LOGI(TAG, "Benchmark dsps_fft4r_fc32_ansi - %6i cycles for %6i points FFT.", (int)cycles, N_check);
- }
-
- dsps_fft4r_deinit_fc32();
- free(check_data_fft);
-}
-
-
-TEST_CASE("dsps_cplx2real_fc32 functionality", "[dsps]")
-{
- float* data = (float*)malloc(sizeof(float) * 1024*2);
- float* check_data_fft = (float*)malloc(sizeof(float) * 1024*2);
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, 1024);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- ret = dsps_fft2r_init_fc32(NULL, 1024);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
-
- int N_check = 256;
- for (size_t pow = 4; pow < 11; pow++)
- {
- N_check = 1<< (pow);
- for (size_t i = 0; i < N_check*2; i++)
- {
- data[i] = 0;
- check_data_fft[i] = data[i];
- }
- data[1] = N_check;
- check_data_fft[1] = data[1];
-
- dsps_fft2r_fc32_ansi(data, N_check);
- dsps_bit_rev_fc32_ansi(data, N_check);
- dsps_cplx2real_fc32_ansi(data, N_check);
-
- dsps_fft2r_fc32_ansi(check_data_fft, N_check);
- dsps_bit_rev_fc32_ansi(check_data_fft, N_check);
- dsps_cplx2real_fc32_ae32(check_data_fft, N_check);
-
- float diff = 0;
- for (size_t i = 0; i < N_check*2; i++)
- {
- diff += fabs(data[i] - check_data_fft[i]);
- }
- diff = diff/N_check;
- if (diff > 0.00001)
- {
- for (size_t i = 0; i < N_check*2; i++)
- {
- ESP_LOGD(TAG, "data[%i]= %f, %f = check_data_fft[%i], diff=%f\n", i, data[i], check_data_fft[i], i, data[i] - check_data_fft[i]);
- }
-
- dsps_view(data, N_check*2, 128, 16, -N_check, N_check, '.');
- dsps_view(check_data_fft, N_check*2, 128, 16, -N_check, N_check, '.');
- ESP_LOGE(TAG, "Error diff[%i] = %f\n", N_check, diff);
- TEST_ASSERT_MESSAGE (false, "Result out of range!\n");
- }
-
- ESP_LOGI(TAG, "diff[%i] = %f\n", N_check, diff);
- }
-
- free(data);
- free(check_data_fft);
-
- dsps_fft4r_deinit_fc32();
- dsps_fft2r_deinit_fc32();
-}
-
-static portMUX_TYPE testnlock = portMUX_INITIALIZER_UNLOCKED;
-
-TEST_CASE("dsps_cplx2real_fc32_ansi benchmark", "[dsps]")
-{
- float* check_data_fft = (float*)malloc(sizeof(float) * 4096*2);
- unsigned int start_b;
- float cycles;
-
- esp_err_t ret = dsps_fft4r_init_fc32(NULL, CONFIG_DSP_MAX_FFT_SIZE);
- if (ret != ESP_OK)
- {
- ESP_LOGE(TAG, "Not possible to initialize FFT. Error = %i", ret);
- return;
- }
- int N_check = 256;
- for (size_t pow = 4; pow < 13; pow++)
- {
- N_check = 1<< (pow);
- for (size_t i = 0; i < N_check; i++)
- {
- check_data_fft[i*2] = cosf(2*M_PI*4/256*i);
- check_data_fft[i*2+1] = sinf(2*M_PI*18/256*i);
- }
-
- portENTER_CRITICAL(&testnlock);
- start_b = xthal_get_ccount();
- dsps_cplx2real_fc32_ansi(check_data_fft, N_check);
- cycles = xthal_get_ccount() - start_b;
- portEXIT_CRITICAL(&testnlock);
-
- ESP_LOGI(TAG, "Benchmark dsps_cplx2real_fc32_ansi - %6i cycles for %6i points FFT.", (int)cycles, N_check);
- }
-
- dsps_fft4r_deinit_fc32();
- free(check_data_fft);
-}
-
-TEST_CASE("dsps_gen_bitrev4r_table bitrev table generation.", "[dsps]")
-{
- for (int i= 2 ; i< 7 ; i++)
- {
- int N_check = 1<<(i*2);
- dsps_gen_bitrev4r_table(N_check, 8, "fc32");
- }
-}
diff --git a/components/esp-dsp/modules/fir/float/dsps_fir_f32_ae32.S b/components/esp-dsp/modules/fir/float/dsps_fir_f32_ae32.S
deleted file mode 100644
index 0d023c5..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fir_f32_ae32.S
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir_platform.h"
-#if (dsps_fir_f32_ae32_enabled == 1)
-
-#include "dsps_dotprod_f32_m_ae32.S"
-
-// This is FIR filter for ESP32 processor.
- .text
- .align 4
- .global dsps_fir_f32_ae32
- .type dsps_fir_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_fir_f32_ae32(fir_f32_t* fir, const float* input, float* output, int len);
-
-dsps_fir_f32_ae32:
-// fir - a2
-// input - a3
-// output - a4
-// len - a5
-
- entry a1, 16
- // Array increment for floating point data should be 4
- l32i a7, a2, 12 // a7 - pos
- movi a10, 4
- mull a13, a7, a10// a13 - a7*4
- l32i a6, a2, 8 // a6 - N
- mull a6, a6, a10// a6 = a6*4
- l32i a10, a2, 0 // a10 - coeffs
- add a10, a10, a6 // a10 = &coeffs[N];
- addi a10, a10, -4 // a10 = &coeffs[N-1];
- l32i a11, a2, 4 // a11 - delay line
- l32i a6, a2, 8 // a6 - N
- movi.n a9, 0
-
-// a13 - delay index
-fir_loop_len:
- // Store to delay line
- lsi f0, a3, 0 // f0 = x[i]
- addi a3, a3, 4 // x++
- ssx f0, a11, a13 // delay[a13] = f0;
- addi a13, a13, 4 // a13++
- addi a7, a7, 1 // a7++
- // verify deley line
- blt a7, a6, do_not_reset_a13
- movi a13, 0
- movi a7, 0
- do_not_reset_a13:
- // Calc amount for delay line before end
- mov a15, a10 // a15 - coeffs
- wfr f2, a9 // f2 = 0;
- sub a14, a6, a7 // a14 = N-pos
- loopnez a14, first_fir_loop // pos...N-1
- lsi f1, a15, 0
- addi a15, a15, -4 // a15--
- lsx f0, a11, a13 // load delay f0 = delay[pos]
- addi a13, a13, 4 // a13++, pos++
- madd.s f2, f0, f1 // f2 += f0*f1
-first_fir_loop:
- movi a13, 0 // load delay line counter to 0
- loopnez a7, second_fir_loop // 0..pos
- lsi f1, a15, 0
- addi a15, a15, -4 // a15--
- lsx f0, a11, a13 // load delay f0 = delay[pos]
- addi a13, a13, 4 // a13++, pos++
- madd.s f2, f0, f1 // f2 += f0*f1
-second_fir_loop:
-
- // and after end
- // Store result
- ssi f2, a4, 0
- //s32i a13, a4, 0// just for debug *a4 = a13
- addi a4, a4, 4 // y++ - increment output pointer
- // Check loop
- addi a5, a5, -1
- bnez a5, fir_loop_len
- // store state
-
- s32i a7, a2, 12 // pos = a7
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_fir_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fir/float/dsps_fir_f32_ansi.c b/components/esp-dsp/modules/fir/float/dsps_fir_f32_ansi.c
deleted file mode 100644
index 7a50c23..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fir_f32_ansi.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir.h"
-
-esp_err_t dsps_fir_f32_ansi(fir_f32_t *fir, const float *input, float *output, int len)
-{
- for (int i = 0 ; i < len ; i++) {
- float acc = 0;
- int coeff_pos = fir->N - 1;
- fir->delay[fir->pos] = input[i];
- fir->pos++;
- if (fir->pos >= fir->N) {
- fir->pos = 0;
- }
- for (int n = fir->pos; n < fir->N ; n++) {
- acc += fir->coeffs[coeff_pos--] * fir->delay[n];
- }
- for (int n = 0; n < fir->pos ; n++) {
- acc += fir->coeffs[coeff_pos--] * fir->delay[n];
- }
- output[i] = acc;
- }
- return ESP_OK;
-}
-
diff --git a/components/esp-dsp/modules/fir/float/dsps_fir_init_f32.c b/components/esp-dsp/modules/fir/float/dsps_fir_init_f32.c
deleted file mode 100644
index 56360d8..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fir_init_f32.c
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir.h"
-
-
-esp_err_t dsps_fir_init_f32(fir_f32_t *fir, float *coeffs, float *delay, int N)
-{
- fir->coeffs = coeffs;
- fir->delay = delay;
- fir->N = N;
- fir->pos = 0;
-
- for (int i = 0 ; i < N; i++) {
- fir->delay[i] = 0;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/fir/float/dsps_fird_f32_ae32.S b/components/esp-dsp/modules/fir/float/dsps_fird_f32_ae32.S
deleted file mode 100644
index b876548..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fird_f32_ae32.S
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir_platform.h"
-#if (dsps_fird_f32_ae32_enabled == 1)
-
-#include "dsps_dotprod_f32_m_ae32.S"
-
-// This is FIR filter for ESP32 processor.
- .text
- .align 4
- .global dsps_fird_f32_ae32
- .type dsps_fird_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_fir_f32_ae32(fir_f32_t* fir, const float* input, float* output, int len);
-
-dsps_fird_f32_ae32:
-// fir - a2
-// input - a3
-// output - a4
-// len - a5
-
- entry a1, 16
- // Array increment for floating point data should be 4
- l32i a7, a2, 12 // a7 - pos
- movi a10, 4
- mull a13, a7, a10// a13 - a7*4
- l32i a6, a2, 8 // a6 - N
- mull a6, a6, a10// a6 = a6*4
- l32i a10, a2, 0 // a10 - coeffs
- add a10, a10, a6 // a10 = &coeffs[N];
- addi a10, a10, -4 // a10 = &coeffs[N-1];
- l32i a11, a2, 4 // a11 - delay line
- l32i a6, a2, 8 // a6 - N
- l32i a12, a2, 16 // a12 - decimation
- l32i a9, a2, 20 // a9 - d_pos
- movi a8, 0 // result = 0;
-
-// a13 - delay index
-fird_loop_len:
- // Store to delay line
- lsi f0, a3, 0 // f0 = x[i]
- addi a3, a3, 4 // x++
- ssx f0, a11, a13 // delay[a13] = f0;
- addi a13, a13, 4 // a13++
- addi a7, a7, 1 // a7++
- // verify deley line
- blt a7, a6, do_not_reset_a13
- movi a13, 0
- movi a7, 0
- do_not_reset_a13:
- // calc d_pos
- addi a9, a9, 1
- blt a9, a12, next_itt_fir32 // Jump if d_pos < d
- addi a8, a8, 1
- movi a9, 0 // reset d_pos
- // Calc amount for delay line before end
- mov a15, a10 // a15 - coeffs
- wfr f2, a9 // f2 = 0;
- sub a14, a6, a7 // a14 = N-pos
- loopnez a14, first_fird_loop // pos...N-1
- lsi f1, a15, 0
- addi a15, a15, -4 // a15--
- lsx f0, a11, a13 // load delay f0 = delay[pos]
- addi a13, a13, 4 // a13++, pos++
- madd.s f2, f0, f1 // f2 += f0*f1
-first_fird_loop:
- movi a13, 0 // load delay line counter to 0
- loopnez a7, second_fird_loop // 0..pos
- lsi f1, a15, 0
- addi a15, a15, -4 // a15--
- lsx f0, a11, a13 // load delay f0 = delay[pos]
- addi a13, a13, 4 // a13++, pos++
- madd.s f2, f0, f1 // f2 += f0*f1
-second_fird_loop:
-
- // and after end
- // Store result
- ssi f2, a4, 0
- addi a4, a4, 4 // y++ - increment output pointer
-next_itt_fir32:
- // Check loop
- addi a5, a5, -1
- bnez a5, fird_loop_len
- // store state
-
- s32i a7, a2, 12 // pos = a7
- s32i a9, a2, 20 // d_pos = a9
-
- mov a2, a8 // return status ESP_OK
- retw.n
-
-#endif // dsps_fird_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fir/float/dsps_fird_f32_ansi.c b/components/esp-dsp/modules/fir/float/dsps_fird_f32_ansi.c
deleted file mode 100644
index efdce1a..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fird_f32_ansi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir.h"
-
-int dsps_fird_f32_ansi(fir_f32_t *fir, const float *input, float *output, int len)
-{
- int result = 0;
- for (int i = 0; i < len ; i++) {
- fir->delay[fir->pos++] = input[i];
- if (fir->pos >= fir->N) {
- fir->pos = 0;
- }
- fir->d_pos++;
- if (fir->d_pos >= fir->decim) {
- fir->d_pos = 0;
- float acc = 0;
- int coeff_pos = fir->N - 1;
- for (int n = fir->pos; n < fir->N ; n++) {
- acc += fir->coeffs[coeff_pos--] * fir->delay[n];
- }
- for (int n = 0; n < fir->pos ; n++) {
- acc += fir->coeffs[coeff_pos--] * fir->delay[n];
- }
- output[result++] = acc;
- }
- }
- return result;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fir/float/dsps_fird_init_f32.c b/components/esp-dsp/modules/fir/float/dsps_fird_init_f32.c
deleted file mode 100644
index bb4fa4c..0000000
--- a/components/esp-dsp/modules/fir/float/dsps_fird_init_f32.c
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_fir.h"
-
-
-esp_err_t dsps_fird_init_f32(fir_f32_t *fir, float *coeffs, float *delay, int N, int decim, int start_pos)
-{
- fir->coeffs = coeffs;
- fir->delay = delay;
- fir->N = N;
- fir->pos = 0;
- fir->decim = decim;
- fir->d_pos = start_pos;
- if (fir->d_pos >= fir->decim) {
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- }
-
- for (int i = 0 ; i < N; i++) {
- fir->delay[i] = 0;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/fir/include/dsps_fir.h b/components/esp-dsp/modules/fir/include/dsps_fir.h
deleted file mode 100644
index b18fc9c..0000000
--- a/components/esp-dsp/modules/fir/include/dsps_fir.h
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_fir_H_
-#define _dsps_fir_H_
-
-
-#include "dsp_err.h"
-
-#include "dsps_fir_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @brief Data struct of f32 fir filter
- *
- * This structure used by filter internally. User should access this structure only in case of
- * extensions for the DSP Library.
- * All fields of this structure initialized by dsps_fir_init_f32(...) function.
- */
-typedef struct fir_f32_s {
- float *coeffs; /*!< Pointer to the coefficient buffer.*/
- float *delay; /*!< Pointer to the delay line buffer.*/
- int N; /*!< FIR filter coefficients amount.*/
- int pos; /*!< Position in delay line.*/
- int decim; /*!< Decimation factor.*/
- int d_pos; /*!< Actual decimation counter.*/
-} fir_f32_t;
-
-/**
- * @brief initialize structure for 32 bit FIR filter
- *
- * Function initialize structure for 32 bit floating point FIR filter
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param fir: pointer to fir filter structure, that must be preallocated
- * @param coeffs: array with FIR filter coefficients. Must be length N
- * @param delay: array for FIR filter delay line. Must be length N
- * @param N: FIR filter length. Length of coeffs and delay arrays.
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fir_init_f32(fir_f32_t *fir, float *coeffs, float *delay, int N);
-
-/**
- * @brief initialize structure for 32 bit Decimation FIR filter
- * Function initialize structure for 32 bit floating point FIR filter with decimation
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param fir: pointer to fir filter structure, that must be preallocated
- * @param coeffs: array with FIR filter coefficients. Must be length N
- * @param delay: array for FIR filter delay line. Must be length N
- * @param N: FIR filter length. Length of coeffs and delay arrays.
- * @param decim: decimation factor.
- * @param start_pos: initial value of decimation counter. Must be [0..d)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fird_init_f32(fir_f32_t *fir, float *coeffs, float *delay, int N, int decim, int start_pos);
-
-
-/**@{*/
-/**
- * @brief FIR filter
- *
- * Function implements FIR filter
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param fir: pointer to fir filter structure, that must be initialized before
- * @param[in] input: input array
- * @param[out] output: array with result of FIR filter
- * @param[in] len: length of input and result arrays
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_fir_f32_ansi(fir_f32_t *fir, const float *input, float *output, int len);
-esp_err_t dsps_fir_f32_ae32(fir_f32_t *fir, const float *input, float *output, int len);
-/**@}*/
-
-/**@{*/
-/**
- * @brief Decimation FIR filter
- *
- * Function implements FIR filter with decimation
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param fir: pointer to fir filter structure, that must be initialized before
- * @param input: input array
- * @param output: array with result of FIR filter
- * @param len: length of input and result arrays
- *
- * @return: function returns amount of samples stored to the output array
- * depends on the previous state value could be [0..len/decimation]
- */
-int dsps_fird_f32_ansi(fir_f32_t *fir, const float *input, float *output, int len);
-int dsps_fird_f32_ae32(fir_f32_t *fir, const float *input, float *output, int len);
-/**@}*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#if CONFIG_DSP_OPTIMIZED
-
-#if (dsps_fir_f32_ae32_enabled == 1)
-#define dsps_fir_f32 dsps_fir_f32_ae32
-#else
-#define dsps_fir_f32 dsps_fir_f32_ansi
-#endif
-
-#if (dsps_fird_f32_ae32_enabled == 1)
-#define dsps_fird_f32 dsps_fird_f32_ae32
-#else
-#define dsps_fird_f32 dsps_fird_f32_ansi
-#endif
-
-#else // CONFIG_DSP_OPTIMIZED
-#define dsps_fir_f32 dsps_fir_f32_ansi
-#define dsps_fird_f32 dsps_fird_f32_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-#endif // _dsps_fir_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fir/include/dsps_fir_platform.h b/components/esp-dsp/modules/fir/include/dsps_fir_platform.h
deleted file mode 100644
index 3715ede..0000000
--- a/components/esp-dsp/modules/fir/include/dsps_fir_platform.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _dsps_fir_platform_H_
-#define _dsps_fir_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_fir_f32_ae32_enabled 1
-#define dsps_fird_f32_ae32_enabled 1
-
-#endif //
-
-#endif // _dsps_fir_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ae32.c b/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ae32.c
deleted file mode 100644
index 486f29e..0000000
--- a/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ae32.c
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_fir.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fir_f32_ae32";
-
-float x[1024];
-float y[1024];
-float y_compare[1024];
-
-float coeffs[32];
-float delay[32];
-float delay_compare[32];
-
-TEST_CASE("dsps_fir_f32_ae32 functionality", "[dsps]")
-{
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
-
- fir_f32_t fir1;
- fir_f32_t fir2;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
- dsps_fir_f32_ae32(&fir1, x, y, len);
- int32_t *ttt = (int32_t *)y;
- for (int i=0 ; i< fir_len*3 ; i++)
- {
- ESP_LOGD(TAG, "fir[%i] = 0x%08x\n", i, ttt[i]);
- }
-
- for (int i = 0 ; i < fir_len ; i++) {
- if (y[i] != i) {
- TEST_ASSERT_EQUAL(y[i], i);
- }
- }
-
- // Check even length
- fir_len--;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = i;
- }
- x[0] = 1;
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
- dsps_fir_init_f32(&fir2, coeffs, delay_compare, fir_len);
-
- dsps_fir_f32_ae32(&fir1, x, y, len);
- dsps_fir_f32_ansi(&fir2, x, y_compare, len);
- dsps_fir_f32_ae32(&fir1, x, y, len);
- dsps_fir_f32_ansi(&fir2, x, y_compare, len);
- dsps_fir_f32_ae32(&fir1, x, y, len);
- dsps_fir_f32_ansi(&fir2, x, y_compare, len);
-
- for (int i = 0 ; i < len ; i++) {
- if (y[i] != y_compare[i]) {
- TEST_ASSERT_EQUAL(y[i], y_compare[i]);
- }
- }
-}
-
-TEST_CASE("dsps_fir_f32_ae32 benchmark", "[dsps]")
-{
-
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int repeat_count = 1;
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
-
- unsigned int start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_fir_f32_ae32(&fir1, x, y, len);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (len * repeat_count);
-
- ESP_LOGI(TAG, "dsps_fir_f32_ae32 - %f per sample for for %i coefficients, %f per tap \n", cycles, fir_len, cycles / (float)fir_len);
-
- float min_exec = 3;
- float max_exec = 800;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-}
diff --git a/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ansi.c b/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ansi.c
deleted file mode 100644
index 9087b51..0000000
--- a/components/esp-dsp/modules/fir/test/test_dsps_fir_f32_ansi.c
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_fir.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fir_f32_ansi";
-
-float x[1024];
-float y[1024];
-
-float coeffs[32];
-float delay[32];
-
-TEST_CASE("dsps_fir_f32_ansi functionality", "[dsps]")
-{
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
- dsps_fir_f32_ansi(&fir1, x, y, len);
-
- for (int i = 0 ; i < fir_len ; i++) {
- if (y[i] != i) {
- TEST_ASSERT_EQUAL(y[i], i);
- }
- }
-
- // Check even length
- fir_len--;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
- dsps_fir_f32_ansi(&fir1, x, y, len);
-
- for (int i = 0 ; i < fir_len ; i++) {
- if (y[i] != i) {
- TEST_ASSERT_EQUAL(y[i], i);
- }
- }
- for (int i = fir_len ; i < len ; i++) {
- if (y[i] != 0) {
- TEST_ASSERT_EQUAL(y[i], 0);
- }
- }
-}
-
-TEST_CASE("dsps_fir_f32_ansi benchmark", "[dsps]")
-{
-
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int repeat_count = 1;
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fir_init_f32(&fir1, coeffs, delay, fir_len);
-
- unsigned int start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_fir_f32_ansi(&fir1, x, y, len);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (len * repeat_count);
-
- ESP_LOGI(TAG, "dsps_fir_f32_ansi - %f per sample for for %i coefficients, %f per tap \n", cycles, fir_len, cycles / (float)fir_len);
-
- float min_exec = 10;
- float max_exec = 800;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-}
diff --git a/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ae32.c b/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ae32.c
deleted file mode 100644
index bd7afab..0000000
--- a/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ae32.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_fir.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fird_f32_ae32";
-
-static float x[1024];
-static float y[1024];
-static float y_compare[1024];
-
-static float coeffs[32];
-static float delay[32];
-static float delay_compare[32];
-
-TEST_CASE("dsps_fird_f32_ae32 functionality", "[dsps]")
-{
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int decim = 4;
-
- fir_f32_t fir1;
- fir_f32_t fir2;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
- coeffs[0] = 1;
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = i;
- }
-
- dsps_fird_init_f32(&fir1, coeffs, delay, fir_len, decim, 0);
- dsps_fird_init_f32(&fir2, coeffs, delay_compare, fir_len, decim, 0);
- int total1 = dsps_fird_f32_ae32(&fir1, x, y, len);
- int total2 = dsps_fird_f32_ansi(&fir2, x, y_compare, len);
- total1 += dsps_fird_f32_ae32(&fir1, x, y, len);
- total2 += dsps_fird_f32_ansi(&fir2, x, y_compare, len);
- total1 += dsps_fird_f32_ae32(&fir1, x, y, len);
- total2 += dsps_fird_f32_ansi(&fir2, x, y_compare, len);
- ESP_LOGI(TAG, "Total result = %i, expected %i from %i", total1, total2, len);
- TEST_ASSERT_EQUAL(total1, total2);
- for (int i=0 ; i< total1 ; i++)
- {
- ESP_LOGD(TAG, "data[%i] = %f\n", i, y[i]);
- }
- for (int i = 0 ; i < total1 ; i++) {
- if (y[i] != y_compare[i]) {
- TEST_ASSERT_EQUAL(y[i], y_compare[i]);
- }
- }
-
-
-}
-
-
-TEST_CASE("dsps_fird_f32_ae32 benchmark", "[dsps]")
-{
-
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int repeat_count = 1;
- int decim = 4;
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fird_init_f32(&fir1, coeffs, delay, fir_len, decim, 0);
-
- unsigned int start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_fird_f32_ae32(&fir1, x, y, len);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (len * repeat_count);
-
- ESP_LOGI(TAG, "dsps_fir_f32_ae32 - %f per sample for for %i coefficients, %f per decim tap \n", cycles, fir_len, cycles / (float)fir_len * decim);
- float min_exec = 3;
- float max_exec = 300;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-}
diff --git a/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ansi.c b/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ansi.c
deleted file mode 100644
index 0bff3be..0000000
--- a/components/esp-dsp/modules/fir/test/test_dsps_fird_f32_ansi.c
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_fir.h"
-#include "dsp_tests.h"
-
-static const char *TAG = "dsps_fird_f32_ansi";
-
-float x[1024];
-float y[1024];
-
-float coeffs[32];
-float delay[32];
-
-TEST_CASE("dsps_fird_f32_ansi functionality", "[dsps]")
-{
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int decim = 4;
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = 0;
- }
- coeffs[0] = 1;
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = i % decim;
- }
-
- dsps_fird_init_f32(&fir1, coeffs, delay, fir_len, decim, 0);
- int total = dsps_fird_f32_ansi(&fir1, x, y, len);
- ESP_LOGI(TAG, "Total result = %i from %i", total, len);
- TEST_ASSERT_EQUAL(total, len / decim);
- for (int i=0 ; i< total ; i++)
- {
- ESP_LOGD(TAG, "data[%i] = %f\n", i, y[i]);
- }
- for (int i = 0 ; i < total ; i++) {
- if (y[i] != (decim - 1)) {
- TEST_ASSERT_EQUAL(y[i], (decim - 1));
- }
- }
-
-
-}
-
-
-TEST_CASE("dsps_fird_f32_ansi benchmark", "[dsps]")
-{
-
- int len = sizeof(x) / sizeof(float);
- int fir_len = sizeof(coeffs) / sizeof(float);
- int repeat_count = 1;
- int decim = 4;
-
- fir_f32_t fir1;
- for (int i = 0 ; i < fir_len ; i++) {
- coeffs[i] = i;
- }
-
- for (int i = 0 ; i < len ; i++) {
- x[i] = 0;
- }
- x[0] = 1;
-
- dsps_fird_init_f32(&fir1, coeffs, delay, fir_len, decim, 0);
-
- unsigned int start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_fird_f32_ansi(&fir1, x, y, len);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (len * repeat_count);
-
- ESP_LOGI(TAG, "dsps_fir_f32_ansi - %f per sample for for %i coefficients, %f per decim tap \n", cycles, fir_len, cycles / (float)fir_len * decim);
- float min_exec = 10;
- float max_exec = 300;
- TEST_ASSERT_EXEC_IN_RANGE(min_exec, max_exec, cycles);
-}
diff --git a/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ae32.S b/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ae32.S
deleted file mode 100644
index 21fc832..0000000
--- a/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ae32.S
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_biquad_platform.h"
-#if (dsps_biquad_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_biquad_f32_ae32
- .type dsps_biquad_f32_ae32,@function
-// The function implements the following C code:
-//esp_err_t dsps_biquad_f32_ae32(const float* input, float* output, int len, float* coef, float* w)
-// {
-// for (int i=0 ; i< len ; i++)
-// {
-// float d0 = input[i] - coef[3]*w[0] - coef[4]*w[1]; (input[i] - a[1]*w[0] - a[2]*w[1];)
-// output[i] = coef[0]*d0 + coef[1]*w[0] + coef[2]*w[1];
-// w[1] = w[0];
-// w[0] = d0;
-// }
-// return ESP_OK;
-// }
-
-dsps_biquad_f32_ae32:
-// input - a2
-// output - a3
-// len - a4
-// coeffs - a5
-// w- a6
-
-// f0 - b0
-// f1 - b1
-// f2 - b2
-// f3 - a1
-// f4 - a2
-
-// f5 - w0
-// f6 - w1
-
- entry a1, 16
- // Array increment for floating point data should be 4
- lsi f0, a5, 0
- lsi f1, a5, 4
- lsi f2, a5, 8
- lsi f3, a5, 12
- lsi f4, a5, 16
-
-
- neg.s f5, f3 // -a[1]
- neg.s f6, f4 // -a[2]
-
- lsi f7, a6, 0 // w[0]
- lsi f8, a6, 4 // w[1]
-
- addi a3, a3, -4 // i-- // preset a3
- lsi f9, a2, 0 // f9 = x[i]
- loopnez a4, loop_bq_end_m_ae32
- madd.s f9, f7, f5 // f9 += -a1*w0
- addi a3, a3, 4 // out++;
- mul.s f10, f1, f7 // f10 = b1*w0
- madd.s f9, f8, f6 // f9 += -a2*w1
- madd.s f10, f9, f0 // f10 += b0*d0
- addi a2, a2, 4 // in++;
- madd.s f10, f2, f8 // f10+= b2*w1, f10 - result
- mov.s f8, f7 // w1 = w0
- mov.s f7, f9 // w0 = d0
- lsi f9, a2, 0 // f9 = x[i]
- ssi f10, a3, 0 // y[i] = result
-loop_bq_end_m_ae32:
- // Store delay line
- ssi f7, a6, 0
- ssi f8, a6, 4
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_biquad_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ansi.c b/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ansi.c
deleted file mode 100644
index 9221698..0000000
--- a/components/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ansi.c
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include "dsps_biquad.h"
-
-
-esp_err_t dsps_biquad_f32_ansi(const float *input, float *output, int len, float *coef, float *w)
-{
- for (int i = 0 ; i < len ; i++) {
- float d0 = input[i] - coef[3] * w[0] - coef[4] * w[1];
- output[i] = coef[0] * d0 + coef[1] * w[0] + coef[2] * w[1];
- w[1] = w[0];
- w[0] = d0;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/iir/biquad/dsps_biquad_gen_f32.c b/components/esp-dsp/modules/iir/biquad/dsps_biquad_gen_f32.c
deleted file mode 100644
index 282e629..0000000
--- a/components/esp-dsp/modules/iir/biquad/dsps_biquad_gen_f32.c
+++ /dev/null
@@ -1,290 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_biquad_gen.h"
-#include
-#include "esp_log.h"
-
-esp_err_t dsps_biquad_gen_lpf_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = (1 - c) / 2;
- float b1 = 1 - c;
- float b2 = b0;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_hpf_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = (1 + c) / 2;
- float b1 = -(1 + c);
- float b2 = b0;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_bpf_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = s / 2;
- float b1 = 0;
- float b2 = -b0;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_bpf0db_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = alpha;
- float b1 = 0;
- float b2 = -alpha;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_notch_f32(float *coeffs, float f, float gain, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float A = sqrtf(pow(10, (double)gain / 20.0));
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = 1 + alpha * A;
- float b1 = -2 * c;
- float b2 = 1 - alpha * A;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_allpass360_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = 1 - alpha;
- float b1 = -2 * c;
- float b2 = 1 + alpha;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_allpass180_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = 1 - alpha;
- float b1 = -2 * c;
- float b2 = 1 + alpha;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_peakingEQ_f32(float *coeffs, float f, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = alpha;
- float b1 = 0;
- float b2 = -alpha;
- float a0 = 1 + alpha;
- float a1 = -2 * c;
- float a2 = 1 - alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_lowShelf_f32(float *coeffs, float f, float gain, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float A = sqrtf(pow(10, (double)gain / 20.0));
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = A * ((A + 1) - (A - 1) * c + 2 * sqrtf(A) * alpha);
- float b1 = 2 * A * ((A - 1) - (A + 1) * c);
- float b2 = A * ((A + 1) - (A - 1) * c - 2 * sqrtf(A) * alpha);
- float a0 = (A + 1) + (A - 1) * c + 2 * sqrtf(A) * alpha;
- float a1 = -2 * ((A - 1) + (A + 1) * c);
- float a2 = (A + 1) + (A - 1) * c - 2 * sqrtf(A) * alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
-
-esp_err_t dsps_biquad_gen_highShelf_f32(float *coeffs, float f, float gain, float qFactor)
-{
- if (qFactor <= 0.0001) {
- qFactor = 0.0001;
- }
- float Fs = 1;
-
- float A = sqrtf(pow(10, (double)gain / 20.0));
- float w0 = 2 * M_PI * f / Fs;
- float c = cosf(w0);
- float s = sinf(w0);
- float alpha = s / (2 * qFactor);
-
- float b0 = A * ((A + 1) + (A - 1) * c + 2 * sqrtf(A) * alpha);
- float b1 = -2 * A * ((A - 1) + (A + 1) * c);
- float b2 = A * ((A + 1) + (A - 1) * c - 2 * sqrtf(A) * alpha);
- float a0 = (A + 1) - (A - 1) * c + 2 * sqrtf(A) * alpha;
- float a1 = 2 * ((A - 1) - (A + 1) * c);
- float a2 = (A + 1) - (A - 1) * c - 2 * sqrtf(A) * alpha;
-
- coeffs[0] = b0 / a0;
- coeffs[1] = b1 / a0;
- coeffs[2] = b2 / a0;
- coeffs[3] = a1 / a0;
- coeffs[4] = a2 / a0;
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/iir/include/dsps_biquad.h b/components/esp-dsp/modules/iir/include/dsps_biquad.h
deleted file mode 100644
index 8e809ee..0000000
--- a/components/esp-dsp/modules/iir/include/dsps_biquad.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#ifndef _dsps_biquad_H_
-#define _dsps_biquad_H_
-
-#include "dsp_err.h"
-
-#include "dsps_add_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**@{*/
-/**
- * @brief IIR filter
- *
- * IIR filter 2nd order direct form II (bi quad)
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] input: input array
- * @param output: output array
- * @param len: length of input and output vectors
- * @param coef: array of coefficients. b0,b1,b2,a1,a2
- * expected that a0 = 1. b0..b2 - numerator, a0..a2 - denominator
- * @param w: delay line w0,w1. Length of 2.
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_f32_ansi(const float *input, float *output, int len, float *coef, float *w);
-esp_err_t dsps_biquad_f32_ae32(const float *input, float *output, int len, float *coef, float *w);
-/**@}*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_biquad_f32_ae32_enabled == 1)
-#define dsps_biquad_f32 dsps_biquad_f32_ae32
-#else
-#define dsps_biquad_f32 dsps_biquad_f32_ansi
-#endif
-#else // CONFIG_DSP_OPTIMIZED
-#define dsps_biquad_f32 dsps_biquad_f32_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-
-#endif // _dsps_biquad_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/iir/include/dsps_biquad_gen.h b/components/esp-dsp/modules/iir/include/dsps_biquad_gen.h
deleted file mode 100644
index 750dc4d..0000000
--- a/components/esp-dsp/modules/iir/include/dsps_biquad_gen.h
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_biquad_gen_H_
-#define _dsps_biquad_gen_H_
-
-#include "dsp_err.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-// Common rules for all generated coefficients.
-// The coefficients placed to the array as follows:
-// coeffs[0] = b0;
-// coeffs[1] = b1;
-// coeffs[2] = b2;
-// coeffs[3] = a1;
-// coeffs[4] = a2;
-// a0 - are not placed and expected always as == 1
-
-/**
- * @brief LPF IIR filter coefficients
- * Coefficients for low pass 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter cut off frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_lpf_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief HPF IIR filter coefficients
- *
- * Coefficients for high pass 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter cut off frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_hpf_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief BPF IIR filter coefficients
- *
- * Coefficients for band pass 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter center frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_bpf_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief 0 dB BPF IIR filter coefficients
- *
- * Coefficients for band pass 2nd order IIR filter (bi-quad) with 0 dB gain in passband
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter center frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_bpf0db_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief Notch IIR filter coefficients
- *
- * Coefficients for notch 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param gain: gain in stopband in dB
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_notch_f32(float *coeffs, float f, float gain, float qFactor);
-
-/**
- * @brief Allpass 360 degree IIR filter coefficients
- *
- * Coefficients for all pass 2nd order IIR filter (bi-quad) with 360 degree phase shift
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_allpass360_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief Allpass 180 degree IIR filter coefficients
- *
- * Coefficients for all pass 2nd order IIR filter (bi-quad) with 180 degree phase shift
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_allpass180_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief peak IIR filter coefficients
- *
- * Coefficients for peak 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_peakingEQ_f32(float *coeffs, float f, float qFactor);
-
-/**
- * @brief low shelf IIR filter coefficients
- *
- * Coefficients for low pass Shelf 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param gain: gain in stopband in dB
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_lowShelf_f32(float *coeffs, float f, float gain, float qFactor);
-
-/**
- * @brief high shelf IIR filter coefficients
- *
- * Coefficients for high pass Shelf 2nd order IIR filter (bi-quad)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param coeffs: result coefficients. b0,b1,b2,a1,a2, a0 are not placed to the array and expected by IIR as 1
- * @param f: filter notch frequency in range of 0..0.5 (normalized to sample frequency)
- * @param gain: gain in stopband in dB
- * @param qFactor: Q factor of filter
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_biquad_gen_highShelf_f32(float *coeffs, float f, float gain, float qFactor);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _dsps_biquad_gen_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/iir/include/dsps_biquad_platform.h b/components/esp-dsp/modules/iir/include/dsps_biquad_platform.h
deleted file mode 100644
index 4155173..0000000
--- a/components/esp-dsp/modules/iir/include/dsps_biquad_platform.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _dsps_biquad_platform_H_
-#define _dsps_biquad_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_biquad_f32_ae32_enabled 1
-
-#endif
-
-#endif // _dsps_biquad_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/iir/test/test_bq_f32_ae32.c b/components/esp-dsp/modules/iir/test/test_bq_f32_ae32.c
deleted file mode 100644
index 33db3fa..0000000
--- a/components/esp-dsp/modules/iir/test/test_bq_f32_ae32.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_biquad_gen.h"
-#include "dsps_biquad.h"
-
-static const char *TAG = "dsps_biquad_f32_ae32";
-const int bq_len = 1024;
-TEST_CASE("dsps_biquad_f32_ae32 functionality", "[dsps]")
-{
- float* x = calloc(bq_len,sizeof(float));
- float* y = calloc(bq_len,sizeof(float));
- float* z = calloc(bq_len,sizeof(float));
-
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = bq_len;
-
- dsps_d_gen_f32(x, len, 0);
- float coeffs[5];
- float w1[2] = {0};
- float w2[2] = {0};
- dsps_biquad_gen_lpf_f32(coeffs, 0.1, 1);
- dsps_biquad_f32_ae32(x, y, len, coeffs, w1);
- dsps_biquad_f32_ansi(x, z, len, coeffs, w2);
-
- for (int i = 0 ; i < 32 ; i++) {
- ESP_LOGD(TAG, "[%i]calc = %f, expected=%f", i, y[i], z[i]);
- if (y[i] != z[i]) {
- TEST_ASSERT_EQUAL( y[i], z[i]);
- }
- }
- free(x);
- free(y);
- free(z);
-}
-
-TEST_CASE("dsps_biquad_f32_ae32 benchmark", "[dsps]")
-{
- float* x = calloc(bq_len,sizeof(float));
- float* y = calloc(bq_len,sizeof(float));
- float* z = calloc(bq_len,sizeof(float));
-
- float w1[2] = {0};
- int len = bq_len;
- int repeat_count = 1024;
- dsps_d_gen_f32(x, len, 0);
- float coeffs[5];
- dsps_biquad_gen_lpf_f32(coeffs, 0.1, 1);
-
-
- unsigned int start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_biquad_f32_ae32(x, y, len, coeffs, w1);
- }
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (len * repeat_count);
-
- start_b = xthal_get_ccount();
- for (int i = 0 ; i < repeat_count ; i++) {
- dsps_biquad_f32_ansi(x, y, len, coeffs, w1);
- }
- end_b = xthal_get_ccount();
- float total_b_ansi = end_b - start_b;
- float cycles_ansi = total_b_ansi / (len * repeat_count);
-
- ESP_LOGI(TAG, "dsps_biquad_f32_ae32 - %f per sample\n", cycles);
- ESP_LOGI(TAG, "dsps_biquad_f32_ansi - %f per sample\n", cycles_ansi);
- // float min_exec = 10;
- // float max_exec = 20;
- // if (cycles >= max_exec) {
- // TEST_ASSERT_MESSAGE (false, "Exec time takes more than expected!");
- // }
- // if (cycles < min_exec) {
- // TEST_ASSERT_MESSAGE (false, "Exec time takes less then expected!");
- // }
- free(x);
- free(y);
- free(z);
-
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/iir/test/test_bq_f32_ansi.c b/components/esp-dsp/modules/iir/test/test_bq_f32_ansi.c
deleted file mode 100644
index feea3ea..0000000
--- a/components/esp-dsp/modules/iir/test/test_bq_f32_ansi.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_tone_gen.h"
-#include "dsps_d_gen.h"
-#include "dsps_biquad_gen.h"
-#include "dsps_biquad.h"
-
-static const char *TAG = "dsps_biquad_f32_ansi";
-
-float x[1024];
-float y[1024];
-
-TEST_CASE("dsps_biquad_f32_ansi functionality", "[dsps]")
-{
- // In the test we generate filter with cutt off frequency 0.1
- // and then filtering 0.1 and 0.3 frequencis.
- // Result must be better then 24 dB
- int len = sizeof(x) / sizeof(float);
-
- dsps_tone_gen_f32(x, len, 1, 0.1, 0);
-
- float coeffs[5];
- float w1[2] = {0};
- float w2[2] = {0};
- dsps_biquad_gen_lpf_f32(coeffs, 0.1, 1);
- dsps_biquad_f32_ansi(x, y, len, coeffs, w1);
- float pow_band = 0;
- for (int i = len / 2 ; i < len ; i++) {
- pow_band += y[i] * y[i];
- }
- float pow_out_band = 0;
- dsps_tone_gen_f32(x, len, 1, 0.3, 0);
- dsps_biquad_f32_ansi(x, y, len, coeffs, w2);
- for (int i = len / 2 ; i < len ; i++) {
- pow_out_band += y[i] * y[i];
- }
- pow_band = 2 * pow_band / (float)len;
- pow_out_band = 2 * pow_out_band / (float)len;
- float diff_db = -10 * log10f(0.000000001 + pow_out_band / pow_band);
- ESP_LOGI(TAG, "Power: pass =%f, stop= %f, diff = %f dB", pow_band, pow_out_band, diff_db);
-
- if (diff_db < 24) {
- ESP_LOGE(TAG, "Attenuation for LPF must be not less then 24! Now it is: %f", diff_db);
- TEST_ASSERT_MESSAGE (false, "LPF attenuation is less then expected");
- }
-}
diff --git a/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ae32.S b/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ae32.S
deleted file mode 100644
index 6f29a5a..0000000
--- a/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ae32.S
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_add_platform.h"
-#if (dsps_add_s16_ae32_enabled == 1)
-
- .text
- .align 4
- .global dsps_add_s16_ae32
- .type dsps_add_s16_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_add_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// int32_t acc = (int32_t)input1[i * step1] + (int32_t)input2[i * step2];
-// output[i * step_out] = acc >> shift;
-// }
-// return ESP_OK;
-// }
-dsps_add_s16_ae32:
-// input1 - a2
-// input2 - a3
-// output - a4
-// len - a5
-// step_in1 - a6
-// step_in2 - a7
-// step_out - stack (a10)
-// shift - stack (a9)
-
- entry a1, 16
-
-
- // l32i.n a10, a1, 16
- // s16i a10, a4, 0
- // l32i.n a10, a1, 20
- // s16i a10, a4, 2
-
- l32i.n a10, a1, 16 // Load step_out to the a10 register
- l32i.n a9, a1, 20 // Load shift to the a9 register
- ssr a9 // sar = a9
-
- slli a6, a6, 1 // a6 - step_in<<1
- slli a7, a7, 1 // a7 - step_in<<1
- slli a10, a10, 1 // a8 - step_out<<1
-
- // s16i a10, a4, 0
- // s16i a6, a4, 2
- // s16i a7, a4, 4
- // s16i a5, a4, 6
-
- l16si a11, a2, 0
- l16si a8, a3, 0
- add a8, a11, a8
- srl a9, a8 // a8 = a8>>sar
-
- loopnez a5, .loop_end_add_s16_ae32
- add.n a2, a2, a6 // input1+=step_in1;
- add.n a3, a3, a7 // input2+=step_in2;
-
- l16si a11, a2, 0
- l16si a8, a3, 0
- s16i a9, a4, 0 // store result to the putput
- add a8, a11, a8
- srl a9, a8 // a8 = a8>>sar
-
- add.n a4, a4, a10 // output+=step_out;
-.loop_end_add_s16_ae32:
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_add_s16_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ansi.c b/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ansi.c
deleted file mode 100644
index 3651ee3..0000000
--- a/components/esp-dsp/modules/math/add/fixed/dsps_add_s16_ansi.c
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_add.h"
-
-esp_err_t dsps_add_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift)
-{
- if (NULL == input1) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == input2) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- int32_t acc = (int32_t)input1[i * step1] + (int32_t)input2[i * step2];
- output[i * step_out] = acc >> shift;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/math/add/float/dsps_add_f32_ae32.S b/components/esp-dsp/modules/math/add/float/dsps_add_f32_ae32.S
deleted file mode 100644
index 8f1c50a..0000000
--- a/components/esp-dsp/modules/math/add/float/dsps_add_f32_ae32.S
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_add_platform.h"
-#if (dsps_add_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_add_f32_ae32
- .type dsps_add_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_add_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// output[i * step_out] = input1[i * step1] + input2[i * step2];
-// }
-// return ESP_OK;
-// }
-
-dsps_add_f32_ae32:
-// input1 - a2
-// input2 - a3
-// output - a4
-// len - a5
-// step1 - a6
-// step2 - a7
-// step_out - stack (a8)
-
- entry a1, 16
-
- l32i.n a8, a1, 16 // Load step_out to the a8 register
- slli a6, a6, 2 // a6 - step1<<2
- slli a7, a7, 2 // a7 - step2<<2
- slli a8, a8, 2 // a8 - step_out<<2
-
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- loopnez a5, loop_end_add_f32_ae32
- lsi f1, a3, 0
- add.n a3, a3, a7 // input2_ptr+=step2;
-
- add.s f2, f1, f0 // f2 = f1 + f0
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- ssi f2, a4, 0
- add.n a4, a4, a8 // input2_ptr+=step2;
-loop_end_add_f32_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_add_f32_ae32_enabled
diff --git a/components/esp-dsp/modules/math/add/float/dsps_add_f32_ansi.c b/components/esp-dsp/modules/math/add/float/dsps_add_f32_ansi.c
deleted file mode 100644
index ae05789..0000000
--- a/components/esp-dsp/modules/math/add/float/dsps_add_f32_ansi.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_add.h"
-
-esp_err_t dsps_add_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-{
- if (NULL == input1) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == input2) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- output[i * step_out] = input1[i * step1] + input2[i * step2];
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/math/add/include/dsps_add.h b/components/esp-dsp/modules/math/add/include/dsps_add.h
deleted file mode 100644
index 32a15eb..0000000
--- a/components/esp-dsp/modules/math/add/include/dsps_add.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_add_H_
-#define _dsps_add_H_
-#include "dsp_err.h"
-
-#include "dsps_add_platform.h"
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief add two arrays
- *
- * The function add one input array to another
- * out[i*step_out] = input1[i*step1] + input2[i*step2]; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input1: input array 1
- * @param[in] input2: input array 2
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param step1: step over input array 1 (by default should be 1)
- * @param step2: step over input array 2 (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_add_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-esp_err_t dsps_add_f32_ae32(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-
-esp_err_t dsps_add_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift);
-esp_err_t dsps_add_s16_ae32(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift);
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-
-#if (dsps_add_f32_ae32_enabled == 1)
-#define dsps_add_f32 dsps_add_f32_ae32
-#else
-#define dsps_add_f32 dsps_add_f32_ansi
-#endif
-
-#if (dsps_add_s16_ae32_enabled == 1)
-#define dsps_add_s16 dsps_add_s16_ae32
-#else
-#define dsps_add_s16 dsps_add_s16_ansi
-#endif
-
-#else // CONFIG_DSP_OPTIMIZED
-#define dsps_add_f32 dsps_add_f32_ansi
-#define dsps_add_s16 dsps_add_s16_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-#endif // _dsps_add_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/add/include/dsps_add_platform.h b/components/esp-dsp/modules/math/add/include/dsps_add_platform.h
deleted file mode 100644
index 18dab1f..0000000
--- a/components/esp-dsp/modules/math/add/include/dsps_add_platform.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _dsps_add_platform_H_
-#define _dsps_add_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_add_f32_ae32_enabled 1
-
-#endif
-
-#if (XCHAL_HAVE_LOOPS == 1)
-#define dsps_add_s16_ae32_enabled 1
-#endif
-
-
-#endif // _dsps_add_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/add/test/test_dsps_add_f32_ansi.c b/components/esp-dsp/modules/math/add/test/test_dsps_add_f32_ansi.c
deleted file mode 100644
index 7af59b9..0000000
--- a/components/esp-dsp/modules/math/add/test/test_dsps_add_f32_ansi.c
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_add.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_add";
-
-TEST_CASE("dsps_add_f32_ansi functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = 2*i;
- }
- dsps_add_f32_ansi(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_add_f32_ae32 functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = 2*i;
- }
- dsps_add_f32_ae32(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-
- int repeat_count = 1;
-
- dsps_add_f32_ae32(x, x, x, n, 1, 1, 1);
-
- unsigned int start_b = xthal_get_ccount();
- dsps_add_f32_ae32(x, x, x, n, 1, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (n * repeat_count);
- ESP_LOGI(TAG, "dsps_add_f32_ae32 - %f cycles per sample \n", cycles);
-
-}
diff --git a/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ae32.c b/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ae32.c
deleted file mode 100644
index bd72ddc..0000000
--- a/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ae32.c
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_add.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_add";
-
-TEST_CASE("dsps_add_s16_ae32 functionality", "[dsps]")
-{
- int n = 64;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int shift = 0;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = ((int32_t)x[i] + (int32_t)x[i])>>shift;
- y[i] = temp;
- }
-
- dsps_add_s16_ae32(x, x, x, n, 1, 1, 1, 0);
- for (int i = 0 ; i < n ; i++) {
- ESP_LOGD(TAG, "x[%i] = %i %i", i, x[i], y[i]);
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_add_s16_ae32 benchmark", "[dsps]")
-{
- const int n = 256;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- int repeat_count = 1;
-
- unsigned int start_b = xthal_get_ccount();
- dsps_add_s16_ae32(x, x, x, n, 1, 1, 1, 0);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_add_s16_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ansi.c b/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ansi.c
deleted file mode 100644
index e780551..0000000
--- a/components/esp-dsp/modules/math/add/test/test_dsps_add_s16_ansi.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_add.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_add";
-
-TEST_CASE("dsps_add_s16_ansi functionality", "[dsps]")
-{
- int n = 64;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int shift = 0;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = ((int32_t)x[i] + (int32_t)x[i])>>shift;
- y[i] = temp;
- }
-
- dsps_add_s16_ansi(x, x, x, n, 1, 1, 1, 0);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_add_s16_ansi benchmark", "[dsps]")
-{
- const int n = 256;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- int repeat_count = 1;
-
- unsigned int start_b = xthal_get_ccount();
- dsps_add_s16_ansi(x, x, x, n, 1, 1, 1, 0);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_add_s16_ansi - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ae32.S b/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ae32.S
deleted file mode 100644
index cb4ea6a..0000000
--- a/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ae32.S
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_addc_platform.h"
-#if (dsps_addc_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_addc_f32_ae32
- .type dsps_addc_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_addc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// output[i * step_out] = input[i * step_in] + C;
-// }
-// return ESP_OK;
-// }
-dsps_addc_f32_ae32:
-// input - a2
-// output - a3
-// len - a4
-// C - a5
-// step_in - a6
-// step_out - a7
-
- entry a1, 16
-
- slli a6, a6, 2 // a6 - step_in<<2
- slli a7, a7, 2 // a7 - step_out<<2
- wfr f0, a5 // a5 - load to the f0
-
- loopnez a4, loop_end_addc_f32_ae32
- lsi f1, a2, 0
-
- add.s f2, f1, f0 // f2 = f1 + f0
- add.n a2, a2, a6 // input1_ptr+=step_in;
- ssi f2, a3, 0
- add.n a3, a3, a7 // output+=step_out;
-loop_end_addc_f32_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_addc_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ansi.c b/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ansi.c
deleted file mode 100644
index f825592..0000000
--- a/components/esp-dsp/modules/math/addc/float/dsps_addc_f32_ansi.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_addc.h"
-
-esp_err_t dsps_addc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out)
-{
- if (NULL == input) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- output[i * step_out] = input[i * step_in] + C;
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/addc/include/dsps_addc.h b/components/esp-dsp/modules/math/addc/include/dsps_addc.h
deleted file mode 100644
index 595320d..0000000
--- a/components/esp-dsp/modules/math/addc/include/dsps_addc.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_addc_H_
-#define _dsps_addc_H_
-#include "dsp_err.h"
-
-#include "dsps_addc_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief add constant
- *
- * The function adds constant to the input array
- * x[i*step_out] = y[i*step_in] + C; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input: input array
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param C: constant value
- * @param step_in: step over input array (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_addc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out);
-esp_err_t dsps_addc_f32_ae32(const float *input, float *output, int len, float C, int step_in, int step_out);
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_addc_f32_ae32_enabled == 1)
-#define dsps_addc_f32 dsps_addc_f32_ae32
-#else
-#define dsps_addc_f32 dsps_addc_f32_ansi
-#endif
-#else
-#define dsps_addc_f32 dsps_addc_f32_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-#endif // _dsps_addc_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/addc/include/dsps_addc_platform.h b/components/esp-dsp/modules/math/addc/include/dsps_addc_platform.h
deleted file mode 100644
index 2880098..0000000
--- a/components/esp-dsp/modules/math/addc/include/dsps_addc_platform.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _dsps_addc_platform_H_
-#define _dsps_addc_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_addc_f32_ae32_enabled 1
-
-#endif
-
-
-#endif // _dsps_addc_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/addc/test/test_dsps_addc_f32_ansi.c b/components/esp-dsp/modules/math/addc/test/test_dsps_addc_f32_ansi.c
deleted file mode 100644
index 2f2d9d4..0000000
--- a/components/esp-dsp/modules/math/addc/test/test_dsps_addc_f32_ansi.c
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_addc.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_addc";
-
-
-TEST_CASE("dsps_addc_f32_ansi functionality", "[dsps]")
-{
- int n = 64;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i + 10;
- }
- dsps_addc_f32_ansi(x, x, n, 10, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_addc_f32_ae32 functionality", "[dsps]")
-{
- int n = 64;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i + 10;
- }
- dsps_addc_f32_ae32(x, x, n, 10, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-
- int repeat_count = 1;
-
- dsps_addc_f32_ae32(x, x, n, 10, 1, 1);
-
- unsigned int start_b = xthal_get_ccount();
- dsps_addc_f32_ae32(x, x, n, 10, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (n * repeat_count);
- ESP_LOGI(TAG, "dsps_addc_f32_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/include/dsps_math.h b/components/esp-dsp/modules/math/include/dsps_math.h
deleted file mode 100644
index 878f34d..0000000
--- a/components/esp-dsp/modules/math/include/dsps_math.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_math_H_
-#define _dsps_math_H_
-
-#include "dsps_add.h"
-#include "dsps_sub.h"
-#include "dsps_mul.h"
-#include "dsps_addc.h"
-#include "dsps_mulc.h"
-#include "dsps_sqrt.h"
-
-#endif // _dsps_math_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mul/fixed/dsps_mul_s16_ansi.c b/components/esp-dsp/modules/math/mul/fixed/dsps_mul_s16_ansi.c
deleted file mode 100644
index 45d48e3..0000000
--- a/components/esp-dsp/modules/math/mul/fixed/dsps_mul_s16_ansi.c
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mul.h"
-
-esp_err_t dsps_mul_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift)
-{
- if (NULL == input1) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == input2) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- int ttt = (int)input1[i * step1] * (int)input2[i * step2];
- output[i * step_out] = ttt>>shift;
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ae32.S b/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ae32.S
deleted file mode 100644
index e01e2e5..0000000
--- a/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ae32.S
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mul_platform.h"
-#if (dsps_mul_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_mul_f32_ae32
- .type dsps_mul_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_mul_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// output[i * step_out] = input1[i * step1] * input2[i * step2];
-// }
-// return ESP_OK;
-// }
-
-dsps_mul_f32_ae32:
-// input1 - a2
-// input2 - a3
-// output - a4
-// len - a5
-// step1 - a6
-// step2 - a7
-// step_out - stack (a8)
-
- entry a1, 16
-
- l32i.n a8, a1, 16 // Load step_out to the a8 register
- slli a6, a6, 2 // a6 - step1<<2
- slli a7, a7, 2 // a7 - step2<<2
- slli a8, a8, 2 // a8 - step_out<<2
-
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- loopnez a5, loop_end_mul_f32_ae32
- lsi f1, a3, 0
- add.n a3, a3, a7 // input2_ptr+=step2;
-
- mul.s f2, f1, f0 // f2 = f1*f0
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- ssi f2, a4, 0
- add.n a4, a4, a8 // input2_ptr+=step2;
-loop_end_mul_f32_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_mul_f32_ae32_enabled
diff --git a/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ansi.c b/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ansi.c
deleted file mode 100644
index 109c11e..0000000
--- a/components/esp-dsp/modules/math/mul/float/dsps_mul_f32_ansi.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mul.h"
-
-esp_err_t dsps_mul_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-{
- if (NULL == input1) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == input2) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- output[i * step_out] = input1[i * step1] * input2[i * step2];
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/math/mul/include/dsps_mul.h b/components/esp-dsp/modules/math/mul/include/dsps_mul.h
deleted file mode 100644
index 303da36..0000000
--- a/components/esp-dsp/modules/math/mul/include/dsps_mul.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_mul_H_
-#define _dsps_mul_H_
-#include "dsp_err.h"
-
-#include "dsps_mul_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief Multiply two arrays
- *
- * The function multiply one input array to another and store result to other array
- * out[i*step_out] = input1[i*step1] * input2[i*step2]; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input1: input array 1
- * @param[in] input2: input array 2
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param step1: step over input array 1 (by default should be 1)
- * @param step2: step over input array 2 (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_mul_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-esp_err_t dsps_mul_f32_ae32(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-/**@}*/
-
-
-/**@{*/
-/**
- * @brief Multiply two arrays
- *
- * The function multiply one input array to another and store result to other array
- * out[i*step_out] = input1[i*step1] * input2[i*step2]; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input1: input array 1
- * @param[in] input2: input array 2
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param step1: step over input array 1 (by default should be 1)
- * @param step2: step over input array 2 (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- * @param shift: output shift after multiplication (by default should be 15)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_mul_s16_ansi(const int16_t *input1, const int16_t *input2, int16_t *output, int len, int step1, int step2, int step_out, int shift);
-
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_mul_f32_ae32_enabled == 1)
-#define dsps_mul_f32 dsps_mul_f32_ae32
-#else
-#define dsps_mul_f32 dsps_mul_f32_ansi
-#endif //
-#define dsps_mul_s16 dsps_mul_s16_ansi
-#else // CONFIG_DSP_OPTIMIZED
-#define dsps_mul_f32 dsps_mul_f32_ansi
-#define dsps_mul_s16 dsps_mul_s16_ansi
-#endif
-#endif // _dsps_mul_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mul/include/dsps_mul_platform.h b/components/esp-dsp/modules/math/mul/include/dsps_mul_platform.h
deleted file mode 100644
index 2e195ea..0000000
--- a/components/esp-dsp/modules/math/mul/include/dsps_mul_platform.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _dsps_mul_platform_H_
-#define _dsps_mul_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_mul_f32_ae32_enabled 1
-
-#endif
-
-#endif // _dsps_mul_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mul/test/test_dsps_mul_f32_ansi.c b/components/esp-dsp/modules/math/mul/test/test_dsps_mul_f32_ansi.c
deleted file mode 100644
index 5fa8344..0000000
--- a/components/esp-dsp/modules/math/mul/test/test_dsps_mul_f32_ansi.c
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_mul.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_mul";
-
-TEST_CASE("dsps_mul_f32_ansi functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i*i;
- }
- dsps_mul_f32_ansi(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_mul_f32_ae32 functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i*i;
- }
- dsps_mul_f32_ae32(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-
- int repeat_count = 1;
-
- dsps_mul_f32_ae32(x, x, x, n, 1, 1, 1);
-
- unsigned int start_b = xthal_get_ccount();
- dsps_mul_f32_ae32(x, x, x, n, 1, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (n * repeat_count);
- ESP_LOGI(TAG, "dsps_mul_f32_ae32 - %f cycles per sample \n", cycles);
-
-}
diff --git a/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ae32.S b/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ae32.S
deleted file mode 100644
index d86d081..0000000
--- a/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ae32.S
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mulc_platform.h"
-#if (dsps_mulc_s16_ae32_enabled == 1)
-
- .text
- .align 4
- .global dsps_mulc_s16_ae32
- .type dsps_mulc_s16_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_mulc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// int32_t acc = (int32_t)input[i * step_in] * (int32_t)C;
-// output[i * step_out] = (int16_t)(acc>>15);
-// }
-// return ESP_OK;
-// }
-dsps_mulc_s16_ae32:
-// input - a2
-// output - a3
-// len - a4
-// C - a5
-// step_in - a6
-// step_out - a7
-
- entry a1, 16
-
- movi.n a8, 15 // output shift
- ssr a8
-
- srli a4, a4, 1 // a4 = a4>>1
- slli a6, a6, 2 // a6 - step_in<<3, because we load two inputs per loop
- slli a7, a7, 1 // a7 - step_out<<2
-
- addi a6, a6, -4;
- addi a2, a2, -4;
-
- ldinc m0, a2
-
- loopnez a4, loop_end_mulc_f32_ae32
- add.n a2, a2, a6 // input+=step_input;
- mul.DA.LL m0, a5
- rsr a8, acchi
- rsr a9, acclo
- src a8, a8, a9 // Here result in a8
- s16i a8, a3, 0 // store result to the putput
- // rsr a9, acclo
- // s16i a9, a3, 0 // store result to the putput
- add.n a3, a3, a7 // output+=step_out;
- mul.DA.HL m0, a5
-
- rsr a8, acchi
- rsr a9, acclo
- ldinc m0, a2 // load next data
- src a10, a8, a9 // Here result in a8
- s16i a10, a3, 0 // store result to the putput
- // // rsr a9, acclo
- // // s16i a9, a3, 0 // store result to the putput
- add.n a3, a3, a7 // output+=step_out;
-loop_end_mulc_f32_ae32:
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_mulc_s16_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ansi.c b/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ansi.c
deleted file mode 100644
index bbe4db9..0000000
--- a/components/esp-dsp/modules/math/mulc/fixed/dsps_mulc_s16_ansi.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mulc.h"
-
-esp_err_t dsps_mulc_s16_ansi(const int16_t *input, int16_t *output, int len, int16_t C, int step_in, int step_out)
-{
- if (NULL == input) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- int32_t acc = (int32_t)input[i * step_in] * (int32_t)C;
- output[i * step_out] = (int16_t)(acc>>15);
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ae32.S b/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ae32.S
deleted file mode 100644
index d1eade0..0000000
--- a/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ae32.S
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mulc_platform.h"
-#if (dsps_mulc_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_mulc_f32_ae32
- .type dsps_mulc_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_mulc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// output[i * step_out] = input[i * step_in] * C;
-// }
-// return ESP_OK;
-// }
-dsps_mulc_f32_ae32:
-// input - a2
-// output - a3
-// len - a4
-// C - a5
-// step_in - a6
-// step_out - a7
-
- entry a1, 16
-
- slli a6, a6, 2 // a6 - step_in<<2
- slli a7, a7, 2 // a7 - step_out<<2
- wfr f0, a5 // a5 - load to the f0
-
- loopnez a4, loop_end_mulc_f32_ae32
- lsi f1, a2, 0
-
- mul.s f2, f1, f0 // f2 = f1 * f0
- add.n a2, a2, a6 // input1_ptr+=step_in;
- ssi f2, a3, 0
- add.n a3, a3, a7 // output+=step_out;
-loop_end_mulc_f32_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_mulc_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ansi.c b/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ansi.c
deleted file mode 100644
index c184eff..0000000
--- a/components/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ansi.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_mulc.h"
-
-esp_err_t dsps_mulc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out)
-{
- if (NULL == input) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- output[i * step_out] = input[i * step_in] * C;
- }
- return ESP_OK;
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/include/dsps_mulc.h b/components/esp-dsp/modules/math/mulc/include/dsps_mulc.h
deleted file mode 100644
index 6b8ff16..0000000
--- a/components/esp-dsp/modules/math/mulc/include/dsps_mulc.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_mulc_H_
-#define _dsps_mulc_H_
-#include "dsp_err.h"
-
-#include "dsps_mulc_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**@{*/
-/**
- * @brief multiply constant
- *
- * The function multiplies input array to the constant value
- * x[i*step_out] = y[i*step_in]*C; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input: input array
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param C: constant value
- * @param step_in: step over input array (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_mulc_f32_ansi(const float *input, float *output, int len, float C, int step_in, int step_out);
-esp_err_t dsps_mulc_f32_ae32(const float *input, float *output, int len, float C, int step_in, int step_out);
-
-esp_err_t dsps_mulc_s16_ae32(const int16_t *input, int16_t *output, int len, int16_t C, int step_in, int step_out);
-esp_err_t dsps_mulc_s16_ansi(const int16_t *input, int16_t *output, int len, int16_t C, int step_in, int step_out);
-
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-#if (dsps_mulc_f32_ae32_enabled == 1)
-#define dsps_mulc_f32 dsps_mulc_f32_ae32
-#else //
-#define dsps_mulc_f32 dsps_mulc_f32_ansi
-#endif
-#if (dsps_mulc_s16_ae32_enabled == 1)
-#define dsps_mulc_s16 dsps_mulc_s16_ae32
-#else
-#define dsps_mulc_s16 dsps_mulc_s16_ansi
-#endif // dsps_mulc_s16_ae32_enabled
-
-#else
-#define dsps_mulc_f32 dsps_mulc_f32_ansi
-#define dsps_mulc_s16 dsps_mulc_s16_ansi
-#endif
-
-
-#endif // _dsps_mulc_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/include/dsps_mulc_platform.h b/components/esp-dsp/modules/math/mulc/include/dsps_mulc_platform.h
deleted file mode 100644
index d0d741c..0000000
--- a/components/esp-dsp/modules/math/mulc/include/dsps_mulc_platform.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _dsps_mulc_platform_H_
-#define _dsps_mulc_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_mulc_f32_ae32_enabled 1
-
-#endif
-
-#if ((XCHAL_HAVE_LOOPS == 1) && (XCHAL_HAVE_MAC16 == 1))
-
-#define dsps_mulc_s16_ae32_enabled 1
-
-#endif //
-
-
-#endif // _dsps_mulc_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_f32_ansi.c b/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_f32_ansi.c
deleted file mode 100644
index 74f36d8..0000000
--- a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_f32_ansi.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_mulc.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_mulc";
-
-TEST_CASE("dsps_mulc_f32_ansi functionality", "[dsps]")
-{
- int n = 64;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i * 10;
- }
- dsps_mulc_f32_ansi(x, x, n, 10, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_mulc_f32_ae32 functionality", "[dsps]")
-{
- int n = 64;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = i*10;
- }
- dsps_mulc_f32_ae32(x, x, n, 10, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-
- int repeat_count = 1;
-
- dsps_mulc_f32_ae32(x, x, n, 10, 1, 1);
-
- unsigned int start_b = xthal_get_ccount();
- dsps_mulc_f32_ae32(x, x, n, 10, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (n * repeat_count);
- ESP_LOGI(TAG, "dsps_mulc_f32_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ae32.c b/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ae32.c
deleted file mode 100644
index 16cd0eb..0000000
--- a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ae32.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_mulc.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_mulc";
-
-TEST_CASE("dsps_mulc_s16_ae32 functionality", "[dsps]")
-{
- int n = 64;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- dsps_mulc_s16_ae32(x, x, n, test_const, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_mulc_s16_ae32 benchmark", "[dsps]")
-{
- const int n = 256;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- int repeat_count = 1;
-
- unsigned int start_b = xthal_get_ccount();
- dsps_mulc_s16_ae32(x, x, n, 10, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_mulc_f32_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ansi.c b/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ansi.c
deleted file mode 100644
index 7017a2a..0000000
--- a/components/esp-dsp/modules/math/mulc/test/test_dsps_mulc_s16_ansi.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_mulc.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_mulc";
-
-TEST_CASE("dsps_mulc_s16_ansi functionality", "[dsps]")
-{
- int n = 64;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- dsps_mulc_s16_ansi(x, x, n, test_const, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_mulc_s16_ae32 benchmark", "[dsps]")
-{
- const int n = 256;
- int16_t x[n];
- int16_t y[n];
- int32_t temp;
- int16_t test_const = 0x2000;
- for (int i = 0 ; i < n ; i++) {
- x[i] = i<<4;
- temp = (int32_t)x[i]*(int32_t)test_const;
- y[i] = temp >> 15;
- }
-
- int repeat_count = 1;
-
- unsigned int start_b = xthal_get_ccount();
- dsps_mulc_s16_ansi(x, x, n, 10, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float cycles = end_b - start_b;
- ESP_LOGI(TAG, "dsps_mulc_f32_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/math/sqrt/float/dsps_sqrt_f32_ansi.c b/components/esp-dsp/modules/math/sqrt/float/dsps_sqrt_f32_ansi.c
deleted file mode 100644
index dc8b1c7..0000000
--- a/components/esp-dsp/modules/math/sqrt/float/dsps_sqrt_f32_ansi.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_sqrt.h"
-#include "esp_err.h"
-#include
-
-inline float
-dsps_sqrtf_f32_ansi (float f)
-{
- const int result = 0x1fbb4000 + (*(int *)&f >> 1);
- return *(float *)&result;
-}
-
-esp_err_t
-dsps_sqrt_f32_ansi (const float *input, float *output, int len)
-{
- if (NULL == input)
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output)
- return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0; i < len; i++)
- {
- output[i] = dsps_sqrtf_f32_ansi (input[i]);
- }
- return ESP_OK;
-}
-
-float
-dsps_inverted_sqrtf_f32_ansi (float data)
-{
- const float x2 = data * 0.5F;
- const float threehalfs = 1.5F;
-
- union
- {
- float f;
- uint32_t i;
- } conv = { data }; // member 'f' set to value of 'data'.
- conv.i = 0x5f3759df - (conv.i >> 1);
- conv.f *= (threehalfs - (x2 * conv.f * conv.f));
- return conv.f;
-}
diff --git a/components/esp-dsp/modules/math/sqrt/include/dsps_sqrt.h b/components/esp-dsp/modules/math/sqrt/include/dsps_sqrt.h
deleted file mode 100644
index 31edc64..0000000
--- a/components/esp-dsp/modules/math/sqrt/include/dsps_sqrt.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_sqrt_H_
-#define _dsps_sqrt_H_
-#include "dsp_err.h"
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**@{*/
-/**
- * @brief square root approximation
- *
- * The function takes square root approximation
- * x[i] ~ sqrt(y[i]); i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input: input array
- * @param output: output array
- * @param len: amount of operations for arrays
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_sqrt_f32_ansi(const float *input, float *output, int len);
-//esp_err_t dsps_sqrt_s32_ansi(const int32_t *input, int16_t *output, int len);
-
-/**@{*/
-/**
- * @brief square root approximation
- *
- * The function takes square root approximation
- * x ~ sqrt(y);
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] data: input value
- *
- * @return
- * - square root value
- */
-float dsps_sqrtf_f32_ansi(const float data);
-
-
-/**@{*/
-/**
- * @brief inverted square root approximation
- *
- * The function takes inverted square root approximation
- * x ~ 1/sqrt(y);
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] data: input value
- *
- * @return
- * - inverted square root value
- */
-float dsps_inverted_sqrtf_f32_ansi(float data );
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#ifdef CONFIG_DSP_OPTIMIZED
-#define dsps_sqrt_f32 dsps_sqrt_f32_ansi
-#define dsps_sqrtf_f32 dsps_sqrtf_f32_ansi
-#define dsps_inverted_sqrtf_f32 dsps_inverted_sqrtf_f32_ansi
-#else
-#define dsps_sqrt_f32 dsps_sqrt_f32_ansi
-#define dsps_sqrtf_f32 dsps_sqrtf_f32_ansi
-#define dsps_inverted_sqrtf_f32 dsps_inverted_sqrtf_f32_ansi
-#endif
-
-#endif // _dsps_sqrt_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/sqrt/test/test_dsps_sqrt_f32_ansi.c b/components/esp-dsp/modules/math/sqrt/test/test_dsps_sqrt_f32_ansi.c
deleted file mode 100644
index 7fb8b77..0000000
--- a/components/esp-dsp/modules/math/sqrt/test/test_dsps_sqrt_f32_ansi.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_sqrt.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_sqrt";
-
-TEST_CASE("dsps_sqrtf_f32_ansi functionality", "[dsps]")
-{
- float max_err = -1000;
- float max_value = 0;
- float min_err = 0;
- float min_value = INT32_MAX;
- int test_points = 100000;
- for (size_t i = 0; i < test_points; i++)
- {
- float test_value = rand();
- // if (test_value > max_value) max_value = test_value;
- // if (test_value < min_value) min_value = test_value;
- float x = sqrtf(test_value);
- float y = dsps_sqrtf_f32(test_value);
- float error = 20*log10f(fabs((x - y)/x) + 0.000001);
- if (error > max_err)
- {
- max_err = error;
- max_value = test_value;
- }
- if (error < min_err)
- {
- min_err = error;
- min_value = test_value;
- }
- if (error > -25) {
- ESP_LOGE(TAG, "dsps_sqrtf_f32_ansi: error = %f dB, value = %f (0x%8.8x)\n", error, test_value, (int)test_value);
- TEST_ASSERT_EQUAL(x, y);
- }
- }
- ESP_LOGI(TAG, "dsps_sqrtf_f32_ansi: max error = %f dB, min error = %f dB, max_value = %f (0x%8.8x), min_value = %f (0x%8.8x)\n", max_err, min_err, max_value, (int)max_value, min_value, (int)min_value);
-}
-
-TEST_CASE("dsps_sqrt_f32_ansi functionality", "[dsps]")
-{
- int n = 256;
- float* x = (float*)malloc(sizeof(float)*n);
- float* result = (float*)malloc(sizeof(float)*n);
- float* y = (float*)malloc(sizeof(float)*n);
- for (int i = 0 ; i < n ; i++) {
- y[i] = i * 10;
- x[i] = y[i]*y[i];
- }
- unsigned int start_b = xthal_get_ccount();
- dsps_sqrt_f32_ansi(x, result, n);
- float cycles = xthal_get_ccount() - start_b;
-
- for (int i = 0 ; i < n ; i++) {
- //printf("Result[%i] = %f, expected = %f, diff = %f\n", i, result[i], y[i], 20*logf(fabs((result[i] - y[i])/y[i]) + 0.000001));
- float error = 20*log10f(fabs((result[i] - y[i])/y[i]) + 0.000001);
- if (error > -25) {
- TEST_ASSERT_EQUAL(result[i], y[i]);
- }
- }
- ESP_LOGI(TAG, "dsps_sqrt_f32_ansi - %f cycles for %i samples \n", cycles, n);
- free(x);
- free(y);
- free(result);
-}
diff --git a/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ae32.S b/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ae32.S
deleted file mode 100644
index 90e9e76..0000000
--- a/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ae32.S
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_sub_platform.h"
-#if (dsps_sub_f32_ae32_enabled == 1)
-
-// This is bi quad filter form II for ESP32 processor.
- .text
- .align 4
- .global dsps_sub_f32_ae32
- .type dsps_sub_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dsps_sub_f32_ae32(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-// {
-// for (int i = 0 ; i < len ; i++) {
-// output[i * step_out] = input1[i * step1] - input2[i * step2];
-// }
-// return ESP_OK;
-// }
-
-dsps_sub_f32_ae32:
-// input1 - a2
-// input2 - a3
-// output - a4
-// len - a5
-// step1 - a6
-// step2 - a7
-// step_out - stack (a8)
-
- entry a1, 16
-
- l32i.n a8, a1, 16 // Load step_out to the a8 register
- slli a6, a6, 2 // a6 - step1<<2
- slli a7, a7, 2 // a7 - step2<<2
- slli a8, a8, 2 // a8 - step_out<<2
-
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- loopnez a5, loop_end_sub_f32_ae32
- lsi f1, a3, 0
- add.n a3, a3, a7 // input2_ptr+=step2;
-
- sub.s f2, f1, f0 // f2 = f1 - f0
- lsi f0, a2, 0
- add.n a2, a2, a6 // input1_ptr+=step1;
- ssi f2, a4, 0
- add.n a4, a4, a8 // input2_ptr+=step2;
-loop_end_sub_f32_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif // dsps_sub_f32_ae32_enabled
diff --git a/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ansi.c b/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ansi.c
deleted file mode 100644
index 0126f1d..0000000
--- a/components/esp-dsp/modules/math/sub/float/dsps_sub_f32_ansi.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_sub.h"
-
-esp_err_t dsps_sub_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out)
-{
- if (NULL == input1) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == input2) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
- if (NULL == output) return ESP_ERR_DSP_PARAM_OUTOFRANGE;
-
- for (int i = 0 ; i < len ; i++) {
- output[i * step_out] = input1[i * step1] - input2[i * step2];
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/math/sub/include/dsps_sub.h b/components/esp-dsp/modules/math/sub/include/dsps_sub.h
deleted file mode 100644
index 2dc1adf..0000000
--- a/components/esp-dsp/modules/math/sub/include/dsps_sub.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dsps_sub_H_
-#define _dsps_sub_H_
-#include "dsp_err.h"
-
-#include "dsps_sub_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-/**@{*/
-/**
- * @brief sub arrays
- *
- * The function subtract one array from another
- * out[i*step_out] = input1[i*step1] - input2[i*step2]; i=[0..len)
- * The implementation use ANSI C and could be compiled and run on any platform
- *
- * @param[in] input1: input array 1
- * @param[in] input2: input array 2
- * @param output: output array
- * @param len: amount of operations for arrays
- * @param step1: step over input array 1 (by default should be 1)
- * @param step2: step over input array 2 (by default should be 1)
- * @param step_out: step over output array (by default should be 1)
- *
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dsps_sub_f32_ansi(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-esp_err_t dsps_sub_f32_ae32(const float *input1, const float *input2, float *output, int len, int step1, int step2, int step_out);
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-
-#if (dsps_sub_f32_ae32_enabled == 1)
-#define dsps_sub_f32 dsps_sub_f32_ae32
-#else
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#endif
-#else
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#endif // CONFIG_DSP_OPTIMIZED
-
-
-#endif // _dsps_sub_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/sub/include/dsps_sub_platform.h b/components/esp-dsp/modules/math/sub/include/dsps_sub_platform.h
deleted file mode 100644
index d71ed0f..0000000
--- a/components/esp-dsp/modules/math/sub/include/dsps_sub_platform.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _dsps_sub_platform_H_
-#define _dsps_sub_platform_H_
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dsps_sub_f32_ae32_enabled 1
-
-#endif
-
-#endif // _dsps_sub_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/math/sub/test/test_dsps_sub_f32_ansi.c b/components/esp-dsp/modules/math/sub/test/test_dsps_sub_f32_ansi.c
deleted file mode 100644
index b5427cd..0000000
--- a/components/esp-dsp/modules/math/sub/test/test_dsps_sub_f32_ansi.c
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include "unity.h"
-#include "dsp_platform.h"
-#include "esp_log.h"
-
-#include "dsps_sub.h"
-#include "esp_attr.h"
-
-static const char *TAG = "dsps_sub";
-
-TEST_CASE("dsps_sub_f32_ansi functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = 0;
- }
- dsps_sub_f32_ansi(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-}
-
-TEST_CASE("dsps_sub_f32_ae32 functionality", "[dsps]")
-{
- int n = 32;
- float x[n];
- float y[n];
- for (int i = 0 ; i < n ; i++) {
- x[i] = i;
- y[i] = 0;
- }
- dsps_sub_f32_ae32(x, x, x, n, 1, 1, 1);
- for (int i = 0 ; i < n ; i++) {
- if (x[i] != y[i]) {
- TEST_ASSERT_EQUAL(x[i], y[i]);
- }
- }
-
- int repeat_count = 1;
- dsps_sub_f32_ae32(x, x, x, n, 1, 1, 1);
-
- unsigned int start_b = xthal_get_ccount();
- dsps_sub_f32_ae32(x, x, x, n, 1, 1, 1);
- unsigned int end_b = xthal_get_ccount();
-
- float total_b = end_b - start_b;
- float cycles = total_b / (n * repeat_count);
- ESP_LOGI(TAG, "dsps_sub_f32_ae32 - %f cycles per sample \n", cycles);
-}
diff --git a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ae32.S b/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ae32.S
deleted file mode 100644
index d28ac9e..0000000
--- a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ae32.S
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_s16_ae32_enabled == 1)
-
-#include "dsps_dotprod_s16_m_ae32.S"
-#include "dspm_mult_s16_m_ae32_vector.S"
-//esp_err_t dspm_mult_s16_ae32(const int16_t* A, const int16_t* B, int16_t* C, int m, int n, int k, int shift);
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_s16_ae32
- .type dspm_mult_s16_ae32,@function
-
-dspm_mult_s16_ae32:
-// A - a2
-// B - a3
-// C - a4
-// m - a5 - any > 0
-// n - a6 - 1,2,3, any
-// k - a7 - 1, any
-// shift - stack (a8)
-
-// a14 - n*4 - pointer increment
-//
- entry a1, 48
-// ====== process matrices when k == 1 ============
- l32i.n a8, a1, 48 // Load shift to the a8 register
-
-
- // Prepare and load round value
- ssr a8 // store shift to ssa
- movi a15, 0x7fff
- srl a15, a15
-
- neg a8, a8
- addi a8, a8, 15
- ssr a8 // store shift to ssa
- movi a8, 0 // Clear a8
-
- slli a14, a6, 1 // Pointer increment for n
- movi.n a10, 2 // Increment = 2
- movi.n a9, 0 // initial counter loop1
-
- movi a12, 1
- beq a7, a12, vector_mult
- // We have normal path with k > 1
- // a2, a3, a4 - A,B,C
- // a5 - m
- // a6 - n
- // a7 - k
- // a8 - temp
- // a9 - temp
- // a10- k counter
- // a11- m counter
- // a12- B
- // a13- A
- // a14 - pointer increment for n
- // a15 - round value
-
- bbsi a6, 0, even_N_samples
-// ---------------- for odd N
- srli a6, a6, 1 // counter a6 = a6/2. We have to do it only once
- slli a7, a7, 1 // counter a7 = a7*2. We have to do it only once
-
- // loop for M
-m_loop_mmult:
- movi a10, 0 // reset k loop counter
- mov a13, a3 // set pointer to the first column
-// loop for K
-k_loop_mmult:
-
- addi a12, a2, -4 // every loop the same start position
-
- movi a8, 0
- wsr a8, acchi
- wsr a15, acclo // initialize acc with shifted round value
-
- loopnez a6, .loop_end_mmult // loop for N
- .loop_mmult:
- ldinc m3, a12
- l16si a8, a13, 0
- add a13, a13, a7
- mula.ad.ll a8, m3
- l16si a8, a13, 0
- add a13, a13, a7
- mula.ad.lh a8, m3
- .loop_end_mmult:
-
- rsr a8, acchi
- rsr a9, acclo
- src a8, a8, a9
- s16i a8, a4, 0
- addi a4, a4, 2
- // check and increment for K
-
- addi a10, a10, 2
- add a13, a3, a10 // we shift collumn
- bne a10, a7, k_loop_mmult
-
- // Check and increment for M
- add a2, a2, a14 // move to the next raw
- addi a5, a5, -1
- bnez.n a5, m_loop_mmult
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-even_N_samples:
-// ---------------- for odd N
- slli a7, a7, 1 // counter a7 = a7*2. We have to do it only once
-
- // loop for M
-m_loop_mmult_even:
- movi a10, 0 // reset k loop counter
- mov a13, a3 // set pointer to the first column
-// loop for K
-k_loop_mmult_even:
-
- mov a12, a2 // every loop the same start position
-
- movi a8, 0
- wsr a8, acchi
- wsr a15, acclo // initialize acc with shifted round value
-
- loopnez a6, .loop_end_mmult_even // loop for N
- .loop_mmult_even:
- l16si a9, a12, 0
- l16si a8, a13, 0
- addi a12, a12, 2
- add a13, a13, a7
- mula.aa.ll a8, a9
- .loop_end_mmult_even:
-
- rsr a8, acchi
- rsr a9, acclo
- src a8, a8, a9
- s16i a8, a4, 0
- addi a4, a4, 2
- // check and increment for K
-
- addi a10, a10, 2
- add a13, a3, a10 // we shift collumn
- bne a10, a7, k_loop_mmult_even
-
- // Check and increment for M
- add a2, a2, a14 // move to the next raw
- addi a5, a5, -1
- bnez.n a5, m_loop_mmult_even
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-// The path where n > 1
-vector_mult:
- dspm_mult_s16_m_ae32_vector;
-
-
-#endif // dspm_mult_s16_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ansi.c b/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ansi.c
deleted file mode 100644
index 13c244e..0000000
--- a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ansi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dsps_dotprod.h"
-#include "dspm_mult.h"
-
-// Matrinx A(m,n), m - amount or rows, n - amount of columns
-// C(m,k) = A(m,n)*B(n,k)
-// c(i,j) = sum(a(i,s)*b(s,j)) , s=1..n
-esp_err_t dspm_mult_s16_ansi(const int16_t *A, const int16_t *B, int16_t *C, int m, int n, int k, int shift)
-{
- int final_shift = shift - 15;
- for (int i = 0 ; i < m ; i++) {
- for (int j = 0 ; j < k ; j++) {
- // This code also could be used
- //dsps_dotprode_f32_ae32(&A[i*n],&B[j],&C[i*k + j],n,1,n);
- long long acc = 0x7fff >> shift;
- for (int s = 0; s < n ; s++) {
- acc += (int32_t)A[i * n + s] * (int32_t)B[s * k + j];
- }
- if (final_shift > 0) {
- C[i * k + j] = (acc << final_shift);
- } else {
- C[i * k + j] = (acc >> (-final_shift));
- }
- }
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32.S b/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32.S
deleted file mode 100644
index 791e085..0000000
--- a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32.S
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro dspm_mult_s16_ae32_MxNxN
-// A - a2
-// B - a3
-// C - a4
-// m - a5
-// n - a6
-// k - a7
-// shift - stack (a8)
-
- movi a10, 4 // load 4 as a constant
- // Check if n >=4 then acceleration is possible and
- blt a6, a10, do_dotproduct
- // Here we make operations one by one...
-
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-do_dotproduct:
-
- mov a12, a2
- mov a13, a3
-
- srli a9, a6, 2 // a9 - count/4 - 1
- addi a9, a9, -1
-
- movi.n a10, 0 // load 0 to the a10 to increment second array
- dotprod_s16_ae32_full a12, a13, a9, a10, a6
-
- /* Get accumulator */
- ssr a6
- rsr a2, acchi
- rsr a3, acclo
- src a2, a2, a3
-
- s16i a2, a4, 0
- movi.n a2, 0
-
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-.endm // dspm_mult_s16_ae32_MxNxN
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32_vector.S b/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32_vector.S
deleted file mode 100644
index af9dd62..0000000
--- a/components/esp-dsp/modules/matrix/fixed/dspm_mult_s16_m_ae32_vector.S
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-.macro dspm_mult_s16_m_ae32_vector
-// m - a5 - any > 0
-// n - a6 - 1,2,3, any
-// k - a7 - 1, any
-
-
- // Define path for n < 4
- movi a7, 4
- blt a6, a7, small_process_loop // jump for n < 4
-
- srli a7, a6, 2
- addi a7, a7, -1
-
-
-mmultv_loop1:
- wsr a8, acchi
- wsr a15, acclo // initialize acc with shifted round value
-
- // Clear initial state of the result register
- // a2 - A
- // a3 - B
- // a4 - C
- // a6 - n
- // a7 - n/4 - 1
- // a8 - 0
- // a15- 0x7fff>>shift
-
- mov a12, a2 // load A
- mov a13, a3 // Load B
-
- dotprod_s16_ae32_full a12, a13, a7, a6
-
- // check loop 1
- /* Get accumulator */
- rsr a12, acchi
- rsr a13, acclo
- src a12, a12, a13
-
- s16i a12, a4, 0
- addi a4, a4, 2
-
- add.n a2, a2, a14 // Increment A, A = A[i*n]
- addi a9, a9, 1 // Increment loop1 counter
- blt a9, a5, mmultv_loop1
-
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-small_process_loop:
-
- wsr a8, acchi
- wsr a15, acclo // initialize acc with shifted round value
-
- mov a12, a2 // load A
- mov a13, a3 // Load B
-
- addi a12, a12, -4 // To arrange fist pointer
- addi a13, a13, -4 // To arrange fist pointer
-
- bbci a6, 1, .mod2chk_short
- ldinc m0, a12
- ldinc m2, a13
- mula.dd.hh m0, m2
- mula.dd.ll m0, m2
- .mod2chk_short:
- bbci a6, 0, .mod1chk_short
- ldinc m0, a12
- ldinc m2, a13
- mula.dd.ll m0, m2
- .mod1chk_short:
-
- // check loop 1
- /* Get accumulator */
- rsr a12, acchi
- rsr a13, acclo
- src a12, a12, a13
-
- s16i a12, a4, 0
- addi a4, a4, 2
-
- add.n a2, a2, a14 // Increment A, A = A[i*n]
- addi a9, a9, 1 // Increment loop1 counter
- blt a9, a5, small_process_loop
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-
-.endm // dspm_mult_s16_m_ae32_vector
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x1_f32_ae32.S b/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x1_f32_ae32.S
deleted file mode 100644
index 1932c19..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x1_f32_ae32.S
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_3x3x1_f32_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_3x3x1_f32_ae32
- .type dspm_mult_3x3x1_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dspm_mult_3x3x1_f32_ansi(const float* A, const float* B, float* C, int m, int n, int k)
-// {
- // for (int i=0 ; i< m ; i++)
- // {
- // for (int j=0 ; j< k ; j++)
- // {
- // C[i*k + j] = A[i*n]*B[j];
- // for (int s=1; s< n ; s++)
- // {
- // C[i*k + j] += A[i*n + s]*B[s*k + j];
- // }
- // }
- // }
-// return ESP_OK;
-// }
-
-dspm_mult_3x3x1_f32_ae32:
-// A - a2
-// B - a3
-// C - a4
-
-// a5 - 0
-// a6 - 3
- entry a1, 16
-
- movi a5, 0
- movi a6, 3
-
- lsi f13,a3, 0 // B[0]
- lsi f14,a3, 4 // B[1]
- lsi f15,a3, 8 // B[2]
-
-// addi a2, a2, -12 // To compensate first increment
- loopnez a6, loop_mac_3x3x1_end_m_ae32
- wfr f0, a5
- lsi f2, a2, 0
- madd.s f0, f2, f13
- lsi f3, a2, 4
- madd.s f0, f3, f14
- lsi f4, a2, 8
- madd.s f0, f4, f15
-
- addi a2, a2, 12
- ssi f0, a4, 0
- addi a4, a4, 4
-
- loop_mac_3x3x1_end_m_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x3_f32_ae32.S b/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x3_f32_ae32.S
deleted file mode 100644
index d549ecc..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_3x3x3_f32_ae32.S
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_3x3x3_f32_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_3x3x3_f32_ae32
- .type dspm_mult_3x3x3_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dspm_mult_3x3x1_f32_ansi(const float* A, const float* B, float* C, int m, int n, int k)
-// {
- // for (int i=0 ; i< m ; i++)
- // {
- // for (int j=0 ; j< k ; j++)
- // {
- // C[i*k + j] = A[i*n]*B[j];
- // for (int s=1; s< n ; s++)
- // {
- // C[i*k + j] += A[i*n + s]*B[s*k + j];
- // }
- // }
- // }
-// return ESP_OK;
-// }
-
-dspm_mult_3x3x3_f32_ae32:
-// A - a2
-// B - a3
-// C - a4
-
-// a5 - 0
-// a6 - 3 - internal loop for n
-// a7 - 3 - external loop for M
- entry a1, 16
-
- movi a5, 0
- movi a6, 3
- movi a7, 3 // loop ccount
-
-m_loop_3x3x3:
- mov a12, a2 // A
- mov a14, a4 // output pointer
-
- lsi f12, a3, 0 // B[0][0]
- lsi f13, a3, 12 // B[1][0]
- lsi f14, a3, 24 // B[2][0]
-
- loopnez a6, loop_mac_3x3x3_end_m_ae32
- wfr f0, a5
-
- lsi f2, a12, 0
- madd.s f0, f2, f12
- lsi f3, a12, 4
- madd.s f0, f3, f13
- lsi f4, a12, 8
- madd.s f0, f4, f14
-
- addi a12, a12, 12
- ssi f0, a14, 0
- addi a14, a14, 12
- loop_mac_3x3x3_end_m_ae32:
-
- addi a3, a3, 4 // increment input pointer B
- addi a4, a4, 4
- addi a7, a7, -1
- bnez a7, m_loop_3x3x3
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x1_f32_ae32.S b/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x1_f32_ae32.S
deleted file mode 100644
index cb6c2d4..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x1_f32_ae32.S
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_4x4x1_f32_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_4x4x1_f32_ae32
- .type dspm_mult_4x4x1_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dspm_mult_3x3x1_f32_ansi(const float* A, const float* B, float* C, int m, int n, int k)
-// {
- // for (int i=0 ; i< m ; i++)
- // {
- // for (int j=0 ; j< k ; j++)
- // {
- // C[i*k + j] = A[i*n]*B[j];
- // for (int s=1; s< n ; s++)
- // {
- // C[i*k + j] += A[i*n + s]*B[s*k + j];
- // }
- // }
- // }
-// return ESP_OK;
-// }
-
-dspm_mult_4x4x1_f32_ae32:
-// A - a2
-// B - a3
-// C - a4
-
-// a5 - 0
-// a6 - 3
- entry a1, 16
-
- movi a5, 0
- movi a6, 4
-
- lsi f12,a3, 0 // B[0]
- lsi f13,a3, 4 // B[1]
- lsi f14,a3, 8 // B[2]
- lsi f15,a3, 12 // B[3]
-
- loopnez a6, loop_mac_4x4x1_end_m_ae32
- wfr f0, a5
- lsi f2, a2, 0
- madd.s f0, f2, f12
- lsi f3, a2, 4
- madd.s f0, f3, f13
- lsi f4, a2, 8
- madd.s f0, f4, f14
- lsi f5, a2, 12
- madd.s f0, f5, f15
-
- addi a2, a2, 16
- ssi f0, a4, 0
- addi a4, a4, 4
-
- loop_mac_4x4x1_end_m_ae32:
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x4_f32_ae32.S b/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x4_f32_ae32.S
deleted file mode 100644
index 980a665..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_4x4x4_f32_ae32.S
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_4x4x4_f32_ae32_enabled == 1)
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_4x4x4_f32_ae32
- .type dspm_mult_4x4x4_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dspm_mult_3x3x1_f32_ansi(const float* A, const float* B, float* C, int m, int n, int k)
-// {
- // for (int i=0 ; i< m ; i++)
- // {
- // for (int j=0 ; j< k ; j++)
- // {
- // C[i*k + j] = A[i*n]*B[j];
- // for (int s=1; s< n ; s++)
- // {
- // C[i*k + j] += A[i*n + s]*B[s*k + j];
- // }
- // }
- // }
-// return ESP_OK;
-// }
-
-dspm_mult_4x4x4_f32_ae32:
-// A - a2
-// B - a3
-// C - a4
-
-// a5 - 0
-// a6 - 4 - internal loop for n
-// a7 - 4 - external loop for M
- entry a1, 16
-
- movi a5, 0
- movi a6, 4
- movi a7, 4 // loop ccount
-
-m_loop_4x4x4:
- mov a12, a2 // A
- mov a14, a4 // output pointer
-
- lsi f12, a3, 0 // B[0][0]
- lsi f13, a3, 16 // B[1][0]
- lsi f14, a3, 32 // B[2][0]
- lsi f15, a3, 48 // B[3][0]
-
- loopnez a6, loop_mac_4x4x4_end_m_ae32
- wfr f0, a5
-
- lsi f2, a12, 0
- madd.s f0, f2, f12
- lsi f3, a12, 4
- madd.s f0, f3, f13
- lsi f4, a12, 8
- madd.s f0, f4, f14
- lsi f5, a12, 12
- madd.s f0, f5, f15
-
- addi a12, a12, 16
- ssi f0, a14, 0
- addi a14, a14, 16
- loop_mac_4x4x4_end_m_ae32:
-
- addi a3, a3, 4 // increment input pointer B
- addi a4, a4, 4
- addi a7, a7, -1
- bnez a7, m_loop_4x4x4
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ae32.S b/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ae32.S
deleted file mode 100644
index f6d5c22..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ae32.S
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "dspm_mult_platform.h"
-#if (dspm_mult_f32_ae32_enabled == 1)
-
-#include "dsps_dotprode_f32_m_ae32.S"
-
-// This is matrix multipliction function for ESP32 processor.
- .text
- .align 4
- .global dspm_mult_f32_ae32
- .type dspm_mult_f32_ae32,@function
-// The function implements the following C code:
-// esp_err_t dspm_mult_f32_ansi(const float* A, const float* B, float* C, int m, int n, int k)
-// {
- // for (int i=0 ; i< m ; i++)
- // {
- // for (int j=0 ; j< k ; j++)
- // {
- // C[i*k + j] = A[i*n]*B[j];
- // for (int s=1; s< n ; s++)
- // {
- // C[i*k + j] += A[i*n + s]*B[s*k + j];
- // }
- // }
- // }
-// return ESP_OK;
-// }
-
-dspm_mult_f32_ae32:
-// A - a2
-// B - a3
-// C - a4
-// m - a5
-// n - a6
-// k - a7
-
-// a8 = n*4
-// a10 = 4
-// a9 - counter loop1: 0..m
-// a11 - counter loop2: 0..k
-// a12 - A
-// a13 - B
-// a4 - C
-
- entry a1, 16
- // Array increment for floating point data should be 4
-
- slli a8, a6, 2 // Pointer increment for A
- slli a15,a7, 2 // Pointer increment for B
-
- movi.n a14, 0 // Innitial state of accumulator f1
- movi.n a10, 4 // Increment = 4
- movi.n a9, 0 // counter loop1
-
-dpf_loop1:
- movi.n a11, 0 // reset counter for loop2
-dpf_loop2:
-
- // Clear initial state of the result register
- // a2 - A
- // a3 - B
- // a6 - n
- // a10 - step == 4 bytes
- // a8 - step n*4
- mov a12, a2 // load A
-
- slli a13, a11, 2 // loop count to pointer value
- add.n a13, a3, a13 // load A
-
- wfr f1, a14 // reset f1
- // Calculating dotproduct...
- dotprode_f32_ae32 a12, a13, a6, a10, a15;
-
- ssi f1, a4, 0 // Store result from f1 to memory at a4
- addi a4, a4, 4 // increment a4 for next time
-
- // check loop 2
- addi a11, a11, 1 // Increment loop2 counter
- blt a11, a7, dpf_loop2
-
- // check loop 1
- add.n a2, a2, a8 // Increment A, A = A[i*n]
-
- addi a9, a9, 1 // Increment loop1 counter
- blt a9, a5, dpf_loop1
-
- movi.n a2, 0 // return status ESP_OK
- retw.n
-
-#endif //dspm_mult_f32_ae32_enabled
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ansi.c b/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ansi.c
deleted file mode 100644
index 371aa25..0000000
--- a/components/esp-dsp/modules/matrix/float/dspm_mult_f32_ansi.c
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-#include "dsps_dotprod.h"
-#include "dspm_mult.h"
-
-// Matrinx A(m,n), m - amount or rows, n - amount of columns
-// C(m,k) = A(m,n)*B(n,k)
-// c(i,j) = sum(a(i,s)*b(s,j)) , s=1..n
-esp_err_t dspm_mult_f32_ansi(const float *A, const float *B, float *C, int m, int n, int k)
-{
- for (int i = 0 ; i < m ; i++) {
- for (int j = 0 ; j < k ; j++) {
- C[i * k + j] = A[i * n] * B[j];
- for (int s = 1; s < n ; s++) {
- C[i * k + j] += A[i * n + s] * B[s * k + j];
- }
- }
- }
- return ESP_OK;
-}
diff --git a/components/esp-dsp/modules/matrix/include/dspm_mult.h b/components/esp-dsp/modules/matrix/include/dspm_mult.h
deleted file mode 100644
index b43c3f0..0000000
--- a/components/esp-dsp/modules/matrix/include/dspm_mult.h
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dspm_mult_H_
-#define _dspm_mult_H_
-
-#include "dsp_err.h"
-#include "dspm_mult_platform.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**@{*/
-/**
- * @brief Matrix multiplication
- *
- * Matrix multiplication for two floating point matrices: C[m][k] = A[m][n] * B[n][k]
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[m][n]
- * @param[in] B input matrix B[n][k]
- * @param C result matrix C[m][k]
- * @param[in] m matrix dimension
- * @param[in] n matrix dimension
- * @param[in] k matrix dimension
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dspm_mult_f32_ansi(const float *A, const float *B, float *C, int m, int n, int k);
-esp_err_t dspm_mult_f32_ae32(const float *A, const float *B, float *C, int m, int n, int k);
-/**@}*/
-
-
-/**
- * @brief Matrix multiplication A[3x3]xB[3x1]
- *
- * Matrix multiplication for two floating point matrices 3x3 and 3x1: C[1][3] = A[3][3] * B[3][1]
- * The implementation is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[3][3]
- * @param[in] B input matrix/vector B[3][1]
- * @param C result matrix/vector C[3][3]
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dspm_mult_3x3x1_f32_ae32(const float *A, const float *B, float *C);
-
-/**
- * @brief Matrix multiplication A[3x3]xB[3x3]
- *
- * Matrix multiplication for two square 3x3 floating point matrices: C[3][3] = A[3][3] * B[3][3]
- * The implementation is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[3][3]
- * @param[in] B input matrix B[3][3]
- * @param C result matrix C[3][3]
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dspm_mult_3x3x3_f32_ae32(const float *A, const float *B, float *C);
-
-/**
- * @brief Matrix multiplication A[4x4]xB[4x1]
- *
- * Matrix multiplication for two floating point matrices 4x4 and 4x1: C[1][4] = A[4][4] * B[4][1]
- * The implementation is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[4][4]
- * @param[in] B input matrix/vector B[4][1]
- * @param C result matrix/vector C[4][4]
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-
-esp_err_t dspm_mult_4x4x1_f32_ae32(const float *A, const float *B, float *C);
-
-/**
- * @brief Matrix multiplication A[4x4]xB[4x4]
- *
- * Matrix multiplication for two square 3x3 floating point matrices: C[4][4] = A[4][4] * B[4][4]
- * The implementation is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[4][4]
- * @param[in] B input matrix B[4][4]
- * @param C result matrix C[4][4]
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dspm_mult_4x4x4_f32_ae32(const float *A, const float *B, float *C);
-
-/**@{*/
-/**
- * @brief Matrix multiplication 16 bit signeg int
- *
- * Matrix multiplication for two signed 16 bit fixed point matrices: C[m][k] = (A[m][n] * B[n][k]) >> (15- shift)
- * The extension (_ansi) use ANSI C and could be compiled and run on any platform.
- * The extension (_ae32) is optimized for ESP32 chip.
- *
- * @param[in] A input matrix A[m][n]
- * @param[in] B input matrix B[n][k]
- * @param C result matrix C[m][k]
- * @param[in] m matrix dimension
- * @param[in] n matrix dimension
- * @param[in] k matrix dimension
- * @param[in] shift every result will be shifted and stored as 16 bit signed value.
- * @return
- * - ESP_OK on success
- * - One of the error codes from DSP library
- */
-esp_err_t dspm_mult_s16_ansi(const int16_t *A, const int16_t *B, int16_t *C, int m, int n, int k, int shift);
-esp_err_t dspm_mult_s16_ae32(const int16_t *A, const int16_t *B, int16_t *C, int m, int n, int k, int shift);
-/**@}*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#if CONFIG_DSP_OPTIMIZED
-
-#if (dspm_mult_s16_ae32_enabled == 1)
-#define dspm_mult_s16 dspm_mult_s16_ae32
-#else
-#define dspm_mult_s16 dspm_mult_s16_ansi
-#endif
-
-#if (dspm_mult_f32_ae32_enabled == 1)
-#define dspm_mult_f32 dspm_mult_f32_ae32
-#else
-#define dspm_mult_f32 dspm_mult_f32_ansi
-#endif
-
-#if (dspm_mult_3x3x1_f32_ae32_enabled == 1)
-#define dspm_mult_3x3x1_f32 dspm_mult_3x3x1_f32_ae32
-#else
-#define dspm_mult_3x3x1_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 3, 3, 1)
-#endif
-#if (dspm_mult_3x3x3_f32_ae32_enabled == 1)
-#define dspm_mult_3x3x3_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 3, 3, 3)
-#else
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#endif
-#if (dspm_mult_4x4x1_f32_ae32_enabled == 1)
-#define dspm_mult_4x4x1_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 4, 4, 1)
-#else
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#endif
-#if (dspm_mult_4x4x4_f32_ae32_enabled == 1)
-#define dspm_mult_4x4x4_f32 dspm_mult_4x4x4_f32_ae32
-#else
-#define dspm_mult_4x4x4_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 4, 4, 4)
-#endif
-
-#else
-#define dspm_mult_s16 dspm_mult_s16_ansi
-#define dspm_mult_f32 dspm_mult_f32_ansi
-#define dspm_mult_3x3x1_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 3, 3, 1)
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#define dsps_sub_f32 dsps_sub_f32_ansi
-#define dspm_mult_4x4x4_f32(A,B,C) dspm_mult_f32_ansi(A,B,C, 4, 4, 4)
-#endif // CONFIG_DSP_OPTIMIZED
-
-
-#endif // _dspm_mult_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/include/dspm_mult_platform.h b/components/esp-dsp/modules/matrix/include/dspm_mult_platform.h
deleted file mode 100644
index c3c09c9..0000000
--- a/components/esp-dsp/modules/matrix/include/dspm_mult_platform.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _dspm_mult_platform_H_
-#define _dspm_mult_platform_H_
-
-
-
-#include
-#include
-
-
-#if ((XCHAL_HAVE_FP == 1) && (XCHAL_HAVE_LOOPS == 1))
-
-#define dspm_mult_f32_ae32_enabled 1
-#define dspm_mult_3x3x1_f32_ae32_enabled 1
-#define dspm_mult_3x3x3_f32_ae32_enabled 1
-#define dspm_mult_4x4x1_f32_ae32_enabled 1
-#define dspm_mult_4x4x4_f32_ae32_enabled 1
-
-#endif
-
-#if ((XCHAL_HAVE_LOOPS == 1) && (XCHAL_HAVE_MAC16 == 1))
-
-#define dspm_mult_s16_ae32_enabled 1
-
-#endif
-
-#endif // _dspm_mult_platform_H_
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/include/mat.h b/components/esp-dsp/modules/matrix/include/mat.h
deleted file mode 100644
index 134ea6a..0000000
--- a/components/esp-dsp/modules/matrix/include/mat.h
+++ /dev/null
@@ -1,504 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef _dspm_mat_h_
-#define _dspm_mat_h_
-#include
-
-/**
- * @brief DSP matrix namespace
- *
- * DSP library matrix namespace.
- */
-namespace dspm {
-/**
- * @brief Matrix
- *
- * The Mat class provides basic matrix operations on single-precision floating point values.
- */
-class Mat {
-public:
- /**
- * Constructor allocate internal buffer.
- * @param[in] rows: amount of matrix rows
- * @param[in] cols: amount of matrix columns
- */
- Mat(int rows, int cols);
- /**
- * Constructor use external buffer.
- * @param[in] data: external buffer with row-major matrix data
- * @param[in] rows: amount of matrix rows
- * @param[in] cols: amount of matrix columns
- */
- Mat(float *data, int rows, int cols);
- /**
- * Allocate matrix with undefined size.
- */
- Mat();
- virtual ~Mat();
- /**
- * Make copy of matrix.
- * @param[in] src: source matrix
- */
- Mat(const Mat &src);
- /**
- * Copy operator
- *
- * @param[in] src: source matrix
- *
- * @return
- * - matrix copy
- */
- Mat &operator=(const Mat &src);
-
- bool ext_buff; /*!< Flag indicates that matrix use external buffer*/
-
- /**
- * Access to the matrix elements.
- * @param[in] row: row position
- * @param[in] col: column position
- *
- * @return
- * - element of matrix M[row][col]
- */
- inline float &operator()(int row, int col)
- {
- return data[row * this->cols + col];
- }
- /**
- * Access to the matrix elements.
- * @param[in] row: row position
- * @param[in] col: column position
- *
- * @return
- * - element of matrix M[row][col]
- */
- inline const float &operator()(int row, int col) const
- {
- return data[row * this->cols + col];
- }
-
- /**
- * += operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: source matrix
- *
- * @return
- * - result matrix: result += A
- */
- Mat &operator+=(const Mat &A);
-
- /**
- * += operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] C: constant
- *
- * @return
- * - result matrix: result += C
- */
- Mat &operator+=(float C);
- /**
- * -= operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: source matrix
- *
- * @return
- * - result matrix: result -= A
- */
- Mat &operator-=(const Mat &A);
-
- /**
- * -= operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] C: constant
- *
- * @return
- * - result matrix: result -= C
- */
- Mat &operator-=(float C);
-
- /**
- * *= operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: source matrix
- *
- * @return
- * - result matrix: result -= A
- */
- Mat &operator*=(const Mat &A);
- /**
- * += with constant operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] C: constant value
- *
- * @return
- * - result matrix: result *= C
- */
- Mat &operator*=(float C);
- /**
- * /= with constant operator
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] C: constant value
- *
- * @return
- * - result matrix: result /= C
- */
- Mat &operator/=(float C);
- /**
- * /= operator
- *
- * @param[in] B: source matrix
- *
- * @return
- * - result matrix: result[i,j] = result[i,j]/B[i,j]
- */
- Mat &operator/=(const Mat &B);
- /**
- * ^= xor with constant operator
- * The operator use DSP optimized implementation of multiplication.
- * @param[in] C: constant value
- *
- * @return
- * - result matrix: result ^= C
- */
- Mat operator^(int C);
-
- /**
- * Swap two rows between each other.
- * @param[in] row1: position of first row
- * @param[in] row2: position of second row
- */
- void swapRows(int row1, int row2);
- /**
- * Matrix transpose.
- * Change rows and columns between each other.
- *
- * @return
- * - transposed matrix
- */
- Mat t();
-
- /**
- * Create identity matrix.
- * Create a square matrix and fill diagonal with 1.
- *
- * @param[in] size: matrix size
- *
- * @return
- * - matrix [N]x[N] with 1 in diagonal
- */
- static Mat eye(int size);
-
- /**
- * Create matrix with all elements 1.
- * Create a square matrix and fill all elements with 1.
- *
- * @param[in] size: matrix size
- *
- * @return
- * - matrix [N]x[N] with 1 in all elements
- */
- static Mat ones(int size);
-
- /**
- * Return part of matrix from defined position (startRow, startCol) as a matrix[blockRows x blockCols].
- *
- * @param[in] startRow: start row position
- * @param[in] startCol: start column position
- * @param[in] blockRows: amount of rows in result matrix
- * @param[in] blockCols: amount of columns in the result matrix
- *
- * @return
- * - matrix [blockRows]x[blockCols]
- */
- Mat block(int startRow, int startCol, int blockRows, int blockCols);
-
- /**
- * Normalizes the vector, i.e. divides it by its own norm.
- * If it's matrix, calculate matrix norm
- *
- */
- void normalize(void);
-
- /**
- * Return norm of the vector.
- * If it's matrix, calculate matrix norm
- *
- * @return
- * - matrix norm
- */
- float norm(void);
-
- /**
- * The method fill 0 to the matrix structure.
- *
- */
- void clear(void);
-
- /**
- * @brief Solve the matrix
- *
- * Solve matrix. Find roots for the matrix A*x = b
- *
- * @param[in] A: matrix [N]x[N] with input coefficients
- * @param[in] b: vector [N]x[1] with result values
- *
- * @return
- * - matrix [N]x[1] with roots
- */
- static Mat solve(Mat A, Mat b);
- /**
- * @brief Band solve the matrix
- *
- * Solve band matrix. Find roots for the matrix A*x = b with bandwidth k.
- *
- * @param[in] A: matrix [N]x[N] with input coefficients
- * @param[in] b: vector [N]x[1] with result values
- * @param[in] k: upper bandwidth value
- *
- * @return
- * - matrix [N]x[1] with roots
- */
- static Mat bandSolve(Mat A, Mat b, int k);
- /**
- * @brief Solve the matrix
- *
- * Different way to solve the matrix. Find roots for the matrix A*x = y
- *
- * @param[in] A: matrix [N]x[N] with input coefficients
- * @param[in] y: vector [N]x[1] with result values
- *
- * @return
- * - matrix [N]x[1] with roots
- */
- static Mat roots(Mat A, Mat y);
-
- /**
- * @brief Dotproduct of two vectors
- *
- * The method returns dotproduct of two vectors
- *
- * @param[in] A: Input vector A Nx1
- * @param[in] B: Input vector B Nx1
- *
- * @return
- * - dotproduct value
- */
- static float dotProduct(Mat A, Mat B);
-
- /**
- * @brief Augmented matrices
- *
- * Augmented matrices
- *
- * @param[in] A: Input vector A MxN
- * @param[in] B: Input vector B MxK
- *
- * @return
- * - Augmented matrix Mx(N+K)
- */
- static Mat augment(Mat A, Mat B);
- /**
- * @brief Gaussian Elimination
- *
- * Gaussian Elimination of matrix
- *
- * @return
- * - result matrix
- */
- Mat gaussianEliminate();
-
- /**
- * Row reduction for Gaussian elimination
- *
- * @return
- * - result matrix
- */
- Mat rowReduceFromGaussian();
-
- /**
- * Find the inverse matrix
- *
- * @return
- * - inverse matrix
- */
- Mat inverse();
-
- /**
- * Find pseudo inverse matrix
- *
- * @return
- * - inverse matrix
- */
- Mat pinv();
-
- int rows; /*!< Amount of rows*/
- int cols; /*!< Amount of columns*/
- float *data; /*!< Buffer with matrix data*/
- int length; /*!< Total amount of data in data array*/
-
- static float abs_tol; /*!< Max acceptable absolute tolerance*/
-private:
- Mat cofactor(int row, int col, int n);
- float det(int n);
- Mat adjoint();
-
- void allocate(); // Allocate buffer
- Mat expHelper(const Mat &m, int num);
-};
-/**
- * Print matrix to the standard iostream.
- * @param[in] os: output stream
- * @param[in] m: matrix to print
- *
- * @return
- * - output stream
- */
-std::ostream &operator<<(std::ostream &os, const Mat &m);
-/**
- * Fill the matrix from iostream.
- * @param[in] is: input stream
- * @param[in] m: matrix to fill
- *
- * @return
- * - input stream
- */
-std::istream &operator>>(std::istream &is, Mat &m);
-
-/**
- * + operator, sum of two matrices
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] B: Input matrix B
- *
- * @return
- * - result matrix A+B
-*/
-Mat operator+(const Mat &A, const Mat &B);
-/**
- * + operator, sum of matrix with constant
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] C: Input constant
- *
- * @return
- * - result matrix A+C
-*/
-Mat operator+(const Mat &A, float C);
-
-/**
- * - operator, subtraction of two matrices
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] B: Input matrix B
- *
- * @return
- * - result matrix A-B
-*/
-Mat operator-(const Mat &A, const Mat &B);
-/**
- * - operator, sum of matrix with constant
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] C: Input constant
- *
- * @return
- * - result matrix A+C
-*/
-Mat operator-(const Mat &A, float C);
-
-/**
- * * operator, multiplication of two matrices.
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] B: Input matrix B
- *
- * @return
- * - result matrix A*B
-*/
-Mat operator*(const Mat &A, const Mat &B);
-
-/**
- * * operator, multiplication of matrix with constant
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] C: floating point value
- *
- * @return
- * - result matrix A*B
-*/
-Mat operator*(const Mat &A, float C);
-
-/**
- * * operator, multiplication of matrix with constant
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] C: floating point value
- * @param[in] A: Input matrix A
- *
- * @return
- * - result matrix A*B
-*/
-Mat operator*(float C, const Mat &A);
-
-/**
- * / operator, divide of matrix by constant
- * The operator use DSP optimized implementation of multiplication.
- *
- * @param[in] A: Input matrix A
- * @param[in] C: floating point value
- *
- * @return
- * - result matrix A*B
-*/
-Mat operator/(const Mat &A, float C);
-
-/**
- * / operator, divide matrix A by matrix B
- *
- * @param[in] A: Input matrix A
- * @param[in] B: Input matrix B
- *
- * @return
- * - result matrix C, where C[i,j] = A[i,j]/B[i,j]
-*/
-Mat operator/(const Mat &A, const Mat &B);
-
-/**
- * == operator, compare two matrices
- *
- * @param[in] A: Input matrix A
- * @param[in] B: Input matrix B
- *
- * @return
- * - true if matrices are the same
- * - false if matrices are different
-*/
-bool operator==(const Mat &A, const Mat &B);
-
-}
-#endif //_dspm_mat_h_
diff --git a/components/esp-dsp/modules/matrix/mat/mat.cpp b/components/esp-dsp/modules/matrix/mat/mat.cpp
deleted file mode 100644
index 60ef17a..0000000
--- a/components/esp-dsp/modules/matrix/mat/mat.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include
-#include
-#include "mat.h"
-#include "esp_log.h"
-
-#include "dsps_math.h"
-#include "dspm_mult.h"
-#include
-
-
-using std::ostream;
-using std::istream;
-using std::endl;
-
-namespace dspm {
-
-float Mat::abs_tol = 1e-10;
-
-Mat::Mat(int rows, int cols)
-{
- ESP_LOGD("Mat", "Mat(%i, %i)", rows, cols);
- this->rows = rows;
- this->cols = cols;
- allocate();
- memset(this->data, 0, this->length * sizeof(float));
-}
-
-Mat::Mat(float *data, int rows, int cols)
-{
- ESP_LOGD("Mat", "Mat(data, %i, %i)", rows, cols);
- this->ext_buff = true;
- this->rows = rows;
- this->cols = cols;
- this->data = data;
- this->length = this->rows * this->cols;
- memcpy(this->data, data, this->length * sizeof(float));
-}
-
-
-Mat::Mat()
-{
- this->rows = 1;
- this->cols = 1;
- ESP_LOGD("Mat", "Mat()");
-
- allocate();
- this->data[0] = 0;
-}
-
-Mat::~Mat()
-{
- ESP_LOGD("Mat", "~Mat(%i, %i), ext_buff=%i, data=0x%8.8x", this->rows, this->cols, this->ext_buff, (uint32_t)this->data);
- if (false == this->ext_buff) {
- delete data;
- }
-}
-
-Mat::Mat(const Mat &m)
-{
- this->rows = m.rows;
- this->cols = m.cols;
-
- allocate();
- memcpy(this->data, m.data, this->length * sizeof(float));
-}
-
-Mat &Mat::operator=(const Mat &m)
-{
- if (this == &m) {
- return *this;
- }
-
- if (this->rows != m.rows || this->cols != m.cols) {
- if (!this->ext_buff) {
- delete this->data;
- }
- this->ext_buff = false;
- this->rows = m.rows;
- this->cols = m.cols;
- allocate();
- }
- memcpy(this->data, m.data, this->length * sizeof(float));
- return *this;
-}
-
-Mat &Mat::operator+=(const Mat &m)
-{
- dsps_add_f32(this->data, m.data, this->data, this->length, 1, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator+=(float C)
-{
- dsps_addc_f32_ansi(this->data, this->data, this->length, C, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator-=(const Mat &m)
-{
- dsps_sub_f32(this->data, m.data, this->data, this->length, 1, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator-=(float C)
-{
- dsps_addc_f32_ansi(this->data, this->data, this->length, -C, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator*=(const Mat &m)
-{
- Mat temp = *this;
- dspm_mult_f32(temp.data, m.data, this->data, temp.rows, temp.cols, m.cols);
- return (*this);
-}
-
-Mat &Mat::operator*=(float num)
-{
- dsps_mulc_f32_ansi(this->data, this->data, this->length, num, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator/=(float num)
-{
- dsps_mulc_f32_ansi(this->data, this->data, this->length, 1 / num, 1, 1);
- return *this;
-}
-
-Mat &Mat::operator/=(const Mat &B)
-{
- Mat temp = *this;
- *this = temp / B;
- return (*this);
-}
-
-Mat Mat::operator^(int num)
-{
- Mat temp(*this);
- return expHelper(temp, num);
-}
-
-void Mat::swapRows(int r1, int r2)
-{
- for (int i = 0; i < this->cols; i++) {
- float temp = this->data[r1 * this->cols + i];
- this->data[r1 * this->cols + i] = this->data[r2 * this->cols + i];
- this->data[r2 * this->cols + i] = temp;
- }
-}
-
-Mat Mat::t()
-{
- Mat ret(this->cols, this->rows);
- for (int i = 0; i < this->rows; ++i) {
- for (int j = 0; j < this->cols; ++j) {
- ret(j, i) = this->data[i * this->cols + j];
- }
- }
- return ret;
-}
-
-Mat Mat::eye(int size)
-{
- Mat temp(size, size);
- for (int i = 0; i < temp.rows; ++i) {
- for (int j = 0; j < temp.cols; ++j) {
- if (i == j) {
- temp(i, j) = 1;
- } else {
- temp(i, j) = 0;
- }
- }
- }
- return temp;
-}
-
-Mat Mat::ones(int size)
-{
- Mat temp(size, size);
- for (int i = 0; i < temp.rows; ++i) {
- for (int j = 0; j < temp.cols; ++j) {
- temp(i, j) = 1;
- }
- }
- return temp;
-}
-
-void Mat::clear()
-{
- memset(this->data, 0, this->length * sizeof(float));
-}
-
-Mat Mat::block(int startRow, int startCol, int blockRows, int blockCols)
-{
- Mat result(blockRows, blockCols);
- for (int i = 0; i < blockRows; ++i) {
- for (int j = 0; j < blockCols; ++j) {
- result(i, j) = (*this)(startRow + i, startCol + j);
- }
- }
- return result;
-}
-
-void Mat::normalize(void)
-{
- float sqr_norm = 0;
- for (int i = 0; i < this->rows; ++i) {
- for (int j = 0; j < this->cols; ++j) {
- sqr_norm += (*this)(i, j) * (*this)(i, j);
- }
- }
- sqr_norm = 1 / sqrtf(sqr_norm);
- *this *= sqr_norm;
-}
-
-float Mat::norm(void)
-{
- float sqr_norm = 0;
- for (int i = 0; i < this->rows; ++i) {
- for (int j = 0; j < this->cols; ++j) {
- sqr_norm += (*this)(i, j) * (*this)(i, j);
- }
- }
- sqr_norm = sqrtf(sqr_norm);
- return sqr_norm;
-}
-
-Mat Mat::solve(Mat A, Mat b)
-{
- // Gaussian elimination
- for (int i = 0; i < A.rows; ++i) {
- if (A(i, i) == 0) {
- // pivot 0 - error
- ESP_LOGW("Mat", "Error: the coefficient matrix has 0 as a pivot. Please fix the input and try again.");
- Mat err_result(0, 0);
- return err_result;
- }
- float a_ii = 1 / A(i, i);
- for (int j = i + 1; j < A.rows; ++j) {
- float a_ji = A(j, i) * a_ii;
- for (int k = i + 1; k < A.cols; ++k) {
- A(j, k) -= A(i, k) * a_ji;
- if ((A(j, k) < abs_tol) && (A(j, k) > -1 * abs_tol)) {
- A(j, k) = 0;
- }
- }
- b(j, 0) -= b(i, 0) * a_ji;
- if (A(j, 0) < abs_tol && A(j, 0) > -1 * abs_tol) {
- A(j, 0) = 0;
- }
- A(j, i) = 0;
- }
- }
-
- // Back substitution
- Mat x(b.rows, 1);
- x((x.rows - 1), 0) = b((x.rows - 1), 0) / A((x.rows - 1), (x.rows - 1));
- if (x((x.rows - 1), 0) < abs_tol && x((x.rows - 1), 0) > -1 * abs_tol) {
- x((x.rows - 1), 0) = 0;
- }
- for (int i = x.rows - 2; i >= 0; --i) {
- float sum = 0;
- for (int j = i + 1; j < x.rows; ++j) {
- sum += A(i, j) * x(j, 0);
- }
- x(i, 0) = (b(i, 0) - sum) / A(i, i);
- if (x(i, 0) < abs_tol && x(i, 0) > -1 * abs_tol) {
- x(i, 0) = 0;
- }
- }
- return x;
-}
-
-Mat Mat::bandSolve(Mat A, Mat b, int k)
-{
- // optimized Gaussian elimination
- int bandsBelow = (k - 1) / 2;
- for (int i = 0; i < A.rows; ++i) {
- if (A(i, i) == 0) {
- // pivot 0 - error
- ESP_LOGW("Mat", "Error: the coefficient matrix has 0 as a pivot. Please fix the input and try again.");
- Mat err_result(b.rows, 1);
- memset(err_result.data, 0, b.rows * sizeof(float));
- return err_result;
- }
- float a_ii = 1 / A(i, i);
- for (int j = i + 1; j < A.rows && j <= i + bandsBelow; ++j) {
- int k = i + 1;
- while ((k < A.cols) && (fabs(A(j, k)) > abs_tol)) {
- A(j, k) -= A(i, k) * (A(j, i) * a_ii);
- k++;
- }
- b(j, 0) -= b(i, 0) * (A(j, i) * a_ii);
- A(j, i) = 0;
- }
- }
-
- // Back substitution
- Mat x(b.rows, 1);
- x((x.rows - 1), 0) = b((x.rows - 1), 0) / A((x.rows - 1), (x.rows - 1));
- for (int i = x.rows - 2; i >= 0; --i) {
- float sum = 0;
- for (int j = i + 1; j < x.rows; ++j) {
- sum += A(i, j) * x(j, 0);
- }
- x(i, 0) = (b(i, 0) - sum) / A(i, i);
- }
-
- return x;
-}
-
-Mat Mat::roots(Mat A, Mat y)
-{
- int n = A.cols + 1;
-
- Mat result(y.rows, 1);
-
- Mat g_m = Mat::augment(A, y);
- for (int j = 0; j < A.cols; j++) {
- float g_jj = 1 / g_m(j, j);
- for (int i = 0; i < A.cols; i++) {
- if (i != j) {
- float c = g_m(i, j) * g_jj;
- for (int k = 0; k < n; k++) {
- g_m(i, k) = g_m(i, k) - c * g_m(j, k);
- }
- }
- }
- }
- for (int i = 0; i < A.rows; i++) {
- result(i, 0) = g_m(i, A.cols) / g_m(i, i);
- }
- return result;
-}
-
-float Mat::dotProduct(Mat a, Mat b)
-{
- float sum = 0;
- for (int i = 0; i < a.rows; ++i) {
- sum += (a(i, 0) * b(i, 0));
- }
- return sum;
-}
-
-Mat Mat::augment(Mat A, Mat B)
-{
- Mat AB(A.rows, A.cols + B.cols);
- for (int i = 0; i < AB.rows; ++i) {
- for (int j = 0; j < AB.cols; ++j) {
- if (j < A.cols) {
- AB(i, j) = A(i, j);
- } else {
- AB(i, j) = B(i, j - A.cols);
- }
- }
- }
- return AB;
-}
-
-Mat Mat::gaussianEliminate()
-{
- Mat Ab(*this);
- int rows = Ab.rows;
- int cols = Ab.cols;
- int Acols = cols - 1;
-
- int i = 0; // row tracker
- int j = 0; // column tracker
-
- // iterate through the rows
- while (i < rows) {
- // find a pivot for the row
- bool pivot_found = false;
- while (j < Acols && !pivot_found) {
- if (Ab(i, j) != 0) { // pivot not equal to 0
- pivot_found = true;
- } else { // check for a possible swap
- int max_row = i;
- float max_val = 0;
- for (int k = i + 1; k < rows; ++k) {
- float cur_abs = Ab(k, j) >= 0 ? Ab(k, j) : -1 * Ab(k, j);
- if (cur_abs > max_val) {
- max_row = k;
- max_val = cur_abs;
- }
- }
- if (max_row != i) {
- Ab.swapRows(max_row, i);
- pivot_found = true;
- } else {
- j++;
- }
- }
- }
-
- // perform elimination as normal if pivot was found
- if (pivot_found) {
- for (int t = i + 1; t < rows; ++t) {
- for (int s = j + 1; s < cols; ++s) {
- Ab(t, s) = Ab(t, s) - Ab(i, s) * (Ab(t, j) / Ab(i, j));
- if (Ab(t, s) < abs_tol && Ab(t, s) > -1 * abs_tol) {
- Ab(t, s) = 0;
- }
- }
- Ab(t, j) = 0;
- }
- }
-
- i++;
- j++;
- }
-
- return Ab;
-}
-
-Mat Mat::rowReduceFromGaussian()
-{
- Mat R(*this);
- int rows = R.rows;
- int cols = R.cols;
-
- int i = rows - 1; // row tracker
- int j = cols - 2; // column tracker
-
- // iterate through every row
- while (i >= 0) {
- // find the pivot column
- int k = j - 1;
- while (k >= 0) {
- if (R(i, k) != 0) {
- j = k;
- }
- k--;
- }
-
- // zero out elements above pivots if pivot not 0
- if (R(i, j) != 0) {
- for (int t = i - 1; t >= 0; --t) {
- for (int s = 0; s < cols; ++s) {
- if (s != j) {
- R(t, s) = R(t, s) - R(i, s) * (R(t, j) / R(i, j));
- if (R(t, s) < abs_tol && R(t, s) > -1 * abs_tol) {
- R(t, s) = 0;
- }
- }
- }
- R(t, j) = 0;
- }
-
- // divide row by pivot
- for (int k = j + 1; k < cols; ++k) {
- R(i, k) = R(i, k) / R(i, j);
- if (R(i, k) < abs_tol && R(i, k) > -1 * abs_tol) {
- R(i, k) = 0;
- }
- }
- R(i, j) = 1;
- }
-
- i--;
- j--;
- }
-
- return R;
-}
-
-Mat Mat::pinv()
-{
- Mat I = Mat::eye(this->rows);
- Mat AI = Mat::augment(*this, I);
- Mat U = AI.gaussianEliminate();
- Mat IAInverse = U.rowReduceFromGaussian();
- Mat AInverse(this->rows, this->cols);
- for (int i = 0; i < this->rows; ++i) {
- for (int j = 0; j < this->cols; ++j) {
- AInverse(i, j) = IAInverse(i, j + this->cols);
- }
- }
- return AInverse;
-}
-
-Mat Mat::cofactor(int row, int col, int n)
-{
- int i = 0, j = 0;
- Mat result(n, n);
- // Looping for each element of the matrix
- for (int r = 0; r < n; r++) {
- for (int c = 0; c < n; c++) {
- // Copying into temporary matrix only those element
- // which are not in given row and column
- if (r != row && c != col) {
- result(i, j++) = (*this)(r, c);
-
- // Row is filled, so increase row index and
- // reset col index
- if (j == this->rows - 1) {
- j = 0;
- i++;
- }
- }
- }
- }
- return result;
-}
-
-float Mat::det(int n)
-{
- float D = 0; // Initialize result
-
- // Base case : if matrix contains single element
- if (n == 1) {
- return (*this)(0, 0);
- }
-
- Mat temp(this->rows, this->rows); // To store cofactors
-
- int sign = 1; // To store sign multiplier
-
- // Iterate for each element of first row
- for (int f = 0; f < n; f++) {
- // Getting Cofactor of A[0][f]
- Mat temp = this->cofactor(0, f, n);
- D += (*this)(0, f) * temp.det(n - 1) * sign;
-
- // terms are to be added with alternate sign
- sign = -sign;
- }
-
- return D;
-}
-
-Mat Mat::adjoint()
-{
- Mat adj(this->rows, this->cols);
- if (this->rows == 1) {
- adj(0, 0) = 1;
- return adj;
- }
-
- // temp is used to store cofactors of A(,)
- int sign = 1;
- Mat temp(this->rows, this->cols);
-
- for (int i = 0; i < this->rows; i++) {
- for (int j = 0; j < this->cols; j++) {
- // Get cofactor of A(i,j)
- temp = this->cofactor( i, j, this->rows);
-
- // sign of adj(j,i) positive if sum of row
- // and column indexes is even.
- sign = ((i + j) % 2 == 0) ? 1 : -1;
-
- // Interchanging rows and columns to get the
- // transpose of the cofactor matrix
- adj(j, i) = (sign) * (temp.det(this->rows - 1));
- }
- }
- return adj;
-}
-
-Mat Mat::inverse()
-{
- Mat result(this->rows, this->cols);
- // Find determinant of matrix
- float det = this->det(this->rows);
- if (det == 0) {
- //std::cout << "Singular matrix, can't find its inverse";
- return result;
- }
-
- // Find adjoint
- Mat adj = this->adjoint();
-
- // Find Inverse using formula "inverse(A) = adj(A)/det(A)"
- for (int i = 0; i < this->rows; i++)
- for (int j = 0; j < this->cols; j++) {
- result(i, j) = adj(i, j) / float(det);
- }
-
- return result;
-}
-
-void Mat::allocate()
-{
- this->ext_buff = false;
- this->length = this->rows * this->cols;
- data = new float[this->length];
- ESP_LOGD("Mat", "allocate(%i) = 0x%8.8x", this->length, (uint32_t)this->data);
-}
-
-Mat Mat::expHelper(const Mat &m, int num)
-{
- if (num == 0) {
- return Mat::eye(m.rows);
- } else if (num == 1) {
- return m;
- } else if (num % 2 == 0) { // num is even
- return expHelper(m * m, num / 2);
- } else { // num is odd
- return m * expHelper(m * m, (num - 1) / 2);
- }
-}
-
-Mat operator+(const Mat &m1, const Mat &m2)
-{
- Mat temp(m1);
- return (temp += m2);
-}
-
-Mat operator+(const Mat &m1, float C)
-{
- Mat temp(m1);
- return (temp += C);
-}
-
-bool operator==(const Mat &m1, const Mat &m2)
-{
- if ((m1.cols != m2.cols) || (m1.rows != m2.rows)) {
- return false;
- }
- for (int i = 0 ; i < (m1.cols * m1.rows) ; i++) {
- if (m1.data[i] != m2.data[i]) {
- printf("Error: %i, m1.data=%f, m2.data=%f \n", i, m1.data[i], m2.data[i]);
- return false;
- }
- }
- return true;
-}
-
-Mat operator-(const Mat &m1, const Mat &m2)
-{
- Mat temp(m1);
- return (temp -= m2);
-}
-
-Mat operator-(const Mat &m1, float C)
-{
- Mat temp(m1);
- return (temp -= C);
-}
-
-Mat operator*(const Mat &m1, const Mat &m2)
-{
- Mat temp(m1.rows, m2.cols);
- dspm_mult_f32(m1.data, m2.data, temp.data, m1.rows, m1.cols, m2.cols);
- return temp;
-}
-
-Mat operator*(const Mat &m, float num)
-{
- Mat temp(m);
- return (temp *= num);
-}
-
-Mat operator*(float num, const Mat &m)
-{
- return (m * num);
-}
-
-Mat operator/(const Mat &m, float num)
-{
- Mat temp(m);
- return (temp /= num);
-}
-
-Mat operator/(const Mat &A, const Mat &B)
-{
- Mat temp(A);
- for (int i = 0; i < A.rows; ++i) {
- for (int j = 1; j < A.cols; ++j) {
- temp(i, j) = A(i, j) / B(i, j);
- }
- }
- return (temp);
-}
-
-ostream &operator<<(ostream &os, const Mat &m)
-{
- for (int i = 0; i < m.rows; ++i) {
- os << m(i, 0);
- for (int j = 1; j < m.cols; ++j) {
- os << " " << m(i, j);
- }
- os << endl;
- }
- return os;
-}
-
-istream &operator>>(istream &is, Mat &m)
-{
- for (int i = 0; i < m.rows; ++i) {
- for (int j = 0; j < m.cols; ++j) {
- is >> m(i, j);
- }
- }
- return is;
-}
-
-}
\ No newline at end of file
diff --git a/components/esp-dsp/modules/matrix/test/test_mat_f32.cpp b/components/esp-dsp/modules/matrix/test/test_mat_f32.cpp
deleted file mode 100644
index 3b755fd..0000000
--- a/components/esp-dsp/modules/matrix/test/test_mat_f32.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include