Commit graph

2 commits

Author SHA1 Message Date
Christian Clauss
8ce7a58be2 tests: Four typos in tests directory.
Found by codespell.

Signed-off-by: Christian Clauss <cclauss@me.com>
2025-02-25 23:34:53 +11:00
Damien George
bdda91fe74 tests/extmod_hardware: Add a test for machine.PWM freq and duty.
This adds a hardware test for `machine.PWM`.  It requires a jumper wire
between two pins, uses `machine.PWM` to output on one of them, and
`machine.time_pulse_us()` to time the PWM on the other pin (some boards
test more than one pair of pins).

It times both the high and low duty cycle (and hence the frequency) for a
range of PWM frequencies and duty cycles (including full on and full off).

Currently supported on:
- esp32 (needs a minor hack for initialisation, and some tests still fail)
- esp8266 (passes for frequencies 1kHz and less)
- mimxrt / Teensy 4.0 (passes)
- rp2 (passes)
- samd21 (passes for frequencies 2kHz and less)

Signed-off-by: Damien George <damien@micropython.org>
2024-12-11 12:22:15 +11:00