Commit Graph

1097 Commits

Author SHA1 Message Date
Damien George 7d3f4b23dc drivers/cc3000: Remove CC3000 WiFi driver files.
It's no longer used by any port.

Signed-off-by: Damien George <damien@micropython.org>
2022-08-26 12:51:37 +10:00
robert-hh 47c45d0e7f rp2/machine_wdt: Check for the maximum timeout value of watchdog.
The value will be checked for timeout <= 8388.  Notes were added to the
documentation.
2022-08-23 16:26:29 +10:00
Mat Booth 04a655c744 extmod/modframebuf: Add polygon drawing methods.
Add method for drawing polygons.

For non-filled polygons, uses the existing line-drawing code to render
arbitrary polygons using the given coords list, at the given x,y position,
in the given colour.

For filled polygons, arbitrary closed polygons are rendered using a fast
point-in-polygon algorithm to determine where the edges of the polygon lie
on each pixel row.

Tests and documentation updates are also included.

Signed-off-by: Mat Booth <mat.booth@gmail.com>
2022-08-19 23:31:28 +10:00
Peter Hinch 42ec9703a0 extmod/modframebuf: Add ellipse drawing method. 2022-08-19 23:31:28 +10:00
Jim Mussared 127b340438 extmod/modframebuf: Add fill argument to rect().
We plan to add `ellipse` and `poly` methods, but rather than having to
implement a `fill_xyz` version of each, we can make them take an optional
fill argument. This commit add this to `rect` as a starting point.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-19 23:31:28 +10:00
Jim Mussared 59e3348c10 tools/mpremote: Add "edit" command.
This allows a remote file to be edited locally by copying it over, running
the local editor, then copying it back.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18 22:29:13 +10:00
Jim Mussared 263737ecfe tools/pyboard.py: Add "touch" filesystem command.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18 22:24:25 +10:00
Jim Mussared a311e9e3d4 tools/mpremote: Allow + terminator for fs commands.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18 22:22:36 +10:00
David Peake 454d969781 docs/esp32: Fix string quoting consistency in SDCard mount example.
It appears that strings in the documentation are typically single quoted.
2022-08-17 12:00:35 +10:00
Ned Konz 5543b2a9cc extmod/uasyncio: Add clear method to ThreadSafeFlag.
This is useful in situations where the ThreadSafeFlag is reused and needs
to be cleared of any previous, unwanted event.

For example, clear the flag at the start of an operation, trigger the
operation (eg an I2C write), then (a)wait for an external event to set the
flag (eg a pin IRQ).  Further events may trigger the flag again but these
are unwanted and should be cleared before the next cycle starts.
2022-08-12 17:06:28 +10:00
Nathan Hendler 9bcb2c0a20 docs/library/rp2: Fix pull_thresh docs to use pull instead of push. 2022-08-11 14:29:47 +10:00
David Lechner 888e831bf7 docs: Update links for Arm GCC toolchain.
The separate A and RM toolchains have been discontinued and replaced
by a single toolchain. This updates the links to the RM toolchain to
the new toolchain.

Signed-off-by: David Lechner <david@pybricks.com>
2022-08-11 14:27:06 +10:00
chrismas9 c038ea0cc6 docs/library/pyb.Timer: Document how to use BKIN pin with example.
Document how to connect the Timer block BRK_IN to a physical Pin alternate
function.

Add an example of PWM Motor drive using complementary outputs with dead
time and break input to kill the PWM and generate a callback.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:22:23 +10:00
chrismas9 33ea400ce8 docs/library/pyb.Pin: Add Pin.ALT constant.
Some Pin alternate functions are inputs, for example, timer capture and
break inputs.  In Pyb.Pin the only way to set alt mode is with Pin.AF_PP or
Pin.AF_OD.  It is not intuitive to use an output mode to configure an
input.  Pin.ALT is used in the machine.Pin class and works in pyb.Pin.

