Commit Graph

1137 Commits

Author SHA1 Message Date
Thorsten von Eicken 2c1299b007 extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.
Also fix related problems with socket on esp32, improve docs for
wrap_socket, and add more tests.
2021-02-17 11:50:54 +11:00
Jim Mussared cdf9c8648f docs/library/uasyncio.rst: Add docs for ThreadSafeFlag.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-02-16 16:35:37 +11:00
Jim Mussared 7ed99544e4 extmod/uasyncio: Add asyncio.current_task().
Matches CPython behavior.

Fixes #6686
2021-02-13 15:11:17 +11:00
Brianna Laugher d128999938 tools: Add filesystem action examples to pyboard.py help.
Signed-off-by: Brianna Laugher <brianna.laugher@gmail.com>
2021-02-13 14:37:28 +11:00
caternuson ac6695faba update design guide 2021-02-11 14:28:58 -08:00
Kevin Banks 87fe58fea5 Added WEBUSB_README to the table of contents (required by CI) 2021-02-04 08:56:51 -06:00
Damien George 78b23c3a1f all: Bump version to 1.14.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-03 00:59:07 +11:00
Damien George 0e44587076 docs/library/machine.Pin.rst: Make it clear which methods are not core.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-03 00:54:18 +11:00
Damien George ef9fde7339 LICENSE,docs: Update copyright year range to include 2021.
Signed-off-by: Damien George <damien@micropython.org>
2021-01-31 23:17:42 +11:00
Samuelson 407df82f81 docs/develop/natmod: Fix a small typo, con->can. 2021-01-30 15:20:44 +11:00
Christopher Tse ddb53c9458 docs/esp8266/quickref: Add warning block about NeoPixel timing. 2021-01-30 14:36:30 +11:00
Andrew Scheller 499e199add docs,stm32: Fix minor typos in RTC docs, and->an. 2021-01-30 14:13:30 +11:00
nanjekyejoannah 4eaebc1988 docs/develop: Add MicroPython Internals chapter.
This commit adds many new sections to the existing "Developing and building
MicroPython" chapter to make it all about the internals of MicroPython.

