Clone
2
macros_micropy
Jos Verlinde edited this page 2026-02-07 12:06:45 +00:00

This documentation is part of the MicroPython project, http://micropython.org/

These MICROPY_* macros have been scanned from the source code in the MicroPython repository. The descriptions for each macro have been generated based on the surrounding code context using the OpenAI o3-mini model.

You are invited to correct any inaccuracy or misinterpretatie you find by editing this page directly.

MICROPY_ALLOC

This configuration set controls various aspects of memory allocation related to parsing, garbage collection, and string management in MicroPython. It optimizes memory usage by defining initial sizes and increment values for different data structures, ensuring efficient handling of resources during program execution.

Macro Description Sample value(s)
MICROPY_ALLOC_GC_STACK_SIZE Sets the size of the garbage collector stack to manage memory allocation efficiently. (1024) // Avoid slowdown when GC stack overflow causes a full sweep of PSRAM-backed heap
MICROPY_ALLOC_LEXEL_INDENT_INC Defines the increment size for allocating additional lexer indentation levels. (8)
MICROPY_ALLOC_LEXER_INDENT_INIT Initial allocation size for lexer indentation levels. (10)
MICROPY_ALLOC_PARSE_CHUNK_INIT Initial byte allocation for parse node chunks to minimize fragmentation. (16)
MICROPY_ALLOC_PARSE_INTERN_STRING_LEN Maximum length of strings to be interned by the parser. (10)
MICROPY_ALLOC_PARSE_RESULT_INC Defines the increment size for the parse result stack. (16)
MICROPY_ALLOC_PARSE_RESULT_INIT Initial allocation size for the parse result stack. (32)
MICROPY_ALLOC_PARSE_RULE_INC Defines the increment size for the parse rule stack allocation. (16)
MICROPY_ALLOC_PARSE_RULE_INIT Initial allocation size for the parse rule stack. (64)
MICROPY_ALLOC_PATH_MAX Defines the maximum length of a path in the filesystem. (128)
MICROPY_ALLOC_QSTR_CHUNK_INIT Initial byte allocation for chunks storing interned string data, affecting memory usage. (64)
MICROPY_ALLOC_QSTR_ENTRIES_INIT Initial count of entries for the qstr pool, influencing dynamic allocation size. (10)
MICROPY_ALLOC_SCOPE_ID_INC Increment value for allocating memory for scope IDs. (6)
MICROPY_ALLOC_SCOPE_ID_INIT Initial allocation size for identifiers in a scope. (4)

MICROPY_BOARD

This configuration group manages board-specific functionalities and behaviors during various operational states, including initialization, power management, and reset processes. It provides macros for handling low-power modes, executing startup scripts, and interfacing with peripherals like Bluetooth and SD cards, ensuring tailored performance for different hardware setups.

Macro Description Sample value(s)
MICROPY_BOARD_BEFORE_SOFT_RESET_LOOP Calls the function boardctrl_before_soft_reset_loop before executing a soft reset. boardctrl_before_soft_reset_loop
MICROPY_BOARD_BT_HCI_POLL_IN_MS Defines the timeout for polling Bluetooth HCI in milliseconds. mp_bluetooth_hci_poll_in_ms_default
MICROPY_BOARD_BT_HCI_POLL_NOW Calls the default function to poll Bluetooth HCI immediately. mp_bluetooth_hci_poll_now_default
MICROPY_BOARD_BUILD Indicates whether the board build is defined as 1 or 0. (1)
MICROPY_BOARD_DEINIT Function called to deinitialize the board. NANO33_board_deinit
MICROPY_BOARD_EARLY_INIT Invoked for early initialization of board-specific settings, particularly for SPI flash chip parameters. board_early_init_sf6
MICROPY_BOARD_END_SOFT_RESET Calls the board-specific function to execute at the end of a soft reset. boardctrl_end_soft_reset
MICROPY_BOARD_ENTER_BOOTLOADER Calls the board-specific function to enter the bootloader mode. board_enter_bootloader
MICROPY_BOARD_ENTER_STANDBY Triggers the board to enter a low-power standby mode. PORTENTA_board_low_power(2);
MICROPY_BOARD_ENTER_STOP Triggers low power mode on the board. PORTENTA_board_low_power(1);
MICROPY_BOARD_EXIT_STANDBY Calls the board_exit_standby function to exit standby mode. board_exit_standby
MICROPY_BOARD_FATAL_ERROR Triggers a fatal error handling function, typically leading to a system halt. boardctrl_fatal_error
MICROPY_BOARD_LEAVE_STANDBY Calls the board_leave_standby function during the boot process. board_leave_standby()
MICROPY_BOARD_LEAVE_STOP Calls the low power function with mode 0 to exit stop mode. PORTENTA_board_low_power(0);
MICROPY_BOARD_NETWORK_INTERFACES Indicates the presence of network interfaces for the board. -
MICROPY_BOARD_PENDSV_ENTRIES Holds additional entries for use with pendsv_schedule_dispatch. -
MICROPY_BOARD_POST_STOP Enables the board oscillator after exiting STOP mode. PORTENTA_board_osc_enable(1);
MICROPY_BOARD_PRE_STOP Calls the board-specific function to disable the oscillator before entering low power mode. PORTENTA_board_osc_enable(0);
MICROPY_BOARD_ROOT_POINTERS Defines pointers to board-specific root objects for I2S functionality. \
MICROPY_BOARD_RUN_BOOT_PY Calls the function to execute boot.py during the initialization process. boardctrl_run_boot_py
MICROPY_BOARD_RUN_MAIN_PY Calls the function to execute main.py during board initialization. boardctrl_run_main_py
MICROPY_BOARD_SDCARD_POWER Activates the SD card power by setting a specific pin high. mp_hal_pin_high(pyb_pin_EN_3V3);
MICROPY_BOARD_SPIFLASH_CHIP_PARAMS0 Reference to the SPI flash chip parameters for external SPI flash #1. (spi_bdev.spiflash.chip_params) // SPI flash #1, R/W storage
MICROPY_BOARD_SPIFLASH_CHIP_PARAMS1 References the chip parameters for the second SPI flash device. (spi_bdev2.spiflash.chip_params) // SPI flash #2, memory mapped
MICROPY_BOARD_STARTUP Invokes board-specific initialization code at startup. board_init
MICROPY_BOARD_START_SOFT_RESET Triggers the board-specific soft reset function. boardctrl_start_soft_reset
MICROPY_BOARD_TOP_SOFT_RESET_LOOP Calls the top-level soft reset loop function for the board. boardctrl_top_soft_reset_loop
MICROPY_BOARD_USBD_CDC_RX_EVENT Callback invoked when USBD CDC data is available. usbd_cdc_rx_event_callback

MICROPY_COMP

This configuration set controls various optimization features in the MicroPython compiler, focusing on constant expressions and tuple assignments. It enhances performance by allowing compile-time evaluations and optimizations for different types of constants and expressions, thereby improving the efficiency of the generated bytecode.

Macro Description Sample value(s)
MICROPY_COMP_ALLOW_TOP_LEVEL_AWAIT Controls the allowance of top-level await expressions in the compiler. (0)
MICROPY_COMP_CONST Enables constant optimization for expressions using the 'const' keyword. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_COMP_CONST_FLOAT Enables float constant folding and optimization features based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_COMP_CONST_FOLDING Enables constant folding optimizations during compilation. (1)
MICROPY_COMP_CONST_LITERAL Enables optimizations for constant literals like OrderedDict. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_COMP_CONST_TUPLE Enables immediate compilation of constant tuples to their respective objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_COMP_DOUBLE_TUPLE_ASSIGN Enables optimization for double tuple assignments like a, b = c, d. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_COMP_MODULE_CONST Enables lookup of constants in modules, allowing expressions like module.CONST. (0)
MICROPY_COMP_RETURN_IF_EXPR Enables optimization for returning an if-expression, reducing bytecode size. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_COMP_TRIPLE_TUPLE_ASSIGN Enables optimization for triple tuple assignments in the compiler. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_CONFIG

This configuration group manages the feature set of the MicroPython build by defining various ROM levels, allowing developers to tailor the build according to the available memory and specific application requirements. It provides options ranging from minimal configurations to full-featured builds, enabling or disabling features based on the selected ROM level.

