Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: adc/wifi: esp32s2/esp32c3: adc2_init_code_calibration() call prep #346

Open
wants to merge 1 commit into
base: zephyr
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ esp_err_t adc2_wifi_release(void);
* @note This is a private function, Don't call `adc2_cal_include` in user code.
*/
void adc2_cal_include(void);

/**
* @brief Set initial code to ADC2 after calibration. ADC2 RTC and ADC2 PWDET controller share the initial code.
* This API be called in before `app_main()`.
*/
void adc2_init_code_calibration(void);
#else
/**
* @brief There's no calibration involved on this chip.
Expand Down
2 changes: 1 addition & 1 deletion components/esp_hw_support/port/esp32c3/adc2_init_cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern int rtc_spinlock;
* @brief Set initial code to ADC2 after calibration. ADC2 RTC and ADC2 PWDET controller share the initial code.
* This API be called in before `app_main()`.
*/
static void adc2_init_code_calibration(void)
void adc2_init_code_calibration(void)
{
adc_hal_calibration_init(ADC_UNIT_2);
adc_calc_hw_calibration_code(ADC_UNIT_2, ADC_ATTEN_DB_11);
Expand Down
2 changes: 1 addition & 1 deletion components/esp_hw_support/port/esp32s2/adc2_init_cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern int rtc_spinlock;
* @brief Set initial code to ADC2 after calibration. ADC2 RTC and ADC2 PWDET controller share the initial code.
* This API be called in before `app_main()`.
*/
static void adc2_init_code_calibration(void)
void adc2_init_code_calibration(void)
{
adc_hal_calibration_init(ADC_UNIT_2);
adc_calc_hw_calibration_code(ADC_UNIT_2, ADC_ATTEN_DB_11);
Expand Down
8 changes: 8 additions & 0 deletions zephyr/esp32c3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ if(CONFIG_SOC_SERIES_ESP32C3)
../../components/hal/adc_hal_common.c
../../components/driver/deprecated/adc_legacy.c
../../components/esp_hw_support/adc_share_hw_ctrl.c
../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/adc2_init_cal.c
../../components/hal/rtc_io_hal.c
../../components/driver/gpio/rtc_io.c
src/esp_adc_cal/esp_adc_cal.c
Expand Down Expand Up @@ -382,6 +383,13 @@ if(CONFIG_SOC_SERIES_ESP32C3)
## WIFI definitions
if (CONFIG_WIFI_ESP32)

zephyr_sources(
../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_rtc_calib.c
../../components/hal/adc_hal_common.c
../../components/esp_hw_support/adc_share_hw_ctrl.c
../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/adc2_init_cal.c
)

set(WPA_SUPPLICANT_COMPONENT_DIR "../../components/wpa_supplicant")
#TODO: Additional WPA supplicant feature like Enterprise mode etc. are yet to be supported.
set(WPA_SUPPLICANT_SRCS "../port/wifi/wpa_supplicant/os_xtensa.c"
Expand Down
8 changes: 8 additions & 0 deletions zephyr/esp32s2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ if(CONFIG_SOC_SERIES_ESP32S2)
../../components/hal/adc_hal_common.c
../../components/driver/deprecated/adc_legacy.c
../../components/esp_hw_support/adc_share_hw_ctrl.c
../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/adc2_init_cal.c
../../components/hal/rtc_io_hal.c
../../components/driver/gpio/rtc_io.c
src/esp_adc_cal/esp_adc_cal.c
Expand Down Expand Up @@ -349,6 +350,13 @@ if(CONFIG_SOC_SERIES_ESP32S2)
## WIFI definitions
if (CONFIG_WIFI_ESP32)

zephyr_sources(
../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_rtc_table.c
../../components/hal/adc_hal_common.c
../../components/esp_hw_support/adc_share_hw_ctrl.c
../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/adc2_init_cal.c
)

zephyr_sources(
src/wifi/esp_wifi_adapter.c
../../components/esp_phy/src/phy_init.c
Expand Down