2022-05-28 05:06:06 -04:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from pytest_embedded import Dut
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.esp32
|
|
|
|
@pytest.mark.esp32s3
|
2022-11-22 04:01:25 -05:00
|
|
|
@pytest.mark.esp32c6
|
2023-01-06 01:17:04 -05:00
|
|
|
@pytest.mark.esp32h2
|
2024-01-10 01:26:04 -05:00
|
|
|
@pytest.mark.esp32p4
|
2022-05-28 05:06:06 -04:00
|
|
|
@pytest.mark.generic
|
|
|
|
@pytest.mark.parametrize('config', [
|
|
|
|
pytest.param('gpio', marks=[pytest.mark.esp32, pytest.mark.esp32s3]),
|
|
|
|
pytest.param('tez', marks=[pytest.mark.esp32, pytest.mark.esp32s3]),
|
|
|
|
pytest.param('soft', marks=[pytest.mark.esp32s3]),
|
|
|
|
], indirect=True)
|
|
|
|
def test_mcpwm_sync_example(dut: Dut) -> None:
|
|
|
|
dut.expect_exact('example: Create timers')
|
|
|
|
dut.expect_exact('example: Create operators')
|
|
|
|
dut.expect_exact('example: Create comparators')
|
|
|
|
dut.expect_exact('example: Create generators')
|
|
|
|
dut.expect_exact('example: Set generator actions on timer and compare event')
|
|
|
|
dut.expect_exact('example: Start timers one by one, so they are not synced')
|
|
|
|
dut.expect_exact('example: Setup sync strategy')
|
|
|
|
dut.expect_exact('example: Now the output PWMs should in sync')
|