Macro Description Sample value(s)
MICROPY_CONFIG_ROM_LEVEL Sets the configuration level for ROM features, controlling which optional features are included. (MICROPY_CONFIG_ROM_LEVEL_MINIMUM)
MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_BASIC_FEATURES Checks if the ROM level is at least BASIC_FEATURES for feature availability. (MICROPY_CONFIG_ROM_LEVEL >= MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES)
MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES Checks if the ROM level is at least the core features level. (MICROPY_CONFIG_ROM_LEVEL >= MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING Checks if the ROM level is at least 'everything' for enabling certain features. (MICROPY_CONFIG_ROM_LEVEL >= MICROPY_CONFIG_ROM_LEVEL_EVERYTHING)
MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES Checks if the ROM level meets or exceeds the extra features level. (MICROPY_CONFIG_ROM_LEVEL >= MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_FULL_FEATURES Checks if the ROM level is at least 'full features' for conditional compilation. (MICROPY_CONFIG_ROM_LEVEL >= MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES)
MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES Enables most common features suitable for small on-device flash, like STM32F411. (20)
MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES Enables only core features for constrained flash environments. (10)
MICROPY_CONFIG_ROM_LEVEL_EVERYTHING Enables all features, including coverage for testing. (50)
MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES Enables convenience features for medium on-device flash, suitable for devices like STM32F405. (30)
MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES Enables all common features for larger or external flash systems. (40)
MICROPY_CONFIG_ROM_LEVEL_MINIMUM Enables a minimal configuration by disabling all optional features. (0)

MICROPY_DEBUG

This configuration group controls various debugging features that enhance the development and troubleshooting experience. It enables detailed output for debugging purposes, including memory checks, verbose logging, and specific object sentinel debugging, allowing developers to identify and resolve issues more effectively.

Macro Description Sample value(s)
MICROPY_DEBUG_MP_OBJ_SENTINELS Enables unique debugging versions of MP_OBJ_NULL, MP_OBJ_STOP_ITERATION, and MP_OBJ_SENTINEL. (0)
MICROPY_DEBUG_PARSE_RULE_NAME Enables printing of parse rule names instead of integers in parse node output. (1)
MICROPY_DEBUG_PRINTER Defines the printer used for debugging output, typically set to stderr. (&mp_stderr_print)
MICROPY_DEBUG_PRINTERS Enables functions that print debugging information for bytecode and parsing. (0)
MICROPY_DEBUG_VALGRIND Enables additional instrumentation for memory checking with Valgrind. (0)
MICROPY_DEBUG_VERBOSE Enables verbose debugging output across various modules. (0)
MICROPY_DEBUG_VM_STACK_OVERFLOW Enables a check for VM stack overflow by adding an extra slot in the stack. (0)

MICROPY_EMIT

This configuration set controls the emission of various types of native code and inline assembly for different architectures in MicroPython. It allows developers to enable or disable specific code generation features, including support for ARM, RISC-V, Xtensa, and x86 architectures, as well as debugging options for native code.

Macro Description Sample value(s)
MICROPY_EMIT_ARM Enables the emission of ARM native code. (1)
MICROPY_EMIT_BYTECODE_USES_QSTR_TABLE Enables the use of a qstr table for mapping internal qstr indices in bytecode to global qstr values. (MICROPY_PERSISTENT_CODE)
MICROPY_EMIT_INLINE_ASM Indicates if any inline assembler emitter is enabled, based on specific architecture flags. (MICROPY_EMIT_INLINE_THUMB || MICROPY_EMIT_INLINE_XTENSA || MICROPY_EMIT_INLINE_RV32)
MICROPY_EMIT_INLINE_RV32 Enables the RISC-V RV32 inline assembler for code generation. (1)
MICROPY_EMIT_INLINE_THUMB Enables the use of inline assembly for Thumb architecture. (SAMD21_EXTRA_FEATURES)
MICROPY_EMIT_INLINE_THUMB_FLOAT Enables float support in the Thumb2 inline assembler. (1)
MICROPY_EMIT_INLINE_XTENSA Enables the use of inline assembly for the Xtensa architecture. (1)
MICROPY_EMIT_INLINE_XTENSA_UNCOMMON_OPCODES Enables support for uncommon Xtensa inline assembler opcodes. (0)
MICROPY_EMIT_MACHINE_CODE Indicates if either native code or inline assembler emitter is enabled. (MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM)
MICROPY_EMIT_NATIVE Indicates if any native emitter is enabled, allowing for native code generation options. (MICROPY_EMIT_X64 || MICROPY_EMIT_X86 || MICROPY_EMIT_THUMB || MICROPY_EMIT_ARM || MICROPY_EMIT_XTENSA || MICROPY_EMIT_XTENSAWIN || MICROPY_EMIT_RV32 || MICROPY_EMIT_NATIVE_DEBUG)
MICROPY_EMIT_NATIVE_DEBUG Enables the human-readable native instructions emitter for debugging purposes. (1)
MICROPY_EMIT_NATIVE_DEBUG_PRINTER Defines the output function for native debug printing. (&mp_stdout_print)
MICROPY_EMIT_NATIVE_PRELUDE_SEPARATE_FROM_MACHINE_CODE Separates the prelude of a native function from machine code for architectures that cannot read executable memory byte-wise. (MICROPY_EMIT_XTENSAWIN)
MICROPY_EMIT_RV32 Enables the emission of RISC-V RV32 native code. (1)
MICROPY_EMIT_RV32_ZBA Enables emission of RISC-V RV32 Zba opcodes in native code. (0)
MICROPY_EMIT_RV32_ZCMP Controls emission of RISC-V RV32 Zcmp opcodes in native code. (0)
MICROPY_EMIT_THUMB Enables the generation of Thumb native code for supported architectures. (0)
MICROPY_EMIT_THUMB_ARMV7M Enables ARMv7-M instruction support in thumb native code. (1)
MICROPY_EMIT_X64 Enables the x64 native code emitter. (1)
MICROPY_EMIT_X86 Disables x86 native code emission when nan-boxing is enabled. (0)
MICROPY_EMIT_XTENSA Enables the emission of Xtensa native code. (1)
MICROPY_EMIT_XTENSAWIN Enables the emission of Xtensa-Windowed native code. (1)

MICROPY_ENABLE

The MICROPY_ENABLE macros configure various features and functionalities of the MicroPython environment, allowing developers to enable or disable components such as the compiler, garbage collection, and runtime features. This customization helps optimize memory usage and performance based on specific application requirements.

Macro Description Sample value(s)
MICROPY_ENABLE_COMPILER Enables the built-in MicroPython compiler for executing scripts and REPL prompt; set to 0 to disable. (1)
MICROPY_ENABLE_DOC_STRING Controls inclusion of doc strings, affecting RAM usage. (0)
MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF Enables a buffer for storing exception details during low-memory conditions. (1)
MICROPY_ENABLE_EXTERNAL_IMPORT Enables importing of external modules from the filesystem. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_ENABLE_FINALISER Enables the finalizer feature for garbage collection, allowing cleanup of objects before they are freed. (1)
MICROPY_ENABLE_GC Enables the garbage collector for memory management. (1)
MICROPY_ENABLE_NATIVE_CODE Indicates whether native code generation or loading is enabled. (MICROPY_EMIT_NATIVE || MICROPY_PERSISTENT_CODE_LOAD_NATIVE)
MICROPY_ENABLE_PYSTACK Enables a separate allocator for the Python stack, requiring initialization with mp_pystack_init. (0)
MICROPY_ENABLE_RUNTIME Controls the inclusion of runtime features, set to 0 to disable. (0)
MICROPY_ENABLE_SCHEDULER Enables the internal scheduler for managing asynchronous tasks and callbacks. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_ENABLE_SOURCE_LINE Includes source line number information in bytecode, increasing RAM usage. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_ENABLE_VM_ABORT Enables support for asynchronously aborting the virtual machine execution. (0)

MICROPY_ERROR

This configuration group manages the error reporting and output mechanisms in MicroPython, allowing developers to customize how errors and warnings are displayed. It provides options for varying levels of detail in error messages, from terse summaries to detailed reports, and specifies the output stream for these messages.

Macro Description Sample value(s)
MICROPY_ERROR_PRINTER Output stream for printing errors and warnings. (&mp_stderr_print)
MICROPY_ERROR_REPORTING Controls the level of detail in error messages and warnings. (MICROPY_ERROR_REPORTING_DETAILED)
MICROPY_ERROR_REPORTING_DETAILED Enables detailed exception messages with full information, including object names. (3)
MICROPY_ERROR_REPORTING_NONE Removes exception messages, requiring MICROPY_ROM_TEXT_COMPRESSION to be disabled. (0)
MICROPY_ERROR_REPORTING_NORMAL Enables basic error details in exception messages. (2)
MICROPY_ERROR_REPORTING_TERSE Enables short static strings for exception messages. (1)

MICROPY_FATFS

This configuration group manages various aspects of FAT filesystem support, including options for long file names, partitioning, and synchronization. It allows customization of file system behavior, such as enabling exFAT support, setting maximum file name lengths, and defining timeout durations for operations.

Macro Description Sample value(s)
MICROPY_FATFS_ENABLE_LFN Controls the use of long file names in FAT filesystem support. (2)
MICROPY_FATFS_EXFAT Enables support for the exFAT filesystem. (1)
MICROPY_FATFS_LFN_CODE_PAGE Sets the OEM code page for long file names in FATFS, defaulting to 437 for U.S. (OEM). Examples: 437 for U.S., 850 for Western Europe. 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
MICROPY_FATFS_MAX_LFN Sets the maximum length for long file names in the FAT filesystem. (MICROPY_ALLOC_PATH_MAX)
MICROPY_FATFS_MAX_SS Determines the maximum sector size for FatFS, typically set to the flash sector size. (MICROPY_HW_FLASH_BLOCK_SIZE_BYTES)
MICROPY_FATFS_MULTI_PARTITION Enables support for multiple partitions in the FAT filesystem. (1)
MICROPY_FATFS_NORTC Enables non-RTC support for the FAT filesystem. (1)
MICROPY_FATFS_REENTRANT Enables re-entrant file system operations for FATFS. (1)
MICROPY_FATFS_RPATH Sets the relative path depth for FatFS support. (2)
MICROPY_FATFS_SYNC_T Defines the type for synchronization objects used in the FatFs module. SemaphoreHandle_t
MICROPY_FATFS_TIMEOUT Sets the timeout duration for FATFS operations in milliseconds. (2500)
MICROPY_FATFS_USE_LABEL Enables the use of volume labels in the FatFS file system. (1)

MICROPY_FLOAT

This configuration set controls the implementation and representation of floating-point numbers in MicroPython, allowing developers to choose between various precision levels and formats. It also includes options for enabling or disabling floating-point support, optimizing for code size, and enhancing the quality of hash functions for float and complex numbers.

Macro Description Sample value(s)
MICROPY_FLOAT_FORMAT_IMPL Determines the floating-point format implementation level, affecting precision and code size. (MICROPY_FLOAT_FORMAT_IMPL_APPROX)
MICROPY_FLOAT_FORMAT_IMPL_APPROX Enables an approximate floating-point representation with slightly larger size. (1) // slightly bigger, almost perfect
MICROPY_FLOAT_FORMAT_IMPL_BASIC Enables the smallest code size for float to string conversion, resulting in inexact representations. (0) // smallest code, but inexact
MICROPY_FLOAT_FORMAT_IMPL_EXACT Enables exact floating-point representation with larger code size. (2) // bigger code, and 100% exact repr
MICROPY_FLOAT_HIGH_QUALITY_HASH Enables a high-quality hash function for float and complex numbers. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_FLOAT_IMPL Determines the floating-point implementation type, either single or double precision. (MICROPY_FLOAT_IMPL_DOUBLE)
MICROPY_FLOAT_IMPL_DOUBLE Enables the use of double precision floating-point representation. (2)
MICROPY_FLOAT_IMPL_FLOAT Enables single-precision floating point support using float type. (1)
MICROPY_FLOAT_IMPL_NONE Disables floating point and complex number support. (0)
MICROPY_FLOAT_USE_NATIVE_FLT16 Enables the use of native _Float16 for 16-bit float support if available. (1)
MICROPY_FLOAT_ZERO Represents the float value zero as a constant. MICROPY_FLOAT_CONST(0.0)

MICROPY_GC

This configuration set manages various aspects of garbage collection, including memory allocation thresholds, initial heap size, and memory safety features. It allows for customization of heap management strategies, such as split heaps and automatic adjustments based on allocation needs, ensuring efficient memory usage and preventing memory-related issues.

Macro Description Sample value(s)
MICROPY_GC_ALLOC_THRESHOLD Controls automatic garbage collection based on memory allocation thresholds. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_GC_CONSERVATIVE_CLEAR Enables zeroing of newly allocated memory blocks to prevent stray pointers. (MICROPY_ENABLE_GC)
MICROPY_GC_INITIAL_HEAP_SIZE Initial heap size for garbage collection, set to 56 KB for ESP32 targets. (56 * 1024)
MICROPY_GC_SPLIT_HEAP Enables testing of a split garbage collection heap. (1)
MICROPY_GC_SPLIT_HEAP_AUTO Enables automatic management of heap areas based on allocation needs. (0)
MICROPY_GC_SPLIT_HEAP_N_HEAPS Determines the number of heaps for garbage collection when split heap is enabled. (1)
MICROPY_GC_STACK_ENTRY_TYPE Defines the C-type for entries in the garbage collector stack, affecting memory allocation policies. uint16_t

MICROPY_HW

This configuration set controls various hardware parameters and functionalities, including ADC channels, analog switches, block device settings, and Bluetooth communication settings. It allows for customization of hardware features such as antenna diversity, flash memory management, and UART configurations, enabling tailored performance for specific applications.

MICROPY_HW_ADC

This configuration set controls the parameters related to the Analog-to-Digital Converter (ADC) hardware, including the count of available external and basic ADC channels, as well as the reference voltage used for conversions. It ensures that the ADC functionality is tailored to the specific hardware capabilities.

Macro Description Sample value(s)
MICROPY_HW_ADC_EXT_COUNT Determines the number of external ADC channels available. (4)
MICROPY_HW_ADC_NUM_CHANNELS Number of basic ADC channels available on the connector. (16) // GPIO_AD domain pins
MICROPY_HW_ADC_VREF Defines the ADC reference voltage value for the hardware. (2)

MICROPY_HW_ANALOG

This configuration set manages the states of various analog switches associated with specific pins on the hardware. It allows for the control of analog signal routing by enabling or disabling connections for designated pins, facilitating the proper functioning of connected peripherals.

Macro Description Sample value(s)
MICROPY_HW_ANALOG_SWITCH_PA0 Configures the analog switch for pin PA0 to be open. (SYSCFG_SWITCH_PA0_OPEN)
MICROPY_HW_ANALOG_SWITCH_PA1 Configures the analog switch for pin PA1 as open. (SYSCFG_SWITCH_PA1_OPEN)
MICROPY_HW_ANALOG_SWITCH_PC2 Configures the analog switch for pin PC2, connected to ULPI NXT and DIR pins. (SYSCFG_SWITCH_PC2_CLOSE)
MICROPY_HW_ANALOG_SWITCH_PC3 Configures the state of the analog switch for pin PC3. (SYSCFG_SWITCH_PC3_CLOSE)

MICROPY_HW_ANTENNA

Macro Description Sample value(s)
MICROPY_HW_ANTENNA_DIVERSITY Enables antenna diversity functionality for the hardware. (0)

MICROPY_HW_BDEV

This configuration set manages the block device operations for internal flash storage and external SPI flash in MicroPython. It defines parameters such as block size, I/O operations, and function pointers for reading and writing blocks, enabling efficient data handling and storage management.

Macro Description Sample value(s)
MICROPY_HW_BDEV_BLOCKSIZE_EXT Defines the block size for extended block protocol on internal flash storage. (FLASH_BLOCK_SIZE)
MICROPY_HW_BDEV_IOCTL Calls the block device I/O control function for internal flash storage. flash_bdev_ioctl
MICROPY_HW_BDEV_READBLOCK Function pointer for reading a block from the flash block device. flash_bdev_readblock
MICROPY_HW_BDEV_SPIFLASH Pointer to the SPI block device configuration. (&spi_bdev)
MICROPY_HW_BDEV_SPIFLASH_CONFIG Pointer to the SPI flash configuration structure. (&spiflash_config)
MICROPY_HW_BDEV_SPIFLASH_EXTENDED Enables the use of an external SPI flash with an extended block protocol. (&spi_bdev) // for extended block protocol
MICROPY_HW_BDEV_SPIFLASH_OFFSET_BLOCKS Calculates the number of flash blocks offset based on the byte offset divided by the block size. (MICROPY_HW_BDEV_SPIFLASH_OFFSET_BYTES / FLASH_BLOCK_SIZE)
MICROPY_HW_BDEV_SPIFLASH_OFFSET_BYTES Defines the byte offset for the SPI flash block device. (4 * 1024 * 1024)
MICROPY_HW_BDEV_SPIFLASH_SIZE_BYTES Calculates the size in bytes of the SPI flash based on the logarithmic size in bits. ((1 << MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2) / 8)
MICROPY_HW_BDEV_WRITEBLOCK Defines the function used for writing a block to the block device. flash_bdev_writeblock

MICROPY_HW_BLE

This configuration group manages the settings and parameters for Bluetooth Low Energy (BLE) communication, specifically focusing on the UART interface. It includes definitions for baud rates, flow control, and pin assignments necessary for establishing and maintaining Bluetooth connectivity.

Macro Description Sample value(s)
MICROPY_HW_BLE_BTSTACK_CHIPSET_INSTANCE Defines the Bluetooth chipset instance for the BTstack HCI. btstack_chipset_cc256x_instance()
MICROPY_HW_BLE_UART_BAUDRATE Defines the baud rate for the Bluetooth UART communication, commonly set to 115200 or 1000000. (1000000)
MICROPY_HW_BLE_UART_BAUDRATE_DOWNLOAD_FIRMWARE Sets the baud rate for Bluetooth UART during firmware download, typically at 3000000 bps. (3000000)
MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY Defines the secondary baud rate for Bluetooth UART communication, set to 3000000. (3000000)
MICROPY_HW_BLE_UART_FLOW_CONTROL Configures the flow control setting for BLE UART communication. (3)
MICROPY_HW_BLE_UART_ID Identifies the UART interface used for Bluetooth communication. (1)
MICROPY_HW_BLE_UART_RTS Defines the RTS pin for the Bluetooth UART interface. (MICROPY_HW_UART8_RTS)
MICROPY_HW_BLE_UART_RX Defines the RX pin number for the BLE UART interface. (7)
MICROPY_HW_BLE_UART_TX Defines the UART transmit pin number for Bluetooth communication. (4)

MICROPY_HW_BOARD

Macro Description Sample value(s)
MICROPY_HW_BOARD_NAME Identifies the hardware board name being used. "F769DISC"

MICROPY_HW_BOOTSEL

Macro Description Sample value(s)
MICROPY_HW_BOOTSEL_DELAY_US Defines the delay duration in microseconds for the BOOTSEL mode. 8

MICROPY_HW_CAN

This configuration group manages the setup of multiple CAN bus interfaces, including their names and the specific GPIO pins used for transmitting and receiving data. It allows for flexible hardware configuration to support various communication needs across different CAN buses.

Macro Description Sample value(s)
MICROPY_HW_CAN1_NAME Defines the name of the first CAN bus, typically used for configuration. "FDCAN1"
MICROPY_HW_CAN1_RX Defines the receive pin for CAN1 communication, typically assigned to pin B8. (pin_B8) // pin 3 on CN10
MICROPY_HW_CAN1_TX Defines the transmit pin for CAN1 bus. (pin_B9) // pin 5 on CN10
MICROPY_HW_CAN2_NAME Identifies the second CAN bus name for hardware configuration. "Y"
MICROPY_HW_CAN2_RX Defines the receive pin for CAN2 communication, typically assigned to a specific GPIO pin. (pin_B5) // pin 29 on CN10
MICROPY_HW_CAN2_TX Defines the transmit pin for CAN2 communication. (pin_B6) // pin 17 on CN10
MICROPY_HW_CAN3_RX Defines the receive pin for CAN3, shared with UART1 or I2C3. (pin_B3) // shared with UART1 or use pin_A8 shared with I2C3
MICROPY_HW_CAN3_TX Defines the transmit pin for CAN3 communication. (pin_B4)

MICROPY_HW_CLK

This configuration group manages the clock settings for various buses and PLLs, allowing for precise control over the system's clock frequencies and dividers. It enables the adjustment of clock parameters such as division factors and PLL configurations to optimize performance and power consumption in embedded applications.

Macro Description Sample value(s)
MICROPY_HW_CLK_AHB_DIV Defines the AHB bus clock divider value. (RCC_HCLK_DIV2)
MICROPY_HW_CLK_APB1_DIV Defines the clock divider for the APB1 bus. (RCC_APB1_DIV2)
MICROPY_HW_CLK_APB2_DIV Defines the clock divider for the APB2 bus. (RCC_APB2_DIV2)
MICROPY_HW_CLK_APB3_DIV Defines the clock divider for the APB3 bus. (RCC_APB3_DIV2)
MICROPY_HW_CLK_APB4_DIV Defines the clock divider for the APB4 bus. (RCC_APB4_DIV2)
MICROPY_HW_CLK_LAST_FREQ Enables saving the last clock frequency settings for reconfiguration after a hard reset. (1)
MICROPY_HW_CLK_PLL2FRAC Fractional part of the PLL2 configuration, set to 0. (0)
MICROPY_HW_CLK_PLL2M Sets the PLL2M value for configuring the PLL2 clock at 200MHz for FMC and QSPI. (4)
MICROPY_HW_CLK_PLL2N Sets the PLL2 N value for clock configuration. (100)
MICROPY_HW_CLK_PLL2P Sets the division factor for PLL2 output clock. (2)
MICROPY_HW_CLK_PLL2Q Sets the division factor for PLL2 output clock. (2)
MICROPY_HW_CLK_PLL2R Sets the division factor for PLL2 output clock. (2)
MICROPY_HW_CLK_PLL2VCI Defines the range for PLL2 VCI clock configuration. (RCC_PLL2VCIRANGE_2)
MICROPY_HW_CLK_PLL2VCO Defines the VCO selection for PLL2 as RCC_PLL2VCOWIDE. (RCC_PLL2VCOWIDE)
MICROPY_HW_CLK_PLL3FRAC Fractional part of the PLL3 configuration, set to 0. (0)
MICROPY_HW_CLK_PLL3M Sets the division factor M for PLL3, affecting the output frequency. (8)
MICROPY_HW_CLK_PLL3N Sets the N value for PLL3 configuration, affecting the output frequency. (160)
MICROPY_HW_CLK_PLL3P Sets the P divider value for PLL3 configuration. (17)
MICROPY_HW_CLK_PLL3Q Sets the division factor for the PLL3 output clock Q. (20)
MICROPY_HW_CLK_PLL3R Sets the division factor R for PLL3 clock configuration. (2)
MICROPY_HW_CLK_PLL3VCI Sets the PLL3 voltage range configuration. (RCC_PLL3VCIRANGE_2)
MICROPY_HW_CLK_PLL3VCI_LL Defines the input range for PLL3 VCO as LL_RCC_PLLINPUTRANGE_1_2. (LL_RCC_PLLINPUTRANGE_1_2)
MICROPY_HW_CLK_PLL3VCO Defines the VCO selection for PLL3 clock configuration, set to RCC_PLL3VCOWIDE. (RCC_PLL3VCOWIDE)
MICROPY_HW_CLK_PLL3VCO_LL Sets the VCO output range for PLL3 to medium. (LL_RCC_PLLVCORANGE_MEDIUM)
MICROPY_HW_CLK_PLLDIV Sets the PLL division factor for clock configuration. (RCC_CFGR_PLLDIV3)
MICROPY_HW_CLK_PLLFRAC Configures the fractional part of the PLL frequency. (0)
MICROPY_HW_CLK_PLLM Sets the PLLM value for clock configuration, affecting system clock frequency. (25)
MICROPY_HW_CLK_PLLMUL Determines the PLL multiplication factor for clock configuration. (RCC_CFGR_PLLMUL12)
MICROPY_HW_CLK_PLLN Sets the N value for the PLL configuration to achieve the desired CPU frequency. (192)
MICROPY_HW_CLK_PLLP Divides the PLL clock to obtain the core clock frequency. (RCC_PLLP_DIV2) // divide PLL clock by this to get core clock
MICROPY_HW_CLK_PLLP1 Sets the division factor for PLL1 output clock. (1)
MICROPY_HW_CLK_PLLP2 Sets the division factor for the PLL output clock. (1)
MICROPY_HW_CLK_PLLQ Divides the core clock to achieve a 48MHz output frequency. (7) // divide core clock by this to get 48MHz
MICROPY_HW_CLK_PLLR Sets the division factor for the PLLR output clock. (RCC_PLLR_DIV2)
MICROPY_HW_CLK_PLLVCI Defines the PLL VCI range for clock configuration. (RCC_PLL1VCIRANGE_2)
MICROPY_HW_CLK_PLLVCI_LL Defines the input range for the PLL VCO as 4-8 MHz. (LL_RCC_PLLINPUTRANGE_4_8)
MICROPY_HW_CLK_PLLVCO Determines the VCO (Voltage Controlled Oscillator) range for the PLL configuration. (RCC_PLL1VCOWIDE)
MICROPY_HW_CLK_PLLVCO_LL Defines the VCO output range for the PLL as wide. (LL_RCC_PLLVCORANGE_WIDE)
MICROPY_HW_CLK_USE_BYPASS Enables bypass mode for the HSE clock, using an external 8MHz signal instead of a crystal. (1)
MICROPY_HW_CLK_USE_HSE Enables the use of an external 32MHz TCXO with PLL as the system clock source. (1)
MICROPY_HW_CLK_USE_HSI Enables the use of the internal high-speed oscillator (HSI) as the clock source. (1)
MICROPY_HW_CLK_USE_HSI48 Enables the use of the internal 48MHz oscillator for the system clock. (1) // internal 48MHz.
MICROPY_HW_CLK_VALUE Defines the clock source value, using HSE as the clock source. (HSE_VALUE)

MICROPY_HW_DAC

Macro Description Sample value(s)
MICROPY_HW_DAC0 Defines the pin used for DAC0 functionality, assigned to pin P014 (A4). Examples: DAC0 on VK_RA6M5 and ARDUINO_PORTENTA_C33 boards. (pin_P014) // A4
MICROPY_HW_DAC1 Defines the pin used for DAC1 functionality, specifically pin P015 (A5). Examples: DAC1 output configuration, DAC1 initialization. (pin_P015) // A5

MICROPY_HW_DEFAULT

This configuration group sets the default identifiers for various hardware communication protocols, including I2C, SPI, and UART. By defining these default IDs, it streamlines the setup process for hardware interactions, ensuring that the appropriate communication interfaces are readily available for use.

Macro Description Sample value(s)
MICROPY_HW_DEFAULT_I2C_ID Sets the default I2C bus ID, with a default value of -1 indicating no default. (-1)
MICROPY_HW_DEFAULT_SPI_ID Identifies the default SPI bus ID, with a default value of -1 indicating no default. (-1)
MICROPY_HW_DEFAULT_UART_ID Defines the default UART ID for hardware configurations, defaulting to -1 if not set. (-1)

MICROPY_HW_DFLL

Macro Description Sample value(s)
MICROPY_HW_DFLL_USB_SYNC Enables synchronization of the DFLL48M oscillator with the USB 1 kHz sync signal. (1)

MICROPY_HW_DMA

Macro Description Sample value(s)
MICROPY_HW_DMA_ENABLE_AUTO_TURN_OFF Enables automatic turn-off of the DMA after a period of inactivity. (1)

MICROPY_HW_EEPROM

Macro Description Sample value(s)
MICROPY_HW_EEPROM_ADDR I2C address for the onboard EEPROM. (0x50)
MICROPY_HW_EEPROM_I2C_BUS Indicates the I2C bus number for the onboard EEPROM. (0) // On LPI2C1 (SoM)

MICROPY_HW_ENABLE

This configuration group manages the enabling and availability of various hardware peripherals and GPIO functionalities across different microcontroller platforms. It allows developers to customize the hardware capabilities of their devices, such as ADC, DAC, CAN bus, and specific GPIO pins, ensuring that only the necessary features are included in the build.

Macro Description Sample value(s)
MICROPY_HW_ENABLE_ADC Controls the availability of the ADC peripheral, enabling pyb.ADC and pyb.ADCAll. (0) // use machine.ADC instead
MICROPY_HW_ENABLE_ANALOG_ONLY_PINS Enables support for analog-only pins in the STM32 hardware configuration. (1)
MICROPY_HW_ENABLE_CAN Enables CAN bus support for STM32 hardware configurations. (1)
MICROPY_HW_ENABLE_DAC Enables the DAC peripheral for audio output and other applications. (1) // A4, A5
MICROPY_HW_ENABLE_DCMI Controls the enabling of the DCMI peripheral. (0)
MICROPY_HW_ENABLE_FDCAN Enables support for FDCAN peripherals on compatible MCUs. (1) // define for MCUs with FDCAN
MICROPY_HW_ENABLE_GPIO0 Enables GPIO0 for various ESP32 SoC configurations. (1)
MICROPY_HW_ENABLE_GPIO1 Enables GPIO1 for various ESP32 configurations. (1)
MICROPY_HW_ENABLE_GPIO10 Enables GPIO10 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO11 Enables GPIO11 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO12 Enables GPIO12 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO13 Enables GPIO13 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO14 Enables GPIO14 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO15 Enables GPIO15 functionality on the ESP32. (1)
MICROPY_HW_ENABLE_GPIO16 Enables GPIO16 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO17 Enables GPIO17 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO18 Enables GPIO18 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO19 Enables GPIO19 for UART0_RXD functionality. (1) // UART0_RXD
MICROPY_HW_ENABLE_GPIO2 Enables GPIO2 functionality on supported ESP32 targets. (1)
MICROPY_HW_ENABLE_GPIO20 Enables GPIO20 for UART0_TXD functionality. (1) // UART0_TXD
MICROPY_HW_ENABLE_GPIO21 Enables GPIO21 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO22 Enables GPIO22 functionality on ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO23 Enables GPIO23 functionality on the ESP32 platform. (1)
MICROPY_HW_ENABLE_GPIO24 Enables GPIO24 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO25 Enables GPIO25 functionality on ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO26 Enables GPIO pin 26 for hardware functionality. (1)
MICROPY_HW_ENABLE_GPIO27 Enables GPIO pin 27 for hardware functionality. (1)
MICROPY_HW_ENABLE_GPIO28 Enables GPIO pin 28 for hardware access. (1)
MICROPY_HW_ENABLE_GPIO29 Enables GPIO29 functionality on the hardware. (1)
MICROPY_HW_ENABLE_GPIO3 Enables GPIO3 functionality on supported ESP32 targets. (1)
MICROPY_HW_ENABLE_GPIO30 Enables GPIO30 functionality. (1)
MICROPY_HW_ENABLE_GPIO31 Enables GPIO31 functionality. (1)
MICROPY_HW_ENABLE_GPIO32 Enables GPIO32 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO33 Enables GPIO33 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO34 Enables GPIO34 functionality on the ESP32. (1)
MICROPY_HW_ENABLE_GPIO35 Enables GPIO35 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO36 Enables GPIO36 functionality on the ESP32 platform. (1)
MICROPY_HW_ENABLE_GPIO37 Enables GPIO37 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO38 Enables GPIO38 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO39 Enables GPIO39 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO4 Enables GPIO4 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO40 Enables GPIO40 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO41 Enables GPIO41 functionality on the ESP32. (1)
MICROPY_HW_ENABLE_GPIO42 Enables GPIO pin 42 for hardware functionality. (1)
MICROPY_HW_ENABLE_GPIO43 Enables GPIO43 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO44 Enables GPIO44 functionality on the ESP32 platform. (1)
MICROPY_HW_ENABLE_GPIO45 Enables GPIO45 functionality on the ESP32 platform. (1)
MICROPY_HW_ENABLE_GPIO46 Enables GPIO46 functionality on supported ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO47 Enables GPIO47 functionality on ESP32S3 and ESP32P4 targets. (1)
MICROPY_HW_ENABLE_GPIO48 Enables GPIO pin 48 for use on specific ESP32 hardware configurations. (1)
MICROPY_HW_ENABLE_GPIO49 Enables GPIO pin 49 for use. (1)
MICROPY_HW_ENABLE_GPIO5 Enables GPIO5 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO50 Enables GPIO pin 50 for hardware functionality. (1)
MICROPY_HW_ENABLE_GPIO51 Enables GPIO pin 51 for hardware functionality. (1)
MICROPY_HW_ENABLE_GPIO52 Enables GPIO pin 52 for use. (1)
MICROPY_HW_ENABLE_GPIO53 Enables GPIO pin 53 for use in hardware configurations. (1)
MICROPY_HW_ENABLE_GPIO54 Enables GPIO pin 54 for use in hardware configurations. (1)
MICROPY_HW_ENABLE_GPIO6 Enables GPIO6 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO7 Enables GPIO7 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO8 Enables GPIO8 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_GPIO9 Enables GPIO9 functionality on the ESP32 hardware. (1)
MICROPY_HW_ENABLE_HW_DAC Enables hardware DAC functionality if DAC0 or DAC1 is defined. (1)
MICROPY_HW_ENABLE_HW_I2C Enables hardware I2C support for the board. (1)
MICROPY_HW_ENABLE_HW_I2C_TARGET Enables hardware I2C target functionality for STM32 peripherals. (1)
MICROPY_HW_ENABLE_HW_PWM Enables hardware PWM functionality. (1)
MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE Selects between using internal flash storage (1 MByte) or onboard SPI flash (512 KByte). Examples: 1 for internal flash, 0 for SPI flash. (0)
MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE_SEGMENT2 Controls the use of a second segment of internal flash storage. (0)
MICROPY_HW_ENABLE_MDNS_QUERIES Enables mDNS queries functionality for hostname resolution. (1)
MICROPY_HW_ENABLE_MDNS_RESPONDER Enables the mDNS responder functionality for network services. (1)
MICROPY_HW_ENABLE_MMCARD Enables the MMC interface, allowing interaction with MMC cards. (0)
MICROPY_HW_ENABLE_OSPI Enables OSPI (Octal Serial Peripheral Interface) support for the hardware. (CORE_M55_HP)
MICROPY_HW_ENABLE_PSRAM Activates support for external PSRAM memory. (1)
MICROPY_HW_ENABLE_RF_SWITCH Enables the RF switch functionality for Wi-Fi modules. (1)
MICROPY_HW_ENABLE_RNG Enables the hardware RNG peripheral for generating random numbers. (1)
MICROPY_HW_ENABLE_RTC Enables the Real-Time Clock (RTC) functionality. (1)
MICROPY_HW_ENABLE_SDCARD Enables support for SD card functionality in the firmware. (0)
MICROPY_HW_ENABLE_SERVO Enables the servo driver for controlling hobby servos via pyb.Servo. (0) // SERVO requires TIM5 (not on L452).
MICROPY_HW_ENABLE_STORAGE Enables the storage subsystem if a block device is defined. (1)
MICROPY_HW_ENABLE_TIMER Enables timer functionality on the hardware. (1)
MICROPY_HW_ENABLE_UART_REPL Enables UART REPL for modules with an external USB-UART when native USB is not used. (1)
MICROPY_HW_ENABLE_USB Enables USB support when a USB cable is connected to specific pins. (0) // can be enabled if USB cable connected to PA11/PA12 (D-/D+)
MICROPY_HW_ENABLE_USBDEV Enables USB device support if the SOC supports USB OTG. (SOC_USB_OTG_SUPPORTED)
MICROPY_HW_ENABLE_USB_RUNTIME_DEVICE Enables support for the machine.USBDevice functionality. (1) // Support machine.USBDevice

MICROPY_HW_ENTER

Macro Description Sample value(s)
MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET Determines if the bootloader is entered via a reset or direct jump. (1)

MICROPY_HW_ESP

This configuration set manages essential hardware functionalities for ESP devices, including GPIO pin assignments for hosted features, reset control for Wi-Fi, and support for advanced communication protocols like I2C and USB Serial/JTAG. It allows developers to customize hardware interactions and optimize performance based on specific ESP hardware capabilities.

Macro Description Sample value(s)
MICROPY_HW_ESP_HOSTED_GPIO0 Defines the GPIO pin used for ESP hosted functionality. (pin_P803)
MICROPY_HW_ESP_HOSTED_RESET Controls the reset pin for ESP hosted Wi-Fi functionality. (pin_P804)
MICROPY_HW_ESP_NEW_I2C_DRIVER Enables the use of a new I2C driver for ESP hardware. (0)
MICROPY_HW_ESP_USB_SERIAL_JTAG Enables USB Serial/JTAG support based on hardware capabilities and configuration. (SOC_USB_SERIAL_JTAG_SUPPORTED && (!MICROPY_HW_USB_CDC || SOC_USB_OTG_PERIPH_NUM > 1))

MICROPY_HW_ESP32S

Macro Description Sample value(s)
MICROPY_HW_ESP32S3_EXTENDED_IO Enables extended GPIO functionality for ESP32-S3, allowing access to GPIO47 and GPIO48. (1)

MICROPY_HW_ETH

This configuration group manages the pin assignments and settings for Ethernet interfaces, specifically focusing on RMII and RGMII modes. It ensures proper alignment and functionality of various Ethernet signals, including data lines, control signals, and clock configurations, to optimize performance and connectivity.

Macro Description Sample value(s)
MICROPY_HW_ETH_DMA_ATTRIBUTE Aligns DMA buffers to a 16KB boundary for optimal performance. attribute((aligned(16384)));
MICROPY_HW_ETH_MDC Pin configuration for the Ethernet Management Data Clock in RMII mode. (pyb_pin_W24)
MICROPY_HW_ETH_MDIO Defines the pin used for the MDIO (Management Data Input/Output) in Ethernet configurations. (pyb_pin_W15)
MICROPY_HW_ETH_RGMII_CLK125 Defines the pin used for the RGMII clock signal in Ethernet configuration. (pin_F2)
MICROPY_HW_ETH_RGMII_GTX_CLK Defines the GPIO pin used for the RGMII transmit clock in Ethernet configuration. (pin_F0)
MICROPY_HW_ETH_RGMII_RXD0 Defines the pin used for the RGMII RXD0 Ethernet data line. (pin_F14)
MICROPY_HW_ETH_RGMII_RXD1 Defines the pin used for the RGMII RXD1 Ethernet data line. (pin_F15)
MICROPY_HW_ETH_RGMII_RXD2 Defines the pin used for the RGMII RXD2 Ethernet data line. (pin_F8)
MICROPY_HW_ETH_RGMII_RXD3 Pin configuration for the RGMII RXD3 signal in Ethernet communication. (pin_F9)
MICROPY_HW_ETH_RGMII_RX_CLK Defines the pin used for the RGMII receive clock in Ethernet configuration. (pin_F7)
MICROPY_HW_ETH_RGMII_RX_CTL Defines the pin used for the RGMII receive control signal in Ethernet configuration. (pin_F10)
MICROPY_HW_ETH_RGMII_TXD0 Pin configuration for the RGMII transmit data line 0. (pin_F12)
MICROPY_HW_ETH_RGMII_TXD1 Defines the pin used for the RGMII transmit data line 1. (pin_F13)
MICROPY_HW_ETH_RGMII_TXD2 Defines the pin used for the RGMII transmit data line 2. (pin_G3)
MICROPY_HW_ETH_RGMII_TXD3 Defines the pin used for the RGMII TXD3 signal in Ethernet configuration. (pin_G4)
MICROPY_HW_ETH_RGMII_TX_CTL Defines the pin used for the RGMII transmit control signal. (pin_F11)
MICROPY_HW_ETH_RMII_CRS_DV Defines the pin used for the CRS/DV signal in the RMII Ethernet interface. (pyb_pin_W14)
MICROPY_HW_ETH_RMII_REF_CLK Defines the reference clock pin for the RMII Ethernet interface. (pyb_pin_W17)
MICROPY_HW_ETH_RMII_RXD0 Pin configuration for the RMII receive data line 0. (pyb_pin_W51)
MICROPY_HW_ETH_RMII_RXD1 Defines the pin used for the RMII RXD1 signal in Ethernet configurations. (pyb_pin_W47)
MICROPY_HW_ETH_RMII_RXER Defines the pin used for the RMII receive error signal. (pin_G2)
MICROPY_HW_ETH_RMII_TXD0 Defines the pin used for the RMII transmit data line 0. (pyb_pin_W45)
MICROPY_HW_ETH_RMII_TXD1 Pin configuration for the RMII transmit data line 1. (pyb_pin_W49)
MICROPY_HW_ETH_RMII_TX_EN Pin configuration for the RMII transmit enable signal. (pyb_pin_W8)

MICROPY_HW_FLASH

This configuration group manages various parameters related to flash memory, including block size, clock frequency, and storage allocation. It ensures optimal performance and functionality of the flash filesystem, enabling features such as automatic mounting at boot and defining storage limits for firmware and data.

Macro Description Sample value(s)
MICROPY_HW_FLASH_BLOCK_SIZE_BYTES Defines the size of a flash memory block in bytes, set to 4096. (4096)
MICROPY_HW_FLASH_CLK Clock frequency for the flash memory interface, typically set to kFlexSpiSerialClk_100MHz or kFlexSpiSerialClk_133MHz. kFlexSpiSerialClk_133MHz
MICROPY_HW_FLASH_DQS Configures the read sample clock source for FlexSPI to use loopback from the DQS pad. kFlexSPIReadSampleClk_LoopbackFromDqsPad
MICROPY_HW_FLASH_FS_LABEL Defines the label for the flash filesystem. "WEACT_F411_BLACKPILL"
MICROPY_HW_FLASH_LATENCY Determines the number of wait states for flash memory access based on system clock frequency. FLASH_LATENCY_7 // 210-216 MHz needs 7 wait states
MICROPY_HW_FLASH_MAX_FREQ Calculates the maximum frequency for flash operations based on system clock and SPI clock divider. (SYS_CLK_HZ / 4)
MICROPY_HW_FLASH_MOUNT_AT_BOOT Controls automatic mounting of the flash filesystem at boot based on storage enablement. (MICROPY_HW_ENABLE_STORAGE)
MICROPY_HW_FLASH_STORAGE_BASE Calculates the base address for flash storage by subtracting the storage size from total flash size. (PICO_FLASH_SIZE_BYTES - MICROPY_HW_FLASH_STORAGE_BYTES)
MICROPY_HW_FLASH_STORAGE_BASE_ADDR Defines the base address for flash storage used in alif.Flash() and USB MSC. (0)
MICROPY_HW_FLASH_STORAGE_BYTES Defines the number of bytes allocated for filesystem storage after reserving space for the firmware image. (PICO_FLASH_SIZE_BYTES - (1 * 1024 * 1024))
MICROPY_HW_FLASH_STORAGE_FS_BYTES Defines the size of the flash storage filesystem in bytes. (16 * 1024 * 1024)
MICROPY_HW_FLASH_STORAGE_ROMFS_BYTES Defines the size of the ROM filesystem storage in bytes. (16 * 1024 * 1024)

MICROPY_HW_FMC

This configuration set defines the pin assignments for the Flexible Memory Controller (FMC) interface, which is essential for connecting external memory devices to the microcontroller. It specifies the pin mappings for address lines, data lines, and bank address lines, enabling proper communication and functionality with various memory types.

Macro Description Sample value(s)
MICROPY_HW_FMC_A0 Defines the pin used for FMC address line A0. (pyb_pin_FMC_A0)
MICROPY_HW_FMC_A1 Defines the pin used for FMC_A1 functionality. (pyb_pin_FMC_A1)
MICROPY_HW_FMC_A10 Represents the pin configuration for FMC_A10, typically used for external memory interfaces. (pyb_pin_FMC_A10)
MICROPY_HW_FMC_A11 Represents the pin configuration for FMC_A11, typically assigned to a specific GPIO pin. (pyb_pin_FMC_A11)
MICROPY_HW_FMC_A12 Defines the pin configuration for FMC_A12, used for static speed pin configuration. (pyb_pin_FMC_A12)
MICROPY_HW_FMC_A2 Defines the pin used for FMC address line A2. (pyb_pin_FMC_A2)
MICROPY_HW_FMC_A3 Defines the pin used for FMC address line A3. (pyb_pin_FMC_A3)
MICROPY_HW_FMC_A4 Defines the pin used for FMC_A4 functionality. (pyb_pin_FMC_A4)
MICROPY_HW_FMC_A5 Represents the pin configuration for FMC_A5, typically assigned to pyb_pin_FMC_A5. (pyb_pin_FMC_A5)
MICROPY_HW_FMC_A6 Defines the pin used for FMC_A6 functionality. (pyb_pin_FMC_A6)
MICROPY_HW_FMC_A7 Defines the pin used for FMC_A7 functionality, mapped to pyb_pin_FMC_A7. (pyb_pin_FMC_A7)
MICROPY_HW_FMC_A8 Represents the pin configuration for FMC_A8, typically assigned to pyb_pin_FMC_A8. (pyb_pin_FMC_A8)
MICROPY_HW_FMC_A9 Represents the pin configuration for FMC_A9, typically assigned to (pyb_pin_FMC_A9). Examples include STM32F769DISC and ARDUINO_GIGA. (pyb_pin_FMC_A9)
MICROPY_HW_FMC_BA0 Defines the pin used for the FMC Bank Address 0. (pyb_pin_FMC_BA0)
MICROPY_HW_FMC_BA1 Defines the pin used for the FMC Bank Address line 1. (pyb_pin_FMC_BA1)
MICROPY_HW_FMC_D0 Represents the FMC data pin D0, mapped to pyb_pin_FMC_D0. (pyb_pin_FMC_D0)
MICROPY_HW_FMC_D1 Defines the pin used for FMC data line D1. (pyb_pin_FMC_D1)
MICROPY_HW_FMC_D10 Represents the pin configuration for FMC_D10, typically used for external memory interfaces. (pyb_pin_FMC_D10)
MICROPY_HW_FMC_D11 Defines the pin configuration for FMC data line D11. (pyb_pin_FMC_D11)
MICROPY_HW_FMC_D12 Defines the pin configuration for FMC data line D12. (pyb_pin_FMC_D12)
MICROPY_HW_FMC_D13 Defines the pin used for FMC data line D13. (pyb_pin_FMC_D13)
MICROPY_HW_FMC_D14 Defines the pin configuration for FMC_D14, mapped to pyb_pin_FMC_D14. (pyb_pin_FMC_D14)
MICROPY_HW_FMC_D15 Defines the pin configuration for FMC data line D15. (pyb_pin_FMC_D15)
MICROPY_HW_FMC_D16 Defines the pin configuration for FMC_D16 on the STM32F769DISC board. (pyb_pin_FMC_D16)
MICROPY_HW_FMC_D17 Represents the FMC data pin D17 for hardware configuration. (pyb_pin_FMC_D17)
MICROPY_HW_FMC_D18 Represents the FMC data pin D18 for hardware configuration. (pyb_pin_FMC_D18)
MICROPY_HW_FMC_D19 Represents the FMC data pin D19 for hardware configuration. (pyb_pin_FMC_D19)
MICROPY_HW_FMC_D2 Defines the pin used for FMC data line D2. (pyb_pin_FMC_D2)
MICROPY_HW_FMC_D20 Represents the pin configuration for FMC_D20 on the STM32F769DISC board. (pyb_pin_FMC_D20)
MICROPY_HW_FMC_D21 Defines the pin configuration for FMC_D21 on the STM32F769DISC board. (pyb_pin_FMC_D21)
MICROPY_HW_FMC_D22 Defines the pin configuration for FMC_D22 as pyb_pin_FMC_D22. (pyb_pin_FMC_D22)
MICROPY_HW_FMC_D23 Defines the pin configuration for FMC data line D23. (pyb_pin_FMC_D23)
MICROPY_HW_FMC_D24 Represents the FMC data pin D24 for hardware configuration. (pyb_pin_FMC_D24)
MICROPY_HW_FMC_D25 Represents the pin configuration for FMC_D25 on the STM32F769DISC board. (pyb_pin_FMC_D25)
MICROPY_HW_FMC_D26 Defines the pin configuration for FMC_D26 as pyb_pin_FMC_D26. (pyb_pin_FMC_D26)
MICROPY_HW_FMC_D27 Defines the pin configuration for FMC_D27 as pyb_pin_FMC_D27. (pyb_pin_FMC_D27)
MICROPY_HW_FMC_D28 Defines the pin configuration for FMC_D28 as pyb_pin_FMC_D28. (pyb_pin_FMC_D28)
MICROPY_HW_FMC_D29 Defines the pin configuration for FMC_D29 on the STM32F769DISC board. (pyb_pin_FMC_D29)
MICROPY_HW_FMC_D3 Represents the pin configuration for FMC data line D3. (pyb_pin_FMC_D3)
MICROPY_HW_FMC_D30 Represents the FMC_D30 pin configuration for hardware abstraction. (pyb_pin_FMC_D30)
MICROPY_HW_FMC_D31 Defines the pin configuration for FMC_D31 on the STM32F769DISC board. (pyb_pin_FMC_D31)
MICROPY_HW_FMC_D4 Defines the pin configuration for FMC data line D4. (pyb_pin_FMC_D4)
MICROPY_HW_FMC_D5 Represents the pin configuration for FMC data line D5. (pyb_pin_FMC_D5)
MICROPY_HW_FMC_D6 Defines the pin used for FMC data line D6. (pyb_pin_FMC_D6)
MICROPY_HW_FMC_D7 Represents the pin configuration for FMC data line D7. (pyb_pin_FMC_D7)
MICROPY_HW_FMC_D8 Represents the pin configuration for FMC data line D8. (pyb_pin_FMC_D8)
MICROPY_HW_FMC_D9 Defines the pin configuration for FMC_D9 as pyb_pin_FMC_D9. (pyb_pin_FMC_D9)
MICROPY_HW_FMC_NBL0 Represents the pin configuration for the FMC NBL0 signal. (pyb_pin_FMC_NBL0)
MICROPY_HW_FMC_NBL1 Defines the pin used for the FMC NBL1 signal. (pyb_pin_FMC_NBL1)
MICROPY_HW_FMC_NBL2 Defines the pin configuration for FMC NBL2. (pyb_pin_FMC_NBL2)
MICROPY_HW_FMC_NBL3 Defines the pin for FMC NBL3 functionality. (pyb_pin_FMC_NBL3)
MICROPY_HW_FMC_SDCKE0 Defines the pin used for the SDRAM clock enable signal. (pyb_pin_FMC_SDCKE0)
MICROPY_HW_FMC_SDCKE1 Defines the pin used for the SDRAM chip enable signal. (pin_B5)
MICROPY_HW_FMC_SDCLK Defines the pin used for the SDRAM clock signal. (pyb_pin_FMC_SDCLK)
MICROPY_HW_FMC_SDNBL0 Defines the pin used for the SDRAM bank 0 low signal. (pin_E0)
MICROPY_HW_FMC_SDNBL1 Pin configuration for the second bank of the SDRAM. (pin_E1)
MICROPY_HW_FMC_SDNCAS Defines the pin used for the SDNCAS signal in FMC configuration. (pyb_pin_FMC_SDNCAS)
MICROPY_HW_FMC_SDNE0 Defines the pin used for the SDRAM chip select (SDNE0) in hardware configurations. (pyb_pin_FMC_SDNE0)
MICROPY_HW_FMC_SDNE1 Defines the pin used for the SDRAM chip select (SDNE1). Examples: (pin_B6) (pin_B6)
MICROPY_HW_FMC_SDNRAS Defines the pin used for the SD RAM Row Address Strobe (RAS). Examples: (pyb_pin_FMC_SDNRAS), (pin_F11). (pyb_pin_FMC_SDNRAS)
MICROPY_HW_FMC_SDNWE Defines the pin used for the SDRAM write enable signal. (pyb_pin_FMC_SDNWE)
MICROPY_HW_FMC_SWAP_BANKS Enables swapping of SDRAM banks for memory configuration. (1)

MICROPY_HW_HARD

Macro Description Sample value(s)
MICROPY_HW_HARD_FAULT_DEBUG Prints error information at reboot if the board crashed. (0)

MICROPY_HW_HAS

This configuration group controls the detection and availability of various hardware components on a microcontroller board, such as storage options, sensors, and user interface elements. By indicating the presence or absence of these components, it enables or disables specific functionalities and drivers, allowing for tailored software behavior based on the hardware capabilities.

Macro Description Sample value(s)
MICROPY_HW_HAS_FLASH Indicates the presence of internal flash storage for use with pyb.Flash. (0) // QSPI extflash not mounted
MICROPY_HW_HAS_KXTJ3 Indicates the presence of the KXTJ3 accelerometer. (1)
MICROPY_HW_HAS_LCD Indicates the presence of an LCD driver, enabling related functionality. (0)
MICROPY_HW_HAS_LED Indicates the presence of LED hardware on the board. (1)
MICROPY_HW_HAS_LIS3DSH Indicates the absence of the LIS3DSH sensor on the hardware. (0)
MICROPY_HW_HAS_MMA7660 Controls the inclusion of the MMA7660 accelerometer driver. (0)
MICROPY_HW_HAS_QSPI_FLASH Indicates the presence of external QSPI flash storage on the MCU. (0)
MICROPY_HW_HAS_SDCARD Indicates the presence of an SD card on the hardware. (0)
MICROPY_HW_HAS_SDHI_CARD Enables access to the SD card through the SDHI controller. (0)
MICROPY_HW_HAS_SWITCH Indicates the presence of a user switch, enabling related functionality. (1)

MICROPY_HW_I2C

This configuration set manages the I2C hardware interfaces, defining the specific pins for SCL and SDA lines across multiple I2C buses. It also establishes parameters such as baud rates, the number of interfaces, and the mapping of hardware controllers to logical indices, ensuring proper communication setup for I2C devices.

Macro Description Sample value(s)
MICROPY_HW_I2C0_SCL Defines the SCL pin for I2C0, requiring explicit pin arguments when no default is set. (0)
MICROPY_HW_I2C0_SDA Defines the SDA pin for I2C0 communication. (pin_P407) // Note that conflict with PMOD IO1
MICROPY_HW_I2C1_NAME Identifies the name of the first I2C bus, often linked to specific hardware slots. "SLOT1234H"
MICROPY_HW_I2C1_SCL Defines the SCL pin for I2C1 communication, typically assigned to a specific GPIO pin. (pin_P205)
MICROPY_HW_I2C1_SDA Defines the SDA pin for I2C1 communication. (pin_B9) // Arduino D14, pin 5 on CN10
MICROPY_HW_I2C2_NAME Identifies the name of the I2C2 bus, often associated with specific hardware slots. "SLOT2"
MICROPY_HW_I2C2_SCL Defines the SCL pin for I2C2 communication, set to pin_P512. (pin_P512)
MICROPY_HW_I2C2_SDA Defines the SDA pin for I2C2, assigned to pin_B11. (pin_B11) // pin 18 on CN10
MICROPY_HW_I2C3_NAME Identifies the I2C3 interface associated with mikroBUS slot 1. "SLOT1"
MICROPY_HW_I2C3_SCL Defines the SCL pin for I2C3 as pin_A8. (pin_A8)
MICROPY_HW_I2C3_SDA Defines the SDA pin for I2C3, set to pin_C9. (pin_C9) // pin 1 on CN10
MICROPY_HW_I2C4_SCL Defines the SCL pin for I2C4, mapped to pin_C0. (pin_C0) // pin 38 on CN7
MICROPY_HW_I2C4_SDA Defines the data line (SDA) pin for I2C4 communication. (pin_C1) // pin 36 on CN7
MICROPY_HW_I2C_BAUDRATE_DEFAULT Sets the default I2C baud rate for communication, typically defined as PYB_I2C_SPEED_STANDARD. (PYB_I2C_SPEED_STANDARD)
MICROPY_HW_I2C_BAUDRATE_MAX Defines the maximum I2C baud rate for hardware configurations. (PYB_I2C_SPEED_STANDARD)
MICROPY_HW_I2C_BAUDRATE_TIMING Defines I2C baud rate timing values for various STM32 microcontrollers. { \
MICROPY_HW_I2C_INDEX Defines the mapping of hardware I2C controllers to logical I2C indices. { 5, 3, 1, 6, 2 }
MICROPY_HW_I2C_NO_DEFAULT_PINS Indicates that no default I2C pins are defined, requiring explicit pin arguments. (1)
MICROPY_HW_I2C_NUM Determines the number of I2C interfaces based on the size of the i2c_index_table array. ARRAY_SIZE(i2c_index_table)

MICROPY_HW_I2S

This configuration controls the availability and functionality of I2S audio interfaces, allowing for the transmission of audio data through multiple buses. It specifies the number of I2S interfaces and enables specific buses for audio applications.

Macro Description Sample value(s)
MICROPY_HW_I2S1 Enables the first I2S bus for audio data transmission. (1)
MICROPY_HW_I2S2 Enables the I2S2 bus for audio data transmission. (1)
MICROPY_HW_I2S_NUM Determines the number of I2S interfaces available. (3)

MICROPY_HW_LED

This configuration group manages the settings and behavior of multiple hardware LEDs, including their GPIO pin assignments, pull-up resistor options, and PWM control parameters. It allows for customization of LED functionality, such as indicating status and supporting tricolor LEDs, ensuring flexibility in visual feedback for various applications.

Macro Description Sample value(s)
MICROPY_HW_LED1 Configures the first LED pin for status indication. (pin_A15)
MICROPY_HW_LED1_PIN Defines the GPIO pin for the first onboard LED. (pin_GPIO_LPSR_07) // SoM Red LED
MICROPY_HW_LED1_PULLUP Indicates whether pull-up resistor is enabled for LED1 (0 = disabled). Examples: 0 for no pull-up, 1 for pull-up enabled. (0)
MICROPY_HW_LED1_PWM Configures PWM settings for LED1 using timer and channel information. { TIM12, 12, TIM_CHANNEL_1, GPIO_AF9_TIM12 }
MICROPY_HW_LED2 Defines the pin for the second LED, typically used for indicating status. (pin_A5) // Green (next to power LED)
MICROPY_HW_LED2_PIN Defines the pin for the second LED on the phyBOARD-RT1170 SoM. (pin_GPIO_LPSR_08) // SoM Green LED
MICROPY_HW_LED2_PWM Configures PWM settings for LED2 using TIM4, channel 2. { TIM4, 4, TIM_CHANNEL_2, GPIO_AF2_TIM4 }
MICROPY_HW_LED3 Defines the pin for the third LED, typically used for indicating status. (pin_B14) // Red LED on Nucleo
MICROPY_HW_LED3_PIN Defines the pin for the Carrier Red LED on the phyBOARD. (pin_GPIO_AD_14) // Carrier Red LED
MICROPY_HW_LED3_PWM Configures PWM settings for the third LED using timer and GPIO settings. { TIM12, 12, TIM_CHANNEL_1, GPIO_AF9_TIM12 }
MICROPY_HW_LED4 Represents the fourth hardware LED pin configuration. (pin_C13) // Same as Led(2)
MICROPY_HW_LED4_PIN Defines the GPIO pin for the carrier green LED. (pin_GPIO_LPSR_13) // Carrier Green LED
MICROPY_HW_LED4_PULLUP Indicates that the yellow LED (LED4) is active high. (0) // Yellow is active high
MICROPY_HW_LED4_PWM Configures PWM settings for LED4 using TIM3, channel 1, and GPIO alternate function 2. { TIM3, 3, TIM_CHANNEL_1, GPIO_AF2_TIM3 }
MICROPY_HW_LED5_PWM Configures the PWM settings for LED5. { NULL, 0, 0, 0 }
MICROPY_HW_LED6_PWM Configures LED6 for PWM control with default parameters. { NULL, 0, 0, 0 }
MICROPY_HW_LED_BLUE Defines the GPIO pin number for the blue LED. (18) // LED3 DS8 Blue
MICROPY_HW_LED_COUNT Determines the number of hardware LEDs available, affecting LED configuration. (4) // 3 RGB + 1 Yellow
MICROPY_HW_LED_GREEN Defines the pin number for the green LED on the board. (16) // LED2 DS8 Green
MICROPY_HW_LED_INVERTED Indicates that LEDs are on when the pin is driven low. (1) // LEDs are on when pin is driven low
MICROPY_HW_LED_PULLUP Indicates whether the RGB LED is active low (1) or high (0). Examples: 1 for active low RGB LED, 0 for active high LED. (1) // RGB LED is active low
MICROPY_HW_LED_RED Defines the pin number for the red LED. (8) // LED1 DS8 Red
MICROPY_HW_LED_TRICOLOR Enables support for a tricolor LED (red, green, blue) on the hardware. (1)

MICROPY_HW_LIGHTSLEEP

Macro Description Sample value(s)
MICROPY_HW_LIGHTSLEEP_ALARM_NUM Defines the hardware timer alarm index for light sleep functionality. (1)

MICROPY_HW_LPSPI

This configuration controls the pin assignments for the LPSPI0 interface, specifying the MISO, MOSI, and SCK pins. It ensures that the correct hardware connections are established for SPI communication, facilitating data transfer between devices.

Macro Description Sample value(s)
MICROPY_HW_LPSPI0_MISO Defines the MISO pin for the LPSPI0 interface as pin_P7_4. (pin_P7_4)
MICROPY_HW_LPSPI0_MOSI Defines the MOSI pin for LPSPI0 as pin_P7_5. (pin_P7_5)
MICROPY_HW_LPSPI0_SCK Defines the SCK pin for LPSPI0 as pin_P7_6. (pin_P7_6)

MICROPY_HW_LPUART

This configuration set defines the receive and transmit pins for two Low Power Universal Asynchronous Receiver-Transmitter (LPUART) interfaces, enabling serial communication capabilities. By specifying these pins, it allows for flexible hardware setups tailored to specific application needs.

Macro Description Sample value(s)
MICROPY_HW_LPUART1_RX Defines the receive pin for LPUART1, typically used for serial communication. (pin_A3) // A3 (to STLINK), B10, C0
MICROPY_HW_LPUART1_TX Defines the transmit pin for LPUART1, typically used for serial communication. (pin_A9)
MICROPY_HW_LPUART2_RX Defines the receive pin for LPUART2 as pin_C7. (pin_C7)
MICROPY_HW_LPUART2_TX Defines the transmit pin for LPUART2. (pin_C6)

MICROPY_HW_MAX

This configuration group defines the maximum available hardware interfaces and peripherals for various communication protocols and timers, including CAN, I2C, I2S, UART, and timers. It allows developers to tailor the MicroPython environment to the specific capabilities of the target hardware, ensuring efficient resource management.

Macro Description Sample value(s)
MICROPY_HW_MAX_CAN Determines the maximum number of CAN interfaces available. (0)
MICROPY_HW_MAX_I2C Determines the maximum number of I2C interfaces available on the hardware. (2)
MICROPY_HW_MAX_I2S Sets the maximum number of I2S peripherals available. (2)
MICROPY_HW_MAX_LPUART Sets the maximum number of Low Power UARTs available, currently defined as 0. (0)
MICROPY_HW_MAX_TIMER Sets the maximum number of hardware timers available. (11)
MICROPY_HW_MAX_UART Determines the maximum number of UART interfaces available, including LPUART. (5) // UART1-5 + LPUART1

MICROPY_HW_MCU

This configuration group manages essential parameters related to the microcontroller hardware, including its name, clock settings, and oscillator options. It allows for the customization of system and peripheral clock frequencies, as well as the choice of clock source, ensuring optimal performance and power management for the specific hardware setup.

Macro Description Sample value(s)
MICROPY_HW_MCU_NAME Defines the name of the microcontroller used in the hardware. MICROPY_PY_SYS_PLATFORM
MICROPY_HW_MCU_OSC32KULP Enables the use of the 32K Low Power oscillator instead of the 32kHz crystal for clock generation. (1)
MICROPY_HW_MCU_PCLK Defines the peripheral clock frequency for the MCU. 100000000
MICROPY_HW_MCU_SYSCLK Defines the system clock frequency for the MCU. 200000000

MICROPY_HW_MCUFLASH

Macro Description Sample value(s)
MICROPY_HW_MCUFLASH Enables the use of internal flash memory for the file system. (1)

MICROPY_HW_MMA

Macro Description Sample value(s)
MICROPY_HW_MMA_AVDD_PIN Pin configuration for the AVDD power supply of the MMA accelerometer. (pin_A10)

MICROPY_HW_MMCARD

Macro Description Sample value(s)
MICROPY_HW_MMCARD_LOG_BLOCK_NBR Defines the number of logical blocks for the MMC card to support specific hardware configurations. (7469056 + 2048)

MICROPY_HW_MUSIC

Macro Description Sample value(s)
MICROPY_HW_MUSIC_PIN Defines the pin used for music output on the micro:bit. (3)

MICROPY_HW_NIC

Macro Description Sample value(s)
MICROPY_HW_NIC_ETH Defines the Ethernet network interface type for hardware configurations. { MP_ROM_QSTR(MP_QSTR_LAN), MP_ROM_PTR(&network_lan_type) },

MICROPY_HW_NINA

This configuration set manages the pin assignments and functionalities for the NINA module, including acknowledgment, chip select, and various GPIO operations. It ensures proper communication and control of the ublox Nina-W10 module by defining essential signal pins such as RTS and CTS.

Macro Description Sample value(s)
MICROPY_HW_NINA_ACK Pin configuration for the NINA module's acknowledgment signal. pin_find(MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY))
MICROPY_HW_NINA_CS Identifies the chip select pin for the NINA module. pin_find(MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS))
MICROPY_HW_NINA_CTS Represents the Clear To Send (CTS) pin for the NINA module, linked to the ACK pin. MICROPY_HW_NINA_ACK
MICROPY_HW_NINA_GPIO0 Defines the GPIO pin number used for the NINA module's GPIO0 functionality. (2)
MICROPY_HW_NINA_GPIO1 Defines the GPIO pin number for the NINA module's GPIO1. (15)
MICROPY_HW_NINA_RESET Pin configuration for resetting the ublox Nina-W10 module. (3)
MICROPY_HW_NINA_RTS Defines the RTS pin for the NINA module using the MOSI pin. pin_find(MP_OBJ_NEW_QSTR(MP_QSTR_MOSI))

MICROPY_HW_NUM

Macro Description Sample value(s)
MICROPY_HW_NUM_PIN_IRQS Determines the number of pin interrupt requests available. (4 * 32 + 3)

MICROPY_HW_OSPI

Macro Description Sample value(s)
MICROPY_HW_OSPI_CS_HIGH_CYCLES Determines the number of cycles nCS remains high, set to 2 cycles. (2) // nCS stays high for 2 cycles
MICROPY_HW_OSPI_PRESCALER Sets the prescaler for the OSPI clock, determining F_CLK as F_AHB/3. (3) // F_CLK = F_AHB/3

MICROPY_HW_OSPIFLASH

This configuration set defines the pin assignments and parameters for interfacing with external OSPI flash memory. It specifies the chip select, data lines, clock, and size of the flash, enabling proper communication and functionality between the hardware and the flash storage.

Macro Description Sample value(s)
MICROPY_HW_OSPIFLASH_CS Defines the chip select pin for the external OSPI flash. (pin_G6)
MICROPY_HW_OSPIFLASH_DQS Defines the data strobe pin for external OSPI flash. (pin_C5)
MICROPY_HW_OSPIFLASH_IO0 Defines the pin used for the first data line of the external OSPI flash. (pin_D11)
MICROPY_HW_OSPIFLASH_IO1 Defines the pin used for the OSPIFLASH IO1 connection. (pin_D12)
MICROPY_HW_OSPIFLASH_IO2 Defines the pin used for the OSPIFLASH IO2 interface. (pin_C2)
MICROPY_HW_OSPIFLASH_IO3 Defines the pin used for OSPIFLASH IO3, set to pin_D13. (pin_D13)
MICROPY_HW_OSPIFLASH_IO4 Defines the pin used for the OSPIFLASH IO4 interface. (pin_H2)
MICROPY_HW_OSPIFLASH_IO5 Defines the pin used for OSPIFLASH IO5, assigned to pin_H3. (pin_H3)
MICROPY_HW_OSPIFLASH_IO6 Defines the pin used for OSPIFLASH IO6 as pin_G9. (pin_G9)
MICROPY_HW_OSPIFLASH_IO7 Defines the pin used for OSPIFLASH IO7 as pin_C0. (pin_C0)
MICROPY_HW_OSPIFLASH_SCK Defines the SCK pin for the external OSPI flash interface. (pin_F10)
MICROPY_HW_OSPIFLASH_SIZE_BITS_LOG2 Defines the size of the external OSPI flash in bits, set to 512MBit. (29)

MICROPY_HW_PIN

Macro Description Sample value(s)
MICROPY_HW_PIN_EXT_COUNT Enables support for externally controlled pins. (7)

MICROPY_HW_PSRAM

Macro Description Sample value(s)
MICROPY_HW_PSRAM_CS_PIN Defines the chip select pin for PSRAM. (0)

MICROPY_HW_PWM

This configuration set defines the names and output pins for multiple PWM channels, enabling precise control over PWM signal generation for various applications. It facilitates the management of hardware interfaces for tasks such as motor control and LED brightness adjustment.

Macro Description Sample value(s)
MICROPY_HW_PWM0_NAME Defines the name for the first PWM channel. "PWM0"
MICROPY_HW_PWM1_NAME Defines the name for the second PWM channel. "PWM1"
MICROPY_HW_PWM2_NAME Defines the name for the second PWM channel. "PWM2"
MICROPY_HW_PWM3_NAME Defines the name for the PWM3 hardware interface. "PWM3"
MICROPY_HW_PWM_1A Defines the PWM output on pin P105. (pin_P105)
MICROPY_HW_PWM_2A Defines the PWM output on pin P113 (D5). Examples: Used for motor control or LED dimming. (pin_P113) // D5
MICROPY_HW_PWM_2B Defines the PWM pin for channel 2B, mapped to pin P114 (D6). Examples: Used in PWM configurations for devices. (pin_P114) // D6
MICROPY_HW_PWM_3A Defines the PWM output for channel 3A on pin P111 (D3). Examples: MICROPY_HW_PWM_3A can be used in PWM configurations. (pin_P111) // D3
MICROPY_HW_PWM_3B Defines the PWM pin for channel 3B as pin_P112 (D4). Examples: Used in PWM configurations for devices. (pin_P112) // D4
MICROPY_HW_PWM_4A Defines the PWM output for channel 4A on pin P115 (D9). Examples: Used in PWM configurations for devices. (pin_P115) // D9
MICROPY_HW_PWM_4B Defines the PWM pin for channel 4B as pin P608 (D7). Examples: Used in PWM configuration for devices. (pin_P608) // D7
MICROPY_HW_PWM_6A Defines the PWM output for channel 6A on pin P601. (pin_P601)
MICROPY_HW_PWM_6B Defines the PWM pin for channel 6B as pin_P408. (pin_P408) // PN3_8
MICROPY_HW_PWM_7A Defines the PWM pin for channel 7A as pin_P304. (pin_P304) // H6_5
MICROPY_HW_PWM_7B Defines the PWM pin for channel 7B as pin_P303. (pin_P303) // H6_3
MICROPY_HW_PWM_8A Defines the PWM output for channel 8A on pin P605. (pin_P605) // PN4_4
MICROPY_HW_PWM_8B Defines the PWM pin for channel 8B, mapped to pin P604. (pin_P604) // PN4_3

MICROPY_HW_PWR

Macro Description Sample value(s)
MICROPY_HW_PWR_SMPS_CONFIG Configures the power supply mode for SMPS on supported STM32 boards. (PWR_SMPS_1V8_SUPPLIES_LDO)

MICROPY_HW_QSPI

This configuration set manages various parameters related to Quad Serial Peripheral Interface (QSPI) operations, including timing, memory region sizing, and clock frequency settings. It allows for fine-tuning of QSPI behavior to optimize performance and reliability in embedded applications.

Macro Description Sample value(s)
MICROPY_HW_QSPI_CS_HIGH_CYCLES Sets the number of cycles nCS remains high, configured to 2 cycles. 2 // nCS stays high for 2 cycles
MICROPY_HW_QSPI_MPU_REGION_SIZE Calculates the MPU region size for QSPI in units of 1024*1024 bytes. ((1 << (MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 - 3)) >> 20)
MICROPY_HW_QSPI_PRESCALER Determines the prescaler value for QSPI clock frequency. (2) // 120 MHz
MICROPY_HW_QSPI_SAMPLE_SHIFT Enables sample shift for QSPI configuration. 1 // sample shift enabled
MICROPY_HW_QSPI_TIMEOUT_COUNTER Controls the timeout counter for QSPI operations, with 0 disabling it. 0 // timeout counter disabled (see F7 errata)

MICROPY_HW_QSPIFLASH

This configuration set controls the parameters and pin assignments for interfacing with QSPI flash memory in hardware setups. It specifies the type of flash memory, the chip select and data line pins, clock settings, and operational characteristics such as dummy cycles and memory size.

Macro Description Sample value(s)
MICROPY_HW_QSPIFLASH Defines the type of QSPI flash memory used in the hardware configuration. W25Q16JV_IQ
MICROPY_HW_QSPIFLASH_CS Defines the chip select pin for the QSPI flash interface. (pyb_pin_QSPI2_CS)
MICROPY_HW_QSPIFLASH_DUMMY_CYCLES Number of dummy cycles for QSPI flash read operations. (4)
MICROPY_HW_QSPIFLASH_IO0 Defines the pin used for QSPI flash data line 0. (pyb_pin_QSPI2_D0)
MICROPY_HW_QSPIFLASH_IO1 Defines the pin used for QSPI flash data line 1. (pyb_pin_QSPI2_D1)
MICROPY_HW_QSPIFLASH_IO2 Defines the pin used for QSPI flash data line 2. (pyb_pin_QSPI2_D2)
MICROPY_HW_QSPIFLASH_IO3 Defines the pin used for QSPI flash IO3, mapped to pyb_pin_QSPI2_D3. (pyb_pin_QSPI2_D3)
MICROPY_HW_QSPIFLASH_SCK Defines the clock pin for the QSPI flash interface. (pyb_pin_QSPI2_CLK)
MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 Log2 of the size of external QSPI flash in bits, indicating 512MBit capacity. (29)

MICROPY_HW_RCC

This configuration set manages the clock sources and states for various peripherals within the hardware, ensuring proper operation of components such as ADC, I2C, SPI, and USB. It allows for customization of oscillator states and PLL sources, facilitating optimized performance and functionality across the system.

Macro Description Sample value(s)
MICROPY_HW_RCC_ADC_CLKSOURCE Sets the clock source for the ADC peripheral to PLL3. (RCC_ADCCLKSOURCE_PLL3)
MICROPY_HW_RCC_FDCAN_CLKSOURCE Clock source configuration for the FDCAN peripheral, set to use the PLL. (RCC_FDCANCLKSOURCE_PLL)
MICROPY_HW_RCC_FMC_CLKSOURCE Defines the clock source for the FMC peripheral as PLL2. (RCC_FMCCLKSOURCE_PLL2)
MICROPY_HW_RCC_HSE_STATE Determines the state of the High-Speed External (HSE) oscillator, allowing configurations for bypass or power modes. (RCC_HSE_BYPASS_PWR)
MICROPY_HW_RCC_HSI48_STATE Defines the state of the HSI48 oscillator as enabled. (RCC_HSI48_ON)
MICROPY_HW_RCC_HSI_STATE Determines the state of the HSI oscillator, either ON or OFF. (RCC_HSI_OFF)
MICROPY_HW_RCC_I2C123_CLKSOURCE Clock source for I2C123 peripheral set to D2PCLK1. (RCC_I2C123CLKSOURCE_D2PCLK1)
MICROPY_HW_RCC_OSCILLATOR_TYPE Combines HSE and HSI48 oscillator types for clock configuration. (RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI48)
MICROPY_HW_RCC_PLL_SRC Determines the source of the PLL clock, set to HSI or HSE. (RCC_PLLSOURCE_HSI)
MICROPY_HW_RCC_QSPI_CLKSOURCE Defines the clock source for the QSPI peripheral as PLL2. (RCC_QSPICLKSOURCE_PLL2)
MICROPY_HW_RCC_RNG_CLKSOURCE Defines the clock source for the RNG peripheral as HSI48. (RCC_RNGCLKSOURCE_HSI48)
MICROPY_HW_RCC_RTC_CLKSOURCE Defines the clock source for the RTC peripheral, set to LSI. (RCC_RTCCLKSOURCE_LSI)
MICROPY_HW_RCC_SDMMC_CLKSOURCE Defines the clock source for the SDMMC peripheral as PLL. (RCC_SDMMCCLKSOURCE_PLL)
MICROPY_HW_RCC_SPI123_CLKSOURCE Defines the clock source for SPI123 peripheral as PLL3. (RCC_SPI123CLKSOURCE_PLL3)
MICROPY_HW_RCC_USB_CLKSOURCE Defines the clock source for USB peripheral as HSI48. (RCC_USBCLKSOURCE_HSI48)

MICROPY_HW_REPL

Macro Description Sample value(s)
MICROPY_HW_REPL_UART_RX Defines the RX pin for the REPL UART interface. (pin_P12_1)
MICROPY_HW_REPL_UART_TX Defines the UART transmit pin for the REPL interface. (pin_P12_2)

MICROPY_HW_RFCORE

This configuration set manages various parameters and settings related to Bluetooth Low Energy (BLE) functionality within the RF core. It allows developers to customize aspects such as attribute sizes, connection parameters, and clock sources to optimize BLE performance and resource allocation.

Macro Description Sample value(s)
MICROPY_HW_RFCORE_BLE_ATT_VALUE_ARRAY_SIZE Defines the size of the attribute value array for BLE. (0)
MICROPY_HW_RFCORE_BLE_DATA_LENGTH_EXTENSION Enables data length extension for BLE communication. (1)
MICROPY_HW_RFCORE_BLE_HSE_STARTUP_TIME Defines the startup time for the High-Speed External clock in BLE applications. (0x148)
MICROPY_HW_RFCORE_BLE_LL_ONLY Enables the use of the Link Layer (LL) only for the BLE stack. (1) // use LL only, we provide the rest of the BLE stack
MICROPY_HW_RFCORE_BLE_LSE_SOURCE Configures the rfcore to use LSE for clocking. (0) // use LSE to clock the rfcore (see errata 2.2.1)
MICROPY_HW_RFCORE_BLE_MASTER_SCA Configures the Slave Clock Accuracy for BLE master mode. (0)
MICROPY_HW_RFCORE_BLE_MAX_ATT_MTU Defines the maximum ATT MTU size for BLE connections. (0)
MICROPY_HW_RFCORE_BLE_MAX_CONN_EVENT_LENGTH Maximum connection event length for BLE, set to the maximum possible value. (0xffffffff)
MICROPY_HW_RFCORE_BLE_MBLOCK_COUNT Defines the number of memory blocks for BLE operations. (0x79)
MICROPY_HW_RFCORE_BLE_NUM_GATT_ATTRIBUTES Sets the number of GATT attributes for BLE configuration, defaulting to 0. (0)
MICROPY_HW_RFCORE_BLE_NUM_GATT_SERVICES Sets the number of GATT services for the RF core BLE configuration. (0)
MICROPY_HW_RFCORE_BLE_NUM_LINK Sets the number of simultaneous BLE links. (1)
MICROPY_HW_RFCORE_BLE_PREPARE_WRITE_LIST_SIZE Determines the size of the prepare write list for BLE operations. (0)
MICROPY_HW_RFCORE_BLE_SLAVE_SCA Configures the Slave Clock Accuracy for BLE communication. (0)
MICROPY_HW_RFCORE_BLE_VITERBI_MODE Enables Viterbi decoding mode for BLE communication. (1)

MICROPY_HW_ROMFS

This configuration set manages the setup and parameters for the ROM filesystem, including its storage locations, sizes, and the ability to utilize both internal and external flash memory options. It allows for the definition of multiple partitions within the filesystem, enabling flexible storage solutions tailored to the hardware capabilities.

Macro Description Sample value(s)
MICROPY_HW_ROMFS_BASE Calculates the base address for the ROM filesystem in flash memory. ((uintptr_t)&_micropy_hw_romfs_part0_start - (uintptr_t)&__flash_start)
MICROPY_HW_ROMFS_BYTES Defines the size of the ROM filesystem in bytes. (uintptr_t)(&_micropy_hw_romfs_part0_size)
MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI Enables the use of ROMFS on external QSPI flash. (1)
MICROPY_HW_ROMFS_ENABLE_EXTERNAL_XSPI Enables the use of ROMFS on external XSPI flash. (1)
MICROPY_HW_ROMFS_ENABLE_INTERNAL_FLASH Controls the enabling of ROMFS on internal flash storage. (0)
MICROPY_HW_ROMFS_ENABLE_PART0 Enables the first ROMFS partition. (1)
MICROPY_HW_ROMFS_ENABLE_PART1 Enables the second ROMFS partition if defined, allowing for additional file system storage. (CORE_M55_HP)
MICROPY_HW_ROMFS_PART0_SIZE Determines the size of the first ROM filesystem partition based on the memory size of the SPI flash. (1 << MICROPY_BOARD_SPIFLASH_CHIP_PARAMS1->memory_size_bytes_log2)
MICROPY_HW_ROMFS_PART0_START Address of the start of ROMFS partition 0 in SPI flash. (uintptr_t)(&_micropy_hw_romfs_part0_start)
MICROPY_HW_ROMFS_PART1_SIZE Holds the size of the second part of the ROM filesystem. (uintptr_t)(&_micropy_hw_romfs_part1_size)
MICROPY_HW_ROMFS_PART1_START Address of the start of the second ROM filesystem partition. (uintptr_t)(&_micropy_hw_romfs_part1_start)
MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ Reference to the SPI flash object used for ROM filesystem operations. (&spi_bdev2.spiflash)
MICROPY_HW_ROMFS_XSPI_SPIBDEV_OBJ Reference to the SPI block device used for external ROM filesystem operations. (&spi_bdev)

MICROPY_HW_RTC

This configuration set manages various aspects of the Real-Time Clock (RTC) functionality, including timeout settings for different clock sources, memory allocation for user data, and options for utilizing external oscillators. It allows for fine-tuning of the RTC's operational parameters, ensuring reliable timekeeping and flexibility in clock source selection.

Macro Description Sample value(s)
MICROPY_HW_RTC_BYP_TIMEOUT_MS Defines the timeout duration in milliseconds for the RTC bypass mode. 150
MICROPY_HW_RTC_LSE_TIMEOUT_MS Defines the timeout duration for LSE startup in milliseconds, set to 1000 ms. 1000 // ST docs spec 2000 ms LSE startup, seems to be too pessimistic
MICROPY_HW_RTC_LSI_TIMEOUT_MS Timeout duration for LSI clock readiness check, set to 500 ms. 500 // this is way too pessimistic, typ. < 1ms
MICROPY_HW_RTC_SOURCE Selects the RTC clock source: 0 for subclock, 1 for LOCO (32.768kHz). Examples: 0 for EK_RA4M1, 1 for EK_RA4W1. (1) // 0: subclock, 1: LOCO (32.768khz)
MICROPY_HW_RTC_USER_MEM_MAX Maximum size of user memory for RTC, defaulting to 2048 bytes to prevent overflow. 2048
MICROPY_HW_RTC_USE_BYPASS Controls the use of bypass mode for the RTC's LSE oscillator. (0)
MICROPY_HW_RTC_USE_CALOUT Controls the activation of the PC13 512Hz output for RTC calibration. (0) // turn on/off PC13 512Hz output
MICROPY_HW_RTC_USE_LSE Enables the use of an external 32.768 kHz crystal for the RTC. (1)
MICROPY_HW_RTC_USE_US Enables microsecond resolution for the RTC if set to 1; otherwise, it defaults to 0. (0)

MICROPY_HW_SDCARD

This configuration set manages the hardware interface for SD and MMC cards, including pin assignments for data, command, and clock lines, as well as detection mechanisms for card presence. It also allows for customization of bus width and automatic mounting options at boot, ensuring proper integration and functionality of SD card support in embedded systems.

Macro Description Sample value(s)
MICROPY_HW_SDCARD_BUS_WIDTH Determines the bus width for the SD/MMC card interface, defaulting to 4 bits. (4)
MICROPY_HW_SDCARD_CK Defines the clock pin for the SD card interface. (pin_C12)
MICROPY_HW_SDCARD_CMD Defines the command pin for the SD card interface. (pyb_pin_SD_SDIO_CMD)
MICROPY_HW_SDCARD_D0 Defines the data line 0 pin for the SD card using custom SDIO pins. (pin_B7)
MICROPY_HW_SDCARD_D1 Defines the pin used for SD card data line D1. (pyb_pin_SD_SDIO_D1)
MICROPY_HW_SDCARD_D2 Defines the pin used for SD card data line D2. (pyb_pin_SD_SDIO_D2)
MICROPY_HW_SDCARD_D3 Defines the pin used for SD card data line D3. (pyb_pin_SD_SDIO_D3)
MICROPY_HW_SDCARD_DETECT_PIN Pin used to detect the presence of an SD card. (pin_G2)
MICROPY_HW_SDCARD_DETECT_PRESENT Indicates the presence of an SD card by defining its GPIO state. (GPIO_PIN_RESET)
MICROPY_HW_SDCARD_DETECT_PULL Configures the pull-up or pull-down resistor for the SD card detect pin. (GPIO_PULLDOWN)
MICROPY_HW_SDCARD_MOUNT_AT_BOOT Controls automatic mounting of the SD card at boot if enabled. (MICROPY_HW_ENABLE_SDCARD)
MICROPY_HW_SDCARD_SDMMC Selects the SDMMC peripheral for SD card driver, with values indicating which peripheral to use (1 or 2). Examples: 1 for SDMMC1, 2 for SDMMC2. (1)

MICROPY_HW_SDIO

This configuration set defines the pin assignments and alternate functions for the SDIO interface, including clock, command, and data lines. It allows for the customization of hardware connections necessary for SDIO communication, ensuring proper integration with the SDMMC peripheral.

Macro Description Sample value(s)
MICROPY_HW_SDIO_CK Defines the clock pin for the SDIO interface. (pyb_pin_WL_SDIO_CLK)
MICROPY_HW_SDIO_CLK_ALT Defines the alternate function for the SDIO clock pin. (0)
MICROPY_HW_SDIO_CMD Pin configuration for the SDIO command line. (pyb_pin_WL_SDIO_CMD)
MICROPY_HW_SDIO_CMD_ALT Defines the alternate function for the SDIO command pin. (0)
MICROPY_HW_SDIO_D0 Pin configuration for SDIO data line 0. (pyb_pin_WL_SDIO_D0)
MICROPY_HW_SDIO_D0_ALT Defines the alternate function for the SDIO data line 0 pin. (0)
MICROPY_HW_SDIO_D1 Defines the pin used for SDIO data line 1. (pyb_pin_WL_SDIO_D1)
MICROPY_HW_SDIO_D1_ALT Configures the alternate function for the SDIO data line 1. (0)
MICROPY_HW_SDIO_D2 Pin configuration for SDIO data line 2. (pyb_pin_WL_SDIO_D2)
MICROPY_HW_SDIO_D2_ALT Configures the alternate function for the SDIO data line 2. (0)
MICROPY_HW_SDIO_D3 Defines the pin used for SDIO data line 3. (pyb_pin_WL_SDIO_D3)
MICROPY_HW_SDIO_D3_ALT Configures the alternate function for SDIO data line 3. (0)
MICROPY_HW_SDIO_SDMMC Selects the SDMMC peripheral for the SDIO driver, either 1 or 2. (1)

MICROPY_HW_SDMMC

This configuration set controls the hardware settings for SDMMC interfaces, including clock and data line pin assignments. It allows for the customization of multiple SDMMC interfaces, enabling efficient communication with SD cards or SDIO peripherals.

Macro Description Sample value(s)
MICROPY_HW_SDMMC1_CK Indicates the use of the SDMMC1 clock for SD card or SDIO peripherals. (1)
MICROPY_HW_SDMMC2_CK Indicates the clock configuration for the second SDMMC interface. (1)
MICROPY_HW_SDMMC_CK Defines the clock pin for the SDMMC interface. (pin_C12)
MICROPY_HW_SDMMC_CMD Defines the command pin for the SDMMC interface. (pin_D2)
MICROPY_HW_SDMMC_D0 Defines the data line 0 pin for the SDMMC interface. (pin_C8)
MICROPY_HW_SDMMC_D1 Defines the data line 1 pin for SDMMC interface. (pin_C9)
MICROPY_HW_SDMMC_D2 Defines the pin used for SDMMC data line D2. (pin_C10)
MICROPY_HW_SDMMC_D3 Defines the data line 3 pin for SDMMC interface as pin_C11. (pin_C11)

MICROPY_HW_SDRAM

This configuration set manages various parameters and timing settings for SDRAM, including refresh cycles, burst lengths, and latency. It ensures optimal performance and reliability of SDRAM operations by defining critical aspects such as memory size, clock frequency, and timing delays.

Macro Description Sample value(s)
MICROPY_HW_SDRAM_AUTOREFRESH_NUM Sets the number of auto-refresh cycles for SDRAM. (8)
MICROPY_HW_SDRAM_BURST_LENGTH Defines the burst length for SDRAM operations, affecting data transfer efficiency. (kSEMC_Sdram_BurstLen8)
MICROPY_HW_SDRAM_CAS_LATENCY Defines the CAS latency for SDRAM configuration. (kSEMC_LatencyThree)
MICROPY_HW_SDRAM_CLOCK_PERIOD Timing configuration for SDRAM clock period, set to 2 for 100MHz operation. 2
MICROPY_HW_SDRAM_COLUMN_BITS_NUM Defines the number of column address bits for SDRAM configuration. (kSEMC_SdramColunm_9bit)
MICROPY_HW_SDRAM_DELAY_CHAIN Configures the delay chain for SDRAM timing. (2)
MICROPY_HW_SDRAM_FREQUENCY_KHZ Defines the SDRAM frequency in kilohertz, set to 100 MHz. (100000) // 100 MHz
MICROPY_HW_SDRAM_INTERN_BANKS_NUM Defines the number of internal banks in the SDRAM, set to 4. 4
MICROPY_HW_SDRAM_MEM_BUS_WIDTH Defines the memory bus width for SDRAM, affecting data transfer size and performance. (kSEMC_PortSize32Bit)
MICROPY_HW_SDRAM_RBURST Enables or disables read burst mode for SDRAM. (1)
MICROPY_HW_SDRAM_RBURST_LENGTH Defines the refresh burst length for SDRAM. (1)
MICROPY_HW_SDRAM_REFRESH_CYCLES Determines the number of refresh cycles for SDRAM operation. 4096
MICROPY_HW_SDRAM_REFRESH_RATE Determines the SDRAM refresh rate in milliseconds. (64) // ms
MICROPY_HW_SDRAM_ROW_BITS_NUM Defines the number of bits used for the row address in SDRAM. 12
MICROPY_HW_SDRAM_RPIPE_DELAY Configures the read pipe delay for SDRAM initialization. 0
MICROPY_HW_SDRAM_SIZE Defines the size of the SDRAM in bytes, calculated from the specified bit size. (64 / 8 * 1024 * 1024) // 64 Mbit
MICROPY_HW_SDRAM_STARTUP_TEST Enables a test for SDRAM validity during startup. (1)
MICROPY_HW_SDRAM_TEST_FAIL_ON_ERROR Enables error handling during SDRAM tests, triggering fatal errors on test failures. (true)
MICROPY_HW_SDRAM_TIMING_TMRD Defines the number of clock cycles for the Load-to-Active delay in SDRAM timing. (2)
MICROPY_HW_SDRAM_TIMING_TRAS Defines the minimum time for a row to be active before it can be precharged, measured in nanoseconds. (42)
MICROPY_HW_SDRAM_TIMING_TRC Defines the Row Cycle Time for SDRAM in nanoseconds. (60)
MICROPY_HW_SDRAM_TIMING_TRCD Defines the time delay between a row activation and a read/write command in nanoseconds. (15)
MICROPY_HW_SDRAM_TIMING_TREF Calculates the refresh timing for SDRAM based on a 64ms interval divided by 8192. (64 * 1000000 / 8192) // 64ms/8192
MICROPY_HW_SDRAM_TIMING_TRP Defines the time delay for precharging a row in SDRAM, measured in nanoseconds. (15)
MICROPY_HW_SDRAM_TIMING_TRRD Defines the time required for a row to be activated after another row has been activated, measured in nanoseconds. (60)
MICROPY_HW_SDRAM_TIMING_TWR Defines the write recovery time for SDRAM in nanoseconds. (12)
MICROPY_HW_SDRAM_TIMING_TXSR Defines the exit self-refresh delay timing for SDRAM, measured in nanoseconds. (70)
MICROPY_HW_SDRAM_WRITE_PROTECTION Controls write protection for SDRAM, with 0 indicating disabled. (0)

MICROPY_HW_SOFT

Macro Description Sample value(s)
MICROPY_HW_SOFT_TIMER_ALARM_NUM Index for the hardware timer alarm, with a range of 0-3, where 3 is reserved for the pico-sdk. (2)

MICROPY_HW_SOFTSPI

Macro Description Sample value(s)
MICROPY_HW_SOFTSPI_MAX_BAUDRATE Calculates the maximum baud rate for software SPI based on CPU ticks. (esp_rom_get_cpu_ticks_per_us() * 1000000 / 200) // roughly
MICROPY_HW_SOFTSPI_MIN_DELAY Sets the minimum delay for software SPI operations. (0)

MICROPY_HW_SPI

This configuration set defines the hardware parameters for multiple SPI (Serial Peripheral Interface) buses, including the assignment of pins for MISO, MOSI, SCK, and chip select (NSS) for each SPI interface. It allows for customization of the SPI communication setup, enabling developers to specify the exact hardware connections for their applications.

Macro Description Sample value(s)
MICROPY_HW_SPI0_MISO Defines the MISO pin for SPI0 communication. (pin_P1_0)
MICROPY_HW_SPI0_MOSI Defines the pin used for the MOSI (Master Out Slave In) line of SPI0. (PICO_DEFAULT_SPI_TX_PIN)
MICROPY_HW_SPI0_NAME Defines the name for the SPI0 interface. "SPI0"
MICROPY_HW_SPI0_RSPCK Defines the pin used for the SPI0 clock signal. (pin_P102) // PMOD A
MICROPY_HW_SPI0_SCK Defines the SCK pin for SPI0, requiring pin arguments when no default SPI is set. (0)
MICROPY_HW_SPI0_SSL Defines the SSL pin for SPI0, assigned to pin P103. (pin_P103) // PMOD A
MICROPY_HW_SPI1_MISO Defines the MISO pin for SPI1, typically used for data input. (pin_G9) // Arduino Connector CN7-Pin12 (D12)
MICROPY_HW_SPI1_MOSI Defines the MOSI pin for SPI1, set to pin_B5. (pin_B5) // Arduino Connector CN7-Pin14 (D11)
MICROPY_HW_SPI1_NAME Defines the name of the first SPI bus, used for identification in the code. "SLOT12H"
MICROPY_HW_SPI1_NSS Defines the chip select (NSS) pin for SPI1, typically used for selecting the slave device. (pin_D14) // Arduino Connector CN7-Pin16 (D10)
MICROPY_HW_SPI1_RSPCK Defines the pin used for the SPI1 clock signal. (pin_P102)
MICROPY_HW_SPI1_SCK Defines the default clock pin for SPI1, using IO_MUX pins unless overridden. SPI2_IOMUX_PIN_NUM_CLK
MICROPY_HW_SPI1_SSL Defines the SSL pin for SPI1 communication, set to pin_P104. (pin_P104)
MICROPY_HW_SPI2_MISO Defines the MISO pin for SPI2 communication, typically assigned to a specific GPIO pin. (pin_I2) // Arduino Connector CN13-Pin5 (D12)
MICROPY_HW_SPI2_MOSI Defines the MOSI pin for SPI2, typically set to pin_B15. (pin_B15) // Arduino Connector CN13-Pin4 (D11)
MICROPY_HW_SPI2_NAME Identifies the name of the second SPI bus, typically associated with a specific hardware slot. "SLOT2"
MICROPY_HW_SPI2_NSS Defines the chip select pin for SPI2. (pin_A3) // Arduino Connector CN13-Pin3 (D10)
MICROPY_HW_SPI2_SCK Defines the SCK pin for SPI2, set to GPIO 36 for ESP32S2 and S3, and can be overridden for other targets. (36)
MICROPY_HW_SPI3_MISO Defines the MISO pin for SPI3, set to pin_B4. (pin_B4) // Arduino D5, pin 27 on CN10
MICROPY_HW_SPI3_MOSI Defines the MOSI pin for SPI3, set to pin_B5. (pin_B5) // Arduino D4, pin 29 on CN10
MICROPY_HW_SPI3_NAME Identifies the name of SPI3 interface for mikroBUS slot 3, 4, and FLASH. "SLOT34F"
MICROPY_HW_SPI3_NSS Defines the chip select pin for SPI3, set to pin_A15. (pin_A15)
MICROPY_HW_SPI3_SCK Defines the SCK pin for SPI3, set to pin_B3. (pin_B3) // Arduino D3, pin 31 on CN10
MICROPY_HW_SPI4_MISO Defines the MISO pin for SPI4, set to pin_A1. (pin_A1) // pin 30 on CN7
MICROPY_HW_SPI4_MOSI Defines the MOSI pin for SPI4, assigned to pin_A11. (pin_A11) // pin 14 on CN10
MICROPY_HW_SPI4_NSS Defines the chip select pin for SPI4, used for the ST7735 LCD. (pin_E11)
MICROPY_HW_SPI4_SCK Defines the SCK pin for SPI4, set to pin_B13. (pin_B13) // pin 30 on CN10
MICROPY_HW_SPI5_MISO Defines the MISO pin for SPI5, typically used for data input. (pin_A12) // pin 12 on CN10
MICROPY_HW_SPI5_MOSI Defines the MOSI pin for SPI5, set to pin_B0. (pin_B0) // pin 34 on CN7
MICROPY_HW_SPI5_NSS Defines the chip select pin for SPI5, set to pin_F6. (pin_F6)
MICROPY_HW_SPI5_SCK Defines the SCK pin for SPI5, set to pin_A10. (pin_A10) // pin 33 on CN10
MICROPY_HW_SPI_INDEX Defines the mapping of hardware SPI interfaces to logical SPI indices. { 1, 6, 5 }
MICROPY_HW_SPI_MAX Determines the maximum number of available hardware SPI peripherals. (2)
MICROPY_HW_SPI_NO_DEFAULT_PINS Indicates that no default SPI pins are defined, requiring explicit pin assignments. (1)
MICROPY_HW_SPI_NUM Determines the number of SPI interfaces based on the size of the spi_index_table array. MP_ARRAY_SIZE(spi_index_table)
MICROPY_HW_SPI_PIN_UNUSED Represents an unused SPI pin, set to UINT8_MAX to indicate no valid pin assigned. UINT8_MAX

MICROPY_HW_SPIFLASH

This configuration set manages the integration and operation of external SPI flash memory within a system, allowing for customizable parameters such as communication speed, pin assignments, and memory size. It also facilitates features like device detection, caching, and software reset, enhancing the overall functionality and performance of the file system.

Macro Description Sample value(s)
MICROPY_HW_SPIFLASH Enables the use of external SPI flash for the file system. (1)
MICROPY_HW_SPIFLASH_BAUDRATE Sets the baud rate for SPI communication with the flash memory. (24000000)
MICROPY_HW_SPIFLASH_CHIP_PARAMS Enables dynamic detection and configuration of SPI flash chip parameters. (1)
MICROPY_HW_SPIFLASH_CS Defines the chip select pin for the SPI flash memory. (pin_D6)
MICROPY_HW_SPIFLASH_DETECT_DEVICE Enables detection of the SPI flash device during initialization. (1)
MICROPY_HW_SPIFLASH_ENABLE_CACHE Enables caching for external SPI flash to support smaller block writes. (1)
MICROPY_HW_SPIFLASH_ID Identifies the SPI flash memory device used on the hardware. (2)
MICROPY_HW_SPIFLASH_IO0 Defines the pin used for the first I/O line of the external SPI flash. (pyb_pin_QSPI1_D0)
MICROPY_HW_SPIFLASH_IO1 Defines the pin used for the second data line (D1) in the QSPI interface. (pyb_pin_QSPI1_D1)
MICROPY_HW_SPIFLASH_IO2 Defines the pin used for the second data line (D2) in QSPI flash communication. (pyb_pin_QSPI1_D2)
MICROPY_HW_SPIFLASH_IO3 Defines the pin used for the third data line in QSPI flash communication. (pyb_pin_QSPI1_D3)
MICROPY_HW_SPIFLASH_MISO Defines the MISO pin for SPI flash communication, varying by board version. (pyb_pin_FLASH_MISO_V13)
MICROPY_HW_SPIFLASH_MOSI Defines the MOSI pin for the SPI flash interface. (MICROPY_HW_SPI1_MOSI)
MICROPY_HW_SPIFLASH_OFFSET_BYTES Offset in bytes for SPI flash storage, skipping the first 1MiB used by the bootloader. (1024 * 1024)
MICROPY_HW_SPIFLASH_SCK Defines the clock pin for the SPI flash interface. (MICROPY_HW_SPI1_SCK)
MICROPY_HW_SPIFLASH_SIZE_BITS Defines the size of the SPI flash memory in bits, allowing for configuration of external storage. (120 * 1024 * 1024)
MICROPY_HW_SPIFLASH_SIZE_BYTES Defines the size of the SPI flash memory in bytes, set to 8 MB. (8 * 1024 * 1024)
MICROPY_HW_SPIFLASH_SOFT_RESET Enables software reset functionality for SPI flash. (1)

MICROPY_HW_STDIN

Macro Description Sample value(s)
MICROPY_HW_STDIN_BUFFER_LEN Defines the length of the standard input buffer, defaulting to 512 bytes. 512

MICROPY_HW_STM

Macro Description Sample value(s)
MICROPY_HW_STM_USB_STACK Enables the STM USB stack when USB support is active and TinyUSB is not used. (MICROPY_HW_ENABLE_USB && !MICROPY_HW_TINYUSB_STACK)

MICROPY_HW_STM32WB

Macro Description Sample value(s)
MICROPY_HW_STM32WB_FLASH_SYNCRONISATION Enables synchronization mechanisms for flash operations on STM32WB devices. (1)

MICROPY_HW_SUBGHZSPI

Macro Description Sample value(s)
MICROPY_HW_SUBGHZSPI_ID Identifies the SUBGHZSPI interface for configuration and usage. 3
MICROPY_HW_SUBGHZSPI_NAME Identifies the SPI bus used for the SUBGHZ internal radio. "SUBGHZ"

MICROPY_HW_SYSTEM

Macro Description Sample value(s)
MICROPY_HW_SYSTEM_TICK_USE_SYSTICK Enables the use of the SysTick timer for system tick management. (1)
MICROPY_HW_SYSTEM_TICK_USE_UTIMER Enables the use of the UTIMER for system tick implementation. (1)

MICROPY_HW_TINYUSB

Macro Description Sample value(s)
MICROPY_HW_TINYUSB_LL_INIT Calls the low-level TinyUSB initialization function. mp_usbd_ll_init
MICROPY_HW_TINYUSB_STACK Enables the use of the TinyUSB stack for USB functionality. (0)

MICROPY_HW_UART

This configuration set manages the pin assignments and operational parameters for multiple UART interfaces, allowing for customization of serial communication settings. It includes definitions for transmit and receive pins, flow control signals, and additional features like hardware flow control, ensuring flexibility in hardware design and communication protocols.

Macro Description Sample value(s)
MICROPY_HW_UART0_CTS Defines the pin used for the Clear To Send (CTS) signal of UART0. (pin_P0_2)
MICROPY_HW_UART0_RTS Defines the pin used for the RTS (Request to Send) signal of UART0. (pin_P0_3)
MICROPY_HW_UART0_RX Defines the receive pin for UART0, typically assigned to a specific GPIO pin. (pin_P410) // MBRX0
MICROPY_HW_UART0_TX Defines the transmit pin for UART0, allowing customization of UART pin assignments. (16)
MICROPY_HW_UART10_RX Defines the receive pin for UART10 as pyb_pin_PORTE_RX. (pyb_pin_PORTE_RX)
MICROPY_HW_UART10_TX Defines the transmit pin for UART10 on Port E. (pyb_pin_PORTE_TX)
MICROPY_HW_UART1_CTS Defines the pin used for the Clear To Send (CTS) signal for UART1. (pin_P403) // PMOD B
MICROPY_HW_UART1_HWFC Enables hardware flow control for UART1. (1)
MICROPY_HW_UART1_NAME Defines the name for UART1, used for identifying the UART interface. "SLOT4"
MICROPY_HW_UART1_PINS Defines the GPIO pins used for UART1 communication. (GPIO_PIN_6 | GPIO_PIN_7)
MICROPY_HW_UART1_PORT Defines the GPIO port used for UART1 communication. (GPIOB)
MICROPY_HW_UART1_RTS Defines the RTS (Request to Send) pin for UART1 communication. (pyb_pin_BT_RTS)
MICROPY_HW_UART1_RX Defines the receive pin for UART1, typically used for serial communication. (28)
MICROPY_HW_UART1_TX Defines the transmit pin for UART1, typically assigned to a specific GPIO pin. (pin_P213)
MICROPY_HW_UART2_CK Defines the clock pin for UART2 as pin_A4. (pin_A4)
MICROPY_HW_UART2_CTS Defines the pin used for Clear To Send (CTS) flow control in UART2. (pin_D3)
MICROPY_HW_UART2_NAME Defines the name for UART2, allowing identification in code. "UART1"
MICROPY_HW_UART2_PINS Defines the GPIO pins used for UART2 communication. (GPIO_PIN_2 | GPIO_PIN_3)
MICROPY_HW_UART2_PORT Defines the GPIO port for UART2 as GPIOA. (GPIOA)
MICROPY_HW_UART2_RTS Defines the RTS (Request to Send) pin for UART2 communication. (pin_A1) // Arduino A1, pin 30 on CN7
MICROPY_HW_UART2_RX Defines the receive pin for UART2, typically set to pin_A3. (pin_A3) // Arduino D0, pin 37 on CN10
MICROPY_HW_UART2_TX Defines the transmit pin for UART2, typically assigned to a specific GPIO pin. (pin_P302)
MICROPY_HW_UART3_CTS Defines the pin used for the Clear To Send (CTS) signal for UART3. (pin_B13) // pin 30 on CN10
MICROPY_HW_UART3_NAME Defines the name for UART3 configuration, typically associated with specific pins. "SLOT1"
MICROPY_HW_UART3_PINS Defines the GPIO pins used for UART3 communication. (GPIO_PIN_10 | GPIO_PIN_11)
MICROPY_HW_UART3_PORT Defines the GPIO port for UART3 as GPIOB. (GPIOB)
MICROPY_HW_UART3_RTS Defines the RTS (Request to Send) pin for UART3, set to pin_B14. (pin_B14) // pin 28 on CN10
MICROPY_HW_UART3_RX Defines the RX pin for UART3, typically set to pin_B11. (pin_B11) // Arduino Connector CN15-Pin1 (D0)
MICROPY_HW_UART3_RX_PULL Configures the pull-up/pull-down resistor setting for UART3 RX pin. (GPIO_NOPULL)
MICROPY_HW_UART3_TX Defines the transmit pin for UART3, typically set to pin_B10. (pin_B10) // B9, B10, C10, D8
MICROPY_HW_UART4_CTS Defines the pin used for the Clear To Send (CTS) signal in UART4 communication. (pyb_pin_BT_CTS)
MICROPY_HW_UART4_NAME Defines the name for UART4, used for identifying the UART interface. "HDR2"
MICROPY_HW_UART4_PINS Defines the GPIO pins used for UART4 communication. (GPIO_PIN_0 | GPIO_PIN_1)
MICROPY_HW_UART4_PORT Defines the GPIO port for UART4 as GPIOA. (GPIOA)
MICROPY_HW_UART4_RTS Defines the RTS pin for UART4 communication. (pyb_pin_BT_RTS)
MICROPY_HW_UART4_RX Defines the receive pin for UART4, typically set to a specific GPIO pin. (pin_A1) // Arduino A1, pin 30 on CN7
MICROPY_HW_UART4_TX Defines the transmit pin for UART4, typically set to a specific GPIO pin. (pin_A0)
MICROPY_HW_UART5_RX Defines the receive pin for UART5, typically assigned to a specific GPIO pin. (pin_B13) // or SPI2
MICROPY_HW_UART5_TX Defines the transmit pin for UART5, set to pin_B0. (pin_B0)
MICROPY_HW_UART6_CTS Defines the pin used for the Clear To Send (CTS) signal for UART6. (pin_G13) // PG13,PG15
MICROPY_HW_UART6_NAME Defines the name for UART6, used for identifying the UART interface. "YA"
MICROPY_HW_UART6_PINS Defines the GPIO pins used for UART6 communication. (GPIO_PIN_6 | GPIO_PIN_7)
MICROPY_HW_UART6_PORT Defines the GPIO port for UART6 as GPIOC. (GPIOC)
MICROPY_HW_UART6_RTS Defines the RTS pin for UART6, set to pin_G8. (pin_G8) // PG8,PG12
MICROPY_HW_UART6_RX Defines the receive pin for UART6, set to pin_C7. (pin_C7) // Arduino D9, pin 19 on CN10
MICROPY_HW_UART6_TX Defines the transmit pin for UART6, typically set to pin_C6. (pin_C6)
MICROPY_HW_UART7_CTS Defines the pin used for UART7 Clear To Send (CTS) functionality. (pin_P403) // PMOD B
MICROPY_HW_UART7_RTS Defines the RTS pin for UART7 communication. (pyb_pin_BT_RTS)
MICROPY_HW_UART7_RX Defines the receive pin for UART7, set to pin_P402. (pin_P402) // PMOD B
MICROPY_HW_UART7_TX Defines the transmit pin for UART7, set to pin_P401. (pin_P401) // PMOD B
MICROPY_HW_UART8_CTS Defines the pin used for UART8 Clear To Send (CTS) functionality. (pin_P107) // PMOD B
MICROPY_HW_UART8_RTS Defines the RTS pin for UART8 communication, set to pin_P606. (pin_P606)
MICROPY_HW_UART8_RX Defines the receive pin for UART8, set to pin_P104. (pin_P104) // PMOD B
MICROPY_HW_UART8_TX Defines the transmit pin for UART8, set to pin P105. (pin_P105) // PMOD B
MICROPY_HW_UART9_CTS Defines the pin used for the Clear To Send (CTS) signal of UART9. (pin_P604)
MICROPY_HW_UART9_RTS Defines the RTS pin for UART9 as pin_P603. (pin_P603)
MICROPY_HW_UART9_RX Defines the receive pin for UART9, typically used for serial communication. (pyb_pin_PORTF_RX)
MICROPY_HW_UART9_TX Defines the transmit pin for UART9, set to pin_P602. (pin_P602)
MICROPY_HW_UART_INDEX Defines the mapping of logical UART indices to hardware UART numbers. { 0, 6, 4, 2, 3, 8, 1, 7, 5 }
MICROPY_HW_UART_NO_DEFAULT_PINS Indicates that UART pins must be explicitly defined instead of using default pins. (1)
MICROPY_HW_UART_NUM Calculates the number of UARTs based on the size of the uart_index_table array. (sizeof(uart_index_table) / sizeof(uart_index_table)[0])
MICROPY_HW_UART_REPL Identifies the UART interface used for the REPL (Read-Eval-Print Loop). Examples: HW_UART_0, HW_UART_1. HW_UART_0
MICROPY_HW_UART_REPL_BAUD Defines the baud rate for the REPL UART interface, defaulting to 115200. (115200)
MICROPY_HW_UART_REPL_RXBUF Defines the size of the receive buffer for the UART REPL, set to 260 bytes. (260)
MICROPY_HW_UART_RTSCTS Enables RTS/CTS hardware flow control for UART communication. (SAMD21_EXTRA_FEATURES)
MICROPY_HW_UART_TXBUF Enables the use of a transmit buffer for UART communication. (1)

MICROPY_HW_USB

This configuration group manages various aspects of USB functionality, including support for USB CDC, HID, and Mass Storage Class, as well as defining interface strings and buffer sizes. It allows for customization of USB communication parameters, such as speed modes and timeout settings, ensuring compatibility with different hardware setups and use cases.

Macro Description Sample value(s)
MICROPY_HW_USB_CDC Enables USB CDC (Communication Device Class) functionality when USB device support is enabled. (MICROPY_HW_ENABLE_USBDEV)
MICROPY_HW_USB_CDC_1200BPS_TOUCH Enables support for USB CDC communication at 1200 bps with touch functionality. (1)
MICROPY_HW_USB_CDC_DTR_RTS_BOOTLOADER Enables bootloader functionality via DTR/RTS signals for USB CDC. (0)
MICROPY_HW_USB_CDC_INTERFACE_STRING Defines the USB CDC interface string for the board. "Board CDC"
MICROPY_HW_USB_CDC_NUM Sets the maximum number of CDC VCP interfaces available. (2)
MICROPY_HW_USB_CDC_RX_DATA_SIZE Defines the size of the incoming buffer for each CDC instance, must be a power of 2. (1024)
MICROPY_HW_USB_CDC_TX_DATA_SIZE Defines the size of the outgoing buffer for each CDC instance, set to 1024 bytes. (1024)
MICROPY_HW_USB_CDC_TX_TIMEOUT Defines the timeout duration for USB CDC transmission in milliseconds. (500)
MICROPY_HW_USB_CDC_TX_TIMEOUT_MS Sets the timeout duration for USB CDC transmission in milliseconds. (500)
MICROPY_HW_USB_CONFIGURATION_FS_STRING Defines the USB configuration string for full-speed mode. "Nicla Vision Config"
MICROPY_HW_USB_CONFIGURATION_HS_STRING Defines the USB configuration string for high-speed mode. "Nicla Vision Config"
MICROPY_HW_USB_DESC_STR_MAX Maximum length for USB descriptor strings, including a terminating byte. (40)
MICROPY_HW_USB_FS Enables USB Full Speed support for hardware configurations. (1)
MICROPY_HW_USB_HID Enables USB HID support when the STM USB stack is active. (MICROPY_HW_STM_USB_STACK)
MICROPY_HW_USB_HS Enables high-speed USB OTG functionality with external PHY support. (1)
MICROPY_HW_USB_HS_IN_FS Enables high-speed USB functionality in full-speed mode. (1)
MICROPY_HW_USB_HS_ULPI3320 Enables support for the ULPI3320 USB high-speed PHY. (1)
MICROPY_HW_USB_HS_ULPI_DIR Defines the pin used for the ULPI DIR signal in USB high-speed configurations. (pin_I11)
MICROPY_HW_USB_HS_ULPI_NXT Defines the pin used for the ULPI NXT signal in USB high-speed configuration. (pin_C3)
MICROPY_HW_USB_HS_ULPI_STP Defines the STP pin for USB HS ULPI interface. (pin_C0)
MICROPY_HW_USB_INTERFACE_FS_STRING Defines the USB interface string for full-speed mode. "Nicla Vision Interface"
MICROPY_HW_USB_INTERFACE_HS_STRING Defines the USB high-speed interface string for the device. "Nicla Vision Interface"
MICROPY_HW_USB_IS_MULTI_OTG Indicates whether the USB peripheral supports multiple OTG modes (0 for single, 1 for multi). Examples: STM32G0, STM32H5 (0); other STM32 models (1). (0)
MICROPY_HW_USB_LANGID_STRING Language ID for USB descriptors, set to 0x409 (English - United States). Examples: 0x409 for English, 0x0407 for German. 0x409
MICROPY_HW_USB_MAIN_DEV Determines the main USB device used for the REPL or USB DFU interface, based on USB PHY configuration. (USB_PHY_FS_ID)
MICROPY_HW_USB_MANUFACTURER_STRING Defines the USB manufacturer string for the device. "Pololu Corporation"
MICROPY_HW_USB_MSC Enables USB Mass Storage functionality with FatFS filesystem support. (1)
MICROPY_HW_USB_MSC_INQUIRY_PRODUCT_STRING Defines the product string for USB MSC inquiries, typically identifying the device. "pyboard Flash "
MICROPY_HW_USB_MSC_INQUIRY_REVISION_STRING Defines the revision string for USB Mass Storage Class inquiry responses. "1.00"
MICROPY_HW_USB_MSC_INQUIRY_VENDOR_STRING Defines the vendor string for USB Mass Storage Class inquiries. "MicroPy "
MICROPY_HW_USB_MSC_INTERFACE_STRING Defines the interface string for the USB Mass Storage Class. "Board MSC"
MICROPY_HW_USB_OTG_ID_PIN Defines the pin used for USB OTG ID functionality, typically set to pin_A10. (pin_A10)
MICROPY_HW_USB_PID USB Product ID for TinyUSB Stack. (0x9802)
MICROPY_HW_USB_PID_CDC Defines the USB Product ID for CDC (Communication Device Class) functionality. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC2 Defines the USB Product ID for the second CDC interface. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC2_MSC Defines the USB Product ID for CDC and MSC functionality with two CDC interfaces. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC2_MSC_HID Defines the USB Product ID for CDC2, MSC, and HID functionality. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC3 Defines the USB Product ID for the CDC3 interface. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC3_MSC Defines the USB Product ID for CDC3 with MSC functionality. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC3_MSC_HID Defines the USB Product ID for CDC3 with MSC and HID support. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC_HID Defines the USB Product ID for CDC and HID functionality. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_CDC_MSC USB Product ID for CDC and MSC mode in STM USB stack. (0x9800)
MICROPY_HW_USB_PID_CDC_MSC_HID Defines the USB Product ID for CDC, MSC, and HID functionality. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PID_MSC Defines the USB Product ID for the Mass Storage Class. (MICROPY_HW_USB_PID)
MICROPY_HW_USB_PRODUCT_FS_STRING Defines the USB product string for full-speed mode. "Nicla Vision Virtual Comm Port in FS Mode"
MICROPY_HW_USB_PRODUCT_HS_STRING Defines the USB product string for high-speed mode. "Nicla Vision Virtual Comm Port in HS Mode"
MICROPY_HW_USB_VBUS_DETECT_PIN Defines the pin used for USB VBUS detection. (pyb_pin_USB_VBUS)
MICROPY_HW_USB_VID Defines the Vendor ID for USB devices. (0x2886)

MICROPY_HW_USES

Macro Description Sample value(s)
MICROPY_HW_USES_BOOTLOADER Indicates whether the hardware uses a bootloader based on the vector table offset. (MICROPY_HW_VTOR != 0x08000000)

MICROPY_HW_USRSW

This configuration group manages the settings for a user switch, including its pin assignment, interrupt mode, state indication when pressed, and pull resistor configuration. It allows for flexible integration and behavior of the user switch in various applications.

Macro Description Sample value(s)
MICROPY_HW_USRSW_EXTI_MODE Configures the external interrupt mode for the user switch. (MP_HAL_PIN_TRIGGER_FALLING)
MICROPY_HW_USRSW_PIN Defines the pin used for the user switch, which can be configured for different behaviors. (pin_C13)
MICROPY_HW_USRSW_PRESSED Indicates the state of the user switch when pressed, typically defined as 1 for active high configurations. (1)
MICROPY_HW_USRSW_PULL Configures the pull-up or pull-down resistor for the user switch. (MP_HAL_PIN_PULL_NONE)

MICROPY_HW_WIFI

This configuration group manages the hardware settings and pin assignments necessary for WiFi communication, including data signaling, SPI interface parameters, and interrupt handling. It ensures proper connectivity and functionality of WiFi modules by defining critical pins and communication speeds.

Macro Description Sample value(s)
MICROPY_HW_WIFI_DATAREADY Indicates the data ready pin for WiFi operations. (pin_P803)
MICROPY_HW_WIFI_HANDSHAKE Pin used for WiFi handshake signaling. (pin_P806)
MICROPY_HW_WIFI_IRQ_PIN Defines the interrupt pin for Wi-Fi data ready events. (MICROPY_HW_WIFI_DATAREADY)
MICROPY_HW_WIFI_SPI_BAUDRATE Sets the baud rate for the WiFi SPI communication. (25 * 1000 * 1000)
MICROPY_HW_WIFI_SPI_CS Defines the chip select pin for the WiFi SPI interface. (pin_P104)
MICROPY_HW_WIFI_SPI_ID Identifies the SPI interface used for WiFi communication. (1)
MICROPY_HW_WIFI_SPI_MISO Defines the GPIO pin number for the MISO line in the Wi-Fi SPI interface. (14)
MICROPY_HW_WIFI_SPI_MOSI Defines the GPIO pin number for the MOSI line in the Wi-Fi SPI interface. (12)
MICROPY_HW_WIFI_SPI_SCK Defines the GPIO pin number for the SPI clock line used in Wi-Fi communication. (13)

MICROPY_HW_WIZNET

This configuration set manages the hardware interface for the WIZnet network module, including pin assignments for chip select, reset, and interrupt handling. It also specifies the SPI communication parameters such as baud rate and pin mappings for MISO, MOSI, and SCK, ensuring proper connectivity and data transfer between the microcontroller and the WIZnet module.

Macro Description Sample value(s)
MICROPY_HW_WIZNET_PIN_CS Defines the chip select pin for the WIZnet network module. (21)
MICROPY_HW_WIZNET_PIN_INTN Enables RECV interrupt handling for incoming data on the INTN pin. (21)
MICROPY_HW_WIZNET_PIN_RST Maps the reset pin for the WIZnet module to an unused GPIO pin. (9)
MICROPY_HW_WIZNET_SPI_BAUDRATE Sets the baud rate for the Wiznet SPI interface to 20 MHz. (20 * 1000 * 1000)
MICROPY_HW_WIZNET_SPI_ID Identifies the SPI interface for Wiznet hardware configuration. (0)
MICROPY_HW_WIZNET_SPI_MISO Defines the GPIO pin number for the MISO line of the Wiznet SPI interface. (12)
MICROPY_HW_WIZNET_SPI_MOSI Defines the GPIO pin number for the MOSI (Master Out Slave In) line in the Wiznet SPI configuration. (11)
MICROPY_HW_WIZNET_SPI_SCK Defines the SPI clock pin number for Wiznet hardware configurations. (10)

MICROPY_HW_XOSC32K

Macro Description Sample value(s)
MICROPY_HW_XOSC32K Enables the use of a 32kHz crystal oscillator for clock generation. (1)

MICROPY_HW_XSPI

Macro Description Sample value(s)
MICROPY_HW_XSPI_CS_HIGH_CYCLES Determines the number of cycles nCS remains high, set to 4 cycles. (2) // nCS stays high for 4 cycles
MICROPY_HW_XSPI_PRESCALER Sets the prescaler for the XSPI clock frequency, calculated as F_CLK = F_AHB/4. (4) // F_CLK = F_AHB/4

MICROPY_HW_XSPIFLASH

Macro Description Sample value(s)
MICROPY_HW_XSPIFLASH_SIZE_BITS_LOG2 Log2 of the size in bits of the external SPI flash memory. (29)

MICROPY_MODULE

This configuration set manages various aspects of module behavior and attributes in MicroPython, including initialization, delegation, and import handling. It allows for customization of module loading, supports frozen modules, and controls how attributes like all and file are processed, enhancing the flexibility and functionality of module management.

Macro Description Sample value(s)
MICROPY_MODULE_ATTR_DELEGATION Enables modules to delegate attribute lookups to a custom handler function. (MICROPY_PY_SYS_ATTR_DELEGATION || MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_MODULE_BUILTIN_INIT Controls whether to call init when importing built-in modules for the first time. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_MODULE_BUILTIN_SUBPACKAGES Enables support for built-in subpackages in modules. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_MODULE_DELEGATIONS Defines delegation entries for module attribute handling. \
MICROPY_MODULE_DICT_SIZE Initial size of the module dictionary. (1)
MICROPY_MODULE_FROZEN Enables support for frozen modules, allowing loading of precompiled modules from flash memory. (MICROPY_MODULE_FROZEN_STR || MICROPY_MODULE_FROZEN_MPY)
MICROPY_MODULE_FROZEN_LEXER Defines the function used for creating a lexer from frozen module strings. mp_lexer_new_from_str_len
MICROPY_MODULE_FROZEN_MPY Enables support for frozen modules in the form of .mpy files. (0)
MICROPY_MODULE_FROZEN_STR Enables support for frozen modules in the form of strings. (0)
MICROPY_MODULE_GETATTR Enables support for module-level getattr functionality. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_MODULE_OVERRIDE_MAIN_IMPORT Enables setting name to 'main' for modules imported with the -m flag. (1)
MICROPY_MODULE___ALL__ Controls processing of all when importing public symbols from a module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_BASIC_FEATURES)
MICROPY_MODULE___FILE__ Controls whether the file attribute is set on imported modules. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_NLR

This configuration set manages the support for non-local returns (NLR) across various CPU architectures, allowing for efficient exception handling and control flow. It specifies the number of registers to be saved during non-local jumps and enables architecture-specific optimizations, ensuring compatibility and performance across different platforms.

Macro Description Sample value(s)
MICROPY_NLR_AARCH64 Enables non-local returns (NLR) support for AArch64 architecture. (1)
MICROPY_NLR_MIPS Enables non-local returns for MIPS architecture. (1)
MICROPY_NLR_NUM_REGS Determines the number of registers to save for non-local returns based on the architecture. (MICROPY_NLR_NUM_REGS_ARM_THUMB_FP)
MICROPY_NLR_NUM_REGS_AARCH64 Defines the number of registers to save for non-local jumps on AArch64 architecture. (13)
MICROPY_NLR_NUM_REGS_ARM_THUMB Defines the number of registers used for non-local returns in ARM Thumb architecture. (10)
MICROPY_NLR_NUM_REGS_ARM_THUMB_FP Defines the number of registers for ARM Thumb with floating-point support, calculated as 16. (10 + 6)
MICROPY_NLR_NUM_REGS_MIPS Defines the number of non-local return (NLR) registers for MIPS architecture. (13)
MICROPY_NLR_NUM_REGS_RV32I Defines the number of registers for non-local returns in RV32I architecture. (14)
MICROPY_NLR_NUM_REGS_RV64I Defines the number of registers for non-local returns in RV64I architecture. (14)
MICROPY_NLR_NUM_REGS_X64 Defines the number of registers used for non-local returns on x64 architecture. (8)
MICROPY_NLR_NUM_REGS_X64_WIN Defines the number of NLR registers for x64 architecture on Windows. (10)
MICROPY_NLR_NUM_REGS_X86 Defines the number of registers used for non-local returns on x86 architecture. (6)
MICROPY_NLR_NUM_REGS_XTENSA Defines the number of registers used for non-local returns on Xtensa architecture. (10)
MICROPY_NLR_NUM_REGS_XTENSAWIN Defines the number of NLR (Non-Local Return) registers for the Xtensa Windows architecture. (17)
MICROPY_NLR_OS_WINDOWS Indicates the use of Windows-specific handling for non-local returns. 1
MICROPY_NLR_POWERPC Enables non-local return (NLR) support for PowerPC architecture. (1)
MICROPY_NLR_RV32I Enables non-local return support for RISC-V 32-bit architecture. (1)
MICROPY_NLR_RV64I Enables non-local return support for RISC-V 64-bit architecture. (1)
MICROPY_NLR_SETJMP Enables the use of setjmp/longjmp for non-local jumps in exception handling. (1)
MICROPY_NLR_THUMB Enables non-local returns for Thumb architecture. (1)
MICROPY_NLR_THUMB_USE_LONG_JUMP Enables long jump for NLR code in Thumb architecture to ensure proper execution. (1)
MICROPY_NLR_X64 Enables non-local returns for x86-64 architecture. (1)
MICROPY_NLR_X86 Enables non-local returns for x86 architecture. (1)
MICROPY_NLR_XTENSA Enables non-local returns for Xtensa architecture. (1)

MICROPY_OBJ

This configuration set focuses on the alignment, representation, and encoding of objects in MicroPython, optimizing memory usage and access efficiency. It allows for various object representation formats, including immediate objects and different bit-width encodings, to enhance performance and reduce code size.

Macro Description Sample value(s)
MICROPY_OBJ_BASE_ALIGNMENT Ensures MicroPython objects are aligned on a specified byte boundary for proper memory access. -
MICROPY_OBJ_IMMEDIATE_OBJS Determines if None, False, and True are encoded as immediate objects instead of pointers, reducing code size. (MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_D)
MICROPY_OBJ_REPR Controls the object representation format used in MicroPython. (MICROPY_OBJ_REPR_B)
MICROPY_OBJ_REPR_A Defines the object representation format for small integers, qstrs, immediate objects, and pointers. (0)
MICROPY_OBJ_REPR_B Defines the representation format for MicroPython objects, allowing encoding of small integers, qstrs, immediate objects, and pointers. (1)
MICROPY_OBJ_REPR_C Defines the representation of objects using a 32-bit word format for efficient encoding and decoding. (2)
MICROPY_OBJ_REPR_D Defines a 64-bit object representation format using nan-boxing for efficient memory usage. (3)

MICROPY_OPT

This configuration group optimizes various performance aspects of the MicroPython virtual machine and its built-in functions. It enhances execution speed, reduces lookup times, and improves the efficiency of mathematical operations, ultimately leading to a more responsive and efficient programming environment.

Macro Description Sample value(s)
MICROPY_OPT_COMPUTED_GOTO Enables computed gotos for a performance boost in the VM, improving execution speed by approximately 10%. (1)
MICROPY_OPT_LOAD_ATTR_FAST_PATH Optimizes attribute loading from instance types, increasing code size by approximately 48 bytes. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_OPT_MAP_LOOKUP_CACHE Enables caching of map lookups to improve performance by reducing search times. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_OPT_MAP_LOOKUP_CACHE_SIZE Determines the amount of RAM (in bytes) allocated for the map lookup cache. (128)
MICROPY_OPT_MATH_FACTORIAL Controls the implementation efficiency of the math.factorial function. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_OPT_MPZ_BITWISE Enables fast bitwise operations for positive arguments, increasing code size. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PERSISTENT

This configuration group manages the persistence of code and data in MicroPython, allowing for the storage, loading, and execution of compiled modules and native code across different runtime instances. It also includes features for tracking memory usage to prevent unwanted garbage collection, ensuring that critical data remains accessible.

Macro Description Sample value(s)
MICROPY_PERSISTENT_CODE Enables the persistence of generated code independent of the VM/runtime instance. (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_LOAD_NATIVE || MICROPY_PERSISTENT_CODE_SAVE || MICROPY_MODULE_FROZEN_MPY)
MICROPY_PERSISTENT_CODE_LOAD Enables loading of .mpy files for persistent code execution. (1)
MICROPY_PERSISTENT_CODE_LOAD_NATIVE Enables loading of persistent native code, defined as the machine code emitter. (MICROPY_EMIT_MACHINE_CODE)
MICROPY_PERSISTENT_CODE_SAVE Enables saving of persistent code data, allowing for the storage of compiled modules. (MICROPY_PY_SYS_SETTRACE)
MICROPY_PERSISTENT_CODE_SAVE_FILE Enables saving persistent code to a file when set to 1, applicable on certain platforms. (1)
MICROPY_PERSISTENT_CODE_SAVE_FUN Enables support for converting functions to persistent code using the marshal module. (MICROPY_PY_MARSHAL)
MICROPY_PERSISTENT_CODE_TRACK_BSS_RODATA Enables tracking of BSS/rodata memory to prevent garbage collection from reclaiming it. (1)
MICROPY_PERSISTENT_CODE_TRACK_FUN_DATA Enables tracking of native function data to prevent garbage collection from reclaiming it. (1)

MICROPY_PLATFORM

This configuration group manages essential platform-specific details for building MicroPython, including architecture, compiler information, and the underlying operating system. It ensures that the build process is tailored to the specific environment by providing necessary identifiers and versioning for the platform and its components.

Macro Description Sample value(s)
MICROPY_PLATFORM_ARCH Identifies the architecture of the platform, such as 'aarch64', 'arm', 'x86_64', or 'riscv64'. "aarch64"
MICROPY_PLATFORM_COMPILER Identifies the compiler used for building the platform, formatted as a string. ""
MICROPY_PLATFORM_COMPILER_BITS Indicates the bitness of the compiler platform, either '64 bit' or '32 bit'. "64 bit"
MICROPY_PLATFORM_LIBC_LIB Identifies the C standard library in use, such as 'glibc', 'newlib', or 'picolibc'. "picolibc"
MICROPY_PLATFORM_LIBC_VER Holds the version of the libc library as a string, specifically for Android API. MP_STRINGIFY(ANDROID_API)
MICROPY_PLATFORM_SYSTEM Identifies the underlying platform, such as 'Android', 'Linux', 'Windows', etc. "MicroPython"
MICROPY_PLATFORM_VERSION Defines the version of the platform being used, concatenated with other identifiers. "IDF" IDF_VER

MICROPY_PORT

This configuration group manages various port-specific settings and functionalities, including memory section definitions, built-in functions, and network interface parameters. It allows customization of initialization and deinitialization processes, as well as the setup of WLAN access points and server functionalities like FTP and Telnet.

Macro Description Sample value(s)
MICROPY_PORT_BSSSECTION Defines the name of the BSS section for uninitialized variables. "upybss"
MICROPY_PORT_BUILTINS Defines additional built-in names for the global namespace. \
MICROPY_PORT_CONSTANTS Defines additional constants for a specific port. \
MICROPY_PORT_DATASECTION Assigns a name for sections containing static/global variables to facilitate easier map file inspection. "upydata"
MICROPY_PORT_DEINIT_FUNC Calls a port-specific deinitialization function during the deinitialization process. deinit()
MICROPY_PORT_EXTRA_BUILTINS Allows the inclusion of additional built-in functions specific to a port. -
MICROPY_PORT_HAS_FTP Enables FTP server functionality in the CC3200 port. (1)
MICROPY_PORT_HAS_TELNET Enables Telnet server functionality in the port. (1)
MICROPY_PORT_INIT_FUNC Calls a port-specific initialization function during startup. init()
MICROPY_PORT_NETWORK_INTERFACES Combines board-specific network interface definitions for use in network modules. \
MICROPY_PORT_SFLASH_BLOCK_COUNT Determines the number of blocks in the serial flash memory. 32
MICROPY_PORT_WLAN_AP_CHANNEL Sets the channel for the WLAN access point. 5
MICROPY_PORT_WLAN_AP_KEY Defines the access point key for WLAN connections. "www.wipy.io"
MICROPY_PORT_WLAN_AP_SECURITY Sets the security type for the WLAN access point to WPA/WPA2. SL_SEC_TYPE_WPA_WPA2
MICROPY_PORT_WLAN_AP_SSID Defines the SSID for the WLAN access point. "wipy-wlan"

MICROPY_PY

This configuration group manages various features and functionalities related to Python's special methods, asynchronous programming, and Bluetooth support. It enables efficient data handling, advanced programming constructs, and Bluetooth communication capabilities, allowing developers to customize their MicroPython builds according to specific application needs.

MICROPY_PY_ALL

Macro Description Sample value(s)
MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS Enables support for all inplace arithmetic operation methods like imul and iadd. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_ALL_SPECIAL_METHODS Enables support for all special methods in user-defined classes. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_ARRAY

Macro Description Sample value(s)
MICROPY_PY_ARRAY Enables the 'array' module, which provides efficient array handling. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_ARRAY_SLICE_ASSIGN Enables support for slice assignments in array and bytearray types. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_ASSIGN

Macro Description Sample value(s)
MICROPY_PY_ASSIGN_EXPR Enables support for assignment expressions using := syntax. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_PY_ASYNC

Macro Description Sample value(s)
MICROPY_PY_ASYNC_AWAIT Enables support for async/await syntax and related features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_PY_ASYNCIO

Macro Description Sample value(s)
MICROPY_PY_ASYNCIO Enables support for the asyncio module based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_ASYNCIO_TASK_QUEUE_PUSH_CALLBACK Enables a callback function when a task is pushed to the asyncio task queue. (0)

MICROPY_PY_ATTRTUPLE

Macro Description Sample value(s)
MICROPY_PY_ATTRTUPLE Enables support for attrtuple type, providing space-efficient tuples with attribute access. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_PY_BINASCII

Macro Description Sample value(s)
MICROPY_PY_BINASCII Enables the binascii module for binary-to-ASCII conversions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BINASCII_CRC32 Enables CRC32 functionality in the binascii module when extra features are included. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_BLE

Macro Description Sample value(s)
MICROPY_PY_BLE Enables Bluetooth Low Energy (BLE) support in the build. (1)
MICROPY_PY_BLE_NUS Enables the Nordic UART Service for BLE, allowing REPL access over Bluetooth. (0)

MICROPY_PY_BLUETOOTH

This configuration set controls various aspects of Bluetooth functionality, enabling features such as central mode, GATT client support, and pairing capabilities. It also manages diagnostic logging, event handling, and memory allocation for Bluetooth operations, ensuring robust and efficient Bluetooth communication in applications.

Macro Description Sample value(s)
MICROPY_PY_BLUETOOTH Enables Bluetooth support in the build. (1)
MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME Sets the default GAP device name for Bluetooth, defaulting to 'MPY BTSTACK'. "MPY BTSTACK"
MICROPY_PY_BLUETOOTH_DIAGNOSTIC_LOGGING Enables Bluetooth diagnostic logging for debugging purposes. (1)
MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE Enables central mode functionality for Bluetooth operations. (0)
MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT Enables the GATT client functionality, defaulting to enabled if central mode is active. (MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE)
MICROPY_PY_BLUETOOTH_ENABLE_HCI_CMD Enables support for low-level HCI commands in Bluetooth functionality. (0)
MICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS Enables support for L2CAP Connection Oriented Channels in Bluetooth. (MICROPY_BLUETOOTH_NIMBLE)
MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING Enables support for Bluetooth pairing and bonding features, requiring synchronous events. (0)
MICROPY_PY_BLUETOOTH_ENTER Prevents PendSV execution from racing with scheduler execution during asynchronous Bluetooth events. MICROPY_PY_PENDSV_ENTER
MICROPY_PY_BLUETOOTH_EXIT Ends an atomic section for Bluetooth operations, ensuring thread safety. MICROPY_END_ATOMIC_SECTION(atomic_state);
MICROPY_PY_BLUETOOTH_HCI_READ_MODE Determines the HCI read mode for Bluetooth, either packet or byte based on STM32WB. MICROPY_PY_BLUETOOTH_HCI_READ_MODE_PACKET
MICROPY_PY_BLUETOOTH_HCI_READ_MODE_BYTE Defines the read mode for Bluetooth HCI as byte. (0)
MICROPY_PY_BLUETOOTH_HCI_READ_MODE_PACKET Enables reading Bluetooth HCI data in packet mode. (1)
MICROPY_PY_BLUETOOTH_MAX_EVENT_DATA_TUPLE_LEN Limits the maximum length of event data tuples for Bluetooth events. 5
MICROPY_PY_BLUETOOTH_NINAW10 Enables Bluetooth Low Energy (BLE) support for NINA W10 modules. (1)
MICROPY_PY_BLUETOOTH_RANDOM_ADDR Enables support for random Bluetooth addresses. (1)
MICROPY_PY_BLUETOOTH_RINGBUF_SIZE Sets the size of the Bluetooth ring buffer, defaulting to 128 bytes. (128)
MICROPY_PY_BLUETOOTH_SYNC_EVENT_STACK_SIZE Calculates the event stack size for Bluetooth synchronization by subtracting a fixed allowance from the RTOS stack size. (CONFIG_BT_NIMBLE_TASK_STACK_SIZE - 1024)
MICROPY_PY_BLUETOOTH_USE_GATTC_EVENT_DATA_REASSEMBLY Enables reassembly of fragmented GATTC event data in NimBLE. MICROPY_BLUETOOTH_NIMBLE
MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS Enables synchronous Bluetooth events for direct VM callback execution, requiring the BLE stack to run in scheduler context. (0)
MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS_WITH_INTERLOCK Enables synchronization of Bluetooth event callbacks with the Global Interpreter Lock (GIL) for thread safety. (1)

MICROPY_PY_BOUND

Macro Description Sample value(s)
MICROPY_PY_BOUND_METHOD_FULL_EQUALITY_CHECK Controls whether bound methods use direct comparison or require a function call for equality checks. (0)

MICROPY_PY_BTREE

Macro Description Sample value(s)
MICROPY_PY_BTREE Enables the Berkeley DB btree module for MicroPython. (0)

MICROPY_PY_BUILTINS

This configuration group manages the availability and functionality of various built-in objects and functions in the MicroPython runtime, such as data types, error handling, and utility functions. It allows developers to customize the built-in capabilities according to their specific needs and memory constraints.

Macro Description Sample value(s)
MICROPY_PY_BUILTINS_BYTEARRAY Enables support for the bytearray object in MicroPython. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_BYTES_DECODE_IGNORE Enables the 'ignore' error handler for bytes.decode(), adding 336 bytes to memory usage. (1) // +336 bytes
MICROPY_PY_BUILTINS_BYTES_DECODE_REPLACE Enables replacement mode for bytes decoding, impacting memory usage. (0) // Save 608 bytes total
MICROPY_PY_BUILTINS_BYTES_HEX Enables the bytes.hex() and bytes.fromhex() methods for byte objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_CODE Determines the level of support for code objects based on various configuration options. (MICROPY_PY_SYS_SETTRACE ? MICROPY_PY_BUILTINS_CODE_FULL : (MICROPY_PY_FUNCTION_ATTRS_CODE ? MICROPY_PY_BUILTINS_CODE_BASIC : (MICROPY_PY_BUILTINS_COMPILE ? MICROPY_PY_BUILTINS_CODE_MINIMUM : MICROPY_PY_BUILTINS_CODE_NONE)))
MICROPY_PY_BUILTINS_CODE_BASIC Enables basic support for code objects with limited features. (2)
MICROPY_PY_BUILTINS_CODE_FULL Enables full support for code objects with all features. (3)
MICROPY_PY_BUILTINS_CODE_MINIMUM Enables minimal support for code objects. (1)
MICROPY_PY_BUILTINS_CODE_NONE Disables support for code objects. (0)
MICROPY_PY_BUILTINS_COMPILE Enables the compile function if the compiler is enabled and extra features are available. (MICROPY_ENABLE_COMPILER && MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_COMPLEX Enables support for complex number types, contingent on the presence of float support. (MICROPY_PY_BUILTINS_FLOAT)
MICROPY_PY_BUILTINS_DICT_FROMKEYS Enables support for the dict.fromkeys() class method. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_ENUMERATE Enables support for the enumerate built-in function based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_EVAL_EXEC Enables support for the eval and exec built-in functions when the compiler is active. (MICROPY_ENABLE_COMPILER)
MICROPY_PY_BUILTINS_EXECFILE Enables support for the Python 2 execfile function when the compiler is enabled and extra features are available. (MICROPY_ENABLE_COMPILER && MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_FILTER Enables support for the filter built-in function. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_FLOAT Enables support for float data types and operations. (1)
MICROPY_PY_BUILTINS_FROZENSET Enables support for the frozenset object when the ROM level is at least extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_HELP Enables the built-in help() function for providing information about objects and modules. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_HELP_MODULES Enables the listing of available modules when executing help('modules'). Examples: help('modules') outputs a list of modules; mp_help_print_modules() displays module information. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_HELP_TEXT Configures the help text displayed by the help() function. rp2_help_text
MICROPY_PY_BUILTINS_INPUT Enables the built-in input() function, requiring readline support. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_MEMORYVIEW Enables support for the memoryview object in MicroPython. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_MEMORYVIEW_ITEMSIZE Enables support for the memoryview.itemsize attribute. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_BUILTINS_MIN_MAX Enables support for the min() and max() built-in functions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_NEXT2 Enables support for calling the next() function with a second argument. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_BASIC_FEATURES)
MICROPY_PY_BUILTINS_NOTIMPLEMENTED Enables the definition of the 'NotImplemented' special constant. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_POW3 Enables support for the pow() function with three integer arguments. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_PROPERTY Enables support for the property object in MicroPython. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_RANGE_ATTRS Enables implementation of start/stop/step attributes for the range builtin type. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_RANGE_BINOP Enables binary operations (equality) for range objects, aligning behavior with CPython. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_BUILTINS_REVERSED Enables support for the reversed() built-in function. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_ROUND_INT Enables support for rounding integers, including bignum, e.g., round(123, -1) = 120. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_SET Enables support for the set object in MicroPython. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_SLICE Enables support for slice subscript operators and the slice object. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_SLICE_ATTRS Enables read access to slice attributes like start, stop, and step. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_SLICE_INDICES Enables support for the .indices(len) method on slice objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_STR_CENTER Enables the str.center() method when the ROM level is at least extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_STR_COUNT Enables the str.count() method for string objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_STR_OP_MODULO Enables the string modulo (%) operator for formatting strings. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_BUILTINS_STR_PARTITION Enables the str.partition() and str.rpartition() methods based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_STR_SPLITLINES Enables the str.splitlines() method for string objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_STR_UNICODE Enables support for Unicode strings in the built-in str object. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_BUILTINS_STR_UNICODE_CHECK Enables UTF-8 validity checks when converting bytes to string. (MICROPY_PY_BUILTINS_STR_UNICODE)

MICROPY_PY_CMATH

Macro Description Sample value(s)
MICROPY_PY_CMATH Enables the 'cmath' module when the ROM level is at least extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_COLLECTIONS

This configuration set controls the inclusion and functionality of the collections module in MicroPython, allowing for advanced data structures such as deque, namedtuple, and OrderedDict. It enables essential features like iteration, subscription, and key order maintenance, enhancing the language's capability for managing collections of data.

Macro Description Sample value(s)
MICROPY_PY_COLLECTIONS Enables the collections module if core features are included. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_COLLECTIONS_DEQUE Enables the 'collections.deque' type when the ROM level is at least extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_COLLECTIONS_DEQUE_ITER Enables iteration support for collections.deque. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_COLLECTIONS_DEQUE_SUBSCR Enables subscription support for 'collections.deque'. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT Enables the _asdict function for namedtuple objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_COLLECTIONS_ORDEREDDICT Enables the 'collections.OrderedDict' type for maintaining order of keys. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_CRYPTOLIB

This configuration controls the inclusion and functionality of the cryptographic library, allowing for SSL support and the definition of constants within the module. It also enables specific cryptographic modes, such as Counter (CTR) mode, enhancing the library's capabilities for secure data processing.

Macro Description Sample value(s)
MICROPY_PY_CRYPTOLIB Enables the cryptographic library functionality, dependent on SSL support. (MICROPY_PY_SSL)
MICROPY_PY_CRYPTOLIB_CONSTS Enables the definition of constants for the cryptolib module. (0)
MICROPY_PY_CRYPTOLIB_CTR Enables Counter (CTR) mode support in the cryptolib module. (0)

MICROPY_PY_DEFLATE

Macro Description Sample value(s)
MICROPY_PY_DEFLATE Enables the deflate module for decompression functionality. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_DEFLATE_COMPRESS Enables compression support in the deflate module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_FULL_FEATURES)

MICROPY_PY_DELATTR

Macro Description Sample value(s)
MICROPY_PY_DELATTR_SETATTR Enables support for class delattr and setattr methods, impacting code size and attribute access speed. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_DESCRIPTORS

Macro Description Sample value(s)
MICROPY_PY_DESCRIPTORS Enables support for Python descriptors like get, set, delete, and set_name. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_ERRNO

This configuration controls the inclusion and functionality of the errno module, which provides error handling capabilities in networking contexts. It allows for the use of an error code dictionary for lookups and supports a customizable list of error constants.

Macro Description Sample value(s)
MICROPY_PY_ERRNO Enables the errno module for error handling. (1)
MICROPY_PY_ERRNO_ERRORCODE Enables the inclusion of the errno.errorcode dictionary. (1)
MICROPY_PY_ERRNO_LIST Custom list of errno constants for the errno module. \

MICROPY_PY_ESP

Macro Description Sample value(s)
MICROPY_PY_ESP32_PCNT Enables the Pulse Counter (PCNT) module if supported by the SoC. (SOC_PCNT_SUPPORTED)

MICROPY_PY_ESPNOW

This configuration set enables and enhances support for the ESP-NOW communication protocol, allowing for efficient peer-to-peer communication. It includes features for managing peers, such as modifying and retrieving peer information, as well as tracking the Received Signal Strength Indicator (RSSI) values for better communication quality assessment.

Macro Description Sample value(s)
MICROPY_PY_ESPNOW Enables support for ESP-NOW communication protocol. (1)
MICROPY_PY_ESPNOW_EXTRA_PEER_METHODS Enables additional peer management methods: mod_peer(), get_peer(), and peer_count(). Examples: espnow.get_peer(peer_mac), espnow.mod_peer(peer_mac, new_info), espnow.peer_count(). 1
MICROPY_PY_ESPNOW_RSSI Enables tracking of RSSI values for peers in ESP-NOW communication. 1

MICROPY_PY_FRAMEBUF

Macro Description Sample value(s)
MICROPY_PY_FRAMEBUF Enables the frame buffer module for graphics operations. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_FSTRINGS

Macro Description Sample value(s)
MICROPY_PY_FSTRINGS Enables support for f-strings, allowing string interpolation in literals. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_FUNCTION

Macro Description Sample value(s)
MICROPY_PY_FUNCTION_ATTRS Enables the implementation of attributes on functions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_FUNCTION_ATTRS_CODE Enables implementation of the code attribute on functions and function constructors when certain conditions are met. (MICROPY_PY_MARSHAL || MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_FULL_FEATURES)

MICROPY_PY_GC

Macro Description Sample value(s)
MICROPY_PY_GC Enables the garbage collection module if core features are included. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_GC_COLLECT_RETVAL Enables returning the number of collected objects from gc.collect(). Examples: gc.collect() returns 5 if 5 objects are collected. (1)

MICROPY_PY_GENERATOR

Macro Description Sample value(s)
MICROPY_PY_GENERATOR_PEND_THROW Enables a non-standard .pend_throw() method for generators to handle exceptions asynchronously. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_PY_HASHLIB

This configuration controls the availability of various cryptographic hashing functions within the hashlib module, allowing for secure data handling. It enables support for MD5, SHA-1, and SHA-256 hashing algorithms, particularly in contexts where SSL is utilized.

Macro Description Sample value(s)
MICROPY_PY_HASHLIB Enables the hashlib module for cryptographic hashing functions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_HASHLIB_MD5 Enables the MD5 hashing algorithm in the hashlib module when SSL support is present. (MICROPY_PY_SSL)
MICROPY_PY_HASHLIB_SHA1 Enables SHA-1 hashing support when SSL and AXTLS are enabled. (MICROPY_PY_SSL && MICROPY_SSL_AXTLS)
MICROPY_PY_HASHLIB_SHA256 Enables SHA-256 hashing functionality in the hashlib module. (1)

MICROPY_PY_HEAPQ

Macro Description Sample value(s)
MICROPY_PY_HEAPQ Enables the heapq module for priority queue operations. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_IO

This configuration controls the inclusion of the 'io' module and its associated classes, which provide essential input/output functionalities in MicroPython. It enables features such as buffered writing, in-memory byte streams, and user-defined stream support, enhancing the flexibility and efficiency of data handling.

Macro Description Sample value(s)
MICROPY_PY_IO Enables the 'io' module for input/output operations. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_IO_BUFFEREDWRITER Enables the io.BufferedWriter class for buffered writing operations. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_IO_BYTESIO Enables the 'io.BytesIO' class for in-memory byte stream operations. (1)
MICROPY_PY_IO_IOBASE Enables the 'io.IOBase' class for user stream support. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

MICROPY_PY_JS

Macro Description Sample value(s)
MICROPY_PY_JS Enables the JavaScript module if the ROM level supports extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_JSFFI

Macro Description Sample value(s)
MICROPY_PY_JSFFI Enables the jsffi module when extra features are included in the ROM configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_JSON

Macro Description Sample value(s)
MICROPY_PY_JSON Enables JSON module support based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_JSON_SEPARATORS Enables support for custom separators in JSON serialization. (1)

MICROPY_PY_LWIP

This configuration set manages the lwIP network stack functionalities within MicroPython, enabling various networking capabilities such as TCP, PPP, and raw socket support. It also includes mechanisms for concurrency control and resource management during lwIP operations, ensuring safe execution and cleanup.

Macro Description Sample value(s)
MICROPY_PY_LWIP Enables the lwIP network stack for MicroPython, allowing for network functionalities. (1)
MICROPY_PY_LWIP_ENTER Acquires a lock to prevent the lwIP task from executing during critical sections. lwip_lock_acquire();
MICROPY_PY_LWIP_EXIT Indicates the exit point for LWIP concurrency protection. MICROPY_PY_PENDSV_EXIT
MICROPY_PY_LWIP_PPP Enables PPP (Point-to-Point Protocol) support when network PPP is enabled. (MICROPY_PY_NETWORK_PPP_LWIP)
MICROPY_PY_LWIP_REENTER Handles re-entering lwIP tasks with concurrency protection. MICROPY_PY_PENDSV_REENTER
MICROPY_PY_LWIP_SOCK_RAW Enables support for raw sockets in the LWIP networking stack. (MICROPY_PY_LWIP)
MICROPY_PY_LWIP_TCP_CLOSE_TIMEOUT_MS Timeout duration in milliseconds before forcibly aborting a TCP socket closure. (10000)

MICROPY_PY_MACHINE

This configuration group manages the functionalities related to hardware control and interfacing in MicroPython, enabling various features such as ADC, DAC, I2C, PWM, and sensor interactions. It allows developers to customize the machine module to suit specific hardware capabilities and application needs, facilitating direct access to low-level hardware operations.

Macro Description Sample value(s)
MICROPY_PY_MACHINE Enables the machine module, primarily for memory-related functions. (1)
MICROPY_PY_MACHINE_ADC Enables ADC (Analog-to-Digital Converter) functionality in the firmware. (1)
MICROPY_PY_MACHINE_ADC_ATTEN_WIDTH Enables legacy ADC.atten() and ADC.width() methods. (0)
MICROPY_PY_MACHINE_ADC_BLOCK Enables the ADC.block() method, requiring implementation of mp_machine_adc_block(). Examples: ADC.block(), ADCBlock() class. (0)
MICROPY_PY_MACHINE_ADC_BLOCK_INCLUDEFILE Path to the ADC block implementation file for the ESP32 port. "ports/esp32/machine_adc_block.c"
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS Defines ADC class constants for various ports, allowing for specific ADC functionalities. \
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS_CORE_VBAT Defines the constant for the core battery voltage ADC channel if ADC_CHANNEL_VBAT is available. \
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS_CORE_VDD Defines the constant for the core voltage ADC channel if available. \
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS_WIDTH_12 Defines a constant for 12-bit ADC width with its corresponding value. \
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS_WIDTH_13 Defines a constant for 13-bit ADC width if supported by the hardware. \
MICROPY_PY_MACHINE_ADC_CLASS_CONSTANTS_WIDTH_9_10_11 Defines ADC width constants for 9, 10, and 11 bits if supported by the hardware. \
MICROPY_PY_MACHINE_ADC_DEINIT Enables the ADC.deinit() method, requiring implementation of mp_machine_adc_deinit(). Examples: ESP32 and SAMD ports define it as (1). (0)
MICROPY_PY_MACHINE_ADC_INCLUDEFILE Path to the ADC implementation file for the specific port. "ports/nrf/modules/machine/adc.c"
MICROPY_PY_MACHINE_ADC_INIT Enables the ADC.init() method, requiring implementation of mp_machine_adc_init_helper(). Examples: Set to (1) to enable ADC initialization. (0)
MICROPY_PY_MACHINE_ADC_READ Enables the ADC.read() method, which is considered legacy. (0)
MICROPY_PY_MACHINE_ADC_READ_UV Enables the ADC.read_uv() method for reading UV values from the ADC. (0)
MICROPY_PY_MACHINE_BARE_METAL_FUNCS Enables bare metal functions for machine operations such as unique ID and sleep modes. (1)
MICROPY_PY_MACHINE_BITSTREAM Enables the inclusion of bitstream functionality for driving protocols like WS2812. (0)
MICROPY_PY_MACHINE_BOOTLOADER Enables bootloader functionality in the machine module. (1)
MICROPY_PY_MACHINE_DAC Enables support for Digital-to-Analog Converter (DAC) functionality based on hardware capabilities. (SOC_DAC_SUPPORTED)
MICROPY_PY_MACHINE_DHT_READINTO Enables the DHT sensor readinto functionality for reading data directly into a buffer. (1)
MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ Enables the implementation of disable and enable interrupt functions. (1)
MICROPY_PY_MACHINE_EXTRA_GLOBALS Enables the addition of extra global entries to the machine module. \
MICROPY_PY_MACHINE_FREQ_NUM_ARGS_MAX Maximum number of arguments for the machine.freq() function. (1)
MICROPY_PY_MACHINE_HW_PWM Enables hardware PWM support in the build. (0)
MICROPY_PY_MACHINE_I2C Enables I2C support based on hardware configuration. (MICROPY_HW_ENABLE_HW_I2C)
MICROPY_PY_MACHINE_I2C_TARGET Enables I2C target functionality on supported SoCs, excluding ESP32. (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32)
MICROPY_PY_MACHINE_I2C_TARGET_FINALISER Enables finalization support for I2C target objects. (1)
MICROPY_PY_MACHINE_I2C_TARGET_HARD_IRQ Enables support for hard IRQ in I2C target functionality. (1)
MICROPY_PY_MACHINE_I2C_TARGET_INCLUDEFILE Path to the I2C target implementation file for various ports. "ports/mimxrt/machine_i2c_target.c"
MICROPY_PY_MACHINE_I2C_TARGET_MAX Determines the maximum number of I2C target instances based on hardware capabilities. (FSL_FEATURE_SOC_LPI2C_COUNT)
MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 Enables support for a separate write as the first transfer in I2C operations. (0)
MICROPY_PY_MACHINE_I2S Enables I2S support based on hardware capabilities. (SOC_I2S_SUPPORTED)
MICROPY_PY_MACHINE_I2S_CONSTANT_RX Defines the I2S mode for receiving data in master mode. (I2S_MODE_MASTER_RX)
MICROPY_PY_MACHINE_I2S_CONSTANT_TX Represents the I2S mode for master transmit operations. (I2S_MODE_MASTER_TX)
MICROPY_PY_MACHINE_I2S_FINALISER Enables the finalizer method for the I2S machine module. (1)
MICROPY_PY_MACHINE_I2S_INCLUDEFILE Path to the I2S machine module implementation file for the specific port. "ports/mimxrt/machine_i2s.c"
MICROPY_PY_MACHINE_I2S_MCK Enables the use of the Master Clock (MCK) pin in I2S configurations. (1)
MICROPY_PY_MACHINE_I2S_RING_BUF Enables the use of a ring buffer for I2S operations. (1)
MICROPY_PY_MACHINE_INCLUDEFILE Path to the implementation file for the machine module. "ports/unix/modmachine.c"
MICROPY_PY_MACHINE_INFO_ENTRY Defines an entry for the machine info object in the global namespace when DEBUG is enabled. { MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&machine_info_obj) },
MICROPY_PY_MACHINE_LED_ENTRY Defines the entry for the LED machine module with its associated type. { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&machine_led_type) },
MICROPY_PY_MACHINE_MEMX Enables the machine.mem8, machine.mem16, and machine.mem32 objects for memory access. (MICROPY_PY_MACHINE)
MICROPY_PY_MACHINE_NFC_RESET_ENTRY Defines the NFC reset entry for the NRF52 series with a corresponding reset constant. { MP_ROM_QSTR(MP_QSTR_NFC_RESET), MP_ROM_INT(PYB_RESET_NFC) },
MICROPY_PY_MACHINE_PIN_ALT_SUPPORT Enables support for alternate function selection in machine.Pin. (1)
MICROPY_PY_MACHINE_PIN_BASE Enables the PinBase class for managing GPIO pins. (1)
MICROPY_PY_MACHINE_PIN_BOARD_CPU Enables support for board CPU pin functionalities. (1)
MICROPY_PY_MACHINE_PIN_LEGACY Enables inclusion of legacy methods and constants in machine.Pin when not in preview version 2. (!MICROPY_PREVIEW_VERSION_2)
MICROPY_PY_MACHINE_PIN_MAKE_NEW Maps to the function mp_pin_make_new for creating new pin objects. mp_pin_make_new
MICROPY_PY_MACHINE_PULSE Enables the time_pulse_us function for measuring pulse durations on pins. (0)
MICROPY_PY_MACHINE_PWM Enables PWM functionality using either hardware or software implementations. (MICROPY_PY_MACHINE_HW_PWM || MICROPY_PY_MACHINE_SOFT_PWM)
MICROPY_PY_MACHINE_PWM_DUTY Enables PWM duty cycle functionality in the machine module. (1)
MICROPY_PY_MACHINE_PWM_INCLUDEFILE Path to the PWM implementation file for the specific port. "ports/nrf/modules/machine/soft_pwm.c"
MICROPY_PY_MACHINE_RESET Enables the inclusion of machine reset functionality. (0)
MICROPY_PY_MACHINE_RESET_ENTRY Enables the machine reset functionality by defining the reset entry point when CONFIG_REBOOT is enabled. { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&machine_reset_obj) },
MICROPY_PY_MACHINE_RNG_ENTRY Defines the entry for the random number generator in the machine module when RNG is enabled. { MP_ROM_QSTR(MP_QSTR_rng), MP_ROM_PTR(&pyb_rng_get_obj) },
MICROPY_PY_MACHINE_RTCOUNTER Enables the real-time counter functionality. (0)
MICROPY_PY_MACHINE_RTCOUNTER_ENTRY Entry for the RTCounter module in the machine namespace. { MP_ROM_QSTR(MP_QSTR_RTCounter), MP_ROM_PTR(&machine_rtcounter_type) },
MICROPY_PY_MACHINE_SDCARD Enables support for SD card functionality. 0
MICROPY_PY_MACHINE_SDCARD_ENTRY Defines the entry for the SDCard type in the machine module. { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&machine_sdcard_type) },
MICROPY_PY_MACHINE_SIGNAL Enables the 'machine.Signal' class for signal handling. (MICROPY_PY_MACHINE)
MICROPY_PY_MACHINE_SOFTI2C Enables the SoftI2C class for I2C communication using software implementation. (0)
MICROPY_PY_MACHINE_SOFTSPI Enables the SoftSPI class for software-based SPI communication. (0)
MICROPY_PY_MACHINE_SOFT_PWM Enables software PWM functionality for controlling PWM signals. (0)
MICROPY_PY_MACHINE_SPI Enables support for the SPI (Serial Peripheral Interface) protocol. (0)
MICROPY_PY_MACHINE_SPI_LSB Indicates that the least significant bit is transmitted first in SPI communication. (SPI_FIRSTBIT_LSB)
MICROPY_PY_MACHINE_SPI_MIN_DELAY Sets the minimum delay for SPI communication. (0)
MICROPY_PY_MACHINE_SPI_MSB Indicates that the most significant bit is transmitted first in SPI communication. (SPI_FIRSTBIT_MSB)
MICROPY_PY_MACHINE_TEMP Enables temperature sensor support in the machine module. (0)
MICROPY_PY_MACHINE_TEMP_ENTRY Entry for the temperature module in the machine API, linking to the temperature type. { MP_ROM_QSTR(MP_QSTR_Temp), MP_ROM_PTR(&machine_temp_type) },
MICROPY_PY_MACHINE_TIMER Enables the 'machine.Timer' class for timing operations. (0)
MICROPY_PY_MACHINE_TIMER_ENTRY Entry for the Timer module in the machine interface, linking to the timer type. { MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
MICROPY_PY_MACHINE_TIMER_NRF Enables support for the NRF timer module. (1)
MICROPY_PY_MACHINE_TOUCH_PAD_ENTRY Enables the TouchPad functionality in the machine module for ESP32. { MP_ROM_QSTR(MP_QSTR_TouchPad), MP_ROM_PTR(&machine_touchpad_type) },
MICROPY_PY_MACHINE_UART Enables UART peripheral support for serial communication. (1)
MICROPY_PY_MACHINE_UART_CLASS_CONSTANTS Defines UART class constants for various UART features and configurations. -
MICROPY_PY_MACHINE_UART_INCLUDEFILE Path to the UART implementation file for the specific port. "ports/nrf/modules/machine/uart.c"
MICROPY_PY_MACHINE_UART_INV_ENTRY Defines UART inversion features for STM32H7, including TX and RX inversion. \
MICROPY_PY_MACHINE_UART_IRQ Enables the UART.irq() method, requiring implementation of mp_machine_uart_irq(). Examples: Used in SAMD21, NRF52840, and RP2 ports. (SAMD21_EXTRA_FEATURES)
MICROPY_PY_MACHINE_UART_READCHAR_WRITECHAR Enables UART.readchar() and UART.writechar() methods, requiring implementation of corresponding functions. (0)
MICROPY_PY_MACHINE_UART_SENDBREAK Enables the UART.sendbreak() method, requiring implementation of mp_machine_uart_sendbreak(). Examples: Set to (1) to enable sendbreak functionality. (0)
MICROPY_PY_MACHINE_WDT Enables the watchdog timer functionality. (1)
MICROPY_PY_MACHINE_WDT_INCLUDEFILE Path to the machine watchdog implementation file for the CC3200 port. "ports/cc3200/mods/machine_wdt.c"
MICROPY_PY_MACHINE_WDT_TIMEOUT_MS Enables the watchdog timer timeout functionality with a default timeout value. (1)

MICROPY_PY_MARSHAL

Macro Description Sample value(s)
MICROPY_PY_MARSHAL Enables the 'marshal' module for serialization of Python objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)

