summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoriabdalkader <i.abdalkader@gmail.com>2021-09-10 14:28:41 +0200
committerDamien George <damien@micropython.org>2021-09-19 23:35:44 +1000
commit782d5b2e534c96f4668443efe37c0514e8fcfe91 (patch)
tree8bf7ef078e917d94c92e86c1dd9b9e3a2c6519f3
parent2c5e9bbdface4eb163b53f486359ca2208b7b0a5 (diff)
downloadmicropython-782d5b2e534c96f4668443efe37c0514e8fcfe91.tar.gz
micropython-782d5b2e534c96f4668443efe37c0514e8fcfe91.zip
stm32: Enable platform module.
The HAL version is based on the stm32lib version.
-rw-r--r--ports/stm32/mpconfigport.h3
-rw-r--r--ports/stm32/mphalport.h17
2 files changed, 20 insertions, 0 deletions
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index 92f1338d6c..6a9e8bf414 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -228,6 +228,9 @@
#ifndef MICROPY_PY_ONEWIRE
#define MICROPY_PY_ONEWIRE (1)
#endif
+#ifndef MICROPY_PY_UPLATFORM
+#define MICROPY_PY_UPLATFORM (1)
+#endif
// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
diff --git a/ports/stm32/mphalport.h b/ports/stm32/mphalport.h
index a76945db5f..edb8d8f64b 100644
--- a/ports/stm32/mphalport.h
+++ b/ports/stm32/mphalport.h
@@ -2,6 +2,23 @@
#include STM32_HAL_H
#include "pin.h"
+// F0-1.9.0+F4-1.16.0+F7-1.7.0+H7-1.6.0+L0-1.11.2+L4-1.8.1+WB-1.10.0
+#if defined(STM32F0)
+#define MICROPY_HAL_VERSION "1.9.0"
+#elif defined(STM32F4)
+#define MICROPY_HAL_VERSION "1.16.0"
+#elif defined(STM32F7)
+#define MICROPY_HAL_VERSION "1.7.0"
+#elif defined(STM32H7)
+#define MICROPY_HAL_VERSION "1.6.0"
+#elif defined(STM32L0)
+#define MICROPY_HAL_VERSION "1.11.2"
+#elif defined(STM32L4)
+#define MICROPY_HAL_VERSION "1.8.1"
+#elif defined(STM32WB)
+#define MICROPY_HAL_VERSION "1.10.0"
+#endif
+
extern const unsigned char mp_hal_status_to_errno_table[4];
static inline int mp_hal_status_to_neg_errno(HAL_StatusTypeDef status) {