circuitpython/ports/samd/mcu/samd21/mpconfigmcu.h
robert-hh fc9d66fac6 samd/machine_rtc: Add the machine.RTC class.
Methods implemented are:
- rtc.init(date)
- rtc.datetime([new_date])
- rtc.calibration(value)

The presence of this class can be controlled by MICROPY_PY_MACHINE_RTC.  If
the RTC module is used, the time module uses the RTC as well.

For boards without a 32kHz crystal, using RTC makes no sense, since it will
then use the ULP32K oscillator, which is not precise at all.  Therefore, it
will by default only be enabled for boards using a crystal, but can be
enabled in the respective mpconfigboard.h.
2022-10-25 23:20:09 +11:00

51 lines
1.2 KiB
C

// Deinitions common to all SAMD21 boards
#include "samd21.h"
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
// MicroPython emitters
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#ifndef MICROPY_PY_BUILTINS_COMPLEX
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#endif
#ifndef MICROPY_PY_MATH
#define MICROPY_PY_MATH (1)
#endif
#ifndef MICROPY_PY_CMATH
#define MICROPY_PY_CMATH (0)
#endif
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
#ifndef MICROPY_HW_UART_TXBUF
#define MICROPY_HW_UART_TXBUF (1)
#endif
#ifndef MICROPY_PY_MACHINE_RTC
#if MICROPY_HW_XOSC32K
#define MICROPY_PY_MACHINE_RTC (1)
#endif
#endif
#define CPU_FREQ (48000000)
#define DFLL48M_FREQ (48000000)
#define MAX_CPU_FREQ (48000000)
#define IRQ_PRI_PENDSV ((1 << __NVIC_PRIO_BITS) - 1)
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;
}