summaryrefslogtreecommitdiff
path: root/docs/library
AgeCommit message (Collapse)Author
2021-11-19docs/library/sys.rst: Add docs for sys.settrace.NitiKaur
2021-11-19docs/library/rp2.rst: Update function asm_pio_encode to add sideset_opt.oli
2021-11-17docs/library/framebuf.rst: Adjust dimensions in example.Sebastian Wicki
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-10-26extmod/modbluetooth: Add connection interval to gap_connect.Jim Mussared
This forwards through directly to the NimBLE and BTStack connect functions. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-14docs/library/stm.rst: Document the stm module.NitiKaur
2021-10-13docs/library/random.rst: Document the random module.NitiKaur
2021-10-13docs/rp2: Add reference for PIO assembly instructions, and PIO tutorial.NitiKaur
2021-09-13docs/library/machine.I2S.rst: Specify that I2S.shift args are kw-only.Peter Hinch
2021-09-10docs/library/bluetooth.rst: Update incorrect link to gatts_write.Matt Trentini
2021-09-10docs/library/os.rst: Clarify littlefs requirements for block erase.Peter Hinch
2021-08-30docs/library: Fix usage of :term: for frozen module reference.Fernando
Signed-off-by: Fernando <fepegar@gmail.com>
2021-08-25extmod/modframebuf: Enable blit between different formats via a palette.Peter Hinch
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-19docs: Add docs for machine.bitstream and neopixel module.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-17docs/library/network.rst: Simplify socket import.Jim Mussared
Replace `import socket as socket` with `import socket`. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-17docs/library/builtins.rst: Add module title.Jim Mussared
This fixes the rendering on library/index.rst. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-14extmod/modbluetooth: Add send_update arg to gatts_write.Jim Mussared
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-13docs/library/index.rst: Clarify module naming and purpose.Jim Mussared
Adds section about extending built-in modules from Python. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13docs: Replace ufoo with foo in all docs.Jim Mussared
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-13docs: Rename ufoo.rst to foo.rst.Jim Mussared
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-13docs/library/zephyr: Add libraries specific to the Zephyr port.Julia Hathaway
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-07docs/library/machine.I2S.rst: Fix use of sd pin in examples.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-08-07extmod/modujson: Add support for dump/dumps separators keyword-argument.Peter Züger
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-07esp8266,esp32: Include hidden networks in WLAN.scan results.Damien George
Addresses issues #2697 and #5329. Signed-off-by: Damien George <damien@micropython.org>
2021-08-04esp32/machine_uart: Add flow kw-arg to enable hardware flow control.Will Sowerbutts
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-07-22docs/library/uasyncio.rst: Document stream readexactly() method.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-07-22docs/library/utime.rst: Clarify behaviour and precision of sleep ms/us.Damien George
This description is based on the existing bare-metal ports implementations. Signed-off-by: Damien George <damien@micropython.org>
2021-07-18docs: Replace master/slave with controller/peripheral in I2C and SPI.David P
See https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names
2021-07-06docs/library: Warn that ustruct doesn't handle spaces in format strings.Tom McDermott
And also add a test to capture the CPython difference.
2021-07-05esp32,stm32: Add new machine.I2S class for I2S protocol support.Mike Teachman
This commit adds I2S protocol support for the esp32 and stm32 ports, via a new machine.I2S class. It builds on the stm32 work of blmorris, #1361. Features include: - a consistent I2S API across the esp32 and stm32 ports - I2S configurations supported: - master transmit and master receive - 16-bit and 32-bit sample sizes - mono and stereo formats - sampling frequency - 3 modes of operation: - blocking - non-blocking with callback - uasyncio - internal ring buffer size can be tuned - documentation for Pyboards and esp32-based boards - tested on the following development boards: - Pyboard D SF2W - Pyboard V1.1 - ESP32 with SPIRAM - ESP32 Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-07-01docs/library: Document new esp32.RMT features and fix wait_done.Jonathan Hogg
Add new API for specifying the idle level and TX carrier output level, and new write_pulses modes of operation. Also fix wait_done documentation which was inverted and wrong about timing.
2021-06-23stm32/usb: Make irq's default trigger enable all events.Damien George
Following how other .irq() methods work on other objects. Signed-off-by: Damien George <damien@micropython.org>
2021-06-17docs/esp32: Document WLAN "reconnects" config option.Thomas Wenrich
2021-06-15extmod/uasyncio: Add readinto() method to Stream class.Mike Teachman
With docs and a multi-test using TCP server/client. This method is a MicroPython extension, although there is discussion of adding it to CPython: https://bugs.python.org/issue41305 Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-06-12docs/library/machine.RTC.rst: Document datetime method and fix ex code.Peter Hinch
This is the minimum change to fix the example code so it actually runs on the majority of ports.
2021-06-10stm32/usb: Add USB_VCP.irq method, to set a callback on USB data RX.Damien George
Usage: usb = pyb.USB_VCP() usb.irq(lambda u:print(u, u.read()), usb.IRQ_RX) Signed-off-by: Damien George <damien@micropython.org>
2021-05-20all: Replace busses with buses.Mike Causer
"buses" is the widely accepted plural form of "bus".
2021-05-20docs/library/pyb.Pin.rst: Update the arguments for Pin.init().Andrew Leech
Add details for Pin.init() value and alt arguments.
2021-05-18docs/library: Add a blank line to fix formatting for ussl docs.Brett Cannon
2021-05-18docs/library: Clarify what type of algorithm is implemented in heapq.Brett Cannon
2021-05-12docs/library/rp2.rst: Fix typo overriden->overridden.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-08docs/library: Add initial API reference for rp2 module and its classes.Tim Radvan
All the method signatures from rp2_pio.c and friends have been taken and converted to RST format, then explanatory notes added for each signature. Signed-off-by: Tim Radvan <tim@tjvr.org>
2021-05-04docs: Fix some spelling mistakes.Mike Causer
2021-04-30docs/library/machine: Add machine.bootloader docs.Damien George
This is provide by a few ports now, and is very useful. Signed-off-by: Damien George <damien@micropython.org>
2021-04-30docs/library/machine: Specify initial machine.PWM class.Damien George
This adds an initial specification of the machine.PWM class, to provide a way to generate PWM output that is portable across the different ports. Such functionality may already be available in one way or another (eg through a Timer object), but because configuring PWM via a Timer is very port-specific, and because it's a common thing to do, it's beneficial to have a top-level construct for it. The specification in this commit aims to provide core functionality in a minimal way. It also somewhat matches most existing ad-hoc implementations of machine.PWM. See discussion in #2283 and #4237. Signed-off-by: Damien George <damien@micropython.org>
2021-04-23py/objexcept: Support errno attribute on OSError exceptions.Damien George
This commit adds the errno attribute to exceptions, so code can retrieve errno codes from an OSError using exc.errno. The implementation here simply lets `errno` (and the existing `value`) attributes work on any exception instance (they both alias args[0]). This is for efficiency and to keep code size down. The pros and cons of this are: Pros: - more compatible with CPython, less difference to document and learn - OSError().errno will correctly return None, whereas the current way of doing it via OSError().args[0] will raise an IndexError - it reduces code size on most bare-metal ports (because they already have the errno qstr) - for Python code that uses exc.errno the generated bytecode is 2 bytes smaller and more efficient to execute (compared with exc.args[0]); so bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute, and bytecode that is frozen saves 2 bytes flash/ROM for each use - it's easier/shorter to type, and saves 2 bytes of space in .py files that use it (for each use) Cons: - increases code size by 4-8 bytes on minimal ports that don't already have the `errno` qstr - all exceptions now have .errno and .value attributes (a cpydiff test is added to address this) See also #2407. Signed-off-by: Damien George <damien@micropython.org>
2021-02-19esp32: Add basic support for Non-Volatile-Storage in esp32 module.Thorsten von Eicken
This commit implements basic NVS support for the esp32. It follows the pattern of the esp32.Partition class and exposes an NVS object per NVS namespace. The initial support provided is only for signed 32-bit integers and binary blobs. It's easy (albeit a bit tedious) to add support for more types. See discussions in: #4436, #4707, #6780
2021-02-17extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.Thorsten von Eicken
Also fix related problems with socket on esp32, improve docs for wrap_socket, and add more tests.
2021-02-16docs/library/uasyncio.rst: Add docs for ThreadSafeFlag.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-02-13extmod/uasyncio: Add asyncio.current_task().Jim Mussared
Matches CPython behavior. Fixes #6686
2021-02-03docs/library/machine.Pin.rst: Make it clear which methods are not core.Damien George
Signed-off-by: Damien George <damien@micropython.org>