Includes:
- component oriented driver, to only install the parts that are needed
- synchronous operation
- async wrapper class for asynchronous operation
- two examples with async & synchronous versions
- documentation
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This adds a utarfile-write extension package that adds the ability to
create and append to tar files.
Work done by Doug Ellis <dpwe@ee.columbia.edu>.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Removes the workaround for micropython/issues/6864.
Sets the default flags for discovered descriptors to be WRITE,
so that d.write() will implicitly set response=True.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This tool makes a buildable package (including pyproject.toml) from
supported micropython-lib packages, suitable for publishing to PyPI and
using from CPython.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is so the package knows the "upstream" name of the corresponding PyPI
package that it's based on.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Prior to this commit, if no tests were found when running unittest discover
then nothing at all was written to stdout, leading one to think it's not
working at all. CPython unittest does display a "0 tests run" sort of
output in such a case, and this commit ensures this package does the same.
Opt-in feature to make it easier for folks to test packages that are still
in development, open in Pull Requests, or even in independent forks.
---
To enable this on your own GitHub fork of the micropython-lib repository
then navigate to the fork's "Settings" -> "Secrets and variables" ->
"Actions" -> "Variables" page, then click "New repository variable", and
create a variable named MIP_INDEX with value true (or any "truthy" value).
Once enabled then any time a branch is pushed to your fork and builds
successfully, GitHub Actions will also push the built packages and package
index to the gh-pages branch which is associated with the repo's GitHub
Pages web site. The packages can then be installed remotely via:
mpremote mip --index \
https://USERNAME.github.io/micropython-lib/mip/BRANCH_NAME PACKAGE_NAME
or on a device as:
mip.install(PACKAGE_NAME, index="https://USERNAME.github.io/micropython-lib/mip/BRANCHNAME")
(Replace USERNAME, BRANCH_NAME and PACKAGE_NAME as applicable. If you've
renamed your fork, change the name micropython-lib to match.)
Note: As well as the MIP_INDEX repository variable, this functionality
depends on both GitHub Actions and GitHub Pages being enabled on your
repository in GitHub. However both options should enable automatically,
unless they have been manually disabled.
This work was funded through GitHub Sponsors.
This is designed to be a common set of packages that all deployments with
networking support should include.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is not included by default in most builds, and isn't necessary for
this module anyway.
Also fix the local variable shadowing the traceback module in _capture_exc.
Added test for both (works on CPython and MicroPython).
Version bump to 0.10.2.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Adds missing "duration_ms" argument to the example, and a second example
that shows the "interval_us" / "window_us" and also active scan.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Previously a child logger just uses the global default when unset.
Modified to matches the CPython behavior of using the parent's level.
Also implemented CPython's getEffectiveLevel() which provides a convenient
way to implement this. In our version, we only ever have one parent
(the root), so it only has to recurse one level.
Also set the default level to WARNING to match CPython.
Updated the examples to highlight the differences (but they now match).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* Add instructions for how to use micropython-lib.
* Add a terminology guide and use consistent terminology
(package/module/library).
* Improve code conventions and contributor guidelines.
* Misc readme updates.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Add support for all format specifiers, support for `datefmt` using
(optional) strftime, and support for Stream and File handlers.
Ports/boards that need to use `FileHandlers` should enable
`MICROPY_PY_SYS_ATEXIT`, and enabled `MICROPY_PY_SYS_EXC_INFO` if using
`logging.exception()`.
This adds most of the common functionality of pathlib.Path.
The glob functionality could use some work; currently it only supports a
single "*" wildcard; however, this is the vast majority of common use-cases
and it won't fail silently if non-supported glob patterns are provided.
Use explicit pin numbers to instantiate the SPI interface on RP2.
On ESP32 use SoftSPI(...) rather than SPI(-1, ...).
Update terminology to initiator/responder.
Tested with two Pico boards.
Originally by @peterhinch.
See https://github.com/micropython/micropython/pull/6007 for discussion.
The summary is that on some cards (especially older Kingston ones) if the
bus is shared with other SPI devices, then it seems to require that MISO
is high for a few cycles before the transaction is initiated.
Because CS is high, this change should otherwise be a no-op.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>