mpconfigport.h 3.22 KB
Newer Older
1
2
#include <stdint.h>

Damien's avatar
Damien committed
3
4
5
6
// options to control how Micro Python is built

#define MICROPY_EMIT_THUMB          (1)
#define MICROPY_EMIT_INLINE_THUMB   (1)
7
#define MICROPY_ENABLE_GC           (1)
8
9
#define MICROPY_ENABLE_REPL_HELPERS (1)
#define MICROPY_ENABLE_FLOAT        (1)
Damien's avatar
Damien committed
10
11
12

// type definitions for the specific machine

Damien's avatar
Damien committed
13
14
#define BYTES_PER_WORD (4)

Damien's avatar
Damien committed
15
16
17
typedef int32_t machine_int_t; // must be pointer size
typedef uint32_t machine_uint_t; // must be pointer size
typedef void *machine_ptr_t; // must be of pointer size
18
typedef const void *machine_const_ptr_t; // must be of pointer size
Damien's avatar
Damien committed
19
typedef float machine_float_t;
20
21

machine_float_t machine_sqrt(machine_float_t x);
22
23
24

// board specific definitions

25
// choose 1 of these boards
26
27
28
//#define PYBOARD
#define PYBOARD4
//#define STM32F4DISC
29

30
#if defined (PYBOARD)
mux's avatar
mux committed
31
32
33
34
35
36
37
38
39
    #define MICROPY_HW_HAS_SWITCH       (1)
    #define MICROPY_HW_HAS_SDCARD       (1)
    #define MICROPY_HW_HAS_MMA7660      (1)
    #define MICROPY_HW_HAS_LIS3DSH      (0)
    #define MICROPY_HW_ENABLE_RNG       (1)
    #define MICROPY_HW_ENABLE_RTC       (1)
    #define MICROPY_HW_ENABLE_TIMER     (1)
    #define MICROPY_HW_ENABLE_SERVO     (1)
    #define MICROPY_HW_ENABLE_AUDIO     (0)
40
41
42
43
44
45
46
47
48
49

    #define USRSW_PORT          (GPIOA)
    #define USRSW_PIN           (GPIO_Pin_13)
    #define USRSW_PUPD          (GPIO_PuPd_UP)
    #define USRSW_EXTI_PIN      (EXTI_PinSource13)
    #define USRSW_EXTI_PORT     (EXTI_PortSourceGPIOA)
    #define USRSW_EXTI_LINE     (EXTI_Line13)
    #define USRSW_EXTI_IRQN     (EXTI15_10_IRQn)
    #define USRSW_EXTI_EDGE     (EXTI_Trigger_Rising)
#elif defined (PYBOARD4)
mux's avatar
mux committed
50
51
52
53
54
55
56
57
58
    #define MICROPY_HW_HAS_SWITCH       (1)
    #define MICROPY_HW_HAS_SDCARD       (1)
    #define MICROPY_HW_HAS_MMA7660      (1)
    #define MICROPY_HW_HAS_LIS3DSH      (0)
    #define MICROPY_HW_ENABLE_RNG       (1)
    #define MICROPY_HW_ENABLE_RTC       (1)
    #define MICROPY_HW_ENABLE_TIMER     (1)
    #define MICROPY_HW_ENABLE_SERVO     (1)
    #define MICROPY_HW_ENABLE_AUDIO     (0)
59
60
61
62
63
64
65
66
67
68

    #define USRSW_PORT          (GPIOB)
    #define USRSW_PIN           (GPIO_Pin_3)
    #define USRSW_PUPD          (GPIO_PuPd_UP)
    #define USRSW_EXTI_PIN      (EXTI_PinSource3)
    #define USRSW_EXTI_PORT     (EXTI_PortSourceGPIOB)
    #define USRSW_EXTI_LINE     (EXTI_Line3)
    #define USRSW_EXTI_IRQN     (EXTI15_10_IRQn)
    #define USRSW_EXTI_EDGE     (EXTI_Trigger_Rising)
#elif defined (STM32F4DISC)
mux's avatar
mux committed
69
70
71
72
73
74
75
76
77
    #define MICROPY_HW_HAS_SWITCH       (1)
    #define MICROPY_HW_HAS_SDCARD       (0)
    #define MICROPY_HW_HAS_MMA7660      (0)
    #define MICROPY_HW_HAS_LIS3DSH      (1)
    #define MICROPY_HW_ENABLE_RNG       (1)
    #define MICROPY_HW_ENABLE_RTC       (1)
    #define MICROPY_HW_ENABLE_TIMER     (1)
    #define MICROPY_HW_ENABLE_SERVO     (0)
    #define MICROPY_HW_ENABLE_AUDIO     (0)
78
79
80
81
82
83
84
85
86

    #define USRSW_PORT          (GPIOA)
    #define USRSW_PIN           (GPIO_Pin_0)
    #define USRSW_PUPD          (GPIO_PuPd_NOPULL)
    #define USRSW_EXTI_PIN      (EXTI_PinSource0)
    #define USRSW_EXTI_PORT     (EXTI_PortSourceGPIOA)
    #define USRSW_EXTI_LINE     (EXTI_Line0)
    #define USRSW_EXTI_IRQN     (EXTI0_IRQn)
    #define USRSW_EXTI_EDGE     (EXTI_Trigger_Falling)
87
88
#endif

89
90
91
#define STM32F40_41xxx
#define USE_STDPERIPH_DRIVER
#define HSE_VALUE (8000000)