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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
MICROPY_HW_ANTENNA
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.
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.
MICROPY_HW_BOARD
| Macro |
Description |
Sample value(s) |
MICROPY_HW_BOARD_NAME |
Identifies the hardware board name being used. |
"F769DISC" |
MICROPY_HW_BOOTSEL
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.
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.
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
MICROPY_HW_EEPROM
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.
MICROPY_HW_ENTER
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.
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.
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
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.
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
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.
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.
MICROPY_HW_PIN
MICROPY_HW_PSRAM
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.
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.
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.
MICROPY_HW_REPL
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.
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.
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.
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.
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.
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
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.
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
MICROPY_HW_SUBGHZSPI
MICROPY_HW_SYSTEM
MICROPY_HW_TINYUSB
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.
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.
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
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.
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.
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.
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.
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
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.
MICROPY_PY_BOUND
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.
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.
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.
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.
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.
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.
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.
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.
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
MICROPY_PY_STRING
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.
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.
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
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.
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.
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.
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.
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) |