aboutsummaryrefslogtreecommitdiff
path: root/teensy/reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/reg.h')
-rw-r--r--teensy/reg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/teensy/reg.h b/teensy/reg.h
new file mode 100644
index 000000000..5d1d27443
--- /dev/null
+++ b/teensy/reg.h
@@ -0,0 +1,8 @@
+typedef struct {
+ const char *name;
+ mp_uint_t offset;
+} reg_t;
+
+#define REG_ENTRY(st, name) { #name, offsetof(st, name) }
+
+mp_obj_t reg_cmd(void *base, reg_t *reg, mp_uint_t num_reg, uint n_args, const mp_obj_t *args);