MICROPY_PY_MATH

This configuration set focuses on enhancing the mathematical capabilities within the environment by enabling various mathematical functions and constants, as well as implementing fixes for specific edge cases involving special values like NaN and infinity. It ensures that users have access to a robust set of mathematical tools while addressing potential issues that may arise during calculations.

Macro Description Sample value(s)
MICROPY_PY_MATH Enables the math module if core features are included. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_MATH_ATAN2_FIX_INFNAN Enables a fix for handling infinity and NaN in the atan2 function. (0)
MICROPY_PY_MATH_CONSTANTS Enables additional mathematical constants like tau, infinity, and NaN in the math module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_MATH_COPYSIGN_FIX_NAN Enables a fix for NaN values in the copysign function by replacing NaN with 0. (1)
MICROPY_PY_MATH_FACTORIAL Enables the math.factorial function if the ROM level supports extra features. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_MATH_FMOD_FIX_INFNAN Controls handling of infinity in the fmod function. (0)
MICROPY_PY_MATH_GAMMA_FIX_NEGINF Enables a workaround for handling gamma function at negative infinity. (1)
MICROPY_PY_MATH_ISCLOSE Enables the math.isclose function for comparing floating-point numbers. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_MATH_MODF_FIX_NEGZERO Enables handling of negative zero in the modf function. (0)
MICROPY_PY_MATH_POW_FIX_NAN Enables fixes for pow(1, NaN) and pow(NaN, 0) to return 1 instead of NaN. (0)
MICROPY_PY_MATH_SPECIAL_FUNCTIONS Enables special mathematical functions such as erf, erfc, gamma, and lgamma. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_MICROPYTHON