This work was done as part of Google's Season of Docs 2020.
2021-01-27 16:59:58 +11:00
Dan Halbert d116ad042f
Merge pull request #4070 from rpavlik/patch-1
Update design_guide.rst
2021-01-26 15:25:10 -05:00
Ryan A. Pavlik 365fafb32b
Update design_guide.rst
Add CO2 as a member name, and clarify the description of eCO2.
2021-01-26 10:36:40 -06:00
Dan Halbert 5b4249e365 fix doc typos 2021-01-25 23:06:47 -05:00
Dan Halbert a9f339b461 typo in circuitpy_mpconfig.h; forgot cxd56 port 2021-01-25 22:40:31 -05:00
Dan Halbert 34d63debd5 Remove obsolete esp.rst, network.rst 2021-01-25 09:29:16 -05:00
Dan Halbert 69869e1439 CIRCUITPY_* switches for JSON, RE, etc. Doc cleanup 2021-01-24 23:10:20 -05:00
Scott Shawcroft 733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00
Dan Halbert 6928de0364 merge from upstream and update to 6.0.x 2021-01-10 13:54:08 -05:00
Dan Halbert ce59b54361 Merge remote-tracking branch 'adafruit/main' into robots.txt 2021-01-10 13:52:47 -05:00
iabdalkader 20f8ce1982 stm32/pyb_can: Add ability to calculate CAN bit timing from baudrate.
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-17 23:01:15 +11:00
Damien George 1719459c28 extmod/modubinascii: Update code, docs for hexlify now CPython has sep.
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-14 14:35:29 +11:00
Mike Causer eedcc98cc5 Fix some spelling mistakes 2020-12-10 02:52:18 +11:00
Jim Mussared 68136eb4ba docs/library/ubluetooth.rst: Add passkey docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:44:36 +11:00
Jim Mussared b799fe1421 docs/library/ubluetooth.rst: Add bonding docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:42:46 +11:00
Jim Mussared fff634e031 docs/library/ubluetooth.rst: Add gap_pair() docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:41:36 +11:00
Jim Mussared f822557cbb docs/library/ubluetooth.rst: Add pairing/bonding config docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:41:21 +11:00
Andrew Leech 05fef8c6a4 extmod/modbluetooth: Add _IRQ_ENCRYPTION_UPDATE event.
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-02 14:40:15 +11:00
Jim Mussared 5e20f689ad docs/library/ubluetooth.rst: Update read request IRQ docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:39:17 +11:00
Jim Mussared 89553997b8 docs/library/ubluetooth.rst: Update char/desc flags.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:37:45 +11:00
Jim Mussared 7a9aa49595 docs/library/ubluetooth.rst: Add _IRQ_CONNECTION_UDPATE docs.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02 14:36:41 +11:00
Damien George a14ca31e85 docs/reference/repl.rst: Add information about new raw-paste mode.
Signed-off-by: Damien George <damien@micropython.org>
2020-12-01 22:35:13 +11:00
Jim Mussared 3795c71271 docs/library/ubluetooth.rst: Add docs for L2CAP channels.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24 01:07:17 +11:00
Damien George dbb13104ca docs/develop/cmodules.rst: Add link to source code for user C example.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 23:10:43 +11:00
stijn 25c4563f26 examples: Add example code for user C modules, both C and C++.
Add working example code to provide a starting point for users with files
that they can just copy, and include the modules in the coverage test to
verify the complete user C module build functionality.  The cexample module
uses the code originally found in cmodules.rst, which has been updated to
reflect this and partially rewritten with more complete information.
2020-10-29 15:30:42 +11:00
stijn 0153148fd2 py/py.mk: Support C++ code for user C modules.
Support C++ code in .cpp files by providing CXX counterparts of the
_USERMOD_ flags we have for C already.  This merely enables the Makefile of
user C modules to use variables specific to C++ compilation, it is still up
to each port's main Makefile to also include these in the build.
2020-10-29 15:29:20 +11:00
stijn 78c8b55067 docs: Fix reference to QSTR_GEN_CFLAGS Makefile flag. 2020-10-29 15:28:18 +11:00
Kevin Thomas 6eebdbc495 docs/reference/glossary.rst: Fix minor grammar error, An -> A. 2020-10-22 15:40:11 +11:00
Howard Lovatt 4842060366 docs/library/machine.Timer.rst: Add mention of constructor arguments. 2020-10-20 17:23:54 +11:00
Howard Lovatt cf6845b1cf docs/library/machine.Signal.rst: Correct typo: usecases to use cases. 2020-10-20 17:21:30 +11:00
Howard Lovatt 23f9439f44 docs/library/machine.rst: Correct minor typo: timout to timeout. 2020-10-20 17:19:47 +11:00
Howard Lovatt 3bc0ecbcd9 docs/library/btree.rst: Correct method typo: __detitem__ to __delitem__. 2020-10-20 17:13:02 +11:00
Damien George d4b61b0017 extmod/utime_mphal: Add generic utime.time_ns() function.
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-01 14:20:42 +10:00
Damien George 98182a97c5 docs: Update I2C and SPI docs to add reference to SoftI2C and SoftSPI.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
David Lechner ee7568ca8d docs/reference/packages.rst: Fix typo, remove duplicate "port".
Fixes #6485.
2020-09-30 23:32:24 +10:00
Scott Shawcroft 785f2beed0
Merge pull request #3481 from caternuson/iss3480_docupdate
Add MP const info to Design Guide
2020-09-28 14:30:28 -07:00
caternuson 4d4dbbcafe RST tweak 2020-09-28 13:28:38 -07:00
caternuson 8e4f08a109 add MP const info to Design Guide 2020-09-28 13:15:43 -07:00
Damien George c8ade2bd7f docs/develop: Add notes on prerequisite tools for building native .mpy.
Signed-off-by: Damien George <damien@micropython.org>
2020-09-25 12:25:29 +10:00
Damien George 81f2162ca0 extmod/modbluetooth: Change module-owned bytes objects to memoryview.
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-25 12:23:11 +10:00
Damien George bd7af6151d ports: Add utime.gmtime() function.
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-18 16:25:36 +10:00
Jim Mussared f271b96b5c docs/library/ubluetooth.rst: Add docs for MTU API. 2020-09-18 12:51:21 +10:00
Jim Mussared c200759290 docs/library/ubluetooth.rst: Clarify peripheral/central vs server/client
Previously this documentation assumed peripheral=server and central=client,
but this is not accurate or true to the implementation.
2020-09-15 15:42:59 +10:00
Jim Mussared 19faf55090 docs/library/ubluetooth.rst: Clarify position/kw arguments.
Almost all ubluetooth functions are positional-only, but some have optional
args.  Make this clearer and show what the defaults are.
2020-09-15 15:28:59 +10:00
Lucian Copeland 3640ef2b7f Fix toctree, incorrect flash port assumptions 2020-09-14 17:37:55 -04:00
Jim Mussared 67d8139e2b docs/library/ubluetooth.rst: Document BLE address modes. 2020-09-08 12:53:24 +10:00
stijn 40ad8f1666 all: Rename "sys" module to "usys".
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-09-04 00:10:24 +10:00
Damien George b0932fcf2e all: Bump version to 1.13.
Signed-off-by: Damien George <damien@micropython.org>
2020-09-02 12:01:26 +10:00
Jeff Epler 28f0139e6e shared_bindings_matrix revert to using shared-bindings
.. hard-coding ulab for now.

