Wykres commitów

634 Commity (6653856b87a76adc5584bb72b32924719effa970)

Autor SHA1 Wiadomość Data
Jos Verlinde 6653856b87 docs/library/machine.Pin.rst: Document defaults for Pin.init. 2022-02-09 15:55:10 +11:00
Jos Verlinde 7f67524031 docs/library/pyb.SPI.rst: Document default for prescaler argument.
To prevent "non-default argument follows default argument" errors.
2022-02-09 15:06:34 +11:00
Jos Verlinde 58cd2a8b0a docs/library/esp.rst: Document the osdebug function. 2022-02-09 15:06:19 +11:00
Jos Verlinde f99b679916 docs/library/machine.WDT.rst: Use correct case for WDT.feed. 2022-02-09 15:05:49 +11:00
Jos Verlinde 7621b17636 docs/library/machine.SPI.rst: Add class constant SoftSPI.MSB and .LSB. 2022-02-09 15:05:38 +11:00
Jos Verlinde 8715ad9ccf docs/library/pyb.DAC.rst: Add DAC class constants. 2022-02-09 15:05:26 +11:00
Jos Verlinde ba4f6f5fdf docs/library/pyb.rst: Add pyb.hid_mouse and pyb.hid_keyboard constants. 2022-02-09 15:04:57 +11:00
Jos Verlinde 50b172023f docs/library/pyb.Timer.rst: Add pyb.Timer class constants. 2022-02-09 15:04:24 +11:00
Jos Verlinde 2c30ac7aeb docs/library/socket.rst: Document socket as a class.
Following CPython: https://bugs.python.org/issue45772
2022-02-09 15:03:26 +11:00
Jos Verlinde cd0531c533 docs: Use the correct * keyword-only notation. 2022-02-09 15:01:00 +11:00
Jos Verlinde a41abd94dc docs/library/collections.rst: Use class for deque and OrderedDict. 2022-02-09 15:00:00 +11:00
Damien George 79a3158de6 stm32/pin: Change remaining uses of "af" to "alt".
The keyword "af" has been deprecated for some time and "alt" should be used
instead (but "af" still works).

Signed-off-by: Damien George <damien@micropython.org>
2022-01-27 16:44:13 +11:00
Christian Decker 2e3a2785cd extmod/modubinascii: Add newline keyword to b2a_base64 function.
This allows encoding things (eg a Basic-Auth header for a request) without
slicing the \n from the string, which allocates additional memory.

Co-authored-by: David Lechner <david@lechnology.com>
2022-01-23 10:18:01 +11:00
Damien George 4d2f487ee1 docs/library: Specify additional ADC methods and new ADCBlock class.
The new ADC methods are: init(), read_uv() and block().

The new ADCBlock class has methods: init() and connect().

See related discussions in #3943, #4213.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-21 22:35:23 +11:00
Damien George 7d71ae25ed extmod/machine_i2c: Increase default SoftI2C timeout to 50ms.
Some devices, eg BNO055, can stretch SCL for a long time, so make the
default large to accommodate them.  50ms matches the current default for
stm32 hardware I2C .

Signed-off-by: Damien George <damien@micropython.org>
2022-01-21 15:10:30 +11:00
Damien George a3bbd5332b esp32/machine_bitstream: Reinstate bitstream bit-bang implementation.
The bit-bang implementation was replaced with the RMT implementation in
599b61c086.  This commit brings back that
bit-bang code, and allows it to be selected via the new static method:

    esp32.RMT.bitstream_channel(None)

The bit-bang implementation may be useful if the RMT needs to be used for
something else, or if bit-banging is more stable in certain applications.

Signed-off-by: Damien George <damien@micropython.org>
2022-01-14 16:40:01 +11:00
Jim Mussared 86394f70fc docs/library/sys.rst: Add note about '.frozen' as an entry in sys.path.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:08:07 +11:00
Damien George d9d67adef1 docs: Remove trailing spaces and convert tabs to spaces.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-15 11:49:22 +11:00
IhorNehrutsa b491967bbd esp32/machine_pwm: Implement duty_u16() and duty_ns() PWM methods.
The methods duty_u16() and duty_ns() are implemented to match the existing
docs.  The duty will remain the same when the frequency is changed.
Standard ESP32 as well as S2, S3 and C3 are supported.

