mimxrt/machine_timer: Use soft-timer implementation for machine.Timer.

This releases the hardware timers for other tasks, which need a higher
resolution and faster response.  And it is less port-specific code.
This commit is contained in:
robert-hh
2022-10-15 11:40:22 +02:00
committed by Damien George
parent 9d2e179fa5
commit 65fa7fd8bb
7 changed files with 55 additions and 123 deletions

View File

@@ -56,21 +56,18 @@ Use the :mod:`time <time>` module::
Timers
------
The i.MXRT port has three hardware timers. Use the :ref:`machine.Timer <machine.Timer>` class
with a timer ID from 0 to 2 (inclusive)::
The i.MXRT port supports virtual Timers. Example of usage::
from machine import Timer
tim0 = Timer(0)
tim0 = Timer(-1)
tim0.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(0))
tim1 = Timer(1)
tim1 = Timer(-1)
tim1.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(1))
The period is in milliseconds.
Virtual timers are not currently supported on this port.
.. _mimxrt_Pins_and_GPIO:
Pins and GPIO