summaryrefslogtreecommitdiff
path: root/docs/library
AgeCommit message (Collapse)Author
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>
2021-01-30docs,stm32: Fix minor typos in RTC docs, and->an.Andrew Scheller
2020-12-17stm32/pyb_can: Add ability to calculate CAN bit timing from baudrate.iabdalkader
Calculate the bit timing from baudrate if provided, allowing sample point override. This makes it a lot easier to make CAN work between different MCUs with different clocks, prescalers etc. Tested on F4, F7 and H7 Y/V variants.
2020-12-14extmod/modubinascii: Update code, docs for hexlify now CPython has sep.Damien George
Since CPython 3.8 the optional "sep" argument to hexlify is officially supported, so update comments in the code and the docs to reflect this. Signed-off-by: Damien George <damien@micropython.org>
2020-12-02docs/library/ubluetooth.rst: Add passkey docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Add bonding docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Add gap_pair() docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Add pairing/bonding config docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02extmod/modbluetooth: Add _IRQ_ENCRYPTION_UPDATE event.Andrew Leech
This allows the application to be notified if any of encrypted, authenticated and bonded state change, as well as the encryption key size. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Update read request IRQ docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Update char/desc flags.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02docs/library/ubluetooth.rst: Add _IRQ_CONNECTION_UDPATE docs.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24docs/library/ubluetooth.rst: Add docs for L2CAP channels.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-20docs/library/machine.Timer.rst: Add mention of constructor arguments.Howard Lovatt
2020-10-20docs/library/machine.Signal.rst: Correct typo: usecases to use cases.Howard Lovatt
2020-10-20docs/library/machine.rst: Correct minor typo: timout to timeout.Howard Lovatt
2020-10-20docs/library/btree.rst: Correct method typo: __detitem__ to __delitem__.Howard Lovatt
2020-10-01extmod/utime_mphal: Add generic utime.time_ns() function.Damien George
It requires mp_hal_time_ns() to be provided by a port. This function allows very accurate absolute timestamps. Enabled on unix, windows, stm32, esp8266 and esp32. Signed-off-by: Damien George <damien@micropython.org>
2020-10-01docs: Update I2C and SPI docs to add reference to SoftI2C and SoftSPI.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-25extmod/modbluetooth: Change module-owned bytes objects to memoryview.Damien George
A read-only memoryview object is a better representation of the data, which is owned by the ubluetooth module and may change between calls to the user's irq callback function. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18ports: Add utime.gmtime() function.Damien George
To portably get the Epoch. This is simply aliased to localtime() on ports that are not timezone aware. Signed-off-by: Damien George <damien@micropython.org>
2020-09-18docs/library/ubluetooth.rst: Add docs for MTU API.Jim Mussared
2020-09-15docs/library/ubluetooth.rst: Clarify peripheral/central vs server/clientJim Mussared
Previously this documentation assumed peripheral=server and central=client, but this is not accurate or true to the implementation.
2020-09-15docs/library/ubluetooth.rst: Clarify position/kw arguments.Jim Mussared
Almost all ubluetooth functions are positional-only, but some have optional args. Make this clearer and show what the defaults are.
2020-09-08docs/library/ubluetooth.rst: Document BLE address modes.Jim Mussared
2020-09-04all: Rename "sys" module to "usys".stijn
This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".
2020-08-26extmod/bluetooth: Support active scanning in BLE.gap_scan().Andrew Leech
This adds an additional optional parameter to gap_scan() to select active scanning, where scan responses are returned as well as normal scan results. This parameter is False by default which retains the existing behaviour.
2020-08-25extmod/vfs_lfs: Add mtime support to littlefs files.Damien George
This commit adds support for modification time of files on littlefs v2 filesystems, using file attributes. For some background see issue #6114. Features/properties of this implementation: - Only supported on littlefs2 (not littlefs1). - Uses littlefs2's general file attributes to store the timestamp. - The timestamp is 64-bits and stores nanoseconds since 1970/1/1 (if the range to the year 2554 is not enough then additional bits can be added to this timestamp by adding another file attribute). - mtime is enabled by default but can be disabled in the constructor, eg: uos.mount(uos.VfsLfs2(bdev, mtime=False), '/flash') - It's fully backwards compatible, existing littlefs2 filesystems will work without reformatting and timestamps will be added transparently to existing files (once they are opened for writing). - Files without timestamps will open correctly, and stat will just return 0 for their timestamp. - mtime can be disabled or enabled each mount time and timestamps will only be updated if mtime is enabled (otherwise they will be untouched). Signed-off-by: Damien George <damien@micropython.org>
2020-08-21docs: Change `\*` to `*` in argument lists.Zenix27
Latest versions of Sphinx (at least 3.1.0) do not need the `*` escaped and will render the `\` in the output if it is there, so remove it. Fixes issue #6209.
2020-07-25docs/library: Update pyb.UART to correct pyboard UART availability.Howard Lovatt
On original pyboard UART 5 isn't available; added pyboard D availability.
2020-07-25docs/library: Update pyb.Timer to add missing args and defaults to init.Howard Lovatt