mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
mimxrt: Enable many Python and some extmod features.
Besides Python features this includes the extmod modules which make use of the Pin module, especially machine.softSPI, machine.SoftI2C and onewire.
This commit is contained in:
@@ -27,9 +27,13 @@
|
||||
|
||||
#include "py/runtime.h"
|
||||
#include "extmod/machine_mem.h"
|
||||
#include "extmod/machine_i2c.h"
|
||||
#include "extmod/machine_signal.h"
|
||||
#include "extmod/machine_spi.h"
|
||||
#include "led.h"
|
||||
#include "pin.h"
|
||||
#include "modmachine.h"
|
||||
#include "fsl_clock.h"
|
||||
|
||||
#include CPU_HEADER_H
|
||||
|
||||
@@ -40,7 +44,7 @@ STATIC mp_obj_t machine_reset(void) {
|
||||
MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_obj, machine_reset);
|
||||
|
||||
STATIC mp_obj_t machine_freq(void) {
|
||||
return MP_OBJ_NEW_SMALL_INT(0);
|
||||
return MP_OBJ_NEW_SMALL_INT(CLOCK_GetFreq(kCLOCK_CpuClk));
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_0(machine_freq_obj, machine_freq);
|
||||
|
||||
@@ -57,6 +61,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&machine_rtc_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SoftI2C), MP_ROM_PTR(&mp_machine_soft_i2c_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_SoftSPI), MP_ROM_PTR(&mp_machine_soft_spi_type) },
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user