summaryrefslogtreecommitdiffstatshomepage
path: root/docs
Commit message (Collapse)AuthorAge
...
* docs/library/machine.RTC: Add docs for RTC.memory() method.Amirreza Hamzavi2024-03-26
| | | | | | Co-Authored-By: glenn20 <glenn20@users.noreply.github.com> Signed-off-by: Amirreza Hamzavi <amirrezahamzavi2000@gmail.com>
* py/binary: Support half-float 'e' format in struct pack/unpack.Matthias Urlichs2024-03-20
| | | | | | | | | This commit implements the 'e' half-float format: 10-bit mantissa, 5-bit exponent. It uses native _Float16 if supported by the compiler, otherwise uses custom bitshifting encoding/decoding routines. Signed-off-by: Matthias Urlichs <matthias@urlichs.de> Signed-off-by: Damien George <damien@micropython.org>
* docs/library/rp2.DMA: Add documentation for rp2 DMA support.Nicko van Someren2024-03-19
| | | | Signed-off-by: Nicko van Someren <nicko@nicko.org>
* docs/library/collections: Update deque docs to describe new features.Damien George2024-03-19
| | | | Signed-off-by: Damien George <damien@micropython.org>
* docs/library/openamp: Document the new openamp module.iabdalkader2024-03-15
| | | | Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
* extmod/machine_usb_device: Add support for Python USB devices.Angus Gratton2024-03-15
| | | | | | | | | | | | | This new machine-module driver provides a "USBDevice" singleton object and a shim TinyUSB "runtime" driver that delegates the descriptors and all of the TinyUSB callbacks to Python functions. This allows writing arbitrary USB devices in pure Python. It's also possible to have a base built-in USB device implemented in C (eg CDC, or CDC+MSC) and a Python USB device added on top of that. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* esp32/network_lan: Add a separate argument to set PHY power pin.robert-hh2024-03-08
| | | | | | | | | | | | | | | | Prior to this commit, the pin defined for power would be used by the esp_idf driver to reset the PHY. That worked, but sometimes the MDIO configuration started before the power was fully settled, leading to an error. With the change in this commit, the power for the PHY is independently enabled in network_lan.c with a 100ms delay to allow the power to settle. A separate define for a reset pin is provided, even if the PHY reset pin is rarely connected. Fixes issue #14013. Signed-off-by: robert-hh <robert@hammelrath.com>
* all: Prune trailing whitespace.Phil Howard2024-03-07
| | | | | | | | | | | | | | | | Prune trailing whitespace across the whole project (almost), done automatically with: grep -IUrl --color "[[:blank:]]$" --exclude-dir=.git --exclude=*.exp |\ xargs sed -i 's/[[:space:]]*$//' Exceptions: - Skip third-party code in lib/ and drivers/cc3100/ - Skip generated code in bluetooth_init_cc2564C_1.5.c - Preserve command output whitespace in docs, eg: docs/esp8266/tutorial/repl.rst Signed-off-by: Phil Howard <phil@gadgetoid.com>
* all: Remove the "STATIC" macro and just use "static" instead.Angus Gratton2024-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The STATIC macro was introduced a very long time ago in commit d5df6cd44a433d6253a61cb0f987835fbc06b2de. The original reason for this was to have the option to define it to nothing so that all static functions become global functions and therefore visible to certain debug tools, so one could do function size comparison and other things. This STATIC feature is rarely (if ever) used. And with the use of LTO and heavy inline optimisation, analysing the size of individual functions when they are not static is not a good representation of the size of code when fully optimised. So the macro does not have much use and it's simpler to just remove it. Then you know exactly what it's doing. For example, newcomers don't have to learn what the STATIC macro is and why it exists. Reading the code is also less "loud" with a lowercase static. One other minor point in favour of removing it, is that it stops bugs with `STATIC inline`, which should always be `static inline`. Methodology for this commit was: 1) git ls-files | egrep '\.[ch]$' | \ xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/" 2) Do some manual cleanup in the diff by searching for the word STATIC in comments and changing those back. 3) "git-grep STATIC docs/", manually fixed those cases. 4) "rg -t python STATIC", manually fixed codegen lines that used STATIC. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* docs/library/bluetooth: Add note that ESP32 supports pairing/bonding.Daniël van de Giessen2024-02-29
| | | | | | Pairing and bonding was fixed for the ESP32 in the two previous commits. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
* py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t.Damien George2024-02-16
| | | | | | | | | | Allows bytecode itself to be used instead of an mp_raw_code_t in the simple and common cases of a bytecode function without any children. This can be used to further reduce frozen code size, and has the potential to optimise other areas like importing. Signed-off-by: Damien George <damien@micropython.org>
* tools/manifestfile.py: Change library search to use a list of paths.Damien George2024-02-08
| | | | | | | | | | | | | | | | | | | This commit changes how library packages are searched for when a manifest file is loaded: there is now simply a list of library paths that is searched in order for the given package. This list defaults to the main directories in micropython-lib, but can be added to -- either appended or prepended -- by using `add_library()`. In particular the way unix-ffi library packages are searched has changed, because the `unix_ffi` argument to `require()` is now removed. Instead, if a build wants to include packages from micropython-lib/unix-ffi, then it must explicitly add this to the list of paths to search using: add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi") Work done in collaboration with Jim Mussared. Signed-off-by: Damien George <damien@micropython.org>
* docs/library/sys.rst: Document implementation.version.releaselevel.Jos Verlinde2024-02-07
| | | | Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
* docs: Use vfs module instead of os.Damien George2024-02-07
| | | | Signed-off-by: Damien George <damien@micropython.org>
* docs/reference/micropython2_migration.rst: Add info about os and vfs.Damien George2024-02-07
| | | | Signed-off-by: Damien George <damien@micropython.org>
* docs/library: Move vfs functions and classes from os to vfs module docs.Damien George2024-02-07
| | | | Signed-off-by: Damien George <damien@micropython.org>
* docs/library/ssl: Change wrap_socket args keyfile/certfile to key/cert.Damien George2024-02-05
| | | | | | So they match the code in extmod/modssl_*.c. Signed-off-by: Damien George <damien@micropython.org>
* docs: Add note about position-only arguments in CPython vs MicroPython.Angus Gratton2024-01-25
| | | | | | | | | Required modifying the gen-cpydiff.py code to allow a "preamble" section to be inserted at the top of any of the generated files. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* docs/develop/porting: Fix argument type of mp_lexer_new_from_file().Damien George2024-01-16
| | | | | | Follow up to 5015779a6f4a180233a78ec8b5fd1ea095057a91. Signed-off-by: Damien George <damien@micropython.org>
* all: Fix "reuse" and "overridden" spelling mistakes.Damien George2024-01-05
| | | | | | | Codespell doesn't pick up "re-used" or "re-uses", and ignores the tests/ directory, so fix these manually. Signed-off-by: Damien George <damien@micropython.org>
* docs/samd/pinout: Update pinout docs with fixed pin assignment.robert-hh2024-01-02
| | | | | | | Fixes a wrong assignment for Sparkfun SAMD51 Thing Plus, and updates the sample script for printing the pin info table. Signed-off-by: robert-hh <robert@hammelrath.com>
* docs/library: Document SSLContext cert methods and asyncio support.Carlosgg2023-12-14
| | | | | | | | Add `load_cert_chain`, `load_verify_locations`, `get_ciphers` and `set_ciphers` SSLContext methods in ssl library, and update asyncio `open_connection` and `start_server` methods with ssl support. Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
* docs/esp32/quickref: Add DAC example.Ihor Nehrutsa2023-12-11
| | | | Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
* docs/library/esp: Correct the description of esp.osdebug().Angus Gratton2023-11-22
| | | | | | | | The behaviour described in the docs was not correct for either port. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* esp32/esp32_rmt: Add RMT.PULSE_MAX constant.Mark Blakeney2023-11-09
| | | | | | | | | If you have a variable frequency and pulse width, and you want to optimize pulse resolution, then you must do a calculation beforehand to ensure you normalize the array to keep all list values within bound. That calculation requires RMT.source_freq(), RMT.clock_div(), and this 32767 constant. Signed-off-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
* esp32/esp32_rmt: Change RMT.source_freq() to class method.Mark Blakeney2023-11-09
| | | | | | | | | | | | | To create an esp32.RMT() instance with an optimum (i.e. highest resolution) clock_div is currently awkward because you need to know the source clock frequency to calculate the best clock_div, but unfortunately that is only currently available as an source_freq() method on the instance after you have already created it. So RMT.source_freq() should really be a class method, not an instance method. This change is backwards compatible for existing code because you can still reference that function from an instance, or now also, from the class. Signed-off-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
* mimxrt/boards/OLIMEX_RT1010: Adjust the UART pin assignment.robert-hh2023-11-09
| | | | | | Olimex asked for that, getting a UART at the UEXT1 connector as well. Signed-off-by: robert-hh <robert@hammelrath.com>
* extmod/machine_adc_block: Factor esp32 ADCBlock bindings to common code.Damien George2023-11-07
| | | | | | | | | | | This is a code factoring to have the Python bindings in one location, and all the ports use those same bindings. At this stage only esp32 implements this class, so the code for the bindings comes from that port. The documentation is also updated to reflect the esp32's behaviour of ADCBlock.connect(). Signed-off-by: Damien George <damien@micropython.org>
* docs/samd: Fix the pinout for SAMD21 Itsy Bitsy Express M0.robert-hh2023-11-06
| | | | | | And the "Pin", "GPIO" and "Name" key explanations. Signed-off-by: robert-hh <robert@hammelrath.com>
* docs/mimxrt: Change the examples which denote a Pin with a number.robert-hh2023-11-05
| | | | | | This option was removed in PR #12211. Signed-off-by: robert-hh <robert@hammelrath.com>
* all: Update Python formatting to ruff-format.Jim Mussared2023-11-03
| | | | | | | | | This updates a small number of files that change with ruff-format's (vs black's) rules. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs/reference/micropython2_migration: Add migration guide.Jim Mussared2023-10-27
| | | | | | | | | | This is just scaffolding for now, but the idea is that there should be an addition to this file for every commit that uses the `MICROPY_PREVIEW_VERSION_2` macro. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs/library/io: Remove io.FileIO and io.TextIOWrapper.Thomas Ackermann2023-10-16
| | | | | | | | FileIO and TextIOWrapper were removed in e65d1e69e88268145ff0e7e73240f028885915be. Remove them also from the documentation. Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
* docs/reference/mpyfiles: Document change in .mpy sub-version.Damien George2023-10-16
| | | | Signed-off-by: Damien George <damien@micropython.org>
* all: Switch to new preview build versioning scheme.v1.22.0-previewJim Mussared2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/micropython/micropython/issues/12127 for details. Previously at the point when a release is made, we update mpconfig.h and set a git tag. i.e. the version increments at the release. Now the version increments immediately after the release. The workflow is: 1. Final commit in the cycle updates mpconfig.h to set (X, Y, 0, 0) (i.e. clear the pre-release state). 2. This commit is tagged "vX.Y.0". 3. First commit for the new cycle updates mpconfig.h to set (X, Y+1, 0, 1) (i.e. increment the minor version, set the pre-release state). 4. This commit is tagged "vX.Y+1.0-preview". The idea is that a nightly build is actually a "preview" of the _next_ release. i.e. any documentation describing the current release may not actually match the nightly build. So we use "preview" as our semver pre-release identifier. Changes in this commit: - Add MICROPY_VERSION_PRERELEASE to mpconfig.h to allow indicating that this is not a release version. - Remove unused MICROPY_VERSION integer. - Append "-preview" to MICROPY_VERSION_STRING when the pre-release state is set. - Update py/makeversionhdr.py to no longer generate MICROPY_GIT_HASH. - Remove the one place MICROPY_GIT_HASH was used (it can use MICROPY_GIT_TAG instead). - Update py/makeversionhdr.py to also understand MICROPY_VERSION_PRERELEASE in mpconfig.h. - Update py/makeversionhdr.py to convert the git-describe output into semver-compatible "X.Y.Z-preview.N.gHASH". - Update autobuild.sh to generate filenames using the new scheme. - Update remove_old_firmware.py to match new scheme. - Update mpremote's pyproject.toml to handle the "-preview" suffix in the tag. setuptools_scm maps to this "rc0" to match PEP440. - Fix docs heading where it incorrectly said "vvX.Y.Z" for release docs. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs,tools: Change remaining "urequests" references to "requests".Damien George2023-10-05
| | | | Signed-off-by: Damien George <damien@micropython.org>
* extmod/modnetwork: Increase max hostname length to 32.Jim Mussared2023-10-04
| | | | | | | | | | | | | | This changes from the previous limit of 15 characters. Although DHCP and mDNS allow for up to 63, ESP32 and ESP8266 only allow 32, so this seems like a reasonable limit to enforce across all ports (and avoids wasting the additional memory). Also clarifies that `MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN` does not include the null terminator (which was unclear before). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Fix various spelling mistakes found by codespell 2.2.6.Damien George2023-10-03
| | | | Signed-off-by: Damien George <damien@micropython.org>
* docs: Add requirements.txt file with dependencies for Sphinx.Jos Verlinde2023-10-02
| | | | Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
* tools/mpremote: Add support for rfc2217, serial over TCP.Jos Verlinde2023-09-29
| | | | Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
* docs/conf.py: Add sphinxcontrib.jquery to extensions.Damien George2023-09-18
| | | | | | This is needed by recent versions of sphinx-rtd-theme. Signed-off-by: Damien George <damien@micropython.org>
* docs/library/gc: Clarify mem_alloc and mem_free only for Python heap.Angus Gratton2023-09-15
| | | | | | As raised in discussions of the ESP32 memory management changes. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* docs/library/esp32: Update ESP32 idf_heap_info docs to match behaviour.Angus Gratton2023-09-15
| | | | Signed-off-by: Angus Gratton <angus@redyak.com.au>
* esp32: Skip validation of image on boot from deepsleep.Glenn Moloney2023-09-05
| | | | | | | | | | | | sdkconfig.base: Add CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y. This reduces time to boot from deepsleep by at least 200ms and can provide significant power savings for deepsleep-based battery applications. docs/library/esp32.rst: Add note cautioning not to enter deepsleep after changing the boot partition, without first performing a hard reset. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
* docs/esp32/tutorial: Add example for pin access via registers.IhorNehrutsa2023-09-04
| | | | | | Synchronous access to pins directly via registers. Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
* docs/library/network: Clarify network.hostname() behaviour.Jim Mussared2023-09-04
| | | | | | | | This must be called before the interface connects. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs/library/platform: Add docs for the platform library.Francis Dela Cruz2023-09-04
| | | | Signed-off-by: Francis Dela Cruz <rainyworlds1@outlook.com>
* docs/library/neopixel: Change link to a micropython-lib reference.Andy Piper2023-09-01
| | | | Signed-off-by: Andy Piper <andypiperuk@gmail.com>
* extmod/moddeflate: Change default window size.Jim Mussared2023-09-01
| | | | | | | | | | | | | | | | | | The primary purpose of this commit is to make decompress default to wbits=15 when the format is gzip (or auto format with gzip detected). The idea is that someone decompressing a gzip stream should be able to use the default `deflate.DeflateIO(f)` and it will "just work" for any input stream, even though it uses a lot of memory. This is done by making uzlib report gzip files as having wbits set to 15 in their header (where it previously only set the wbits out parameter for zlib files), and then fixing up the logic in `deflateio_init_read`. Updates the documentation to match. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* stm32/subghz: Add STM32WL55 subghz radio interface to stm module.Angus Gratton2023-08-23
| | | | | | | | This is the minimum C interface to allow a modem driver to be built in Python. Interface is simple, with the intention that the micropython-lib driver is the main (only) consumer of it. Signed-off-by: Angus Gratton <angus@redyak.com.au>