This configuration set controls various features of the micropython module, enhancing memory management and providing additional functionalities such as heap locking and memory information retrieval. It also enables support for specific features like RingIO and stack usage monitoring, allowing for more efficient resource management in MicroPython applications.

Macro Description Sample value(s)
MICROPY_PY_MICROPYTHON Enables the micropython module based on core feature availability. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_MICROPYTHON_HEAP_LOCKED Enables the 'micropython.heap_locked' function for managing heap locking. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_MICROPYTHON_MEM_INFO Enables memory information functions in the micropython module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_MICROPYTHON_RINGIO Enables support for the micropython.RingIO() functionality. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_MICROPYTHON_STACK_USE Enables the 'micropython.stack_use' function based on memory info configuration. (MICROPY_PY_MICROPYTHON_MEM_INFO)

MICROPY_PY_MUSIC

Macro Description Sample value(s)
MICROPY_PY_MUSIC Enables the music module for sound playback functionality. (0)

MICROPY_PY_NETWORK

This configuration group manages networking capabilities, enabling various functionalities such as LAN and WLAN support, as well as socket operations. It also allows customization of network parameters like hostname settings and SPI clock speed for communication, ensuring flexibility in network module integration.

Macro Description Sample value(s)
MICROPY_PY_NETWORK Enables networking functionality. (1)
MICROPY_PY_NETWORK_HOSTNAME_DEFAULT Default hostname for the network module, configurable per board. "mpy-metro-m7"
MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN Maximum length for network hostname, excluding null terminator. (32)
MICROPY_PY_NETWORK_INCLUDEFILE Path to the network module header file for inclusion. "ports/esp8266/modnetwork.h"
MICROPY_PY_NETWORK_LAN Enables LAN network support for ESP32 when set to 1. (1)
MICROPY_PY_NETWORK_LAN_SPI_CLOCK_SPEED_MZ Defines the SPI clock speed for LAN communication in MHz. (20)
MICROPY_PY_NETWORK_MODULE_GLOBALS_INCLUDEFILE Path to the header file containing global definitions for the network module. "ports/esp8266/modnetwork_globals.h"
MICROPY_PY_NETWORK_PPP_LWIP Enables PPP support using LWIP for network functionality. (MICROPY_PY_LWIP)
MICROPY_PY_NETWORK_WLAN Enables WLAN support for network functionality. (1)

