summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk21
-rw-r--r--py/circuitpy_mpconfig.h41
-rw-r--r--py/circuitpy_mpconfig.mk17
3 files changed, 78 insertions, 1 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index ccdf973e9..d6c0f995e 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -99,6 +99,18 @@ endif
ifeq ($(CIRCUITPY_AESIO),1)
SRC_PATTERNS += aesio/%
endif
+ifeq ($(CIRCUITPY_ALARM),1)
+SRC_PATTERNS += alarm/%
+endif
+ifeq ($(CIRCUITPY_ALARM_IO),1)
+SRC_PATTERNS += alarm_io/%
+endif
+ifeq ($(CIRCUITPY_ALARM_TIME),1)
+SRC_PATTERNS += alarm_time/%
+endif
+ifeq ($(CIRCUITPY_ALARM_TOUCH),1)
+SRC_PATTERNS += alarm_touch/%
+endif
ifeq ($(CIRCUITPY_ANALOGIO),1)
SRC_PATTERNS += analogio/%
endif
@@ -235,6 +247,9 @@ endif
ifeq ($(CIRCUITPY_SHARPDISPLAY),1)
SRC_PATTERNS += sharpdisplay/%
endif
+ifeq ($(CIRCUITPY_SLEEP),1)
+SRC_PATTERNS += sleep/%
+endif
ifeq ($(CIRCUITPY_SOCKETPOOL),1)
SRC_PATTERNS += socketpool/%
endif
@@ -298,6 +313,10 @@ SRC_COMMON_HAL_ALL = \
_bleio/__init__.c \
_pew/PewPew.c \
_pew/__init__.c \
+ alarm/__init__.c \
+ alarm_io/__init__.c \
+ alarm_time/__init__.c \
+ alarm_touch/__init__.c \
analogio/AnalogIn.c \
analogio/AnalogOut.c \
analogio/__init__.c \
@@ -353,6 +372,8 @@ SRC_COMMON_HAL_ALL = \
rtc/__init__.c \
sdioio/SDCard.c \
sdioio/__init__.c \
+ sleep/__init__.c \
+ sleep/ResetReason.c \
socketpool/__init__.c \
socketpool/SocketPool.c \
socketpool/Socket.c \
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 08efabddb..11f844892 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -243,6 +243,34 @@ extern const struct _mp_obj_module_t aesio_module;
#define AESIO_MODULE
#endif
+#if CIRCUITPY_ALARM
+extern const struct _mp_obj_module_t alarm_module;
+#define ALARM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_alarm), (mp_obj_t)&alarm_module },
+#else
+#define ALARM_MODULE
+#endif
+
+#if CIRCUITPY_ALARM_IO
+extern const struct _mp_obj_module_t alarm_io_module;
+#define ALARM_IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_alarm_io), (mp_obj_t)&alarm_io_module },
+#else
+#define ALARM_IO_MODULE
+#endif
+
+#if CIRCUITPY_ALARM_TIME
+extern const struct _mp_obj_module_t alarm_time_module;
+#define ALARM_TIME_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_alarm_time), (mp_obj_t)&alarm_time_module },
+#else
+#define ALARM_TIME_MODULE
+#endif
+
+#if CIRCUITPY_ALARM_TOUCH
+extern const struct _mp_obj_module_t alarm_touch_module;
+#define ALARM_TOUCH_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_alarm_touch), (mp_obj_t)&alarm_touch_module },
+#else
+#define ALARM_TOUCH_MODULE
+#endif
+
#if CIRCUITPY_ANALOGIO
#define ANALOGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module },
extern const struct _mp_obj_module_t analogio_module;
@@ -607,7 +635,6 @@ extern const struct _mp_obj_module_t sdioio_module;
#define SDIOIO_MODULE
#endif
-
#if CIRCUITPY_SHARPDISPLAY
extern const struct _mp_obj_module_t sharpdisplay_module;
#define SHARPDISPLAY_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sharpdisplay),(mp_obj_t)&sharpdisplay_module },
@@ -615,6 +642,13 @@ extern const struct _mp_obj_module_t sharpdisplay_module;
#define SHARPDISPLAY_MODULE
#endif
+#if CIRCUITPY_SLEEP
+extern const struct _mp_obj_module_t sleep_module;
+#define SLEEP_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sleep),(mp_obj_t)&sleep_module },
+#else
+#define SLEEP_MODULE
+#endif
+
#if CIRCUITPY_SOCKETPOOL
extern const struct _mp_obj_module_t socketpool_module;
#define SOCKETPOOL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socketpool), (mp_obj_t)&socketpool_module },
@@ -772,6 +806,10 @@ extern const struct _mp_obj_module_t wifi_module;
// Some are omitted because they're in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS above.
#define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \
AESIO_MODULE \
+ ALARM_MODULE \
+ ALARM_IO_MODULE \
+ ALARM_TIME_MODULE \
+ ALARM_TOUCH_MODULE \
ANALOGIO_MODULE \
AUDIOBUSIO_MODULE \
AUDIOCORE_MODULE \
@@ -824,6 +862,7 @@ extern const struct _mp_obj_module_t wifi_module;
SDCARDIO_MODULE \
SDIOIO_MODULE \
SHARPDISPLAY_MODULE \
+ SLEEP_MODULE \
SOCKETPOOL_MODULE \
SSL_MODULE \
STAGE_MODULE \
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index a6aabec33..c47e3755b 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -39,6 +39,18 @@ CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT)
CIRCUITPY_AESIO ?= 0
CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO)
+CIRCUITPY_ALARM ?= 0
+CFLAGS += -DCIRCUITPY_ALARM=$(CIRCUITPY_ALARM)
+
+CIRCUITPY_ALARM_IO ?= 0
+CFLAGS += -DCIRCUITPY_ALARM_IO=$(CIRCUITPY_ALARM_IO)
+
+CIRCUITPY_ALARM_TIME ?= 0
+CFLAGS += -DCIRCUITPY_ALARM_TIME=$(CIRCUITPY_ALARM_TIME)
+
+CIRCUITPY_ALARM_TOUCH ?= 0
+CFLAGS += -DCIRCUITPY_ALARM_TOUCH=$(CIRCUITPY_ALARM_TOUCH)
+
CIRCUITPY_ANALOGIO ?= 1
CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO)
@@ -209,6 +221,11 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO)
CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO)
CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY)
+# TODO: CIRCUITPY_SLEEP will gradually be added to all ports
+# even if it doesn't actually sleep, so make this 1 eventually.
+CIRCUITPY_SLEEP ?= 0
+CFLAGS += -DCIRCUITPY_SLEEP=$(CIRCUITPY_SLEEP)
+
CIRCUITPY_SOCKETPOOL ?= $(CIRCUITPY_WIFI)
CFLAGS += -DCIRCUITPY_SOCKETPOOL=$(CIRCUITPY_SOCKETPOOL)