Commit Graph

45 Commits

Author SHA1 Message Date
Armando 1822062bb7 fix(adc): fixed adc_cali_check_scheme wrong return on c2/h2/c6 2024-12-17 16:20:24 +08:00
gaoxu 38d0be39a8 fix(adc): fix adc continuous get less results beacuse do not reset apb clk 2023-12-04 14:29:57 +08:00
Armando f8500f77b1 fix(adc): rename ADC_ATTEN_DB_11 to ADC_ATTEN_DB_12
By design, it's 12 dB. There're errors among chips, so the actual
attenuation will be 11dB more or less
2023-11-07 14:12:50 +08:00
Jiang Jiang Jian 45e1b89efe Merge branch 'feature/default_clock_source_can_leave_empty_v5.0' into 'release/v5.0'
feat(mcpwm): default clock source setting can leave empty (v5.0)

See merge request espressif/esp-idf!25549
2023-08-26 10:15:28 +08:00
Armando d90cb866f1 test(adc): continuous driver iram test with gdma iram safe option only 2023-08-25 10:56:20 +08:00
morris 676553f432 fix(adc): invalid assertion on the adc_unit 2023-08-25 10:21:46 +08:00
Armando d2fb10008e fix(adc): fix adc continuous hal func not in iram when gdma isr iram 2023-08-24 10:50:33 +08:00
Armando bf5e10dd23 fix(adc): fix s_adc_tsen_enabled not set issue 2023-07-06 16:48:59 +08:00
laokaiyao bd70b44144 adc_oneshot: move power acquire back to adc_oneshot_new_unit
Revert and fix of d197c59eaa in !23575
2023-07-06 16:46:24 +08:00
Armando 9bec4233a4 adc: port gh pr to current adc continuous mode driver
DMA EOF may happens per multiple dma descriptors, instead of only one.

Closes https://github.com/espressif/esp-idf/pull/11500
2023-06-13 10:28:46 +08:00
Niklas Gürtler 82c055bac9 Fix #10804 by running continuous ADC DMA in endless loop instead of restarting after each run (descriptor chain) to avoid losing samples. Use descriptor error callback for GDMA to check for DMA buffer overrun.
Signed-off-by: Armando <douyiwen@espressif.com>
2023-06-13 10:28:46 +08:00
Armando ac3f74ecb6 adc: fix adc continuous driver conv_frame_size not bigger than 4092 issue
Closes https://github.com/espressif/esp-idf/issues/11385
2023-06-13 10:28:46 +08:00
morris 4a05274dc4 adc: fixed the issue that multiply overflow before type expand 2023-06-07 11:42:29 +08:00
Armando 85980884d7 adc: improve adc power logic 2023-04-20 10:34:37 +08:00
morris c24222dcde gptimer: fix race condition between start and stop
Added state transition in gptimer_start/stop functions.
So that it's not possible to make a stopped timer continue to run
because of race condition.
2023-03-11 11:42:09 +08:00
Omar Chebib 83907aaa20 TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-03-07 10:23:43 +08:00
Chen Yudong c8e7ab7f17 CI: add generic to xtal_40mhz jobs 2023-03-01 22:40:32 +08:00
Armando aa3cc6ac17 esp_adc: fix continuous mode pm lock release fail issue and add tests
Closes https://github.com/espressif/esp-idf/issues/10853
2023-03-01 10:51:19 +08:00
Armando d101d9c100 esp_adc: update license 2023-02-20 10:34:34 +08:00
Armando 0f49c8677b include inttypes.h 2023-02-20 10:34:34 +08:00
Armando 45776dc0cc esp_adc: add esp32c2 adc high/low test threshold and expected val 2023-02-20 10:34:34 +08:00
Armando ed98062c66 esp_adc: refacotr tests for all supported attenuations 2023-02-20 10:34:34 +08:00
Armando a03ca90d4a esp_adc: replace hardcoded calibration version to a macro
On esp32c3 and esp32s3, we support calibration version 1. This commit
replace it with ESP_EFUSE_ADC_CALIB_VER to avoid hardcode.
2023-02-20 10:34:34 +08:00
Armando fe0643ca40 esp_adc: support adc calibration on esp32c2 2023-02-20 10:34:34 +08:00
Armando bb074904b4 adc: no longer support adc2 oneshot mode on esp32c3
Due to HW limitation, we don't support this anymore. On c3, ADC2 under oneshot mode is not stable.

However, you can enable CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 to force use
ADC2.

Refer to errata to know more details:
https://www.espressif.com/sites/default/files/documentation/esp32-s3_errata_en.pdf
https://www.espressif.com/sites/default/files/documentation/esp32-c3_errata_en.pdf
2022-12-16 12:07:38 +08:00
Armando 1c373cf293 adc: no longer support adc2 continuous mode on esp32c3 and esp32s3
Due to HW limitation, we don't support this anymore. On s3 and c3, ADC2 under continuous  mode is not stable.