MICROPY_PY_NRF

Macro Description Sample value(s)
MICROPY_PY_NRF Enables support for NRF modules and features. (CORE_FEAT)

MICROPY_PY_ONEWIRE

Macro Description Sample value(s)
MICROPY_PY_ONEWIRE Enables the low-level 1-Wire module for communication with 1-Wire devices. (SAMD21_EXTRA_FEATURES)

MICROPY_PY_OPENAMP

This configuration set controls various aspects of OpenAMP functionality, enabling features such as ELF file loading, virtual file system support, and resource table usage for communication between host and remote processors. Additionally, it manages trace logging capabilities, allowing for efficient debugging and monitoring of remote processor activities.

Macro Description Sample value(s)
MICROPY_PY_OPENAMP_REMOTEPROC_ELFLD_ENABLE Enables support for loading ELF files, potentially increasing memory usage. (1)
MICROPY_PY_OPENAMP_REMOTEPROC_STORE_ENABLE Enables a VFS-based image store for loading ELF files when no custom image store is defined. (1)
MICROPY_PY_OPENAMP_RSC_TABLE_ENABLE Enables the use of a resource table for sharing configuration between host and remote cores. (1)
MICROPY_PY_OPENAMP_TRACE_BUF Memory address of the OpenAMP trace buffer. ((uint32_t)openamp_trace_buf)
MICROPY_PY_OPENAMP_TRACE_BUF_ENABLE Enables a trace buffer for logging by remote processors. (1)
MICROPY_PY_OPENAMP_TRACE_BUF_LEN Sets the default length of the OpenAMP trace buffer to 128 bytes. (128)

