mpconfigport.h 4.25 KB
Newer Older
Rahix's avatar
Rahix committed
1
2
/* Hardware Name */
#define MICROPY_HW_BOARD_NAME "card10"
Rahix's avatar
Rahix committed
3
#define MICROPY_HW_MCU_NAME "max32666"
Rahix's avatar
Rahix committed
4
5

/* MicroPython Config Options */
Hinerk's avatar
Hinerk committed
6
#define MICROPY_PY_MICROPYTHON_MEM_INFO     (1)
Rahix's avatar
Rahix committed
7

8
9
10
/* We raise asynchronously from an interrupt handler */
#define MICROPY_ASYNC_KBD_INTR              (1)
#define MICROPY_KBD_EXCEPTION               (1)
Rahix's avatar
Rahix committed
11

12
13
14
15
16
/* Enable precompiled frozen modules */
#define MICROPY_MODULE_FROZEN_MPY           (1)
#define MICROPY_MODULE_FROZEN               (1)
#define MICROPY_QSTR_EXTRA_POOL             mp_qstr_frozen_const_pool

Rahix's avatar
Rahix committed
17
18
19
20
#define MICROPY_ENABLE_DOC_STRING           (1)
#define MICROPY_ENABLE_GC                   (1)
#define MICROPY_FLOAT_IMPL                  (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_HELPER_REPL                 (1)
Hinerk's avatar
Hinerk committed
21
#define MICROPY_LONGINT_IMPL                (MICROPY_LONGINT_IMPL_MPZ)
Rahix's avatar
Rahix committed
22

23
24
#define MICROPY_ENABLE_SCHEDULER            (1)

25
#define MICROPY_ENABLE_SOURCE_LINE          (1)
26
27
28
29
30
31

/* Create weak links from MicroPython specific
 * implementations of modules to standard names.
 * I.e. allow `import time` to import utime module.
 */
#define MICROPY_MODULE_WEAK_LINKS           (1)
32

33
/* urandom init */
34
int mp_hal_csprng_read_int(void);
35

Rahix's avatar
Rahix committed
36
/* Builtin function and modules */
37
#define MICROPY_PY_ALL_SPECIAL_METHODS      (1)
Rahix's avatar
Rahix committed
38
39
#define MICROPY_PY_BUILTINS_HELP            (1)
#define MICROPY_PY_BUILTINS_HELP_MODULES    (1)
40
#define MICROPY_PY_BUILTINS_INPUT           (1)
Rahix's avatar
Rahix committed
41
#define MICROPY_PY_UBINASCII                (1)
Rahix's avatar
Rahix committed
42
#define MICROPY_PY_UHEAPQ                   (1)
Rahix's avatar
Rahix committed
43
#define MICROPY_PY_UJSON                    (1)
Rahix's avatar
Rahix committed
44
45
#define MICROPY_PY_URANDOM                  (1)
#define MICROPY_PY_URANDOM_EXTRA_FUNCS      (1)
46
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC   (mp_hal_csprng_read_int())
47
48
49
50
#define MICROPY_PY_URE                      (1)
#define MICROPY_PY_URE_MATCH_GROUPS         (1)
#define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
#define MICROPY_PY_URE_SUB                  (1)
Rahix's avatar
Rahix committed
51
#define MICROPY_PY_UTIME_MP_HAL             (1)
52
#define MICROPY_PY_IO_FILEIO                (1)
53
#define MICROPY_PY_UERRNO                   (1)
54
#define MICROPY_PY_FRAMEBUF                 (1)
55
#define MICROPY_PY_BLUETOOTH                (1)
Rahix's avatar
Rahix committed
56
57

/* Modules */
58
#define MODULE_BHI160_ENABLED               (1)
Arist's avatar
Arist committed
59
#define MODULE_MAX86150_ENABLED             (1)
chris007's avatar
chris007 committed
60
#define MODULE_BME680_ENABLED               (1)
fleur's avatar
fleur committed
61
#define MODULE_BUTTONS_ENABLED              (1)
Gerd's avatar
Gerd committed
62
#define MODULE_DISPLAY_ENABLED              (1)
63
#define MODULE_GPIO_ENABLED                 (1)
Rahix's avatar
Rahix committed
64
65
#define MODULE_INTERRUPT_ENABLED            (1)
#define MODULE_LEDS_ENABLED                 (1)
66
#define MODULE_LIGHT_SENSOR_ENABLED         (1)
schneider's avatar
schneider committed
67
#define MODULE_MAX30001_ENABLED             (1)
68
#define MODULE_OS_ENABLED                   (1)
69
#define MODULE_PERSONAL_STATE_ENABLED       (1)
Stefan Haun's avatar
Stefan Haun committed
70
#define MODULE_POWER_ENABLED                (1)
71
#define MODULE_SPO2_ALGO_ENABLED            (1)
Rahix's avatar
Rahix committed
72
73
#define MODULE_UTIME_ENABLED                (1)
#define MODULE_VIBRA_ENABLED                (1)
74
#define MODULE_WS2812_ENABLED               (1)
75
#define MODULE_CONFIG_ENABLED               (1)
76
#define MODULE_BLE_ENABLED                  (1)
Rahix's avatar
Rahix committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90

/*
 * This port is intended to be 32-bit, but unfortunately, int32_t for
 * different targets may be defined in different ways - either as int
 * or as long. This requires different printf formatting specifiers
 * to print such value. So, we avoid int32_t and use int directly.
 */
#define UINT_FMT "%u"
#define INT_FMT "%d"
typedef int mp_int_t;       /* must be pointer size */
typedef unsigned mp_uint_t; /* must be pointer size */

typedef long mp_off_t;

91
92
93
94
/* extra built in names to add to the global namespace */
#define MICROPY_PORT_BUILTINS \
    { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },

Rahix's avatar
Rahix committed
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * Make a pointer to RAM callable (eg set lower bit for Thumb code)
 * (This scheme won't work if we want to mix Thumb and normal ARM code.)
 */
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))

/* We need to provide a declaration/definition of alloca() */
#include <alloca.h>

/* TODO: Document this */
#define MP_STATE_PORT MP_STATE_VM

107
108
109
110
111
112
#ifndef NO_QSTR
#include "epicardium.h"
#else
#define EPIC_INT_NUM 1
#endif

Rahix's avatar
Rahix committed
113
114
/* For some reason, we need to define readline history manually */
#define MICROPY_PORT_ROOT_POINTERS \
115
116
    const char *readline_hist[16]; \
    mp_obj_t interrupt_callbacks[EPIC_INT_NUM]; \
117
    void *spo2_memory; \
118