Thanks to @kdschlosser for the fix for rounding in resolution calculation.

Documentation is updated and examples expanded for esp32, including the
quickref and tutorial.  Additional notes are added to the machine.PWM docs
regarding limitations of hardware PWM.
2021-12-03 23:58:52 +11:00
Jonathan Hogg 851ecb2da1 extmod/modbluetooth: Support gap_connect(None) to cancel a connection.
Allow cancellation of in-progress peripheral connections.
2021-12-01 11:56:37 +11:00
Scott Armitage de7e3cd792 docs/library/machine.Pin.rst: Add Pin.ANALOG mode constant. 2021-11-30 22:33:18 +11:00
Michael Buesch 68d1245f42 docs/library/machine.Timer.rst: Document `period` and `callback` args.
Signed-off-by: Michael Buesch <m@bues.ch>
2021-11-30 22:29:03 +11:00
Michael Buesch 1e7c8f2b0b docs/library/machine.SPI.rst: Add example SPI usage.
Signed-off-by: Michael Buesch <m@bues.ch>
2021-11-30 22:28:19 +11:00
Michael Buesch e7900351bf docs/library/machine.Timer.rst: Document 'id' as positional-only arg.
Signed-off-by: Michael Buesch <m@bues.ch>
2021-11-30 22:27:58 +11:00
Peter Hinch d94ac4333f docs/library/uasyncio.rst: Detail exception behaviour in cancel/timeout. 2021-11-30 21:43:06 +11:00
NitiKaur b851950c26 docs/library/sys.rst: Add docs for sys.settrace. 2021-11-19 15:30:34 +11:00
oli f72b49756d docs/library/rp2.rst: Update function asm_pio_encode to add sideset_opt. 2021-11-19 13:38:56 +11:00
Sebastian Wicki 8f3510799d docs/library/framebuf.rst: Adjust dimensions in example.
This commit swaps the dimensions of the `framebuffer.FrameBuffer` in the
docs example from 10x100 to 100x10 pixels to avoid clipping.

This is done to better fit the subsequent example code, which writes
text of size 96x8 followed by a 96x1 horizontal line.

The y coordinate of the horizontal line is also adjusted such that it is
drawn inside of the new canvas bounds.
2021-11-17 14:36:33 +11:00
Jim Mussared 43467b9c71 extmod/modbluetooth: Add connection interval to gap_connect.
This forwards through directly to the NimBLE and BTStack connect functions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-26 00:16:53 +11:00
NitiKaur 763042a287 docs/library/stm.rst: Document the stm module. 2021-10-14 23:19:08 +11:00
NitiKaur c42c1c8718 docs/library/random.rst: Document the random module. 2021-10-13 16:56:37 +11:00
NitiKaur baa5a76fc0 docs/rp2: Add reference for PIO assembly instructions, and PIO tutorial. 2021-10-13 15:54:49 +11:00
Peter Hinch 4552f1816b docs/library/machine.I2S.rst: Specify that I2S.shift args are kw-only. 2021-09-13 18:21:46 +10:00
Matt Trentini 60d3a3c3a0 docs/library/bluetooth.rst: Update incorrect link to gatts_write. 2021-09-10 15:24:02 +10:00
Peter Hinch cc0884bb4f docs/library/os.rst: Clarify littlefs requirements for block erase. 2021-09-10 15:21:12 +10:00
Fernando 577a3c4192 docs/library: Fix usage of :term: for frozen module reference.
Signed-off-by: Fernando <fepegar@gmail.com>
2021-08-30 23:51:18 +10:00
Peter Hinch 2296df0a32 extmod/modframebuf: Enable blit between different formats via a palette.
This achieves a substantial performance improvement when rendering glyphs
to color displays, the benefit increasing proportional to the number of
pixels in the glyph.
2021-08-25 15:31:23 +10:00
Jim Mussared 53145c4c5f docs: Add docs for machine.bitstream and neopixel module.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-19 22:50:32 +10:00
Jim Mussared 44818d1a35 docs/library/network.rst: Simplify socket import.
Replace `import socket as socket` with `import socket`.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-17 11:26:24 +10:00
Jim Mussared af162257d3 docs/library/builtins.rst: Add module title.
This fixes the rendering on library/index.rst.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-17 11:26:24 +10:00
Jim Mussared 1d9e489af3 extmod/modbluetooth: Add send_update arg to gatts_write.
This allows the write to trigger a notification or indication, but only to
subscribed clients. This is different to gatts_notify/gatts_indicate,
which will unconditionally notify/indicate.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-14 22:21:55 +10:00
Jim Mussared d7fbc755dc docs/library/index.rst: Clarify module naming and purpose.
Adds section about extending built-in modules from Python.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13 23:14:08 +10:00
Jim Mussared c737cde947 docs: Replace ufoo with foo in all docs.
Anywhere a module is mentioned, use its "non-u" name for consistency.

