summaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)Author
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-02-07docs/samd/pinout: Add pinout for the Generic SAMD board types.robert-hh
The table shows the devices available at the pin and the respective package letter. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-07docs/samd/pinout: Add pinout for Adafruit NeoKey Trinkey and QT Py.robert-hh
Only pins accessible at the board are shown. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-01-22LICENSE,docs: Update copyright year range to include 2025.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-01-17docs/esp32: Defer to the download page for flashing steps.Angus Gratton
The user already has it open, and its customised for their particular board. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17docs/esp32: Update tutorial flashing steps to match deploy.md.Angus Gratton
Includes fixing the flashing address for newer SoCs, as reported in discussion https://github.com/orgs/micropython/discussions/16417 Also removes some redundant or out of date information, and adds links to the Espressif esptool docs which are quite comprehensive. Information about ESP32_GENERIC variants is moved to the board page, as it only applies to that board. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
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>
2025-01-16docs/reference/isr_rules: Describe issue with hard ISRs and globals.peterhinch
Signed-off-by: Damien George <damien@micropython.org>
2024-12-23tools/mpy_ld.py: Add native modules support for RV32 code.Alessandro Gatti
This commit adds support for RV32IMC native modules, as in embedding native code into a self-contained MPY module and and make its exported functions available to the MicroPython environment. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-12-20doc: Note that machine.USBDevice is now available on esp32 port.Angus Gratton
Support was added in commit 5f2d05d, this updates the docs to match. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-12-19ports: Fix machine.RTC.init() method so argument order matches the docs.robert-hh
This commit makes the argument ordering of `machine.RTC.init()` the same for all the ports that implement arguments to this method: cc3200, esp32, mimxrt and samd. The cc3200 argument ordering is used, which matches the documentation. Also document the availability and the differing semantics for the stm32 and renesas-ra port. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-12-19mimxrt/machine_rtc: Drop machine.RTC.now() method.robert-hh
This is not part of the common machine API. It's dropped on the mimxrt port and kept only on the cc3200 port for legacy. Also show the port availability of `RTC.now()` in the documentation. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-12-19docs: Fix the quickref documentation of rtc.datetime().robert-hh
Such that it matches the implementation and the documentation of the `machine.RTC` class. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-12-10mimxrt/machine_rtc: Deprecate RTC.cancel in MicroPython v2.Alessandro Gatti
The current documentation for the `machine.RTC` class contains information about the `RTC.cancel` method for cancelling pending alarms. However only two ports (cc3200 and mimxrt) implement this functionality but under a different name: `RTC.alarm_cancel`. The mimxrt port also implements `RTC.cancel` but it is aliased to `RTC.alarm_cancel` anyway. To maintain naming consistency, this commit updates the documentation to officially define `RTC.alarm_cancel` as the method to call to cancel pending alarms and deprecates mimxrt's `RTC.cancel` implementation. `RTC.cancel` in the mimxrt port is thus scheduled for removal in MicroPython v2. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-12-03docs/library/binascii: Add docs for binascii.crc32 method.Amirreza Hamzavi
Signed-off-by: Amirreza Hamzavi <amirrezahamzavi2000@gmail.com>
2024-11-30docs,ports: Fix some comments and error messages with doubled-up words.chuangjinglu
Signed-off-by: chuangjinglu <chuangjinglu@outlook.com>
2024-11-28docs,esp32: Update machine.TouchPad docs for ESP32-S2 and ESP32-S3.Angus Gratton
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-28tests/multi_espnow: Add channel setting test, add some docs.Angus Gratton
Test currently passes. It was added so it can be used to check for regressions when fixing channel selection for AP mode in a follow-up commit. Also add some docs about how channel setting is observed to work for ESP-NOW. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-19docs: Change copyright line to mention "authors and contributors".Damien George
The docs have been authored by many people now. Instead of singling out individuals in the copyright line, prefer to mention all "MicroPython authors and contributors". Individual contributions can still be discovered via the git history. Signed-off-by: Damien George <damien@micropython.org>
2024-11-19docs/library: Note link between machine.soft_reset() and sys.exit().Angus Gratton
This is currently an implementation detail of MicroPython rather than by design. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-19docs/esp32: Add a factory reset page.Angus Gratton
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-19docs/rp2: Add a small factory reset page.Angus Gratton
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-19docs: Add a "Reset and Boot Sequence" reference page.Angus Gratton
Previously individual ports documented these aspects to varying degrees, but most of the information is common to all ports. In particular, this adds a canonical explanation of `boot.py` and `main.py`. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-18ports: Make PWM duty_u16 have an upper value of 65535 across all ports.robert-hh
The following ports used 65536 as the upper value (100% duty cycle) and are changed in this commit to use 65535: esp8266, mimxrt, nrf, samd. Tested that output is high at `duty_u16(65535)` and low at `duty_u16(0)`. Also verified that at `duty_u16(32768)` the high and low pulse have the same length. Partially reverts #10850, commits 9c7ad68165bcd224c94ca6d8f172362cf8000d99 and 2ac643c15bec8c88ece0e944ce58f36d02dfd2dd. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-11-13extmod/network_ppp: Add stream config parameter.Daniël van de Giessen
This makes the stream that the PPP object wraps, which is normally only set once via the constructor, accessible and configurable via the `ppp.config()` method. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-11-08docs: Specify the recommended network.WLAN.IF_[AP|STA] constants.Angus Gratton
Removes the deprecated network.[AP|STA]_IF form from the docs. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-11-04tests/run-tests.py: Change --target/--device options to --test-instance.Damien George
Previously to this commit, running the test suite on a bare-metal board required specifying the target (really platform) and device, eg: $ ./run-tests.py --target pyboard --device /dev/ttyACM1 That's quite a lot to type, and you also need to know what the target platform is, when a lot of the time you either don't care or it doesn't matter. This commit makes it easier to run the tests by replacing both of these options with a single `--test-instance` (`-t` for short) option. That option specifies the executable/port/device to test. Then the target platform is automatically detected. The `--test-instance` can be passed: - "unix" (the default) to use the unix version of MicroPython - "webassembly" to test the webassembly port - anything else is considered a port/device to pass to Pyboard There are also some shortcuts to specify a port/device, following `mpremote`: - a<n> is short for /dev/ttyACM<n> - u<n> is short for /dev/ttyUSB<n> - c<n> is short for COM<n> For example: $ ./run-tests.py -t a1 Note that the default test instance is "unix" and so this commit does not change the standard way to run tests on the unix port, by just doing `./run-tests.py`. As part of this change, the platform (and it's native architecture if it supports importing native .mpy files) is show at the start of the test run. Signed-off-by: Damien George <damien@micropython.org>
2024-10-31docs/reference/packages: Fix description of --target option in mip.Jan Klusáček
Descripton of mip usage with micropython port suggest using it like this: ./micropython -m mip install --target=third-party pkgname But it should be called without equal sign: ./micropython -m mip install --target third-party pkgname Signed-off-by: honza.klu@gmail.com
2024-10-22rp2/machine_uart: Make it so TX is done only when no longer busy.Damien George
Prior to this commit, when flushing a UART on the rp2 port, it returns just before the last character is sent out the wire. Fix this by waiting until the BUSY flag is cleared. This also fixes the behaviour of `UART.txdone()` to return `True` only when the last byte has gone out. Updated docs and tests to match. The test now checks that UART TX time is very close to the expected time (prior, it was just testing that the TX time was less than the expected time). Signed-off-by: Damien George <damien@micropython.org>
2024-10-15rp2/rp2_pio: Add support for RP2350A/B variants in PIO interface.Phil Howard
Add support for 32 and 48 pin variants of RP2350. Add new `PIO.gpio_base()` method, mirroring the Pico SDK. Signed-off-by: Phil Howard <phil@gadgetoid.com> Signed-off-by: Damien George <damien@micropython.org>
2024-10-09esp32: Add support for esp32c6.Andrew Leech
This commit adds general support for ESP32-C6 SoCs. Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-10-09docs/reference/mpremote: Update docs to mention new features.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-10-01zephyr: Allow using devicetree node labels to construct machine objects.Maureen Helm
Zephyr v3.7.0 added a new feature to allow getting devices by their devicetree node labels. Use this feature in the MicroPython Zephyr port to simplify constructing machine module objects, including Pin, SPI, I2C, and UART. It's still possible to use the more verbose device names (e.g., gpio@400ff040, i2c@40066000, spi@4002c000), but now we can also use their devicetree node labels (e.g., gpiob, i2c0, spi0). Node labels aren't standardized across all SoC families because they generally try to follow their respective SoC hardware user manual naming convention, however many boards define common labels for devices routed to Arduino headers (e.g., arduino_i2c, arduino_serial, and arduino_spi). That means I2C("arduino_i2c") will work on quite a few boards (>100 in the main Zephyr tree). Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-02zephyr: Upgrade to Zephyr v3.7.0.Maureen Helm
Updates the Zephyr port build instructions and CI to use the latest Zephyr release tag. Tested on frdm_k64f. Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-02docs/zephyr: Update docs to reflect device name changes.Maureen Helm
Zephyr v3.2.0 deprecated the devicetree label property as a base property, which had been used as the device name string for device_get_binding(). The device name string is now the devicetree node name appended with its unit-address. Update Zephyr port documentation to reflect this change. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2024-09-19py/objringio: Add micropython.RingIO() interface for general use.Andrew Leech
This commit adds a new `RingIO` type which exposes the internal ring-buffer code for general use in Python programs. It has the stream interface making it similar to `StringIO` and `BytesIO`, except `RingIO` has a fixed buffer size and is automatically safe when reads and writes are in different threads or an IRQ. This new type is enabled at the "extra features" ROM level. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2024-09-19py/scheduler: Only run callbacks on the main thread if GIL is disabled.Angus Gratton
Otherwise it's very difficult to reason about thread safety in a scheduler callback, as it can run at any time on any thread - including racing against any bytecode operation on any thread. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-19docs/library: Document machine.Pin.toggle() method.Angus Gratton
Original commit was by @millosolomillo from 2022, but CI no longer accepts their auto-generated GitHub commit email... Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-17docs/library: Document math.log with two arguments.Damien George
The functionality is there but was not documented. Signed-off-by: Damien George <damien@micropython.org>
2024-09-17docs/reference: Fix pyboard.py filesystem cp example with three files.Damien George
Fix documentation to match behaviour (directories are not preserved). Fixes issue #11101. Signed-off-by: Damien George <damien@micropython.org>
2024-09-17docs/esp32: Update pin access example with addresses for ESP32-S3.Paul Grayson
Signed-off-by: Paul Grayson <pdg@alum.mit.edu> Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-06samd/mphalport: Simplify mp_hal_delay_ms().robert-hh
Do NOT use `mp_hal_delay_us()` for short delays. This was initially done to make short delays precise, but it does not allow for scheduling. Leave using `mp_hal_delay_us()` to user code if needed. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-29docs/library: Document the network.PPP class.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-08-29docs/library/machine.UART: Extend the documentation for UART.irq.robert-hh
For more ports and trigger options, based on the current state of the code. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-29docs/library/machine.UART: Fix UART.irq docs to match current code.Damien George
These docs now match the code in `extmod/machine_uart.c`. IRQ trigger support still need to be updated for each port (to be done in a follow-up commit). Signed-off-by: Damien George <damien@micropython.org>
2024-08-20rp2/modmachine: Set the peripheral frequency with machine.freq().robert-hh
By default, the peripheral clock for UART and SPI is set to 48 MHz and will not be affected by the MCU clock change. This can be changed by a second argument to `machine.freq(freq, peripheral_freq)`. The second argument must be either 48 MHz or identical with the first argument. Note that UART and SPI baud rates may have to be re-configured after changing the MCU clock. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-20docs/mimxrt/quickref: Add a note about machine.RTC() subseconds.robert-hh
Telling that subseconds is not supported and returns always 0. This was changed in 913f9ad5ad9bb446c6e4310b6b5eda310098a1cf. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-01docs/library/neopixel: Mention bitstream timing tuple.Tim Weber
Signed-off-by: Tim Weber <scy@scy.name>
2024-08-01py/py.mk: Add SRC_USERMOD_LIB_ASM to include assembly files.George Hopkins
Introduce SRC_USERMOD_LIB_ASM to allow users to include assembly files as part of their user modules. It could be used to include optimized functions or outputs of other programming languages. Signed-off-by: George Hopkins <george-hopkins@null.net>
2024-07-23docs: Specify that machine.idle() returns at least every 1ms.Angus Gratton
A lot of existing code (i.e. micropython-lib lps22h, lcd160cr sensor drivers, lora sync_modem driver, usb-device-hid) calls machine.idle() inside a tight loop that is polling some condition. This reduces the power usage compared to constantly looping, but can be faster than calling a sleep function. However on a tickless port there's not always an interrupt before the condition they are polling for, so it's difficult to restructure this code if machine.idle() doesn't have any upper limit on execution time. This commit specifies an upper limit of 1ms before machine.idle() resumes execution. This is already the case for all ports except rp2. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>