2022-06-04 07:27:12 -04:00
|
|
|
// Deinitions common to all SAMD21 boards
|
|
|
|
#include "samd21.h"
|
|
|
|
|
2022-06-15 09:16:07 -04:00
|
|
|
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
|
2022-06-04 07:27:12 -04:00
|
|
|
|
2022-06-15 09:16:07 -04:00
|
|
|
// MicroPython emitters
|
|
|
|
#define MICROPY_EMIT_THUMB (0)
|
|
|
|
#define MICROPY_EMIT_INLINE_THUMB (0)
|
2022-07-10 05:55:56 -04:00
|
|
|
#define MICROPY_MODULE_BUILTIN_INIT (1)
|
2022-06-09 07:46:54 -04:00
|
|
|
|
2022-06-21 11:32:48 -04:00
|
|
|
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
2022-09-08 11:55:08 -04:00
|
|
|
|
|
|
|
#ifndef MICROPY_PY_BUILTINS_COMPLEX
|
2022-06-21 11:32:48 -04:00
|
|
|
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
2022-09-08 11:55:08 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-09 20:22:13 -05:00
|
|
|
#ifndef MICROPY_PY_UTIME
|
|
|
|
#define MICROPY_PY_UTIME (1)
|
|
|
|
#endif
|
|
|
|
|
2022-09-08 11:55:08 -04:00
|
|
|
#ifndef MICROPY_PY_MATH
|
|
|
|
#define MICROPY_PY_MATH (1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MICROPY_PY_CMATH
|
2022-06-21 11:32:48 -04:00
|
|
|
#define MICROPY_PY_CMATH (0)
|
2022-09-08 11:55:08 -04:00
|
|
|
#endif
|
2022-06-06 05:13:25 -04:00
|
|
|
|
2023-02-14 04:02:22 -05:00
|
|
|
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (trng_random_u32(300))
|
|
|
|
unsigned long trng_random_u32(int delay);
|
2023-01-24 14:36:19 -05:00
|
|
|
|
2022-06-15 09:16:07 -04:00
|
|
|
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
|
|
|
|
|
2022-09-08 11:55:08 -04:00
|
|
|
#ifndef MICROPY_HW_UART_TXBUF
|
2022-06-15 09:16:07 -04:00
|
|
|
#define MICROPY_HW_UART_TXBUF (1)
|
2022-09-08 11:55:08 -04:00
|
|
|
#endif
|
2022-06-15 09:16:07 -04:00
|
|
|
|
2023-02-14 04:02:22 -05:00
|
|
|
#define MICROPY_PY_UOS_URANDOM (1)
|
2022-09-15 09:58:54 -04:00
|
|
|
|
2023-02-03 11:03:31 -05:00
|
|
|
#ifndef MICROPY_PY_MACHINE_PIN_BOARD_CPU
|
|
|
|
#define MICROPY_PY_MACHINE_PIN_BOARD_CPU (1)
|
|
|
|
#endif
|
|
|
|
|
2022-06-15 09:16:07 -04:00
|
|
|
#define CPU_FREQ (48000000)
|
2022-06-30 10:50:15 -04:00
|
|
|
#define DFLL48M_FREQ (48000000)
|
2023-01-24 12:37:27 -05:00
|
|
|
#define MAX_CPU_FREQ (54000000)
|
|
|
|
#define FDPLL_REF_FREQ (32768)
|
2022-06-15 09:16:07 -04:00
|
|
|
|
|
|
|
#define IRQ_PRI_PENDSV ((1 << __NVIC_PRIO_BITS) - 1)
|
2022-06-06 05:13:25 -04:00
|
|
|
|
|
|
|
static inline uint32_t raise_irq_pri(uint32_t pri) {
|
|
|
|
(void)pri;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void restore_irq_pri(uint32_t basepri) {
|
|
|
|
(void)basepri;
|
|
|
|
}
|