The examples are changed to use Pin.ALT because TIM2_CH3 can be a capture
input or pulse output.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:16:32 +10:00
chrismas9 e168d47424 docs/library/pyb.Pin: Fix out-of-context paragraphs, and AF_PP typo.
Remove out of context callback paragraph, it was part of the wipy docs.
And move the paragraph about PULL_UP/PULL_DOWN resistor values to within
the init() method docs.  Also fix pull-pull -> push-pull.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-07-29 12:07:09 +10:00
Peter Hinch fe5598452d docs/library/time: Provide more info about which epoch is used.
Some embedded targets use 1970 epoch.
2022-07-29 11:27:16 +10:00
Andrew Scheller fa15aed0f7 docs/library/neopixel: Add note that neopixel is included in rp2 builds. 2022-07-23 23:27:04 +10:00
Carlosgg b41cfea02a extmod/modussl_mbedtls: Implement cert_reqs and cadata arguments.
Add cert_reqs and cadata keyword-args to ssl.wrap_socket() and
ssl.CERT_NONE, ssl.CERT_OPTIONAL, ssl.CERT_REQUIRED constants to allow
certificate validation.

CPython doesn't accept cadata in ssl.wrap_socket(), but it does in
SSLContext.load_verify_locations(), so we use this name to at least match
the same name in load_verify_locations().

Add docs for these new arguments, as well as docs for the existing
server_hostname argument which is important for certificate validation.

Tests are added as well.

Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
2022-07-20 16:46:04 +10:00
David Lechner 81dbea1ce3 shared/readline: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register the readline_history root
pointer array used by shared/readline.c and removes the registration from
all mpconfigport.h files.

This also required adding a new MICROPY_READLINE_HISTORY_SIZE config option
since not all ports used the same sized array.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:48:49 +10:00
IhorNehrutsa 1ea82b6dcc esp32,esp8266: Rename WLAN dhcp_hostname config to hostname.
But retain old name for backwards compatibility.
2022-07-05 23:40:32 +10:00
Jim Mussared 3ce21945b1 docs/library/bluetooth: Add link to aioble.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-24 18:05:39 +10:00
Damien George db7682e02d extmod/uasyncio: Implement stream read(-1) to read all data up to EOF.
Fixes issue #6355.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-24 17:04:57 +10:00
Christian Walther ba21f76f89 esp32/modesp32: Add wake_on_ulp() so ULP can wake CPU from deepsleep.
Add esp32.wake_on_ulp() to give access to esp_sleep_enable_ulp_wakeup(),
which is needed to allow the ULP co-processor to wake the main CPU from
deep sleep.
2022-06-23 17:31:01 +10:00
Luiz Brandao 7861eddd0f docs/library/uasyncio: Consistently use "uasyncio" instead of "asyncio". 2022-06-21 17:28:48 +10:00
Patrick Joy 3d58bb23c2 docs/library/machine: Add note on interrupts being critical to system. 2022-06-21 17:25:11 +10:00
Stewart C. Russell f12754af06 docs: Set LaTeX engine to XeLaTeX for PDF generation.
Also added to suggested packages list for PDF build.

See comment in Sphinx project for (some) details:
https://github.com/sphinx-doc/sphinx/pull/5693#pullrequestreview-180444650
2022-06-21 14:49:13 +10:00
Damien George 9175482f29 docs/library: Remove unnecessary "pyb." prefix on class names.
Otherwise these classes are refered to with a double prefix, like
pyb.pyb.ADC.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-21 14:33:23 +10:00
Howard Lovatt 89e1e67748 docs/library/pyb.Timer: Document `brk` argument and its constants. 2022-06-21 14:22:50 +10:00
David Lechner a565811f23 extmod/modbtree: Use buffer protocol for keys/values.
This changes the btree implementation to use the buffer protocol for
reading key/values in all methods.  `str` and `bytes` objects are not the
only bytes-like objects that could be used.

Documentation and tests are also updated.

Addresses issue #8748.

Signed-off-by: David Lechner <david@pybricks.com>
2022-06-21 00:44:49 +10:00
David Lechner c118b5d0e4 extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk.
This separates extmod source files from `py.mk`.  Previously, `py.mk`
assumed that every consumer of the py/ directory also wanted to include
extmod/.  However, this is not the case.  For example, building mpy-cross
uses py/ but doesn't need extmod/.

This commit moves all extmod-specific items from `py.mk` to `extmod.mk` and
explicitly includes `extmod.mk` in ports that use it.

