summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-08-10 01:09:04 +1000
committerDamien George <damien@micropython.org>2021-08-19 22:50:11 +1000
commit870000f35b2d278bd759c54ac59e2f97fcdc7dfd (patch)
treefb008534c294d3571320e5db25059a3a310dbd32 /py
parent226c0341ca78086b98f802d26f61220a2c19ffef (diff)
extmod: Add machine.bitstream.
This is a generic API for synchronously bit-banging data on a pin. Initially this adds a single supported encoding, which supports controlling WS2812 LEDs. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py')
-rw-r--r--py/mpconfig.h5
-rw-r--r--py/py.mk1
2 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index a5d639efe..2e83c90c5 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1470,6 +1470,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MACHINE (0)
#endif
+// Whether to include: bitstream
+#ifndef MICROPY_PY_MACHINE_BITSTREAM
+#define MICROPY_PY_MACHINE_BITSTREAM (0)
+#endif
+
// Whether to include: time_pulse_us
#ifndef MICROPY_PY_MACHINE_PULSE
#define MICROPY_PY_MACHINE_PULSE (0)
diff --git a/py/py.mk b/py/py.mk
index bc9232ef4..609ba6cae 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -184,6 +184,7 @@ PY_EXTMOD_O_BASENAME = \
extmod/moducryptolib.o \
extmod/modubinascii.o \
extmod/virtpin.o \
+ extmod/machine_bitstream.o \
extmod/machine_mem.o \
extmod/machine_pinbase.o \
extmod/machine_signal.o \