MICROPY_PY_OS

This configuration set controls the features and functionalities of the OS module, enabling various system-level operations such as environment variable management, file system synchronization, and terminal stream duplication. It also includes support for executing shell commands and retrieving system information, enhancing the interaction between MicroPython and the underlying operating system.

Macro Description Sample value(s)
MICROPY_PY_OS Enables the os built-in module. (1)
MICROPY_PY_OS_DUPTERM Enables support for duplicate terminal streams in the OS module. (1)
MICROPY_PY_OS_DUPTERM_BUILTIN_STREAM Enables support for built-in stream duplication in the OS module. (1)
MICROPY_PY_OS_DUPTERM_NOTIFY Enables notification functionality for the os.dupterm feature. (1)
MICROPY_PY_OS_DUPTERM_STREAM_DETACHED_ATTACHED Enables handling of detached and attached duplicate terminal streams. (1)
MICROPY_PY_OS_ERRNO Enables the errno functionality in the OS module. (1)
MICROPY_PY_OS_GETENV_PUTENV_UNSETENV Enables the getenv, putenv, and unsetenv functions in the os module. (1)
MICROPY_PY_OS_INCLUDEFILE Path to the OS module implementation file for additional Unix features. "ports/unix/modos.c"
MICROPY_PY_OS_SEP Enables support for the OS path separator feature. (1)
MICROPY_PY_OS_STATVFS Enables the statvfs function in the OS module if the OS module is enabled. (MICROPY_PY_OS)
MICROPY_PY_OS_SYNC Enables the sync() function to synchronize all filesystems. (MICROPY_VFS)
MICROPY_PY_OS_SYSTEM Enables the 'system' function in the OS module for executing shell commands. (1)
MICROPY_PY_OS_UNAME Enables the os.uname function for testing purposes. (1)
MICROPY_PY_OS_UNAME_RELEASE_DYNAMIC Enables dynamic retrieval of the OS release version. (1)
MICROPY_PY_OS_URANDOM Enables the urandom function for generating random bytes. (1)

