summaryrefslogtreecommitdiff
path: root/docs/library
AgeCommit message (Collapse)Author
12 daysdocs/library/network.WLAN: Fix typo for ESP32 protocol constants.Thomas Kiss
Signed-off-by: Thomas Kiss <thokis@googlemail.com>
2025-12-03docs/library/machine.Timer: Explain the id parameter in more detail.Angus Gratton
As noted in discussion on PR #18263, the id parameter is optional on ports that support virtual timers. Add some more general explanation of hardware vs virtual timers, and remove redundant documentation about timer callbacks in favour of the isr_rules page. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-26docs/library: Add machine.DAC documentation.Matt Trentini
Fixes issue #7915. Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2025-11-26docs/library: Fix typos under I2CTarget irq method description.Alex Tran
There were a few typos in the documentation for the `I2CTarget.irq` method description where `IRQ_ADDR_MATCH_READ` was used, however `IRQ_ADDR_MATCH_WRITE` should have been used. Fixes issue #18470. Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
2025-11-26docs/library: Document OrderedDict.popitem()'s CPython differences.Jos Verlinde
Fixes issue #18370. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2025-11-25tests/multi_espnow: Add test case for espnow rate changes.Angus Gratton
Uses constants added in previous commit. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-25esp32,docs: Add constants and documentation for espnow data rates.Angus Gratton
Changes are: - Add constants for some of the supported ESP-NOW data rates. - Add constants for switching an ESP32 WLAN radio in/out of Long Range mode. - Document the new constants and their usage. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-21docs/library/os: Clarify ilistdir tuples size element.Alex Tran
The currently documentation for ilistdir tuples says that the size element is included based on the platform. However, this is not the case as it is included based on the filesystem type. This commit makes the according adjustment. Fixes issue #17516. Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
2025-11-17esp32/esp32_rmt: Update RMT module to use the new RMT API.Elvis Pfutzenreuter
The current `esp32.RMT` class uses a legacy API from ESP-IDF 4.x. The ESP-IDF 5.x offers a new API, which is overall better, and easier to implement the RX side in the future. This commit updates the module and the documentation, preserving the current MicroPython RMT API as much as possible. The bitstream RMT implementation was updated as well, since ESP-IDF does not allow firmware to reference legacy and new APIs at the same time (it resets right after boot with an error message, even if neither module is imported). The documentation is updated accordingly. Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
2025-11-13esp32/modesp32: Add esp32.wake_on_gpio() function.Meir Armon
Some boards support waking up via GPIO pins, but this is not currently supported by MicroPython. This commit adds support for waking with GPIO in a similar interface to waking with ext0, ext1, touch and ulp. This commit adds documentation for this new function as well. Signed-off-by: Meir Armon <meirarmon@gmail.com>
2025-10-13zephyr/modzsensor: Add set/get sensor attributes to zsensor.Ned Konz
This commit adds `Sensor.attr_set()` and `Sensor.attr_get_*()` methods that are necessary to set various sensor attributes if they haven't been set statically in the device tree. This is needed, for example, because the LSM6DS3TR-C sensor on the XIAO BLE NRF52840 SENSE board will not work with `zsensor` because it doesn't have any default configuration for sampling frequency. Various `SENSOR_ATTR_*` constants from `zephyr/incude/zephyr/drivers/sensor.h` have been added as `ATTR_*` constants in the `zsensor` module. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-09-26docs/library/os: Document dupterm_notify function.Jos Verlinde
Closes issue #17799. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
2025-09-25docs: Document the cross-port Timer hard= option.Chris Webb
Update the main machine.Timer specification, and any references to hard/soft interrupts in port-specific documentation. There is a separate copy of the machine.Timer documentation for the pyboard, so update that too to keep everything consistent. Signed-off-by: Chris Webb <chris@arachsys.com>
2025-09-11extmod/modplatform: Expose CPU features/extensions.Alessandro Gatti
This adds the ability to expose CPU-specific features/extensions to scripts when the `platform` module is compiled in, by implementing `platform.processor()`. Right now this is only available on bare-metal RV32 and RV64. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-11extmod/modre: Add support for start- and endpos.Jared Hancock
Pattern objects have two additional parameters for the ::search and ::match methods to define the starting and ending position of the subject within the string to be searched. This allows for searching a sub-string without creating a slice. However, one caveat of using the start-pos rather than a slice is that the start anchor (`^`) remains anchored to the beginning of the text. Signed-off-by: Jared Hancock <jared@greezybacon.me>
2025-08-02docs/library/machine: Add docs for Counter and Encoder.Jonathan Hogg
Add documentation for `machine.Counter` and `machine.Encoder` as currently implemented by the esp32 port, but intended to be implemented by other ports. Originally authored by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com> and Jonathan Hogg <me@jonathanhogg.com>. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2025-08-01docs/esp32: Add documentation for esp32.PCNT.Jonathan Hogg
Document the new `esp32.PCNT` class for hardware pulse counting. Originally authored by: Jonathan Hogg <me@jonathanhogg.com> Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2025-08-01docs/library: Document the new machine.I2CTarget class.Damien George
With some working examples that show how to use all the features. Signed-off-by: Damien George <damien@micropython.org>
2025-08-01docs/library/btree: Fix method links to explicitly specify class.Koudai Aono
So they don't clash with other potential references. Signed-off-by: Koudai Aono <koxudaxi@gmail.com>
2025-08-01docs/library/rp2.StateMachine: Add a note about PIO in and jmp pins.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-07-31docs/library/bluetooth: Document all allowed args to UUID constructor.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-07-23extmod/mbedtls: Implement recommended DTLS features, make optional.Angus Gratton
- DTLS spec recommends HelloVerify and Anti Replay protection be enabled, and these are enabled in the default mbedTLS config. Implement them here. - To help compensate for the possible increase in code size, add a MICROPY_PY_SSL_DTLS build config macro that's enabled for EXTRA and above by default. This allows bare metal mbedTLS ports to use DTLS with HelloVerify support. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-07-22py/modsys: Add sys.implementation._thread attribute.Damien George
This is useful to distinguish between GIL and non-GIL builds. Signed-off-by: Damien George <damien@micropython.org>
2025-06-16esp32/modesp32: Make wake_on_ext1 available only on SoCs supporting it.Meir Armon
The `esp32.wake_on_ext1()` method should only be available on boards that have SOC_PM_SUPPORT_EXT1_WAKEUP=y. And update docs to reflect this. Signed-off-by: Meir Armon <meirarmon@gmail.com>
2025-06-16esp32/modesp32: Make wake_on_ext0 available only on SoCs supporting it.Meir Armon
The `esp32.wake_on_ext0()` method should only be available on boards that have SOC_PM_SUPPORT_EXT0_WAKEUP=y. And update docs to reflect this. Signed-off-by: Meir Armon <meirarmon@gmail.com>
2025-06-16esp32/modesp32: Make wake_on_touch available only on SoCs supporting it.Meir Armon
The `esp32.wake_on_touch()` method should only be available on boards that have SOC_TOUCH_SENSOR_SUPPORTED=y. And update docs to reflect this. Signed-off-by: Meir Armon <meirarmon@gmail.com>
2025-06-16esp32/modesp32: Make wake_on_ulp available only on SoCs that support it.Meir Armon
The `esp32.wake_on_ulp()` method should only be available on boards that have SOC_ULP_SUPPORTED=y. Update docs to reflect this. Signed-off-by: Meir Armon <meirarmon@gmail.com>
2025-06-04extmod/modframebuf: Add support for blit'ing read-only data.Damien George
Currently the `FrameBuffer.blit(buf, x, y)` method requires the `buf` argument to be another `FrameBuffer`, which is quite restrictive because it doesn't allow blit'ing read-only memory/data. This commit extends `blit()` to allow the `buf` argument to be a tuple or list of the form: (buffer, width, height, format[, stride]) where `buffer` can be anything with the buffer protocol and may be read-only, eg `bytes`. Also, the palette argument to `blit()` may be of the same form. The form of this tuple/list was chosen to be the same as the signature of the `FrameBuffer` constructor (that saves quite a bit of code size doing it that way). Signed-off-by: Damien George <damien@micropython.org>
2025-06-03docs: Add a description of recv/recvfrom flags argument.Angus Gratton
Implementation added for various ports in the parent commits. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-28docs/esp32: Mention the use of Timer(0) by UART.IRQ_RXIDLE.robert-hh
In both the machine.UART and esp32.quickref sections. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-05-28docs/library/time: Amend the documentation of time.mktime().robert-hh
By showing the argument and refer to epoch instead of a fixed date. The note about epoch lists the ports using the POSIX epoch. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-05-16esp32/modesp32: Implement esp32.idf_task_info().Daniël van de Giessen
This adds a new function, `esp32.idf_task_info()`, that can be used to retrieve task statistics which is useful for diagnosing issues where some tasks are using up a lot of CPU time. It's best used in conjunction with the `utop` module from micropython-lib. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2025-05-16docs/esp32: Improve PWM documentation and examples.IhorNehrutsa
This reduces inconsitencies between esp32 and other ports. According to the discussion in #10817. Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
2025-05-07docs,ports: Fix SparkFun capitalization.Malcolm McKellips
This is a follow-up to 1e92bdd206f6f87ba65ea05c5b2623fca0b926cd correcting more of the instances where "Sparkfun" should be "SparkFun". Signed-off-by: Damien George <damien@micropython.org>
2025-04-29zephyr: Fix call to thread_analyzer_print for v4.0.Detlev Zundel
Commit 1b6e0f64796dfd6f86a8679ea6d24e1fca1e63a8 for Zephyr v4.0.0 changed the function "thread_analyzer_print" to require a cpu argument and allow thread analysis on each cpu separately. The argument is ignored when THREAD_ANALYZER_AUTO_SEPARATE_CORES=n which is the default on single core machines. Promote this change to the MicroPython zephyr module. Signed-off-by: Detlev Zundel <dzu@member.fsf.org> Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2025-03-27docs/library/vfs: Document no-args mount output.Anson Mansfield
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-03-13esp32/machine_sdcard: Add SDCard SPI mode support for ESP32-S2,C3,C6.Angus Gratton
These micros don't have full SDMMC host support, but they can initialise the SDCard in SPI mode. A bit limited on C3 and C6 as they only have one host SPI peripheral. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32/machine_sdcard: Add SDCard pin assignments for ESP32-S3 support.Angus Gratton
Previously ESP32-S3 SDMMC could only use fixed pin assignments, however the ESP-IDF defaults don't match common boards. The chip also supports using GPIO Matrix to assign any pin. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-05esp8266/network_wlan: Allow enumerating connected stations in AP mode.Alessandro Gatti
This commit introduces the ability to obtain a list of stations connected to the device when in soft-AP mode. A new parameter ("stations") to pass to WLAN.status is supported, returning a tuple of (bssid, ipv4) entries, one per connected station. An empty tuple is returned if no stations are connected, and an exception is raised if an error occurred whilst building the python objects to return to the interpreter. Documentation is also updated to cover the new parameter. This fixes #5395. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-03-05py/modsys: Add sys.implementation._build entry.Damien George
For a given MicroPython firmware/executable it can be sometimes important to know how it was built, which variant/board configuration it came from. This commit adds a new field `sys.implementation._build` that can help identify the configuration that MicroPython was built with. For now it's either: * <VARIANT> for unix, webassembly and windows ports * <BOARD>-<VARIANT> for microcontroller ports (the variant is optional) In the future additional elements may be added to this string, separated by a hyphen. Resolves issue #16498. Signed-off-by: Damien George <damien@micropython.org>
2025-02-28docs/library/machine.Pin: Show availability of low, high and toggle.robert-hh
Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-25docs: Fix double 'the' in documentation.Ronald Weber
Signed-off-by: Ronald Weber <ronaldxweber@gmail.com>
2025-02-14extmod/modtls_mbedtls: Wire in support for DTLS.Keenan Johnson
This commit enables support for DTLS, i.e. TLS over datagram transport protocols like UDP. While support for DTLS is absent in CPython, it is worth supporting it in MicroPython because it is the basis of the ubiquitous CoAP protocol, used in many IoT projects. To select DTLS, a new set of "protocols" are added to SSLContext: - ssl.PROTOCOL_DTLS_CLIENT - ssl.PROTOCOL_DTLS_SERVER If one of these is set, the library assumes that the underlying socket is a datagram-like socket (i.e. UDP or similar). Our own timer callbacks are implemented because the out of the box implementation relies on `gettimeofday()`. This new DTLS feature is enabled on all ports that use mbedTLS. This commit is an update to a previous PR #10062. Addresses issue #5270 which requested DTLS support. Signed-off-by: Keenan Johnson <keenan.johnson@gmail.com>
2025-02-11docs/library/marshal: Document the marshal module.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-02-11docs/library/espnow: Clarify usage of the "rate" configuration key.Alessandro Gatti
This commit adds a clarification for the ESPNow module's documentation regarding its "config" method. The original documentation for that method could be interpreted as having all its configuration keys being able to be queried, but the "rate" configuration key is actually write-only due to ESP-IDF's lack of a way to retrieve that bit of information from the radio's configuration. The documentation changes highlight the fact that said configuration key is actually write-only. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-02-11docs/reference: Add strings vs bytes to speed optimisation tips.Angus Gratton
Also add some additional context links, suggestions for alternative classes, etc. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-02-11docs: Note which ports have default or optional network.PPP support.Angus Gratton
Also add the default values of these macros to the respective `mpconfigport.h` files, to improve discoverability. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-02-11docs/esp32: Add documentation for SPI Ethernet devices on esp32 port.Angus Gratton
Also cross-link with the other WIZNET5K driver, to avoid confusion. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-02-08rp2/rp2_pio: Add side_pindir support for PIO.Markus Gyger
Side-setting can also be used to change pin directions instead of pin values. This adds a parameter `side_pindir` to decorator `asm_pio()` to configure it. Also replaces a few close-by 0s with corresponding PIO.* constants. Addresses issue #10027. Signed-off-by: Markus Gyger <markus@gyger.org>
2025-01-17stm32/pyb_can: Make pyb.CAN baud calculation a little more forgiving.Angus Gratton
Not every baudrate or sample point combination has an exact match, but getting within 1% on sample point and .1% on baud rate should always be good enough. Because the search goes from shorter bit periods (lowest brp) and increases, the first match which meets this criteria should still mostly be the best available. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>