However, you can enable CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 to force use
ADC2.

Refer to errata to know more details:
https://www.espressif.com/sites/default/files/documentation/esp32-s3_errata_en.pdf
https://www.espressif.com/sites/default/files/documentation/esp32-c3_errata_en.pdf
2022-12-16 12:07:38 +08:00
morris 62cbfaee2d Merge branch 'test/improve_adc_continuous_iram_test_aim_v5.0' into 'release/v5.0'
esp_adc: improve adc continuous iram test aim (v5.0)

See merge request espressif/esp-idf!20549
2022-12-02 22:47:00 +08:00
Armando 46d3627e66 esp_adc: added esp32c2 adc runners 2022-10-21 11:20:41 +08:00
Armando 35b0be3eca esp_adc: improve adc continuous iram test aim
This commit increases adc continuous iram test period of cache disabling
time. Now time is: 1 second

- The aim of this test is to make sure the continuous mode driver ISR
callbacks can run in an IRAM-Safe context.
- Closing cache takes time. WHereas the code to close the cache is
updated. This time gets changed.
2022-10-12 11:32:04 +08:00
Armando 4f8bd12479 esp_adc: added comments to c3 test thresh, also sync to legacy tests 2022-09-27 12:19:36 +08:00
Armando 3ae1c587c0 ci: use adc dedicated test runners for adc tests 2022-09-27 12:19:25 +08:00
jingli e6566deae4 ci: fix ci error(insufficient internal ram link error) 2022-09-21 16:23:10 +08:00
Armando 78a38c8940 esp_adc: remove wno flag 2022-09-05 15:46:54 +08:00
Armando 0b58bbd29b esp_adc: migrate adc wifi test to test app 2022-08-29 12:33:16 +08:00
Armando 1fdf242750 esp_adc: add a kconfig to disable dac on certain adc IOs
Added a kconfig option. By default, when using ADC oneshot
driver, it will disable
DAC channels:
- ESP32:   IO25, IO26
- ESP32S2: IO17, IO18
if ADC2 is in use.

You can disable this option, to measure DAC output, via internal ADC.
This is for test usage.
2022-08-23 10:48:18 +08:00
Armando 81007ee4ed esp_adc: add adc ulp mode disable enum
Prior to this commit, adc ulp is disabled by setting
adc_oneshot_unit_init_cfg_t::ulp_mode to false.

After this commit, a new enum `ADC_ULP_MODE_DISABLE` is added. So
setting `ulp_mode` to `ADC_ULP_MODE_DISABLE`, instead of `false`, to
disable the ulp mode.
2022-08-23 10:48:15 +08:00
Ivan Grokhotkov 401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
morris cf4cfc69ed esp_adc: add test with -O0 2022-08-02 23:07:06 +08:00
Armando 5e6a16380a esp_adc: move adc common hw related code into esp_hw_support 2022-07-28 03:49:48 +00:00
Armando 0e6c8aef19 esp_adc: increase adc continuous iram test time overhead a bit
Prior to this commit, overhead is 0us on esp32s2, s3, c3, c2. However
when the conv_done event happens, software takes some time to do
necessary operations.
2022-07-26 18:19:14 +08:00
Darian c8ee369a7c Merge branch 'feature/deprecate-old-cpu-api' into 'master'
HAL: Deprecate old CPU/SoC/Interrupt Controller HAL API

Closes IDF-4919 and IDF-5032

See merge request espressif/esp-idf!18987
2022-07-23 00:37:33 +08:00
morris 5dbae0c2cd esp_adc: fix dead code reported by coverity 2022-07-22 00:12:36 +00:00
Guillaume Souchere 0bac33ed41 esp_system: Remove deprecate section from esp_cpu.h
- Remove esp_cpu_in_ocd_mode() from esp_cpu.h. Users should call esp_cpu_dbgr_is_attached() instead.
- Remove esp_cpu_get_ccount() from esp_cpu.h. Users should call esp_cpu_get_cycle_count() instead.
- Remove esp_cpu_set_ccount() from esp_cpu.h. Users should call esp_cpu_set_cycle_count() instead.
- Other IDF components updated to call esp_cpu_dbgr_is_attached(), esp_cpu_get_cycle_count() and esp_cpu_set_cycle_count() as well.
2022-07-22 00:06:06 +08:00
Darian Leung 781d06af73 esp_hw_support: Remove compare_set.h API
This function removes the following legacy atomic CAS functions:

From compare_set.h (file removed):
- compare_and_set_native()
- compare_and_set_extram()

From portmacro.h
- uxPortCompareSet()
- uxPortCompareSetExtram()

Users should call esp_cpu_compare_and_set() instead as this function hides the details
of atomic CAS on internal and external RAM addresses.

Due to the removal of compare_set.h, some missing header includes are also fixed in this commit.
2022-07-22 00:06:06 +08:00
Armando 5b523a3313 esp_adc: new esp_adc component and adc drivers 2022-07-15 18:31:00 +08:00