MICROPY_PY_PENDSV

This configuration manages the PendSV interrupt priority to control the execution of background tasks during context switching. It ensures that critical sections of code can run without interruption by adjusting the interrupt priority levels appropriately.

Macro Description Sample value(s)
MICROPY_PY_PENDSV_ENTER Prevents background tasks from executing by raising the PendSV interrupt priority. uint32_t atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
MICROPY_PY_PENDSV_EXIT Restores the previous interrupt priority level after exiting a PendSV context. restore_irq_pri(atomic_state);
MICROPY_PY_PENDSV_REENTER Raises the interrupt priority to prevent background tasks during re-entry. atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);

MICROPY_PY_PLATFORM

Macro Description Sample value(s)
MICROPY_PY_PLATFORM Enables the platform module for accessing platform-specific information. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_PYB

Macro Description Sample value(s)
MICROPY_PY_PYB Enables inclusion of the pyb module in the build. (1)
MICROPY_PY_PYB_LEGACY Enables inclusion of legacy functions and classes in the pyb module. (1)

MICROPY_PY_RA

Macro Description Sample value(s)
MICROPY_PY_RA Enables inclusion of the ra module with peripheral register constants. (1)

MICROPY_PY_RANDOM

This configuration set controls the availability and functionality of the random number generation features in MicroPython. It allows for the inclusion of basic random functions, additional utilities, hardware support for randomness, and initialization of the random seed, enhancing the randomness capabilities for applications.

Macro Description Sample value(s)
MICROPY_PY_RANDOM Enables the random module and its functions based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_RANDOM_EXTRA_FUNCS Enables additional random functions like randrange, randint, and choice. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_RANDOM_HW_RNG Enables hardware random number generation support. (0)
MICROPY_PY_RANDOM_SEED_INIT_FUNC Initializes the random seed function on import. (mp_random_seed_init())

MICROPY_PY_RE

This configuration set controls the implementation and features of regular expression support, allowing for pattern matching and manipulation in code. It includes options for debugging, group matching, and substitution functionalities, enhancing the versatility and usability of regular expressions.

Macro Description Sample value(s)
MICROPY_PY_RE Enables support for regular expressions based on the re1.5 library. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_RE_DEBUG Enables debugging features for regular expressions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_RE_MATCH_GROUPS Enables support for matching groups in regular expressions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_RE_MATCH_SPAN_START_END Enables support for span, start, and end methods in regular expression matching. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_RE_SUB Enables the 're.sub' function for regular expression substitutions. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_REVERSE

Macro Description Sample value(s)
MICROPY_PY_REVERSE_SPECIAL_METHODS Enables support for reverse arithmetic operation methods like radd and rsub. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)

MICROPY_PY_SELECT

This configuration group manages the functionality and optimizations of the 'select' module, which is used for I/O multiplexing in MicroPython. It allows for the enabling of the select() function, sets polling intervals for non-file-descriptor objects, and provides options for POSIX-specific enhancements.

Macro Description Sample value(s)
MICROPY_PY_SELECT Enables the 'select' module for handling I/O multiplexing. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SELECT_IOCTL_CALL_PERIOD_MS Sets the polling interval in milliseconds for non-file-descriptor objects during polling. (1)
MICROPY_PY_SELECT_POSIX_OPTIMISATIONS Enables POSIX optimisations in the 'select' module while disabling select.select(). Examples: Setting to 1 allows using poll() instead of select(), while setting to 0 reverts to default behavior. (1)
MICROPY_PY_SELECT_SELECT Enables the select() function in the select module for compatibility. (1)

MICROPY_PY_SOCKET

This configuration set controls the functionality and behavior of the socket module, enabling network communication and supporting asynchronous event handling. It also allows for extended state management and sets default parameters for socket operations, enhancing the overall networking capabilities.

Macro Description Sample value(s)
MICROPY_PY_SOCKET Enables the socket module for network communication. (1)
MICROPY_PY_SOCKET_EVENTS Enables support for asynchronous socket event callbacks. (MICROPY_PY_WEBREPL)
MICROPY_PY_SOCKET_EVENTS_HANDLER Invokes the socket events handler function if socket events are enabled. extern void socket_events_handler(void); socket_events_handler();
MICROPY_PY_SOCKET_EXTENDED_STATE Enables extended socket state for network interfaces requiring additional state management. (1)
MICROPY_PY_SOCKET_LISTEN_BACKLOG_DEFAULT Determines the default backlog value for socket.listen(), capped at 128 or SOMAXCONN. (SOMAXCONN < 128 ? SOMAXCONN : 128)

MICROPY_PY_SSL

This configuration set controls the inclusion and management of SSL support within the build, allowing for secure communication through protocols like SSL and DTLS. It also facilitates memory management for SSL objects and ensures proper context handling during SSL operations.

Macro Description Sample value(s)
MICROPY_PY_SSL Enables SSL support, dependent on network functionality. (MICROPY_PY_NETWORK)
MICROPY_PY_SSL_DTLS Enables support for the DTLS protocol when using mbedTLS and sufficient ROM level. (MICROPY_SSL_MBEDTLS && MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SSL_FINALISER Enables finaliser code for SSL objects, allowing for resource cleanup. (MICROPY_ENABLE_FINALISER)
MICROPY_PY_SSL_MBEDTLS_NEED_ACTIVE_CONTEXT Enables storage of the current SSLContext for mbedtls callbacks. (MICROPY_PY_SSL_ECDSA_SIGN_ALT)

MICROPY_PY_STM

Macro Description Sample value(s)
MICROPY_PY_STM Enables the STM module for sub-GHz radio functions. (1) // for subghz radio functions
MICROPY_PY_STM_CONST Controls inclusion of named register constants in the STM module to save memory. (0) // saves size, no named registers

MICROPY_PY_STR

Macro Description Sample value(s)
MICROPY_PY_STR_BYTES_CMP_WARN Issues a warning when comparing string and bytes objects. (1)

MICROPY_PY_STRING

Macro Description Sample value(s)
MICROPY_PY_STRING_TX_GIL_THRESHOLD Minimum string length for GIL-aware stdout printing operations. (20)

MICROPY_PY_STRUCT

Macro Description Sample value(s)
MICROPY_PY_STRUCT Enables the 'struct' module for packing and unpacking binary data. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_PY_STRUCT_UNSAFE_TYPECODES Enables unsafe and non-standard typecodes O, P, S in the struct module, allowing access to arbitrary memory. (1)

MICROPY_PY_SYS

This configuration set controls various features and functionalities of the 'sys' module, which is essential for system-level operations in MicroPython. It enables access to command-line arguments, exception handling, module import paths, and standard input/output streams, among other capabilities, thereby enhancing the interaction between the MicroPython environment and the underlying system.

Macro Description Sample value(s)
MICROPY_PY_SYS Controls the inclusion of the 'sys' module and its features. (0)
MICROPY_PY_SYS_ARGV Enables the 'sys.argv' attribute for accessing command-line arguments. (1)
MICROPY_PY_SYS_ATEXIT Enables the sys.atexit function for registering callbacks on program exit. (1)
MICROPY_PY_SYS_ATTR_DELEGATION Enables attribute delegation for the sys module based on the presence of sys.path, sys.ps1/ps2, or sys.tracebacklimit. (MICROPY_PY_SYS_PATH || MICROPY_PY_SYS_PS1_PS2 || MICROPY_PY_SYS_TRACEBACKLIMIT)
MICROPY_PY_SYS_EXC_INFO Enables the 'sys.exc_info' function for retrieving current exception information. (0)
MICROPY_PY_SYS_EXECUTABLE Enables the sys.executable attribute, providing the path to the MicroPython binary. (1)
MICROPY_PY_SYS_EXIT Enables the 'sys.exit' function in the system module. (1)
MICROPY_PY_SYS_GETSIZEOF Enables the 'sys.getsizeof' function to return the size of an object in bytes. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_SYS_INTERN Enables the 'sys.intern' function for string interning. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_PY_SYS_MAXSIZE Enables the 'sys.maxsize' constant, representing the maximum size of a Python object. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SYS_MODULES Disables all optional features of the sys module. (0)
MICROPY_PY_SYS_PATH Enables the 'sys.path' attribute for module import paths. (1)
MICROPY_PY_SYS_PATH_ARGV_DEFAULTS Controls whether to initialize sys.argv and sys.path to default values during startup. (0)
MICROPY_PY_SYS_PATH_DEFAULT Default paths for module search, including frozen modules and user libraries. ".frozen:~/.micropython/lib:/usr/lib/micropython"
MICROPY_PY_SYS_PLATFORM Defines the platform name for the MicroPython environment. "alif"
MICROPY_PY_SYS_PS1_PS2 Enables mutable attributes sys.ps1 and sys.ps2 for controlling REPL prompts. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SYS_SETTRACE Enables the 'sys.settrace' function for setting a trace function in Python code execution. (0)
MICROPY_PY_SYS_STDFILES Enables the provision of sys.stdin, sys.stdout, and sys.stderr objects. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SYS_STDIO_BUFFER Enables the sys.{stdin,stdout,stderr}.buffer object for buffered I/O operations. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_SYS_TRACEBACKLIMIT Enables the mutable 'tracebacklimit' attribute in the sys module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)

MICROPY_PY_THREAD

This configuration controls the multithreading capabilities within the MicroPython environment, allowing for the use of the _thread module and ensuring thread safety through the implementation of a Global Interpreter Lock (GIL). It also provides options for managing GIL behavior and supports recursive mutexes to enhance thread management.