Signed-off-by: David Lechner <david@pybricks.com>
2022-06-21 00:14:34 +10:00
iabdalkader 6e868d47dc docs: Update to use new WLAN argument names for ssid/security/key.
Addresses issue #8083.
2022-06-17 21:43:44 +10:00
Maureen Helm bada8b3cad zephyr: Upgrade to Zephyr v3.1.0.
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@intel.com>
2022-06-17 16:51:34 +10:00
Damien George 9b486340da all: Bump version to 1.19.1.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-17 12:57:59 +10:00
Damien George d7919ea71e all: Bump version to 1.19.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-16 15:11:02 +10:00
Andrew Scheller cedb93c179 docs: Update Raspberry Pi URLs from .org to .com. 2022-06-14 11:41:13 +10:00
Damien George cf7d962cf3 docs/reference/mpyfiles: Update .mpy description to match latest format.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Damien George 9670a156da all: Rename MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K.
To match MICROPY_PY_NETWORK_CYW43 and MICROPY_PY_NETWORK_NINAW10.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-07 16:55:18 +10:00
Damien George efe23aca71 all: Remove third argument to MP_REGISTER_MODULE.
It's no longer needed because this macro is now processed after
preprocessing the source code via cpp (in the qstr extraction stage), which
means unused MP_REGISTER_MODULE's are filtered out by the preprocessor.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 16:31:37 +10:00
Andrew Leech ea9a904b72 docs/reference/manifest: Add link to details about opt-level for freeze. 2022-05-27 14:45:46 +10:00
robert-hh f795d5bc38 docs/mimxrt: Move the pinout tables to a separate document.
This shortens the quickref.  Also change the note about the hardware SPI
frequeny limits.
2022-05-27 12:48:16 +10:00
robert-hh eda52e4d73 docs/mimxrt: Add i.MX RT1015 to general.rst, and a few clarifications. 2022-05-27 12:47:54 +10:00
David Lechner c012318d74 unix: Implement `-X realtime` command-line option on macOS.
This adds a new command line option to the unix port `-X realtime` to
enable realtime priority on threads.  This enables high precision timers
for applications that need more accurate timers.

Related docs:
https://developer.apple.com/library/archive/technotes/tn2169/_index.html

Fixes issue #8621.

Signed-off-by: David Lechner <david@pybricks.com>
2022-05-24 00:51:47 +10:00
Damien George c1b9d2259e py/dynruntime.mk: Add basic support for armv6m architecture.
The examples/natmod features0 and features1 examples now build and run on
ARMv6-M platforms.  More complicated examples are not yet supported because
the compiler emits references to built-in functions like __aeabi_uidiv.

Signed-off-by: Damien George <damien@micropython.org>
2022-05-23 23:01:25 +10:00
Damien George 079f3e5e5b py/parse: Allow all constant objects to be used in "X = const(o)".
Now that constant tuples are supported in the parser, eg (1, True, "str"),
it's a small step to allow anything that is a constant to be used with the
pattern:

    from micropython import const

    X = const(obj)

This commit makes the required changes to allow the following types of
constants:

    from micropython import const

    _INT = const(123)
    _FLOAT = const(1.2)
    _COMPLEX = const(3.4j)
    _STR = const("str")
    _BYTES = const(b"bytes")
    _TUPLE = const((_INT, _STR, _BYTES))
    _TUPLE2 = const((None, False, True, ..., (), _TUPLE))

Prior to this, only integers could be used in const(...).

Signed-off-by: Damien George <damien@micropython.org>
2022-05-18 16:18:35 +10:00
Damien George 2a366e183e docs/reference/mpyfiles: Remove docs about mpy flags and qstr win size.
Signed-off-by: Damien George <damien@micropython.org>
2022-05-17 12:51:54 +10:00
Takeo Takahashi a21fd7cc21 docs/renesas-ra: Remove unused image files.
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2022-05-03 13:22:01 +10:00
Takeo Takahashi 52add7b45c docs: Update files for renesas-ra port.
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2022-04-29 12:29:08 +09:00
Takeo Takahashi 1b61800530 docs/renesas-ra: Add renesas-ra docs files.
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2022-04-29 12:29:08 +09:00
Damien George 402df833fe py/modsys: Introduce sys.implementation._machine constant.
This contains a string useful for identifying the underlying machine.  This
string is kept consistent with the second part of the REPL banner via the
new config option MICROPY_BANNER_MACHINE.

This makes os.uname() more or less redundant, as all the information in
os.uname() is now available in the sys module.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00
Damien George 59c5d41611 py/modsys: Rename sys.implementation.mpy to sys.implementation._mpy.
Per CPython docs, non-standard attributes must begin with an underscore.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00