Commit Graph

1082 Commits

Author SHA1 Message Date
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
Lucian Copeland 3640ef2b7f Fix toctree, incorrect flash port assumptions 2020-09-14 17:37:55 -04: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
Damien George a4c96fb3b0 extmod/uasyncio: Add asyncio.wait_for_ms function.
Fixes issue #6107.
2020-06-10 22:29:44 +10:00
David Lechner 1e6d18c915 docs: Fix Sphinx 3.x warnings, and enable warnings-as-errors on build.
This enables warnings as errors and fixes all current errors, namely:

- reference to terms in the glossary must now be explicit (:term:)
- method overloads must not be declared as a separate method or must
  use :noindex:
- 2 cases where `` should have been used instead of `
2020-06-05 21:42:17 +10:00
Jim Mussared 1cad63c0bc extmod/modbluetooth: Ensure status=0 always on success.
This commit makes sure that all discovery complete and read/write status
events set the status to zero on success.

The status value will be implementation-dependent on non-success cases.
2020-06-05 14:11:04 +10:00
Jim Mussared 9708fe8788 docs/library: Update ubluetooth for new events and discover by uuid. 2020-06-05 14:10:13 +10:00
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
Andrew Leech e54626f4c1 docs/reference: Add note about multiple exceptions when heap is locked. 2020-06-02 15:56:34 +10:00
cccc 1662a0b06f esp32/machine_sdcard: Add "freq" keyword arg to SDCard constructor.
To allow high speed access.
2020-05-28 12:19:04 +10:00
Jeff Epler 9966bf86da shared_bindings_matrix: sommersoft's suggestions 2020-05-26 09:55:23 -05:00
Jeff Epler 8f81beea7e shared_bindings_matrix: Use a trivial target
Sommersoft noticed that without submodules (as RTD currently does),
the "make -qp" failed due to trying to find files within submodules.

The "print-VAR" target doesn't have any dependencies, so it sidesteps
the problem.

If we move ulab's pyi files into the submodule, though, we'll need to
fetch submodules anyway during doc building.
2020-05-25 13:46:30 -05:00
Jeff Epler 76149ebf57 Remove board_chip logic
Not sure why I moved it, the computed value is never required
2020-05-25 09:59:13 -05:00
Jeff Epler 894bb3c003 Add esp32s2, litex to SUPPORTED_PORTS, sort it 2020-05-25 09:58:57 -05:00
Jeff Epler 32de8b437c shared_bindings_matrix: Work from parsed 'make' output
Revisiting this because I noticed the support matrix said that pyruler
had several modules it obviously didn't, such as the recently added
vectorio.

It is less error-prone because we can use the final values instead
of re-coding the Makefile logic in python.  The only things we need
to do are invoke make in "print-database" mode, then chase any
indirect references like CIRCUITPY_VECTORIO = $(CIRCUITPY_DISPLAYIO)

It does take longer, about 45s on my laptop.
2020-05-25 09:50:24 -05:00
Scott Shawcroft 1d77000c19
Update doc deps 2020-05-19 10:30:47 -07:00
Scott Shawcroft 1e9436519b
Fix ReadTheDocs after switching to stubs + autoapi. 2020-05-18 16:29:15 -07:00
Damien George cae77daf00 docs/develop: Fix module/source name in Makefile of native example. 2020-05-16 15:00:46 +10:00
Scott Shawcroft afc84c2fd1
Fix ulab, math and template. 2020-05-14 15:58:36 -07:00
Scott Shawcroft 4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
Damien George 3b6c9119eb extmod/modbluetooth: Add support for changing the GAP device name.
This commit allows the user to set/get the GAP device name used by service
0x1800, characteristic 0x2a00.  The usage is:

    BLE.config(gap_name="myname")
    print(BLE.config("gap_name"))

As part of this change the compile-time setting
MICROPY_PY_BLUETOOTH_DEFAULT_NAME is renamed to
MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME to emphasise its link to GAP and this
new "gap_name" config value.  And the default value of this for the NimBLE
bindings is changed from "PYBD" to "MPY NIMBLE" to be more generic.
2020-05-11 21:30:41 +10:00
Dan Halbert bae7a5e433 make translate again 2020-05-04 17:26:59 -04:00
Thorsten von Eicken 952ff8a8ea esp32: Improve support for OTA updates.
This commit adds several small items to improve the support for OTA
updates on an esp32:

- a partition table for 4MB flash modules that has two OTA partitions ready
  to go to do updates
- a GENERIC_OTA board that uses that partition table and that enables
  automatic roll-back in the bootloader
- a new esp32.Partition.mark_app_valid_cancel_rollback() class-method to
  signal that the boot is successful and should not be rolled back at the
  next reset
- an automated test for doing an OTA update
- documentation updates
2020-05-03 15:00:45 +10:00
Thorsten von Eicken 7d97d241e8 docs/library: Fix docs for machine.WDT to specify millisecond timeout. 2020-05-02 22:55:48 +10:00
Damien George 391927c126 docs/library: Note that machine.Pin.irq's hard arg may not be supported. 2020-04-30 23:50:53 +10:00
Dan Halbert 7337ea4955 fix support_matrix.py to handle ?= 2020-04-30 00:54:46 -04:00
Jim Mussared 7563d58210 unix: Add support for modbluetooth and BLE using btstack.
This commit adds full support to the unix port for Bluetooth using the
common extmod/modbluetooth Python bindings.  This uses the libusb HCI
transport, which supports many common USB BT adaptors.
2020-04-29 16:45:46 +10:00
Scott Shawcroft 755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
Lucian Copeland 8791ca6af3 implement requested changes 2020-04-23 13:33:41 -04:00
Lucian Copeland d0a2106547 Remove old build flags, add fixes for shared_matrix 2020-04-22 16:06:08 -04:00
Thorsten von Eicken a177831c46 esp32/modesp32: Add idf_heap_info(capabilities) to esp32 module.
This commit adds an idf_heap_info(capabilities) method to the esp32 module
which returns info about the ESP-IDF heaps.  It's useful to get a bit of a
picture of what's going on when code fails because ESP-IDF can't allocate
memory anymore.  Includes documentation and a test.
2020-04-23 00:02:11 +10:00
Thomas Friebel 1b1ceb67b2 docs/library: Document that char_data/notify_data are also references. 2020-04-19 00:18:14 +10:00
Lucian Copeland 25245bc442 Merge remote-tracking branch 'upstream/master' into stm32-docfix 2020-04-17 13:27:48 -04:00
Scott Shawcroft b580b34cbf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-14 17:14:44 -07:00
Damien George db137e70dc extmod/uasyncio: Add Loop.new_event_loop method.
This commit adds Loop.new_event_loop() which is used to reset the singleton
event loop.  This functionality is put here instead of in Loop.close() to
make it possible to write code that is compatible with CPython.
2020-04-13 22:16:52 +10:00
sommersoft 1c45a261c4 network.rst: remove duplicate method directive 2020-04-09 08:44:35 -05:00
Peter Hinch 7409467361 docs/library: Note that uasyncio.wait_for() can raise exception. 2020-04-09 22:11:13 +10:00
Damien George e0905e85a7 esp8266: Change from FAT to littlefs v2 as default filesystem.
This commit changes the esp8266 boards to use littlefs v2 as the
filesystem, rather than FAT.  Since the esp8266 doesn't expose the
filesystem to the PC over USB there's no strong reason to keep it as FAT.
Littlefs is smaller in code size, is more efficient in use of flash to
store data, is resilient over power failure, and using it saves about 4k of
heap RAM, which can now be used for other things.

This is a backwards incompatible change because all existing esp8266 boards
will need to update their filesystem after installing new firmware (eg
backup old files, install firmware, restore files to new filesystem).

As part of this commit the memory layout of the default board (GENERIC) has
changed.  It now allocates all 1M of memory-mapped flash to the firmware,
so the filesystem area starts at the 2M point.  This is done to allow more
frozen bytecode to be stored in the 1M of memory-mapped flash.  This
requires an esp8266 module with 2M or more of flash to work, so a new board
called GENERIC_1M is added which has the old memory-mapping (but still
changed to use littlefs for the filesystem).

In summary there are now 3 esp8266 board definitions:
- GENERIC_512K: for 512k modules, doesn't have a filesystem.
- GENERIC_1M: for 1M modules, 572k for firmware+frozen code, 396k for
  filesystem (littlefs).
- GENERIC: for 2M (or greater) modules, 968k for firmware+frozen code,
  1M+ for filesystem (littlefs), FAT driver also included in firmware for
  use on, eg, external SD cards.
2020-04-04 16:30:36 +11:00
Damien George df156b18e5 docs,tests: Add docs and test for uasyncio custom exc handler methods. 2020-04-04 10:47:48 +11:00
Damien George f97b5395ed extmod/uasyncio: Add StreamReader/StreamWriter as aliases of Stream cls.
To be compatible with CPython.  Fixes issue #5847.
2020-04-02 00:51:00 +11:00
Damien George b389bc0afa extmod/uasyncio: Implement Loop.stop() to stop the event loop. 2020-04-02 00:14:18 +11:00
Scott Shawcroft 77562a2acd
Update the supported ports 2020-03-31 18:27:55 -07:00
Lars Kellogg-Stedman 3a0f64fc7a tools/pyboard.py: Add -d as an alias for --device. 2020-03-30 11:37:32 +11:00
Lars Kellogg-Stedman 1cf994c48b tools/pyboard.py: Support setting device/baudrate from shell env vars.
Allow defaults for --device and --baudrate to be set in the environment
using PYBOARD_DEVICE and PYBOARD_BAUDRATE.
2020-03-30 11:37:32 +11:00
Damien George c99322f8d8 docs/library: Add initial docs for uasyncio module. 2020-03-26 01:25:45 +11:00
Lucian Copeland 7ff336fbc5 Change docs target 2020-03-11 18:50:56 -04:00
Andrew Leech 86bfabec11 py/modmicropython: Add heap_locked function to test state of heap.
This commit adds micropython.heap_locked() which returns the current
lock-depth of the heap, and can be used by Python code to check if the heap
is locked or not.  This new function is configured via
MICROPY_PY_MICROPYTHON_HEAP_LOCKED and is disabled by default.

This commit also changes the return value of micropython.heap_unlock() so
it returns the current lock-depth as well.
2020-03-11 16:54:16 +11:00
Damien George dd0bc26e65 extmod/modbluetooth: Change scan result's "connectable" to "adv_type".
This commit changes the BLE _IRQ_SCAN_RESULT data from:

    addr_type, addr, connectable, rssi, adv_data

to:

    addr_type, addr, adv_type, rssi, adv_data

This allows _IRQ_SCAN_RESULT to handle all scan result types (not just
connectable and non-connectable passive scans), and to distinguish between
them using adv_type which is an integer taking values 0x00-0x04 per the BT
specification.

This is a breaking change to the API, albeit a very minor one: the existing
connectable value was a boolean and True now becomes 0x00, False becomes
0x02.

Documentation is updated and a test added.

Fixes #5738.
2020-03-11 14:00:44 +11:00
caternuson 125409fe95 add proximity and sound_level 2020-03-06 13:31:08 -08:00
Thomas Friebel f4726735cf extmod/modbluetooth: Implement config getter for BLE rxbuf size.
Knowing the buffer size can be important, to ensure that valid data will be
received.
2020-02-18 13:37:50 +11:00
Thorsten von Eicken be92aacba3 docs/develop: Detail how to add symbols to mp_fun_table for native mods. 2020-02-16 00:04:25 +11:00
stijn 5f91933e54 windows: Improve default search path.
The default value for MICROPYPATH used in unix/main.c is
"~/.micropython/lib:/usr/lib/micropython" which has 2 problems when used in
the Windows port:
- it has a ':' as path separator but the port uses ';' so the entire string
  is effectively discarded since it gets interpreted as a single path which
  doesn't exist
- /usr/lib/micropython is not a valid path in a standard Windows
  environment

Override the value with a suitable default.
2020-02-11 13:34:35 +11:00
Peter Hinch 88cbfd791a docs/library: Fix framebuf monochrome 1-bit modes, swapping HLSB/HMSB.
This fix can be demonstrated by the following:

    b = bytearray(32)
    f = framebuf.FrameBuffer(b, 32, 8, framebuf.MONO_HLSB)
    f.pixel(0, 0, 1)
    print('MONO_HLSB', hex(b[0]))

    b = bytearray(32)
    f = framebuf.FrameBuffer(b, 32, 8, framebuf.MONO_HMSB)
    f.pixel(0, 0, 1)
    print('MONO_HMSB', hex(b[0]))

Outcome:

    MONO_HLSB 0x80
    MONO_HMSB 0x1
2020-02-10 23:04:15 +11:00
Lucian Copeland 3c50098dfc add stm32f4 to docs 2020-02-06 15:17:42 -05:00
David Lechner 83439e38fc unix/main: Add command-line -h option for printing help text.
This adds a -h option to print the usage help text and adds a new, shorter
error message that is printed when invalid arguments are given.  This
behaviour follows CPython (and other tools) more closely.
2020-02-04 17:54:31 +11:00
David Lechner c8d2f7838f docs/unix: Add a new new quickref page for the UNIX port.
This adds a new quickstart page for the UNIX port that documents the
command line options and environment variables.
2020-02-04 17:53:06 +11:00
Jesse Andrews c4ea4c1810 docs/esp8266: In TCP tutorial, add HTTP response code and content-type.
Show how to send an HTTP response code and content-type.  Without the
response code Safari/iOS will fail.  Without the content-type Lynx/Links
will fail.
2020-02-03 23:50:09 +11:00
adzierzanowski a55c17dc69 esp32/modnetwork: Add max_clients kw-arg to WLAN.config for AP setting.
This allows the user to configure the maximum number of clients that are
connected to the access point.  Resolves #5125.
2020-01-22 16:43:25 +11:00