summaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)Author
2024-03-08esp32/network_lan: Add a separate argument to set PHY power pin.robert-hh
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>
2024-03-07all: Prune trailing whitespace.Phil Howard
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>
2024-03-07all: Remove the "STATIC" macro and just use "static" instead.Angus Gratton
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>
2024-02-29docs/library/bluetooth: Add note that ESP32 supports pairing/bonding.Daniël van de Giessen
Pairing and bonding was fixed for the ESP32 in the two previous commits. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-02-16py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t.Damien George
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>
2024-02-08tools/manifestfile.py: Change library search to use a list of paths.Damien George
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>
2024-02-07docs/library/sys.rst: Document implementation.version.releaselevel.Jos Verlinde
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2024-02-07docs: Use vfs module instead of os.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-07docs/reference/micropython2_migration.rst: Add info about os and vfs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-07docs/library: Move vfs functions and classes from os to vfs module docs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-05docs/library/ssl: Change wrap_socket args keyfile/certfile to key/cert.Damien George
So they match the code in extmod/modssl_*.c. Signed-off-by: Damien George <damien@micropython.org>
2024-01-25docs: Add note about position-only arguments in CPython vs MicroPython.Angus Gratton
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>
2024-01-16docs/develop/porting: Fix argument type of mp_lexer_new_from_file().Damien George
Follow up to 5015779a6f4a180233a78ec8b5fd1ea095057a91. Signed-off-by: Damien George <damien@micropython.org>
2024-01-05all: Fix "reuse" and "overridden" spelling mistakes.Damien George
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>
2024-01-02docs/samd/pinout: Update pinout docs with fixed pin assignment.robert-hh
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>
2023-12-14docs/library: Document SSLContext cert methods and asyncio support.Carlosgg
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>
2023-12-11docs/esp32/quickref: Add DAC example.Ihor Nehrutsa
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
2023-11-22docs/library/esp: Correct the description of esp.osdebug().Angus Gratton
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>
2023-11-09esp32/esp32_rmt: Add RMT.PULSE_MAX constant.Mark Blakeney
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>
2023-11-09esp32/esp32_rmt: Change RMT.source_freq() to class method.Mark Blakeney
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>
2023-11-09mimxrt/boards/OLIMEX_RT1010: Adjust the UART pin assignment.robert-hh
Olimex asked for that, getting a UART at the UEXT1 connector as well. Signed-off-by: robert-hh <robert@hammelrath.com>
2023-11-07extmod/machine_adc_block: Factor esp32 ADCBlock bindings to common code.Damien George
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>
2023-11-06docs/samd: Fix the pinout for SAMD21 Itsy Bitsy Express M0.robert-hh
And the "Pin", "GPIO" and "Name" key explanations. Signed-off-by: robert-hh <robert@hammelrath.com>
2023-11-05docs/mimxrt: Change the examples which denote a Pin with a number.robert-hh
This option was removed in PR #12211. Signed-off-by: robert-hh <robert@hammelrath.com>
2023-11-03all: Update Python formatting to ruff-format.Jim Mussared
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>
2023-10-27docs/reference/micropython2_migration: Add migration guide.Jim Mussared
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>
2023-10-16docs/library/io: Remove io.FileIO and io.TextIOWrapper.Thomas Ackermann
FileIO and TextIOWrapper were removed in e65d1e69e88268145ff0e7e73240f028885915be. Remove them also from the documentation. Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
2023-10-16docs/reference/mpyfiles: Document change in .mpy sub-version.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-06all: Switch to new preview build versioning scheme.v1.22.0-previewJim Mussared
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>
2023-10-05docs,tools: Change remaining "urequests" references to "requests".Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-04extmod/modnetwork: Increase max hostname length to 32.Jim Mussared
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>
2023-10-03all: Fix various spelling mistakes found by codespell 2.2.6.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-02docs: Add requirements.txt file with dependencies for Sphinx.Jos Verlinde
Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
2023-09-29tools/mpremote: Add support for rfc2217, serial over TCP.Jos Verlinde
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2023-09-18docs/conf.py: Add sphinxcontrib.jquery to extensions.Damien George
This is needed by recent versions of sphinx-rtd-theme. Signed-off-by: Damien George <damien@micropython.org>
2023-09-15docs/library/gc: Clarify mem_alloc and mem_free only for Python heap.Angus Gratton
As raised in discussions of the ESP32 memory management changes. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-09-15docs/library/esp32: Update ESP32 idf_heap_info docs to match behaviour.Angus Gratton
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-09-05esp32: Skip validation of image on boot from deepsleep.Glenn Moloney
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>
2023-09-04docs/esp32/tutorial: Add example for pin access via registers.IhorNehrutsa
Synchronous access to pins directly via registers. Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
2023-09-04docs/library/network: Clarify network.hostname() behaviour.Jim Mussared
This must be called before the interface connects. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-04docs/library/platform: Add docs for the platform library.Francis Dela Cruz
Signed-off-by: Francis Dela Cruz <rainyworlds1@outlook.com>
2023-09-01docs/library/neopixel: Change link to a micropython-lib reference.Andy Piper
Signed-off-by: Andy Piper <andypiperuk@gmail.com>
2023-09-01extmod/moddeflate: Change default window size.Jim Mussared
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>
2023-08-23stm32/subghz: Add STM32WL55 subghz radio interface to stm module.Angus Gratton
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>
2023-08-15esp32: Enable automatic Python heap growth.Angus Gratton
Via MICROPY_GC_SPLIT_HEAP_AUTO feature flag added in previous commit. Tested on ESP32 GENERIC_SPIRAM and GENERIC_S3 configurations, with some worst-case allocation patterns and the standard test suite. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-05docs/develop/gettingstarted: Update ARM package list.Elecia White
Signed-off-by: Elecia White <elecia@logicalelegance.com>
2023-08-04docs/develop/gettingstarted: Clarify submodule initialization.Rene Straub
When building for a specific board this must be specified in make submodules. I.e. make BOARD=STM32F769DISC submodules. Signed-off-by: Rene Straub <rene@see5.ch>
2023-07-21docs/library/deflate: Add docs for deflate.DeflateIO.Jim Mussared
Also update zlib & gzip docs to describe the micropython-lib modules. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-13docs/esp32/quickref: Add LAN example for WT32-ETH01 version 1.4.Elvis Pfutzenreuter
This board requires slightly different configuration to work. It is important to hard reset (cycle power) if you try to initialize LAN and it fails, before trying again with new parameters. Discussion: https://github.com/orgs/micropython/discussions/11446 AliExpress purchase link: https://pt.aliexpress.com/item/1005002023196214.html Signed-off-by: Elvis Pfutzenreuter <epxx@epxx.co>
2023-06-26docs/library/ssl: Add documentation for SSLContext.Damien George
Signed-off-by: Damien George <damien@micropython.org>