1c32cec7f1
The range is 1MHz - 48 MHz. Note that below 8 MHz there is no USB support. The frequency will be set to an integer fraction of 48 MHz. And after changing the frequency, the peripherals like PWM, UART, I2C, SPI have to be reconfigured. Current consumption e.g. of the Seeed Xiao board at 1 MHz is about 1.5 mA, mostly caused by the on-board LED (green LED with 1k resistor at 3.3V).
34 lines
1005 B
C
34 lines
1005 B
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)
|
|
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
|
#define MICROPY_PY_MATH (0)
|
|
#define MICROPY_PY_CMATH (0)
|
|
|
|
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
|
|
|
|
#define MICROPY_HW_UART_TXBUF (1)
|
|
|
|
#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;
|
|
}
|