From 3f4898456bb1a451e5e6d45cb62c9c718f2b8a76 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 10 Apr 2014 22:46:40 +0100 Subject: stmhal: Add stm module, which contains some constants for the MCU. Also contains raw memory read/write functions, read8, read16, read32, write8, write16, write32. Can now do: stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13) This turns on the red LED. With the new constant folding, the above constants for the GPIO address are actually compiled to constants (and the addition done) at compile time. For viper code and inline assembler, this optimisation will make a big difference. In the inline assembler, using these constants would not be possible without this constant folding. --- stmhal/modstm.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 stmhal/modstm.h (limited to 'stmhal/modstm.h') diff --git a/stmhal/modstm.h b/stmhal/modstm.h new file mode 100644 index 000000000..205cdd2a1 --- /dev/null +++ b/stmhal/modstm.h @@ -0,0 +1 @@ +extern const mp_obj_module_t stm_module; -- cgit v1.2.3