The "import module" vs "import umodule" is something of a FAQ, and this
commit intends to help clear that up.  As a first approximation MicroPython
is Python, and so imports should work the same as Python and use the same
name, to a first approximation.  The u-version of a module is a detail that
can be learned later on, when the user wants to understand more and have
finer control over importing.

Existing Python code should just work, as much as it is possible to do that
within the constraints of embedded systems, and the MicroPython
documentation should match the idiomatic way to write Python code.

With universal weak links for modules (via MICROPY_MODULE_WEAK_LINKS) users
can consistently use "import foo" across all ports (with the exception of
the minimal ports).  And the ability to override/extend via "foo.py"
continues to work well.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13 22:53:29 +10:00
Jim Mussared 218606351c docs: Rename ufoo.rst to foo.rst.
This is a simple rename of the files, no content changes
(other than updating index.rst to use the new paths)

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13 20:31:32 +10:00
Julia Hathaway 6ed6990625 docs/library/zephyr: Add libraries specific to the Zephyr port.
Includes documentation for Zephyr specific modules (zephyr and zsensor),
classes (DiskAccess and FlashArea), and functions.

Signed-off-by: Julia Hathaway <julia.hathaway@nxp.com>
2021-08-13 20:21:14 +10:00
Damien George 45f9a38451 docs/library/machine.I2S.rst: Fix use of sd pin in examples.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-07 20:40:54 +10:00
Peter Züger ffc854f17f extmod/modujson: Add support for dump/dumps separators keyword-argument.
Optionally enabled via MICROPY_PY_UJSON_SEPARATORS.  Enabled by default.

For dump, make sure mp_get_stream_raise is called after
mod_ujson_separators since CPython does it in this order (if both
separators and stream are invalid, separators will raise an exception
first).

Add separators argument in the docs as well.

Signed-off-by: Peter Züger <zueger.peter@icloud.com>
Signed-off-by: Damien George <damien@micropython.org>
2021-08-07 13:52:16 +10:00
Damien George 8616129f2e esp8266,esp32: Include hidden networks in WLAN.scan results.
Addresses issues #2697 and #5329.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-07 13:28:34 +10:00
Will Sowerbutts a3675294ae esp32/machine_uart: Add flow kw-arg to enable hardware flow control.
This enables optional support for the hardware UART to use the RTS and/or
CTS pins for flow control.

The new "flow" constructor keyword specifies a bitmask of RTS and/or CTS.
This matches the interface used by machine.UART on stm32 and rp2.

Previously on ESP32 it was possible to specify which pins to use for the
RTS and CTS signals, but hardware flow control was never functional: CTS
was not checked before transmitting bytes, and RTS was always driven high
(signalling no buffer space available).  With this patch, CTS and RTS both
operate as expected.

This also includes an update to the machine.UART documentation.

Signed-off-by: Will Sowerbutts <will@sowerbutts.com>
2021-08-04 13:52:15 +10:00
Damien George 7f69246895 docs/library/uasyncio.rst: Document stream readexactly() method.
Signed-off-by: Damien George <damien@micropython.org>
2021-07-22 22:39:04 +10:00