Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
With some working examples that show how to use all the features.
Signed-off-by: Damien George <damien@micropython.org>
|
|
So they don't clash with other potential references.
Signed-off-by: Koudai Aono <koxudaxi@gmail.com>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
- 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>
|
|
This is useful to distinguish between GIL and non-GIL builds.
Signed-off-by: Damien George <damien@micropython.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
In both the machine.UART and esp32.quickref sections.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
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>
|
|
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>
|
|
This reduces inconsitencies between esp32 and other ports.
According to the discussion in #10817.
Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Signed-off-by: Ronald Weber <ronaldxweber@gmail.com>
|
|
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>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Amirreza Hamzavi <amirrezahamzavi2000@gmail.com>
|
|
Signed-off-by: chuangjinglu <chuangjinglu@outlook.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|