mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
Some checks failed
JavaScript code lint and formatting with Biome / eslint (push) Has been cancelled
Check code formatting / code-formatting (push) Has been cancelled
Check spelling with codespell / codespell (push) Has been cancelled
Build docs / build (push) Has been cancelled
Check examples / embedding (push) Has been cancelled
Package mpremote / build (push) Has been cancelled
.mpy file format and tools / test (push) Has been cancelled
Build ports metadata / build (push) Has been cancelled
alif port / build_alif (alif_ae3_build) (push) Has been cancelled
cc3200 port / build (push) Has been cancelled
esp32 port / build_idf (esp32_build_cmod_spiram_s2) (push) Has been cancelled
esp32 port / build_idf (esp32_build_s3_c3) (push) Has been cancelled
esp8266 port / build (push) Has been cancelled
mimxrt port / build (push) Has been cancelled
nrf port / build (push) Has been cancelled
powerpc port / build (push) Has been cancelled
qemu port / build_and_test_arm (push) Has been cancelled
qemu port / build_and_test_rv32 (push) Has been cancelled
renesas-ra port / build_renesas_ra_board (push) Has been cancelled
rp2 port / build (push) Has been cancelled
samd port / build (push) Has been cancelled
stm32 port / build_stm32 (stm32_misc_build) (push) Has been cancelled
stm32 port / build_stm32 (stm32_nucleo_build) (push) Has been cancelled
stm32 port / build_stm32 (stm32_pyb_build) (push) Has been cancelled
unix port / minimal (push) Has been cancelled
unix port / reproducible (push) Has been cancelled
unix port / standard (push) Has been cancelled
unix port / standard_v2 (push) Has been cancelled
unix port / coverage (push) Has been cancelled
unix port / coverage_32bit (push) Has been cancelled
unix port / nanbox (push) Has been cancelled
unix port / float (push) Has been cancelled
unix port / stackless_clang (push) Has been cancelled
unix port / float_clang (push) Has been cancelled
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This is a follow-up to 1e92bdd206 correcting
more of the instances where "Sparkfun" should be "SparkFun".
Signed-off-by: Damien George <damien@micropython.org>
97 lines
3.2 KiB
C
97 lines
3.2 KiB
C
// The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme.
|
|
// In cases where the 0th peripheral is the default, the "0" is omitted from
|
|
// the name (e.g. "I2C" instead of "I2C0").
|
|
//
|
|
// Note: UART (UART0) is not present in the edge connector pinout because the
|
|
// primary debug serial port is exposed as a virtual serial port over USB,
|
|
// i.e. Serial.print() should print over USB VCP, not UART_TX1.
|
|
//
|
|
// For more details, see https://www.sparkfun.com/micromod#tech-specs
|
|
|
|
#define MICROPY_HW_BOARD_NAME "SparkFun STM32 MicroMod Processor"
|
|
#define MICROPY_HW_MCU_NAME "STM32F405RG"
|
|
|
|
// 1 = use STM32 internal flash (1 MByte)
|
|
// 0 = use onboard external SPI flash (16 MByte)
|
|
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
|
|
|
|
#define MICROPY_HW_HAS_FLASH (1)
|
|
#define MICROPY_HW_ENABLE_RNG (1)
|
|
#define MICROPY_HW_ENABLE_RTC (1)
|
|
#define MICROPY_HW_ENABLE_DAC (1)
|
|
#define MICROPY_HW_ENABLE_USB (1)
|
|
|
|
// External SPI Flash config
|
|
#if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
|
|
|
|
// 128 Mbit (16 MByte) external SPI flash
|
|
#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)
|
|
|
|
#define MICROPY_HW_SPIFLASH_CS (pin_C3)
|
|
#define MICROPY_HW_SPIFLASH_SCK (pin_C10)
|
|
#define MICROPY_HW_SPIFLASH_MOSI (pin_C12)
|
|
#define MICROPY_HW_SPIFLASH_MISO (pin_C11)
|
|
|
|
#define MICROPY_BOARD_EARLY_INIT board_early_init
|
|
void board_early_init(void);
|
|
|
|
extern const struct _mp_spiflash_config_t spiflash_config;
|
|
extern struct _spi_bdev_t spi_bdev;
|
|
#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)
|
|
#define MICROPY_HW_BDEV_SPIFLASH (&spi_bdev)
|
|
#define MICROPY_HW_BDEV_SPIFLASH_CONFIG (&spiflash_config)
|
|
#define MICROPY_HW_BDEV_SPIFLASH_SIZE_BYTES (MICROPY_HW_SPIFLASH_SIZE_BITS / 8)
|
|
#define MICROPY_HW_BDEV_SPIFLASH_EXTENDED (&spi_bdev) // for extended block protocol
|
|
|
|
#endif // !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
|
|
|
|
// STM32 HSE config
|
|
// The module has a 12 MHz crystal for the HSE oscillator.
|
|
#define MICROPY_HW_CLK_PLLM (12)
|
|
#define MICROPY_HW_CLK_PLLN (336)
|
|
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
|
|
#define MICROPY_HW_CLK_PLLQ (7)
|
|
#define MICROPY_HW_CLK_LAST_FREQ (1)
|
|
|
|
// STM32 LSE config
|
|
// The module has a 32.768 kHz crystal for the LSE (RTC).
|
|
#define MICROPY_HW_RTC_USE_LSE (1)
|
|
#define MICROPY_HW_RTC_USE_US (0)
|
|
#define MICROPY_HW_RTC_USE_CALOUT (1)
|
|
|
|
// UART2 config (MicroMod UART1)
|
|
#define MICROPY_HW_UART2_NAME "UART1"
|
|
#define MICROPY_HW_UART2_TX (pin_A2)
|
|
#define MICROPY_HW_UART2_RX (pin_A3)
|
|
|
|
// CAN1 config (MicroMod CAN)
|
|
#define MICROPY_HW_CAN1_NAME "CAN"
|
|
#define MICROPY_HW_CAN1_TX (pin_B9)
|
|
#define MICROPY_HW_CAN1_RX (pin_B8)
|
|
|
|
// I2C1 config (MicroMod I2C1)
|
|
#define MICROPY_HW_I2C1_NAME "I2C1"
|
|
#define MICROPY_HW_I2C1_SCL (pin_B6)
|
|
#define MICROPY_HW_I2C1_SDA (pin_B7)
|
|
|
|
// I2C2 config (MicroMod I2C)
|
|
#define MICROPY_HW_I2C2_NAME "I2C"
|
|
#define MICROPY_HW_I2C2_SCL (pin_B10)
|
|
#define MICROPY_HW_I2C2_SDA (pin_B11)
|
|
|
|
// SPI1 config (MicroMod SPI)
|
|
#define MICROPY_HW_SPI1_NAME "SPI"
|
|
#define MICROPY_HW_SPI1_NSS (pin_C4)
|
|
#define MICROPY_HW_SPI1_SCK (pin_A5)
|
|
#define MICROPY_HW_SPI1_MISO (pin_A6)
|
|
#define MICROPY_HW_SPI1_MOSI (pin_A7)
|
|
|
|
// LED1 config
|
|
// The module has a single blue status LED.
|
|
#define MICROPY_HW_LED1 (pin_A15)
|
|
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
|
|
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
|
|
|
|
// USB device config
|
|
#define MICROPY_HW_USB_FS (1)
|