Macro Description Sample value(s)
MICROPY_PY_THREAD Enables support for threading and the '_thread' module. (0) // disable ARM_THUMB_FP using vldr due to RA has single float only
MICROPY_PY_THREAD_GIL Enables the Global Interpreter Lock (GIL) for thread safety in the runtime. (MICROPY_PY_THREAD)
MICROPY_PY_THREAD_GIL_VM_DIVISOR Determines the number of VM jump-loops before releasing the GIL, defaulting to 32. (32)
MICROPY_PY_THREAD_RECURSIVE_MUTEX Enables the use of recursive mutexes when threading is enabled. (MICROPY_PY_THREAD)

MICROPY_PY_TIME

This configuration set controls the functionalities and features of the time module, enabling various time-related operations such as retrieving the current time, custom sleep functionality, and additional global time functions. It also allows for precise timekeeping through tick functionality and supports both standard and high-resolution time retrieval.

Macro Description Sample value(s)
MICROPY_PY_TIME Enables the unix-specific 'time' module for time-related functionalities. (1)
MICROPY_PY_TIME_CUSTOM_SLEEP Enables a custom sleep function for time.sleep(). (1)
MICROPY_PY_TIME_EXTRA_GLOBALS Adds extra global time-related functions to the time module. \
MICROPY_PY_TIME_GMTIME_LOCALTIME_MKTIME Enables the time.gmtime, time.localtime, and time.mktime functions. (1)
MICROPY_PY_TIME_INCLUDEFILE Path to the implementation file for the time module. "ports/cc3200/mods/modtime.c"
MICROPY_PY_TIME_TICKS Enables the use of RTC1 for time ticks generation. (1)
MICROPY_PY_TIME_TICKS_PERIOD Defines the period for time ticks, calculated as one more than the maximum positive small integer. (MP_SMALL_INT_POSITIVE_MASK + 1)
MICROPY_PY_TIME_TIME_TIME_NS Enables the time.time() and time.time_ns() functions for retrieving the current time in seconds and nanoseconds. (0)

MICROPY_PY_UBLUEPY

This configuration controls the support for the ubluepy Bluetooth module, allowing for both central and peripheral functionalities. It enables developers to implement Bluetooth communication features in their applications, facilitating device interactions and connectivity.

Macro Description Sample value(s)
MICROPY_PY_UBLUEPY Enables the ubluepy module for Bluetooth Low Energy functionality. (1)
MICROPY_PY_UBLUEPY_CENTRAL Enables central Bluetooth functionality in ubluepy. (1)
MICROPY_PY_UBLUEPY_PERIPHERAL Enables support for the ubluepy peripheral functionality. (1)

MICROPY_PY_UCTYPES

Macro Description Sample value(s)
MICROPY_PY_UCTYPES Enables the uctypes module for defining and accessing raw data structures in memory. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_PY_UCTYPES_NATIVE_C_TYPES Enables support for C native type aliases like SHORT, INT, LONG in uctypes. (1)

MICROPY_PY_UHEAPQ

Macro Description Sample value(s)
MICROPY_PY_UHEAPQ Enables the uheapq module for priority queue functionality. (1)

MICROPY_PY_USOCKET

Macro Description Sample value(s)
MICROPY_PY_USOCKET Enables support for the uSocket module. (1)

MICROPY_PY_USSL

Macro Description Sample value(s)
MICROPY_PY_USSL Enables support for SSL in the uPy networking stack. (1)

MICROPY_PY_UTIMEQ

Macro Description Sample value(s)
MICROPY_PY_UTIMEQ Enables the utimeq module for managing time queues. (1)

MICROPY_PY_UWEBSOCKET

Macro Description Sample value(s)
MICROPY_PY_UWEBSOCKET Enables support for the uWebSocket module. (1)

MICROPY_PY_VFS

Macro Description Sample value(s)
MICROPY_PY_VFS Enables the virtual file system (VFS) module based on ROM level and VFS configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES && MICROPY_VFS)

MICROPY_PY_WAIT

Macro Description Sample value(s)
MICROPY_PY_WAIT_FOR_INTERRUPT Inserts assembly code to wait for an interrupt on ESP32 architecture. asm volatile ("waiti 0\n")

MICROPY_PY_WEBREPL

This configuration controls the WebREPL module, which facilitates remote access to the MicroPython environment through a web interface. It includes settings for managing file transfer delays and optimizing memory usage by allowing static allocation of file buffers, making it suitable for various operational contexts.

Macro Description Sample value(s)
MICROPY_PY_WEBREPL Enables the WebREPL module for remote access via a web interface. (MICROPY_PY_NETWORK)
MICROPY_PY_WEBREPL_DELAY Sets a delay in milliseconds for WebREPL file transfers to manage traffic overload. (20)
MICROPY_PY_WEBREPL_STATIC_FILEBUF Enables static allocation of the file buffer in WebREPL for memory-constrained environments. (1)

MICROPY_PY_WEBSOCKET

Macro Description Sample value(s)
MICROPY_PY_WEBSOCKET Enables the websocket module for handling WebSocket connections. (1)

MICROPY_PY_ZEPHYR

Macro Description Sample value(s)
MICROPY_PY_ZEPHYR Enables support for the Zephyr RTOS in the MicroPython build. (1)

MICROPY_PY_ZSENSOR

Macro Description Sample value(s)
MICROPY_PY_ZSENSOR Enables support for the ZSensor module. (1)

MICROPY_READER

This configuration set controls the file reading capabilities within the environment, allowing for the use of both POSIX and virtual file system (VFS) readers. It also defines parameters related to buffer sizes for VFS readers, ensuring efficient memory management during file imports.

Macro Description Sample value(s)
MICROPY_READER_POSIX Enables the POSIX file reader for importing files. (1)
MICROPY_READER_VFS Enables the Virtual File System (VFS) reader for importing files. (1)
MICROPY_READER_VFS_DEFAULT_BUFFER_SIZE Calculates the default buffer size for VFS readers based on garbage collection block size. (2 * MICROPY_BYTES_PER_GC_BLOCK - offsetof(mp_reader_vfs_t, buf))
MICROPY_READER_VFS_MAX_BUFFER_SIZE Limits the maximum buffer size for VFS readers to 255 bytes. (255)
MICROPY_READER_VFS_MIN_BUFFER_SIZE Minimum buffer size for VFS reader based on GC block size and buffer offset. (MICROPY_BYTES_PER_GC_BLOCK - offsetof(mp_reader_vfs_t, buf))

MICROPY_REPL

This configuration set controls various aspects of the Read-Eval-Print Loop (REPL) environment, enhancing user interaction and functionality. It includes features such as automatic indentation, customizable keybindings, event-driven operations, and debugging information, allowing for a more efficient and user-friendly coding experience.

Macro Description Sample value(s)
MICROPY_REPL_AUTO_INDENT Enables automatic indentation in the REPL for improved code formatting. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE Enables extra key bindings for word movement and deletion in the REPL. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EVERYTHING)
MICROPY_REPL_EMACS_KEYS Enables emacs-style keybindings for word movement and deletion in the REPL. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_REPL_EMACS_WORDS_MOVE Enables emacs-style word movement and kill commands in the REPL. (1)
MICROPY_REPL_EVENT_DRIVEN Enables event-driven REPL functions for specific ports. (0)
MICROPY_REPL_INFO Controls the inclusion of debugging information in the REPL. (0)
MICROPY_REPL_STDIN_BUFFER_MAX Sets the maximum number of bytes for the stdin buffer, limited to 64 for certain boards. (64)

MICROPY_SYS

This configuration group manages the settings related to the system LED, including its GPIO pin, port, and peripheral clock. It allows for customization of the LED's hardware interface on various boards, ensuring proper functionality and control.

Macro Description Sample value(s)
MICROPY_SYS_LED_GPIO Defines the GPIO pin used for the system LED. pin_GP25
MICROPY_SYS_LED_PIN_NUM Defines the pin number for the system LED, set to PIN_21 (GP25) on the WIPY board. PIN_21 // GP25 (SOP2)
MICROPY_SYS_LED_PORT Defines the GPIO port for the system LED. GPIOA1_BASE
MICROPY_SYS_LED_PORT_PIN Defines the GPIO pin used for the system LED. GPIO_PIN_1
MICROPY_SYS_LED_PRCM Defines the peripheral clock for the system LED. PRCM_GPIOA1

MICROPY_USE

This configuration group manages various features and functionalities within the MicroPython environment, allowing developers to customize error handling, input processing, and arithmetic operations. It provides options for enabling internal libraries and functionalities, enhancing compatibility and performance on specific architectures.

Macro Description Sample value(s)
MICROPY_USE_GCC_MUL_OVERFLOW_INTRINSIC Enables the use of GCC built-in multiplication overflow detection for ARM architectures with Thumb ISA version 2 or higher. (__ARM_ARCH_ISA_THUMB >= 2)
MICROPY_USE_INTERNAL_ERRNO Controls the use of internal error numbers instead of system-provided ones. (0)
MICROPY_USE_INTERNAL_PRINTF Controls the use of internal printf functions; set to 0 for ESP32 SDK compatibility. (0) // ESP32 SDK requires its own printf
MICROPY_USE_READLINE Enables the use of MicroPython's readline functionality for input handling. (1)
MICROPY_USE_READLINE_HISTORY Enables the use of readline history functionality for command line input. (1)

MICROPY_VERSION

This configuration group manages the versioning system for MicroPython, defining various components such as major, minor, and micro version numbers, as well as indicating whether the build is a prerelease or stable version. It facilitates version comparison and provides formatted version strings for display and identification purposes.

Macro Description Sample value(s)
MICROPY_VERSION Combined version number as a 32-bit integer for version comparison. MICROPY_MAKE_VERSION(MICROPY_VERSION_MAJOR, MICROPY_VERSION_MINOR, MICROPY_VERSION_MICRO)
MICROPY_VERSION_MAJOR Major version number of MicroPython, used in versioning and fallback mechanisms. 1
MICROPY_VERSION_MICRO Defines the micro version number of MicroPython, used in versioning. 0
MICROPY_VERSION_MINOR Indicates the minor version number of MicroPython, currently set to 28. 28
MICROPY_VERSION_PRERELEASE Indicates if the build is a prerelease version, with 1 for prerelease and 0 for stable release. 1
MICROPY_VERSION_STRING Combines version components into a string, appending '-preview' if in prerelease. MICROPY_VERSION_STRING_BASE "-preview"
MICROPY_VERSION_STRING_BASE Generates a string representation of the version based on major, minor, and micro version numbers. \

MICROPY_VFS

This configuration set controls the Virtual File System (VFS) capabilities, allowing for the integration and management of various filesystem types such as FAT, LittleFS, and POSIX. It enables features like writable filesystems and access to ROM files, facilitating a flexible and extensible file handling environment.

Macro Description Sample value(s)
MICROPY_VFS Enables the Virtual File System (VFS) support. (CORE_FEAT)
MICROPY_VFS_FAT Enables support for mounting FAT filesystems within the virtual filesystem. (0)
MICROPY_VFS_LFS1 Enables support for the VFS LittleFS v1 filesystem. (0)
MICROPY_VFS_LFS2 Enables support for the LittleFS v2 filesystem within the Virtual File System (VFS). Examples: make BOARD=PCA10040 MICROPY_VFS_LFS2=1, make BOARD=PCA10056 MICROPY_VFS_LFS2=1. (0)
MICROPY_VFS_POSIX Enables the POSIX virtual filesystem support. (MICROPY_VFS)
MICROPY_VFS_POSIX_WRITABLE Enables writable support for POSIX filesystems. (1)
MICROPY_VFS_ROM Enables support for a ROM filesystem in MicroPython. (MICROPY_HW_ROMFS_ENABLE_INTERNAL_FLASH || MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI || MICROPY_HW_ROMFS_ENABLE_EXTERNAL_XSPI)
MICROPY_VFS_ROM_IOCTL Enables the mp_vfs_rom_ioctl function for querying and modifying read-only memory areas. (MICROPY_VFS_ROM)
MICROPY_VFS_WRITABLE Enables support for writable filesystems, allowing operations like mkdir, remove, and rename. (1)

MICROPY_VM

This configuration set manages the behavior and execution of virtual machine hooks within the MicroPython environment. It allows for the customization of event triggering and polling mechanisms during the execution of bytecode, enhancing the responsiveness and control of the virtual machine.

Macro Description Sample value(s)
MICROPY_VM_HOOK_COUNT Sets the number of virtual machine hooks to be executed. (10)
MICROPY_VM_HOOK_INIT Initializes a variable for VM hook divisor with a predefined count. static uint vm_hook_divisor = MICROPY_VM_HOOK_COUNT;
MICROPY_VM_HOOK_LOOP Triggers a polling hook during the VM opcode loop. MICROPY_VM_HOOK_POLL
MICROPY_VM_HOOK_POLL Triggers an internal event hook when a counter reaches zero. if (--vm_hook_divisor == 0) { \
MICROPY_VM_HOOK_RETURN Executes the VM hook for polling just before the return opcode is completed. MICROPY_VM_HOOK_POLL

MICROPY_MISC

This collection of macros configures various aspects of the MicroPython environment, including system behavior, build information, and hardware support. It allows for customization of features such as interrupt handling, Bluetooth support, and compatibility with CPython, while also managing memory allocation and error detection. Additionally, it provides options for displaying build metadata and controlling the execution environment.

Macro Description Sample value(s)
MICROPY_ASYNC_KBD_INTR Enables raising KeyboardInterrupt directly from the signal handler when not using the GIL. (!MICROPY_PY_THREAD_GIL)
MICROPY_BANNER_MACHINE Defines the machine-specific banner message format for display. MICROPY_PY_SYS_PLATFORM " [" MICROPY_PLATFORM_COMPILER "] version"
MICROPY_BANNER_NAME_AND_VERSION Defines the banner string including version and build date for MicroPython. "MicroPython (with v2.0 preview) " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE
MICROPY_BEGIN_ATOMIC_SECTION Locks interrupts to ensure atomic operations. irq_lock
MICROPY_BLUETOOTH_NIMBLE Enables the NimBLE Bluetooth stack for MicroPython. (1)
MICROPY_BLUETOOTH_NIMBLE_BINDINGS_ONLY Enables only the Bluetooth NimBLE bindings without full implementation. (1)
MICROPY_BUILD_DATE Indicates the date when the MicroPython build was created. "2025-08-16"
MICROPY_BUILD_TYPE_PAREN Formats the build type in parentheses for display purposes. " (" MICROPY_BUILD_TYPE ")"
MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG Enables checking the type of the 'self' argument in built-in methods to prevent undefined behavior. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_BYTES_PER_GC_BLOCK Defines the number of bytes in a memory allocation/GC block, rounded up for allocations. (4 * MP_BYTES_PER_OBJ_WORD)
MICROPY_CAN_OVERRIDE_BUILTINS Enables the ability to override built-in functions in the builtins module. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_CPYTHON_COMPAT Enables features that enhance compatibility with CPython, potentially increasing code size and memory usage. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_DYNAMIC_COMPILER Enables support for dynamic compilation features. (1)
MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE Determines the size of the emergency exception buffer, with 0 indicating dynamic allocation. (0) // 0 - implies dynamic allocation
MICROPY_END_ATOMIC_SECTION Ends an atomic section by restoring the previous interrupt state. irq_unlock
MICROPY_EPOCH_IS_1970 Enables time values to be based on the epoch starting from 1970/1/1. (1)
MICROPY_EPOCH_IS_2000 Determines if the epoch for timestamps is set to January 1, 2000. (1 - (MICROPY_EPOCH_IS_1970))
MICROPY_ESP32_USE_BOOTLOADER_RTC Enables the use of RTC for bootloader functionality on certain ESP32 targets. (1)
MICROPY_ESP8266_APA102 Enables support for APA102 LED strip functionality on ESP8266. (1)
MICROPY_ESP_IDF_ENTRY Defines the entry point for the ESP-IDF application, defaulting to app_main. app_main
MICROPY_EVENT_POLL_HOOK Triggers an event poll mechanism, typically yielding control to handle events. __WFI();
MICROPY_EVENT_POLL_HOOK_WITH_USB Executes the USB stack when the scheduler is locked and USB data is pending. \
MICROPY_EXPOSE_MP_COMPILE_TO_RAW_CODE Controls the exposure of mp_compile_to_raw_code as a public function based on built-in code settings. (MICROPY_PY_BUILTINS_CODE >= MICROPY_PY_BUILTINS_CODE_BASIC || MICROPY_PERSISTENT_CODE_SAVE)
MICROPY_FULL_CHECKS Enables full checks similar to CPython to ensure test suite passes. (1)
MICROPY_GCREGS_SETJMP Enables fallback to setjmp() for discovering GC pointers in registers. (1)
MICROPY_GIT_HASH Contains the current Git commit hash for the build. "0a119b8164"
MICROPY_GIT_TAG Contains the current Git tag of the MicroPython build. "v1.27.0-preview.16.g0a119b8164.dirty"
MICROPY_HAL_HAS_STDIO_MODE_SWITCH Indicates the availability of functions for switching standard I/O modes. (1)
MICROPY_HAL_HAS_VT100 Indicates support for VT100 terminal commands. (1)
MICROPY_HAL_VERSION Indicates the version of the Hardware Abstraction Layer (HAL). "2.8.0"
MICROPY_HAS_FILE_READER Enables file reading capabilities based on the presence of either POSIX or VFS readers. (MICROPY_READER_POSIX || MICROPY_READER_VFS)
MICROPY_HEAP_END Determines the end address of the heap based on SDRAM validity. ((sdram_valid) ? sdram_end() : &_heap_end)
MICROPY_HEAP_SIZE Defines the size of the garbage collector heap in bytes. (25600) // heap size 25 kilobytes
MICROPY_HEAP_START Determines the starting address of the heap based on SDRAM validity. ((sdram_valid) ? sdram_start() : &_heap_start)
MICROPY_HELPER_LEXER_UNIX Enables the inclusion of Unix-specific lexer helper functions. (1)
MICROPY_HELPER_REPL Enables the inclusion of REPL helper functions based on ROM level configuration. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_I2C_PINS_ARG_OPTS Indicates that I2C pin arguments are not required for most boards. 0
MICROPY_INTERNAL_EVENT_HOOK Fallback for ports lacking specific non-blocking event processing; evaluates to (void)0. (void)0
MICROPY_INTERNAL_PRINTF_PRINTER Pointer to the mp_print_t printer for printf output when internal printf is enabled. (&mp_plat_print)
MICROPY_KBD_EXCEPTION Enables the KeyboardInterrupt exception and related functionality. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_LOADED_MODULES_DICT_SIZE Initial size of the sys.modules dictionary. (3)
MICROPY_LONGINT_IMPL Determines the implementation of long integers, allowing options like long long or MPZ. (MICROPY_LONGINT_IMPL_LONGLONG)
MICROPY_LONGINT_IMPL_LONGLONG Enables long integer implementation using 64-bit long long type. (1)
MICROPY_LONGINT_IMPL_MPZ Indicates the use of the MPZ type for long integer implementation. (2)
MICROPY_LONGINT_IMPL_NONE Indicates that long integer support is disabled. (0)
MICROPY_MACHINE_BITSTREAM_TYPE_HIGH_LOW Defines a timing format for driving WS2812 LEDs as a 4-tuple of high and low times. (0)
MICROPY_MACHINE_MEM_GET_READ_ADDR Defines the function for obtaining the read address in the machine memory module. mod_machine_mem_get_addr
MICROPY_MACHINE_MEM_GET_WRITE_ADDR Defines the function to retrieve the write address for machine memory operations. mod_machine_mem_get_addr
MICROPY_MALLOC_USES_ALLOCATED_SIZE Enables passing the allocated memory size to realloc/free for enhanced memory debugging. (1)
MICROPY_MBEDTLS_CONFIG_BARE_METAL Enables bare metal memory management for mbedTLS in coverage builds. (1)
MICROPY_MBFS Enables the micro:bit filesystem when VFS is disabled. (!MICROPY_VFS)
MICROPY_MEM_STATS Enables collection of memory allocation statistics such as total, current, and peak bytes allocated. (0)
MICROPY_MIN_USE_CORTEX_CPU Enables support for minimal IRQ and reset framework on Cortex-M CPUs. (1)
MICROPY_MIN_USE_STDOUT Enables the use of standard output for printing. (1)
MICROPY_MIN_USE_STM32_MCU Enables minimal support for STM32 microcontroller features. (1)
MICROPY_MPHALPORT_H Defines the header file for the microcontroller hardware abstraction layer. "pic16bit_mphal.h"
MICROPY_MULTIPLE_INHERITANCE Enables support for multiple inheritance in Python classes, affecting class resolution and function calls. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
MICROPY_NO_ALLOCA Disables the use of alloca() and replaces it with heap allocation. (1)
MICROPY_PAGE_MASK Mask for aligning addresses to page boundaries. (MICROPY_PAGE_SIZE - 1)
MICROPY_PAGE_SIZE Defines the memory page size as 4096 bytes. 4096
MICROPY_PIN_DEFS_PORT_H Includes the port-specific pin definition header file. "pin_defs_stm32.h"
MICROPY_PLAT_DEV_MEM Enables access to physical memory via /dev/mem on Linux systems. (1)
MICROPY_PREVIEW_VERSION_2 Enables in-progress or breaking changes slated for the 2.x release. (0)
MICROPY_PROF_INSTR_DEBUG_PRINT_ENABLE Enables debugging output for the settrace feature, not for production builds. 0
MICROPY_PYEXEC_COMPILE_ONLY Enables compile-only mode for executing scripts without running them. (1)
MICROPY_PYEXEC_ENABLE_EXIT_CODE_HANDLING Enables handling of exit codes from sys.exit() calls. (1)
MICROPY_PYEXEC_ENABLE_VM_ABORT Controls handling of abort behavior in the pyexec code. (0)
MICROPY_PYSTACK_ALIGN Determines the byte alignment for memory allocated by the Python stack. (8)
MICROPY_QSTR_BYTES_IN_HASH Determines the number of bytes allocated for storing qstr hashes, affecting memory usage and hash computation. (2)
MICROPY_QSTR_BYTES_IN_LEN Determines the number of bytes allocated for storing the length of qstr identifiers. (1)
MICROPY_QSTR_EXTRA_POOL Defines an additional ROM pool for extra qstrs required by frozen code. mp_qstr_frozen_const_pool
MICROPY_READLINE_HISTORY_SIZE Determines the maximum number of items stored in the readline history. (50)
MICROPY_REGISTERED_EXTENSIBLE_MODULES Lists the extensible modules registered for the build. \
MICROPY_REGISTERED_MODULES Lists all registered modules for the MicroPython build. \
MICROPY_RV32_EXTENSIONS Combines enabled RISC-V RV32 extensions into a single value. \
MICROPY_SAFE_BOOT_PIN_NUM Defines the GPIO pin number used for safe boot functionality. PIN_15 // GP22
MICROPY_SAFE_BOOT_PORT Defines the GPIO port used for safe boot functionality. GPIOA2_BASE
MICROPY_SAFE_BOOT_PORT_PIN Indicates the GPIO pin used for safe boot mode functionality. GPIO_PIN_6
MICROPY_SAFE_BOOT_PRCM Identifies the peripheral clock for the safe boot pin. PRCM_GPIOA2
MICROPY_SCHEDULER_DEPTH Determines the maximum number of entries in the scheduler, affecting task management. (4)
MICROPY_SCHEDULER_STATIC_NODES Enables support for scheduling static nodes with C callbacks in the scheduler. (0)
MICROPY_SCHED_HOOK_SCHEDULED Triggers an event signal when a function is scheduled on the scheduler queue. mp_hal_signal_event()
MICROPY_SELECT_REMAINING_TIME Assumes select() updates the remaining timeout value when interrupted by a signal. (1)
MICROPY_SOFT_TIMER_TICKS_MS Defines the millisecond tick counter for soft timers, typically set to a hardware timer variable. uwTick
MICROPY_SPI_PINS_ARG_OPTS Configures the requirement for SPI pin arguments, defaulting to none for most boards. 0
MICROPY_SSL_MBEDTLS Enables the use of mbedTLS for SSL support. (MICROPY_PY_SSL)
MICROPY_STACKLESS Controls the use of the C stack for Python function calls, enabling stackless mode when set to 1. (0)
MICROPY_STACKLESS_STRICT Controls strict stackless behavior, affecting exception handling during deep recursion. (0)
MICROPY_STACK_CHECK Enables checking of C stack usage to prevent overflow during function calls. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_STACK_CHECK_MARGIN Defines the byte margin subtracted from the stack size for stack checks. (1024)
MICROPY_STACK_SIZE_HARD_IRQ Defines the size of the stack for hard IRQ handlers, with 0 indicating no separate stack. (CONFIG_ISR_STACK_SIZE)
MICROPY_STDIO_UART Enables the use of UART for standard input/output. 1
MICROPY_STDIO_UART_BAUD Sets the baud rate for UART standard input/output. 115200
MICROPY_STREAMS_NON_BLOCK Enables support for POSIX-semantics non-blocking streams. (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
MICROPY_STREAMS_POSIX_API Enables POSIX-like stream functions for compatibility with C libraries requiring read/write/lseek/fsync. (1)
MICROPY_TASK_PRIORITY Sets the priority level for the MicroPython task. (2)
MICROPY_TASK_STACK_LEN Calculates the number of stack elements for the MicroPython task based on stack size and element size. (MICROPY_TASK_STACK_SIZE / sizeof(StackType_t))
MICROPY_TASK_STACK_SIZE Defines the stack size for tasks in bytes, calculated as 6 KB plus 512 bytes. ((6 * 1024) + 512) // in bytes
MICROPY_TIMESTAMP_IMPL Determines the type used for timestamps, specifically using time_t for port modtime functions. (MICROPY_TIMESTAMP_IMPL_TIME_T)
MICROPY_TIMESTAMP_IMPL_LONG_LONG Represents timestamps using a long long type. (0)
MICROPY_TIMESTAMP_IMPL_TIME_T Uses the time_t type for representing timestamps. (2)
MICROPY_TIMESTAMP_IMPL_UINT Defines the use of an unsigned integer type for representing timestamps. (1)
MICROPY_TIME_SUPPORT_Y1969_AND_BEFORE Enables support for date and time functions before the year 1970. (1)
MICROPY_TIME_SUPPORT_Y2100_AND_BEYOND Enables support for date and time functions beyond the year 2099. (MICROPY_TIME_SUPPORT_Y1969_AND_BEFORE)
MICROPY_TRACKED_ALLOC Enables tracking of memory allocations for garbage collection when SSL or Bluetooth features are used. (MICROPY_SSL_MBEDTLS || MICROPY_BLUETOOTH_BTSTACK)
MICROPY_TRACKED_ALLOC_STORE_SIZE Determines if the size of tracked allocations is stored based on garbage collection settings. (!MICROPY_ENABLE_GC)
MICROPY_UART_PINS_ARG_OPTS Indicates that UART pin arguments are required when no default pins are defined. MP_ARG_REQUIRED
MICROPY_UNIX_MACHINE_IDLE Invokes sched_yield() to allow other threads to run during idle time. sched_yield();
MICROPY_USDHC1 Defines pin configurations for USDHC1 interface. \
MICROPY_VARIANT_ENABLE_JS_HOOK Controls periodic calls to mp_js_hook() for checking interrupt characters. (0)
MICROPY_WARNINGS Enables warning messages during compilation and execution. (1)
MICROPY_WARNINGS_CATEGORY Controls the support for warning categories during runtime. (0)