mimxrt: Add the Timer class to the machine module.

It supports three hardware timer channels based on the PIT timers of the
MIMXRT MCU.  The timer id's are 0, 1 and 2.  On soft reboot all active
timers will be stopped via finalisers.
This commit is contained in:
robert-hh
2021-05-18 17:27:00 +02:00
committed by Damien George
parent 934505ac33
commit 4c407c790f
6 changed files with 261 additions and 1 deletions

View File

@@ -29,6 +29,7 @@
#include "extmod/machine_mem.h"
#include "led.h"
#include "pin.h"
#include "modmachine.h"
#include CPU_HEADER_H
@@ -54,6 +55,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&machine_led_type) },
#endif
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
};
STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table);