It also fixes a problem where board_name was unassigned when
use_branded_name was False, which only happened at release-building
time.

Trying to change this caused multiple problems in the release process.
2020-08-29 07:37:00 -05:00
Damien George 338b12d3c8 LICENSE,docs: Update copyright year range to include 2020.
Signed-off-by: Damien George <damien@micropython.org>
2020-08-29 13:58:20 +10:00
Dan Halbert fe73cfb922
Merge pull request #3333 from hierophect/esp32-enable-ulab
Fix all assignments affected by inline makefile comments
2020-08-27 10:36:59 -04:00
Lucian Copeland c77523503b Fix trailing whitespace errors across ports and docs 2020-08-26 14:48:46 -04:00
Jeff Epler e121e267ad shared_bindings_matrix: Use stubs, not shared-bindings
This fixes a problem where things that were in extmod/ could not
be listed.
2020-08-26 11:29:59 -05:00
Jeff Epler 5422dd682c shared_bindings_matrix: Run in parallel
.. this makes it take a fraction of the time, at least on systems
with a lot of CPU threads.  Even on my old laptop with a 2-core CPU
it reduces the time from 55s to 27s.
2020-08-26 11:29:55 -05:00
Andrew Leech a80a146858 extmod/bluetooth: Support active scanning in BLE.gap_scan().
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-26 15:00:11 +10:00
Damien George 2acc087880 extmod/vfs_lfs: Add mtime support to littlefs files.
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-25 17:35:19 +10:00
Zenix27 e76c7466b6 docs: Change `\*` to `*` in argument lists.
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-08-21 12:24:13 +10:00
Dan Halbert e1a843878e add robots.txt to specify doc versions to appear in search engines 2020-08-17 09:49:46 -04:00
sommersoft ffffccf7a0 docs/rstjinja.py: add jinja processing for building latex (pdf) docs 2020-08-15 14:29:09 -05:00
Taku Fukada 56c898da80 Modify some Python stubs 2020-08-07 01:01:28 +09:00
Taku Fukada 887eb3b6d9 Apply a Sphinx transform to make the core module docs look better 2020-08-07 00:01:31 +09:00
Scott Shawcroft efee11dffe
Add black too 2020-07-28 11:42:58 -07:00
Scott Shawcroft 01cd1c5b34
add isort to doc deps
Fixes #3200
2020-07-27 18:42:53 -07:00
Josh Lloyd fe7d47971f docs/esp32: Fix machine.Timer quickref to specify HW timers.
Also remove trailing spaces on other lines.
2020-07-25 00:50:06 +10:00
Howard Lovatt 47289f4bc9 docs/library: Update pyb.UART to correct pyboard UART availability.
On original pyboard UART 5 isn't available; added pyboard D availability.
2020-07-25 00:46:29 +10:00
Howard Lovatt 4a7c2731c5 docs/library: Update pyb.Timer to add missing args and defaults to init. 2020-07-25 00:34:48 +10:00
Howard Lovatt cf9be201d7 docs/library: Update pyb.SPI init method to add descr about "ti" arg. 2020-07-25 00:28:16 +10:00
Jonathan Hogg 5f0e9d1bac docs/library: Update documentation of esp32's RMT.
This explains how looping now works, and removes the warning about calling
wait_done().
2020-07-21 00:57:35 +10:00
Jim Mussared c7f7c0214c docs/library: For ubluetooth, add docs for _IRQ_GATTS_INDICATE_DONE. 2020-07-20 23:28:31 +10:00
Jim Mussared b7698841b2 docs/library: Add gatts_indicate() doc to ubluetooth.rst.
Also clarify behavior of `gatts_notify` and add some TODOs about adding an
event for indication acknowledgement.
2020-07-18 14:34:44 +10:00
Diego Elio Pettenò 34b4993d63 Add license to some obvious files. 2020-07-06 19:16:25 +01:00
Tyler Crumpton d1c9bb30e2
Fix minor typo in MicroPython libraries page 2020-07-06 09:56:52 -05:00
Scott Shawcroft eec42d4cb5
Merge pull request #3087 from sommersoft/cpy_org_sptmtrx
Release PRs To circuitpython.org: Include The Available Built-in Modules For Each Board
2020-07-02 13:45:39 -07:00
spacemanspiff2007 b572aa5721 docs/esp32: Add info about PWM duty cycle range to esp32 quickref.
See related #4581.
2020-06-30 22:28:09 +10:00
victor cb9aafbf8f docs/library: Clarify that the arg to esp.deepsleep is in microseconds. 2020-06-30 22:01:44 +10:00
Scott Shawcroft 7750eb0dcc
Merge pull request #3082 from sommersoft/customcss_old_docs_warning
[main] Custom CSS For "Viewing Outdated Docs" Message
2020-06-29 15:52:46 -07:00
sommersoft c84c30846c docs/shared_bindings_matrix.py: use '__file__' to ascertain root dir 2020-06-29 09:02:04 -05:00
sommersoft d911dc98d9 docs/shared_binding_matrix.py: fix usage with the branded name (building docs) 2020-06-29 01:09:04 -05:00
sommersoft 87e4f47866 docs/shared_bindings_matrix.py: changes to allow usage in 'tools/build_board_info.py'; includes root dir finder, and output board name option. 2020-06-29 00:17:12 -05:00
sommersoft ba0911b0f6 add custom css for 'viewing-old-docs' message 2020-06-26 17:01:25 -05:00
Jeff Epler 844f575a90 redirects: Add __init__ page redirects 2020-06-26 15:06:22 -05:00
Jeff Epler 2019d47ed5 redirects.txt: sort according to LANG=C.UTF-8 collation rules 2020-06-26 15:05:57 -05:00
Jeff Epler e7923c068e docs: Explain our shift in terminology 2020-06-25 11:44:21 -05:00
Jeff Epler 1d2cc0b968 I2CPeripheral: Rename class and its module
This is an incompatible change.
2020-06-25 11:44:19 -05:00
Jeff Epler ce95b9379d Refer to "main" branch of circuitpython 2020-06-25 11:42:23 -05:00
Jon Rob 1678f41744 esp32/esp32_rmt: Extend RMT to support carrier feature.
The ESP32 RMT peripheral has hardware support for a carrier frequency, and
this commit exposes it to Python with the keyword arguments carrier_freq
and carrier_duty_percent in the constructor.  Example usage:

    r = esp32.RMT(0, pin=Pin(2), clock_div=80, carrier_freq=38000, carrier_duty_percent=50)
2020-06-17 00:03:33 +10:00
Jeff Epler cb8539b06d docs: Generate redirects for autoapi renaming 2020-06-14 13:04:21 -05:00
Nick Crabtree 2934e41df0 docs/esp8266: Add quickref documentation for UART on esp8266.
This patch adds quickref documentation for the change in commit
afd0701bf7.  This commit added the ability to
disable the REPL and hence use UART0 for serial communication on the
esp8266, but was not previously documented anywhere.

The text is largely taken from the commit message, with generic information
on using the UART duplicated from the Wipy quickref document.
2020-06-10 22:46:09 +10:00