diff --git a/zephyr/Makefile b/zephyr/Makefile
index 3779765fb58b7f0b43db5644d61b7f2262b8a147..d020ab5ce00fa8ce0c01d9b99c18b8edd8902c7c 100644
--- a/zephyr/Makefile
+++ b/zephyr/Makefile
@@ -42,6 +42,7 @@ INC += -I$(ZEPHYR_BASE)/net/ip/contiki/os
 SRC_C = main.c \
 	help.c \
 	modutime.c \
+	modzephyr.c \
 	modmachine.c \
 	machine_pin.c \
 	uart_core.c \
diff --git a/zephyr/modzephyr.c b/zephyr/modzephyr.c
new file mode 100644
index 0000000000000000000000000000000000000000..1edfa7f3b984a9ed7df5968ff4c52875da49e6b5
--- /dev/null
+++ b/zephyr/modzephyr.c
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2017 Linaro Limited
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "py/mpconfig.h"
+#if MICROPY_PY_ZEPHYR
+
+#include <zephyr.h>
+
+#include "py/runtime.h"
+
+STATIC mp_obj_t mod_is_preempt_thread(void) {
+    return mp_obj_new_bool(k_is_preempt_thread());
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_is_preempt_thread_obj, mod_is_preempt_thread);
+
+STATIC const mp_rom_map_elem_t mp_module_time_globals_table[] = {
+    { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zephy) },
+    { MP_ROM_QSTR(MP_QSTR_is_preempt_thread), MP_ROM_PTR(&mod_is_preempt_thread_obj) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(mp_module_time_globals, mp_module_time_globals_table);
+
+const mp_obj_module_t mp_module_zephyr = {
+    .base = { &mp_type_module },
+    .globals = (mp_obj_dict_t*)&mp_module_time_globals,
+};
+
+#endif // MICROPY_PY_ZEPHYR
diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h
index 2cd5ffcecccf81bca7a5db4b7ca7966cc0a53389..e1e85df9cdab74af10cb47ac723bca28db0744aa 100644
--- a/zephyr/mpconfigport.h
+++ b/zephyr/mpconfigport.h
@@ -60,6 +60,7 @@
 #define MICROPY_PY_STRUCT           (0)
 #define MICROPY_PY_UTIME            (1)
 #define MICROPY_PY_UTIME_MP_HAL     (1)
+#define MICROPY_PY_ZEPHYR           (1)
 #define MICROPY_PY_SYS_MODULES      (0)
 #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
 #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
@@ -100,6 +101,7 @@ typedef long mp_off_t;
 
 extern const struct _mp_obj_module_t mp_module_machine;
 extern const struct _mp_obj_module_t mp_module_time;
+extern const struct _mp_obj_module_t mp_module_zephyr;
 
 #if MICROPY_PY_UTIME
 #define MICROPY_PY_UTIME_DEF { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_time) },
@@ -107,9 +109,16 @@ extern const struct _mp_obj_module_t mp_module_time;
 #define MICROPY_PY_UTIME_DEF
 #endif
 
+#if MICROPY_PY_ZEPHYR
+#define MICROPY_PY_ZEPHYR_DEF { MP_ROM_QSTR(MP_QSTR_zephyr), MP_ROM_PTR(&mp_module_zephyr) },
+#else
+#define MICROPY_PY_ZEPHYR_DEF
+#endif
+
 #define MICROPY_PORT_BUILTIN_MODULES \
     { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \
     MICROPY_PY_UTIME_DEF \
+    MICROPY_PY_ZEPHYR_DEF \
 
 #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \
     { MP_OBJ_NEW_QSTR(MP_QSTR_time), MP_ROM_PTR(&mp_module_time) }, \