Commit c3d35c6a authored by Damien George's avatar Damien George
Browse files

stm: Put pyb module in ROM.

parent 01d50d0d
......@@ -79,6 +79,7 @@ SRC_C = \
pin_map.c \
exti.c \
usrsw.c \
pybmodule.c \
# pybwlan.c \
SRC_S = \
......
......@@ -313,14 +313,14 @@ static const mp_obj_type_t exti_meta_obj_type = {
.load_attr = exti_load_attr,
};
static const mp_obj_type_t exti_obj_type = {
const mp_obj_type_t exti_obj_type = {
{ &exti_meta_obj_type },
.name = MP_QSTR_Exti,
.print = exti_obj_print,
.methods = exti_methods,
};
void exti_init_early(void) {
void exti_init(void) {
for (exti_vector_t *v = exti_vector; v < &exti_vector[EXTI_NUM_VECTORS]; v++) {
v->callback_obj = mp_const_none;
v->param = NULL;
......@@ -328,10 +328,6 @@ void exti_init_early(void) {
}
}
void exti_init(mp_obj_t mod) {
rt_store_attr(mod, MP_QSTR_Exti, (mp_obj_t)&exti_obj_type);
}
static void Handle_EXTI_Irq(uint32_t line) {
if (EXTI_PR_BB(line)) {
EXTI_PR_BB(line) = 1; // Clears bit
......
......@@ -13,8 +13,7 @@
#define EXTI_NUM_VECTORS 23
void exti_init_early(void);
void exti_init(mp_obj_t mod);
void exti_init(void);
uint exti_register(mp_obj_t pin_obj, mp_obj_t mode_obj, mp_obj_t trigger_obj, mp_obj_t callback_obj, void *param);
......@@ -27,3 +26,4 @@ typedef struct {
void *param;
} exti_t;
extern const mp_obj_type_t exti_obj_type;
......@@ -92,14 +92,3 @@ mp_obj_t pyb_gpio_output(mp_obj_t arg_pin, mp_obj_t arg_mode) {
}
MP_DEFINE_CONST_FUN_OBJ_2(pyb_gpio_output_obj, pyb_gpio_output);
void gpio_init(mp_obj_t mod) {
rt_store_attr(mod, MP_QSTR_gpio, (mp_obj_t)&pyb_gpio_obj);
rt_store_attr(mod, MP_QSTR_gpio_in, (mp_obj_t)&pyb_gpio_input_obj);
rt_store_attr(mod, MP_QSTR_gpio_out, (mp_obj_t)&pyb_gpio_output_obj);
rt_store_attr(mod, qstr_from_str("PULL_NONE"), MP_OBJ_NEW_SMALL_INT(GPIO_PuPd_NOPULL));
rt_store_attr(mod, qstr_from_str("PULL_UP"), MP_OBJ_NEW_SMALL_INT(GPIO_PuPd_UP));
rt_store_attr(mod, qstr_from_str("PULL_DOWN"), MP_OBJ_NEW_SMALL_INT(GPIO_PuPd_DOWN));
rt_store_attr(mod, qstr_from_str("PUSH_PULL"), MP_OBJ_NEW_SMALL_INT(GPIO_OType_PP));
rt_store_attr(mod, qstr_from_str("OPEN_DRAIN"), MP_OBJ_NEW_SMALL_INT(GPIO_OType_OD));
}
mp_obj_t pyb_gpio(uint n_args, mp_obj_t *args);
mp_obj_t pyb_gpio_input(mp_obj_t arg_pin, mp_obj_t arg_mode);
mp_obj_t pyb_gpio_output(mp_obj_t arg_pin, mp_obj_t arg_mode);
void gpio_init(mp_obj_t mod);
MP_DECLARE_CONST_FUN_OBJ(pyb_gpio_obj);
MP_DECLARE_CONST_FUN_OBJ(pyb_gpio_input_obj);
MP_DECLARE_CONST_FUN_OBJ(pyb_gpio_output_obj);
......@@ -34,24 +34,20 @@
#include "pendsv.h"
#include "pyexec.h"
#include "led.h"
#include "gpio.h"
#include "servo.h"
#include "lcd.h"
#include "storage.h"
#include "sdcard.h"
#include "accel.h"
#include "usart.h"
#include "usb.h"
#include "timer.h"
#include "audio.h"
#include "pybwlan.h"
#include "i2c.h"
#include "usrsw.h"
#include "adc.h"
#include "rtc.h"
#include "file.h"
#include "pin.h"
#include "exti.h"
#include "pybmodule.h"
int errno;
......@@ -82,43 +78,26 @@ void __fatal_error(const char *msg) {
}
}
static mp_obj_t pyb_config_source_dir = MP_OBJ_NULL;
static mp_obj_t pyb_config_main = MP_OBJ_NULL;
STATIC mp_obj_t pyb_config_source_dir = MP_OBJ_NULL;
STATIC mp_obj_t pyb_config_main = MP_OBJ_NULL;
mp_obj_t pyb_source_dir(mp_obj_t source_dir) {
STATIC mp_obj_t pyb_source_dir(mp_obj_t source_dir) {
if (MP_OBJ_IS_STR(source_dir)) {
pyb_config_source_dir = source_dir;
}
return mp_const_none;
}
mp_obj_t pyb_main(mp_obj_t main) {
MP_DEFINE_CONST_FUN_OBJ_1(pyb_source_dir_obj, pyb_source_dir);
STATIC mp_obj_t pyb_main(mp_obj_t main) {
if (MP_OBJ_IS_STR(main)) {
pyb_config_main = main;
}
return mp_const_none;
}
// sync all file systems
mp_obj_t pyb_sync(void) {
storage_flush();
return mp_const_none;
}
mp_obj_t pyb_delay(mp_obj_t count) {
sys_tick_delay_ms(mp_obj_get_int(count));
return mp_const_none;
}
mp_obj_t pyb_udelay(mp_obj_t usec) {
uint32_t count = 0;
const uint32_t utime = (168 * mp_obj_get_int(usec) / 5);
for (;;) {
if (++count > utime) {
return mp_const_none;
}
}
}
MP_DEFINE_CONST_FUN_OBJ_1(pyb_main_obj, pyb_main);
void fatality(void) {
led_state(PYB_LED_R1, 1);
......@@ -151,6 +130,7 @@ static const char *help_text =
" pyb.gc() -- run the garbage collector\n"
" pyb.repl_info(<val>) -- enable/disable printing of info after each command\n"
" pyb.delay(<n>) -- wait for n milliseconds\n"
" pyb.udelay(<n>) -- wait for n microseconds\n"
" pyb.Led(<n>) -- create Led object for LED n (n=1,2)\n"
" Led methods: on(), off()\n"
" pyb.Servo(<n>) -- create Servo object for servo n (n=1,2,3,4)\n"
......@@ -170,129 +150,6 @@ static mp_obj_t pyb_help(void) {
return mp_const_none;
}
// get lots of info about the board
static mp_obj_t pyb_info(void) {
// get and print unique id; 96 bits
{
byte *id = (byte*)0x1fff7a10;
printf("ID=%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11]);
}
// get and print clock speeds
// SYSCLK=168MHz, HCLK=168MHz, PCLK1=42MHz, PCLK2=84MHz
{
RCC_ClocksTypeDef rcc_clocks;
RCC_GetClocksFreq(&rcc_clocks);
printf("S=%lu\nH=%lu\nP1=%lu\nP2=%lu\n", rcc_clocks.SYSCLK_Frequency, rcc_clocks.HCLK_Frequency, rcc_clocks.PCLK1_Frequency, rcc_clocks.PCLK2_Frequency);
}
// to print info about memory
{
printf("_text_end=%p\n", &_text_end);
printf("_data_start_init=%p\n", &_data_start_init);
printf("_data_start=%p\n", &_data_start);
printf("_data_end=%p\n", &_data_end);
printf("_bss_start=%p\n", &_bss_start);
printf("_bss_end=%p\n", &_bss_end);
printf("_stack_end=%p\n", &_stack_end);
printf("_ram_start=%p\n", &_ram_start);
printf("_heap_start=%p\n", &_heap_start);
printf("_heap_end=%p\n", &_heap_end);
printf("_ram_end=%p\n", &_ram_end);
}
// qstr info
{
uint n_pool, n_qstr, n_str_data_bytes, n_total_bytes;
qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes);
printf("qstr:\n n_pool=%u\n n_qstr=%u\n n_str_data_bytes=%u\n n_total_bytes=%u\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
}
// GC info
{
gc_info_t info;
gc_info(&info);
printf("GC:\n");
printf(" %lu total\n", info.total);
printf(" %lu : %lu\n", info.used, info.free);
printf(" 1=%lu 2=%lu m=%lu\n", info.num_1block, info.num_2block, info.max_block);
}
// free space on flash
{
DWORD nclst;
FATFS *fatfs;
f_getfree("0:", &nclst, &fatfs);
printf("LFS free: %u bytes\n", (uint)(nclst * fatfs->csize * 512));
}
return mp_const_none;
}
static void SYSCLKConfig_STOP(void) {
/* After wake-up from STOP reconfigure the system clock */
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET) {
}
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08) {
}
}
static mp_obj_t pyb_stop(void) {
PWR_EnterSTANDBYMode();
//PWR_FlashPowerDownCmd(ENABLE); don't know what the logic is with this
/* Enter Stop Mode */
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
/* Configures system clock after wake-up from STOP: enable HSE, PLL and select
* PLL as system clock source (HSE and PLL are disabled in STOP mode) */
SYSCLKConfig_STOP();
//PWR_FlashPowerDownCmd(DISABLE);
return mp_const_none;
}
static mp_obj_t pyb_standby(void) {
PWR_EnterSTANDBYMode();
return mp_const_none;
}
mp_obj_t pyb_hid_send_report(mp_obj_t arg) {
mp_obj_t *items = mp_obj_get_array_fixed_n(arg, 4);
uint8_t data[4];
data[0] = mp_obj_get_int(items[0]);
data[1] = mp_obj_get_int(items[1]);
data[2] = mp_obj_get_int(items[2]);
data[3] = mp_obj_get_int(items[3]);
usb_hid_send_report(data);
return mp_const_none;
}
mp_obj_t pyb_rng_get(void) {
return mp_obj_new_int(RNG_GetRandomNumber() >> 16);
}
mp_obj_t pyb_millis(void) {
return mp_obj_new_int(sys_tick_counter);
}
int main(void) {
// TODO disable JTAG
......@@ -382,7 +239,8 @@ soft_reset:
def_path[2] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib);
sys_path = mp_obj_new_list(3, def_path);
exti_init_early();
exti_init();
#if MICROPY_HW_HAS_SWITCH
switch_init();
#endif
......@@ -408,65 +266,15 @@ soft_reset:
RNG_Cmd(ENABLE);
#endif
// add some functions to the python namespace
{
rt_store_name(MP_QSTR_help, rt_make_function_n(0, pyb_help));
mp_obj_t m = mp_obj_new_module(MP_QSTR_pyb);
rt_store_attr(m, MP_QSTR_info, rt_make_function_n(0, pyb_info));
rt_store_attr(m, MP_QSTR_gc, (mp_obj_t)&pyb_gc_obj);
rt_store_attr(m, qstr_from_str("repl_info"), rt_make_function_n(1, pyb_set_repl_info));
#if MICROPY_HW_HAS_SDCARD
rt_store_attr(m, qstr_from_str("SD"), (mp_obj_t)&pyb_sdcard_obj);
#endif
rt_store_attr(m, MP_QSTR_stop, rt_make_function_n(0, pyb_stop));
rt_store_attr(m, MP_QSTR_standby, rt_make_function_n(0, pyb_standby));
rt_store_attr(m, MP_QSTR_source_dir, rt_make_function_n(1, pyb_source_dir));
rt_store_attr(m, MP_QSTR_main, rt_make_function_n(1, pyb_main));
rt_store_attr(m, MP_QSTR_sync, rt_make_function_n(0, pyb_sync));
rt_store_attr(m, MP_QSTR_delay, rt_make_function_n(1, pyb_delay));
rt_store_attr(m, MP_QSTR_udelay, rt_make_function_n(1, pyb_udelay));
#if MICROPY_HW_HAS_SWITCH
rt_store_attr(m, MP_QSTR_switch, (mp_obj_t)&pyb_switch_obj);
#endif
#if MICROPY_HW_ENABLE_SERVO
rt_store_attr(m, MP_QSTR_servo, rt_make_function_n(2, pyb_servo_set));
#endif
rt_store_attr(m, MP_QSTR_pwm, rt_make_function_n(2, pyb_pwm_set));
#if MICROPY_HW_HAS_MMA7660
rt_store_attr(m, MP_QSTR_accel, (mp_obj_t)&pyb_accel_read_obj);
rt_store_attr(m, MP_QSTR_accel_read, (mp_obj_t)&pyb_accel_read_all_obj);
rt_store_attr(m, MP_QSTR_accel_mode, (mp_obj_t)&pyb_accel_write_mode_obj);
#endif
rt_store_attr(m, MP_QSTR_hid, rt_make_function_n(1, pyb_hid_send_report));
#if MICROPY_HW_ENABLE_RTC
rt_store_attr(m, MP_QSTR_time, (mp_obj_t)&pyb_rtc_read_obj);
rt_store_attr(m, qstr_from_str("rtc_info"), (mp_obj_t)&pyb_rtc_info_obj);
#endif
#if MICROPY_HW_ENABLE_RNG
rt_store_attr(m, MP_QSTR_rand, rt_make_function_n(0, pyb_rng_get));
#endif
rt_store_attr(m, MP_QSTR_Led, (mp_obj_t)&pyb_Led_obj);
#if MICROPY_HW_ENABLE_SERVO
rt_store_attr(m, MP_QSTR_Servo, rt_make_function_n(1, pyb_Servo));
#endif
rt_store_attr(m, MP_QSTR_I2C, rt_make_function_n(2, pyb_I2C));
rt_store_attr(m, MP_QSTR_Usart, rt_make_function_n(2, pyb_Usart));
rt_store_attr(m, qstr_from_str("ADC_all"), (mp_obj_t)&pyb_ADC_all_obj);
rt_store_attr(m, MP_QSTR_ADC, (mp_obj_t)&pyb_ADC_obj);
rt_store_attr(m, qstr_from_str("millis"), rt_make_function_n(0, pyb_millis));
#if MICROPY_HW_ENABLE_AUDIO
rt_store_attr(m, qstr_from_str("Audio"), (mp_obj_t)&pyb_Audio_obj);
#endif
pin_map_init();
pin_map_init(m);
gpio_init(m);
exti_init(m);
rt_store_name(MP_QSTR_pyb, m);
// add some functions to the builtin Python namespace
rt_store_name(MP_QSTR_help, rt_make_function_n(0, pyb_help));
rt_store_name(MP_QSTR_open, rt_make_function_n(2, pyb_io_open));
rt_store_name(MP_QSTR_open, rt_make_function_n(2, pyb_io_open));
}
// we pre-import the pyb module
// probably shouldn't do this, so we are compatible with CPython
rt_store_name(MP_QSTR_pyb, (mp_obj_t)&pyb_module);
// check if user switch held (initiates reset of filesystem)
bool reset_filesystem = false;
......@@ -659,7 +467,7 @@ soft_reset:
pyexec_repl();
printf("PYB: sync filesystems\n");
pyb_sync();
storage_flush();
printf("PYB: soft reboot\n");
......
......@@ -110,7 +110,7 @@ extern const pin_named_pins_obj_t pin_cpu_pins_obj;
const pin_obj_t *pin_find_named_pin(const pin_named_pin_t *pins, const char *name);
const pin_af_obj_t *pin_find_af(const pin_obj_t *pin, uint8_t fn, uint8_t unit, uint8_t pin_type);
void pin_map_init(mp_obj_t mod);
void pin_map_init(void);
// C function for mapping python pin identifier into an ordinal pin number.
const pin_obj_t *pin_map_user_obj(mp_obj_t user_obj);
......
......@@ -142,9 +142,8 @@ static const pin_map_obj_t pin_map_obj_init = {
pin_map_obj_t pin_map_obj;
void pin_map_init(mp_obj_t mod) {
void pin_map_init(void) {
pin_map_obj = pin_map_obj_init;
rt_store_attr(mod, MP_QSTR_Pin, (mp_obj_t)&pin_map_obj);
}
// C API used to convert a user-supplied pin name into an ordinal pin number.
......
#include <stdint.h>
#include <stdio.h>
#include <stm32f4xx.h>
#include <stm32f4xx_rcc.h>
#include "misc.h"
#include "ff.h"
#include "mpconfig.h"
#include "qstr.h"
#include "obj.h"
#include "map.h"
#include "gc.h"
#include "gccollect.h"
#include "systick.h"
#include "rtc.h"
#include "pyexec.h"
#include "servo.h"
#include "storage.h"
#include "usb.h"
#include "usrsw.h"
#include "sdcard.h"
#include "accel.h"
#include "led.h"
#include "i2c.h"
#include "usart.h"
#include "adc.h"
#include "audio.h"
#include "pin.h"
#include "gpio.h"
#include "exti.h"
#include "pybmodule.h"
// get lots of info about the board
STATIC mp_obj_t pyb_info(void) {
// get and print unique id; 96 bits
{
byte *id = (byte*)0x1fff7a10;
printf("ID=%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11]);
}
// get and print clock speeds
// SYSCLK=168MHz, HCLK=168MHz, PCLK1=42MHz, PCLK2=84MHz
{
RCC_ClocksTypeDef rcc_clocks;
RCC_GetClocksFreq(&rcc_clocks);
printf("S=%lu\nH=%lu\nP1=%lu\nP2=%lu\n", rcc_clocks.SYSCLK_Frequency, rcc_clocks.HCLK_Frequency, rcc_clocks.PCLK1_Frequency, rcc_clocks.PCLK2_Frequency);
}
// to print info about memory
{
printf("_text_end=%p\n", &_text_end);
printf("_data_start_init=%p\n", &_data_start_init);
printf("_data_start=%p\n", &_data_start);
printf("_data_end=%p\n", &_data_end);
printf("_bss_start=%p\n", &_bss_start);
printf("_bss_end=%p\n", &_bss_end);
printf("_stack_end=%p\n", &_stack_end);
printf("_ram_start=%p\n", &_ram_start);
printf("_heap_start=%p\n", &_heap_start);
printf("_heap_end=%p\n", &_heap_end);
printf("_ram_end=%p\n", &_ram_end);
}
// qstr info
{
uint n_pool, n_qstr, n_str_data_bytes, n_total_bytes;
qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes);
printf("qstr:\n n_pool=%u\n n_qstr=%u\n n_str_data_bytes=%u\n n_total_bytes=%u\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
}
// GC info
{
gc_info_t info;
gc_info(&info);
printf("GC:\n");
printf(" %lu total\n", info.total);
printf(" %lu : %lu\n", info.used, info.free);
printf(" 1=%lu 2=%lu m=%lu\n", info.num_1block, info.num_2block, info.max_block);
}
// free space on flash
{
DWORD nclst;
FATFS *fatfs;
f_getfree("0:", &nclst, &fatfs);
printf("LFS free: %u bytes\n", (uint)(nclst * fatfs->csize * 512));
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_info_obj, pyb_info);
// sync all file systems
STATIC mp_obj_t pyb_sync(void) {
storage_flush();
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_sync_obj, pyb_sync);
STATIC mp_obj_t pyb_millis(void) {
return mp_obj_new_int(sys_tick_counter);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_millis_obj, pyb_millis);
STATIC mp_obj_t pyb_delay(mp_obj_t count) {
sys_tick_delay_ms(mp_obj_get_int(count));
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_delay_obj, pyb_delay);
STATIC mp_obj_t pyb_udelay(mp_obj_t usec) {
uint32_t count = 0;
const uint32_t utime = (168 * mp_obj_get_int(usec) / 5);
for (;;) {
if (++count > utime) {
return mp_const_none;
}
}
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_udelay_obj, pyb_udelay);
STATIC mp_obj_t pyb_rng_get(void) {
return mp_obj_new_int(RNG_GetRandomNumber() >> 16);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_rng_get_obj, pyb_rng_get);
STATIC void SYSCLKConfig_STOP(void) {
/* After wake-up from STOP reconfigure the system clock */
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET) {
}
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSYSCLKSource() != 0x08) {
}
}
STATIC mp_obj_t pyb_stop(void) {
PWR_EnterSTANDBYMode();
//PWR_FlashPowerDownCmd(ENABLE); don't know what the logic is with this
/* Enter Stop Mode */
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
/* Configures system clock after wake-up from STOP: enable HSE, PLL and select
* PLL as system clock source (HSE and PLL are disabled in STOP mode) */
SYSCLKConfig_STOP();
//PWR_FlashPowerDownCmd(DISABLE);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_0(pyb_stop_obj, pyb_stop);
STATIC mp_obj_t pyb_standby(void) {
PWR_EnterSTANDBYMode();
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_0(pyb_standby_obj, pyb_standby);
STATIC mp_obj_t pyb_hid_send_report(mp_obj_t arg) {
mp_obj_t *items = mp_obj_get_array_fixed_n(arg, 4);
uint8_t data[4];
data[0] = mp_obj_get_int(items[0]);
data[1] = mp_obj_get_int(items[1]);
data[2] = mp_obj_get_int(items[2]);
data[3] = mp_obj_get_int(items[3]);
usb_hid_send_report(data);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(pyb_hid_send_report_obj, pyb_hid_send_report);
MP_DEFINE_CONST_FUN_OBJ_2(pyb_I2C_obj, pyb_I2C); // TODO put this in i2c.c
MP_DECLARE_CONST_FUN_OBJ(pyb_source_dir_obj); // defined in main.c
MP_DECLARE_CONST_FUN_OBJ(pyb_main_obj); // defined in main.c
STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_gc), (mp_obj_t)&pyb_gc_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_repl_info), (mp_obj_t)&pyb_set_repl_info_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stop), (mp_obj_t)&pyb_stop_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_standby), (mp_obj_t)&pyb_standby_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_source_dir), (mp_obj_t)&pyb_source_dir_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_main), (mp_obj_t)&pyb_main_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_millis), (mp_obj_t)&pyb_millis_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_delay), (mp_obj_t)&pyb_delay_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_udelay), (mp_obj_t)&pyb_udelay_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_sync), (mp_obj_t)&pyb_sync_obj },
#if MICROPY_HW_ENABLE_RNG
{ MP_OBJ_NEW_QSTR(MP_QSTR_rand), (mp_obj_t)&pyb_rng_get_obj },
#endif
#if MICROPY_HW_ENABLE_RTC
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&pyb_rtc_read_obj },