Files
esp-idf/examples/peripherals/adc/oneshot_read/pytest_adc_oneshot.py

30 lines
868 B
Python
Raw Normal View History

2025-02-24 10:18:03 +08:00
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded.dut import Dut
2025-02-24 10:18:03 +08:00
from pytest_embedded_idf.utils import idf_parametrize
2022-12-21 12:07:35 +08:00
@pytest.mark.adc
2025-02-24 10:18:03 +08:00
@idf_parametrize(
2025-07-14 17:34:11 +08:00
'target',
['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32c5', 'esp32p4', 'esp32c61'],
indirect=['target'],
2025-02-24 10:18:03 +08:00
)
def test_adc_oneshot(dut: Dut) -> None:
2022-12-21 12:07:35 +08:00
dut.expect(r'EXAMPLE: ADC1 Channel\[(\d+)\] Raw Data: (\d+)', timeout=5)
@pytest.mark.adc
@pytest.mark.xtal_26mhz
@pytest.mark.parametrize(
'config, baud',
[
('esp32c2_xtal26m', '74880'),
],
indirect=True,
)
2025-02-24 10:18:03 +08:00
@idf_parametrize('target', ['esp32c2'], indirect=['target'])
2022-12-21 12:07:35 +08:00
def test_adc_oneshot_esp32c2_xtal_26mhz(dut: Dut) -> None:
dut.expect(r'EXAMPLE: ADC1 Channel\[(\d+)\] Raw Data: (\d+)', timeout=5)