Commit Graph

1067 Commits

Author SHA1 Message Date
dherrada c8437e6595 Added type hints to rgbmatrix 2020-07-03 11:10:13 -04:00
dherrada 93d20077cc Added type hints to pulseio 2020-07-03 11:04:03 -04:00
dherrada a2c7e2795b Added type hints to ps2io 2020-07-03 10:51:39 -04:00
dherrada 41f12a7a6c Added type hints to pixelbuf 2020-07-03 10:47:44 -04:00
dherrada e273b9a11f Added type hints to _pew 2020-07-03 10:42:57 -04:00
dherrada 0abf45a446 Added type hints to nvm 2020-07-03 10:37:55 -04:00
dherrada 0a8d9eed45 Added type hints to microcontroller 2020-07-03 10:33:28 -04:00
dherrada 2e8b8c7b95 Added type hints to i2cperipheral 2020-07-03 10:29:39 -04:00
dherrada 6a3968d805 Added type hints to gnss 2020-07-03 10:26:31 -04:00
dherrada d73348f673 Added type hints to gamepadshift 2020-07-03 10:19:34 -04:00
dherrada ff8604bb82 Added type hints to gamepad 2020-07-03 10:17:35 -04:00
dherrada 51841447be Added type hints to frequencyio 2020-07-03 10:14:40 -04:00
dherrada ca0e8ea1eb Added type hints to framebufferio 2020-07-03 10:12:04 -04:00
dherrada 48ea2271b7 Added type hints to fontio 2020-07-03 10:08:25 -04:00
dherrada 783cc4de39 Added type hints to displayio 2020-07-03 10:05:14 -04:00
Scott Shawcroft 70fdde4aaa
Remove trailing space 2020-07-02 15:11:40 -07:00
dherrada 9b4ffc0571 Changed unions to ReadableBuffer and WriteableBuffer 2020-07-02 17:47:52 -04:00
Scott Shawcroft c33542f978
Merge branch 'main' into patch-1 2020-07-02 13:56:09 -07:00
dherrada dd27fdfbe3 Added type hints to countio 2020-07-02 14:15:43 -04:00
dherrada 51fd286cbf Added type hints to board 2020-07-02 14:14:05 -04:00
dherrada 26f1fd0071 Added type hints to _bleio 2020-07-02 14:11:25 -04:00
dherrada 54cb1feea0 Removed all 'self, )' 2020-07-02 13:28:36 -04:00
dherrada 522b17ca93 Made suggested changes 2020-07-02 13:25:07 -04:00
dherrada ac113fdc81 Changed bytearray to a union 2020-07-02 12:39:17 -04:00
dherrada ffc5f0c338 Added type hints to bitbangio 2020-07-02 12:37:03 -04:00
dherrada ed476a417c Added type hints to audiopwmio 2020-07-02 12:07:03 -04:00
dherrada e114b31a7a Added type hints to audiomp3 2020-07-02 12:02:21 -04:00
dherrada 24bca06db0 Added type hints to audiomixer 2020-07-02 12:02:13 -04:00
dherrada 3d1e0051e6 Added type hints to audioio 2020-07-02 12:02:07 -04:00
dherrada b26ee6c1f6 Added type hints to audiocore 2020-07-02 12:02:02 -04:00
dherrada 2681bd52b5 Did audiobusio 2020-07-02 11:33:18 -04:00
dherrada 627ecadb3f Did aesio 2020-07-02 11:10:53 -04:00
dherrada cb259de5ef Did busio, fixed up analogio 2020-07-02 10:23:17 -04:00
dherrada 6fd6747e9e Added type hints for analogio 2020-07-02 09:36:22 -04:00
Jeff Epler fcddfd0f39
Merge pull request #3083 from tannewt/esp32s2_busio
Add busio support for the ESP32-S2
2020-07-01 21:02:08 -05:00
Jeff Epler e33accae4d ulab: document sosfilt 2020-07-01 10:15:09 -05:00
Jeff Epler 472a04ba4b sdioio: Remove junk in comments 2020-06-26 13:17:00 -05:00
Jeff Epler 0f2fb93d14
Update shared-bindings/sdcardio/SDCard.c
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2020-06-26 13:15:30 -05:00
Jeff Epler 05837b2841 sdioio: Add shared-bindings
There is no implementation yet.
2020-06-26 11:50:25 -05:00
Jeff Epler 159728b550 shared-bindings: Factor out validate_list_is_free_pins
This will ultimately be used by SDIO, where a variable length list
of data lines is called for.
2020-06-26 11:50:24 -05:00
Jeff Epler 57fde2e07b sdcardio: implement new library for SD card I/O
Testing performed: That a card is successfully mounted on Pygamer with
the built in SD card slot

This module is enabled for most FULL_BUILD boards, but is disabled for
samd21 ("M0"), litex, and pca10100 for various reasons.
2020-06-26 11:50:23 -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 9110e36636 Use main/selected terminology in docstrings
Also copy some notes from busio docstrings to bitbangio docstrings
2020-06-25 11:42:23 -05:00
Scott Shawcroft c5fa9730a8
Compiles! 2020-06-24 12:47:59 -07:00
Scott Shawcroft a26102607e
Add UART support 2020-06-24 12:47:58 -07:00
Kamil Tomaszewski ab4c09cea7 gnss: Add timestamp 2020-06-24 11:14:44 +02:00
Kamil Tomaszewski 3509dad5b3 gnss: Remove start and stop 2020-06-24 11:14:44 +02:00
Kamil Tomaszewski c49f4bcc85 gnss: add a comment about the units 2020-06-24 11:14:44 +02:00
Kamil Tomaszewski 84f424f631 gnss: Implement new library for GNSS 2020-06-24 11:14:44 +02:00
Jeff Epler a580f0f1c4 _pew: move to common-hal
I noticed that this code was referring to samd-specific functionality,
and isn't enabled except in one samd board (pewpew10).  Move it.

There is incomplte support for _pew in mimxrt10xx which then caused build
errors; adding a #if guard to check for _pew being enabled fixes it.
The _pew module is not likely to be important on mimxrt but I'll leave the
choice to remove it to someone else.
2020-06-22 10:45:27 -05:00
Jeff Epler 32a29ffdff shared-bindings: Change docstrings with '\x...' chars to raw strings
Closes: #3032
2020-06-14 13:05:08 -05:00
Jeff Epler 3c3cad5ae6 docs: Improve 5.0.x <-> main branch doc linkrot
This improves, but does not entirely fix, the broken links that result
from the autoapi change.  It fixes module-level links, but class links
still do not work (e.g., /shared-bindings/displayio/Palette.html (5.0.x)
is now just /shared-bindings/displayio/#displayio.Palette).
2020-06-14 11:12:35 -05: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
Scott Shawcroft 959f7297da
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-06-01 17:01:16 -07:00
Scott Shawcroft a170c5e13a
Merge branch 'master' into update-ulab 2020-06-01 15:19:21 -07:00
Scott Shawcroft 323cca8910
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-06-01 15:18:12 -07:00
Jeff Epler 8af77cb91f ulab: docs: Fix markup error 2020-06-01 11:02:51 -05:00
Jeff Epler 5061405eb3 fix spelling 2020-06-01 09:16:55 -05:00
Jeff Epler 18c659780e ulab: update
.. add new modules and functions to our shared-bindings stubs
2020-06-01 09:02:29 -05:00
Jeff Epler 89bd87d9fc shared-bindings: Fix docs of storage.VfsFat
This is almost, but not entirely, a whitespace change.

"..." was missing or mis-placed in several places

The invalid syntax 'def f(self, ):' was used in several places.
2020-05-31 10:35:42 -05:00
Scott Shawcroft 2fd7a43f2f
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-05-29 10:16:24 -07:00
Jeff Epler 90571e7b7f Various doc examples: Fix the "/ 18" copypasta bug 2020-05-27 16:43:35 -05:00
Scott Shawcroft 1ed4978620
Remove NONE from mode enum and doc tweaks 2020-05-27 10:58:21 -07:00
Sean Cross aac5a4f178 watchdog: use common_hal_watchdog_* pattern
This pulls all common functionality into `shared-bindings` and keeps
platform-specific code inside `nrf`. Additionally, this performs most
validation in the `shared-bindings` site.

The only validation that occurs inside platform-specific `common-hal`
code is related to timeout limits that are platform-specific.

Additionally, all documentation is now inside the `shared-bindings`
directory.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:38:29 +08:00
Sean Cross dbf1bef56a watchdog: support catching the timeout
With this patch, the exception can now be caught:

    import microcontroller
    import watchdog
    import time

    wdt = microcontroller.watchdog
    wdt.timeout = 5

    while True:
        wdt.mode = watchdog.WatchDogMode.RAISE
        print("Starting loop -- should exit after five seconds")
        try:
            while True:
                time.sleep(10)
                # pass # This also works for a spinloop
        except watchdog.WatchDogTimeout as e:
            print("Watchdog Expired (PASS)")
        except Exception as e:
            print("Other exception (FAIL)")
    print("Exited loop")

This prints:

    Starting loop -- should exit after five seconds
    Watchdog Expired (PASS)
    Starting loop -- should exit after five seconds
    Watchdog Expired (PASS)
    Starting loop -- should exit after five seconds
    Watchdog Expired (PASS)

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:50 +08:00
Sean Cross c7efc94a33 watchdog: move timeout exception to shared-bindings
Make this exception globally available to all platforms that have
enabled the watchdog timer.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 08362c9cab watchdogtimer: refactor to new api
This refactors the WatchDogTimer API to use the format proposed in
https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 87737fb50a watchdog: fix documentation build error
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 595f6387c2 watchdog: rename module from `wdt` and move to `microcontroller`
This also places it under the `microcontroller` object.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross f4719609f7 wdt: add watchdog support
This adds shared bindings for a watchdog timer, based on the API
provided by micropython.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:48 +08:00
Dan Halbert 3574670226
Merge pull request #2931 from tannewt/esp32s2_digitalio
Finish digitalio and pin use tracking for ESP32S2
2020-05-26 19:18:45 -04:00
Scott Shawcroft 2ffd70417d
Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalio 2020-05-26 13:09:57 -07:00
Roy Hooper d13d0244ec Adjust docs to reflect behaviour. 2020-05-24 20:39:53 -04:00
George Waters c592a2b4db
Simplify pixelbuf set_pixels function 2020-05-22 21:19:17 -04:00
George Waters f078055f59
Use mp_int_t for setting pixelbuf slice indices
When handling negative steps, start and stop need to be mp_int_t so they
can be checked against a potential negative value during the for loop
used to set the slice values.
2020-05-22 16:28:09 -04:00
George Waters 16ffc731f3
Implement negative step for pixelbuf slices 2020-05-21 21:57:45 -04:00
Scott Shawcroft 3bb6a32a20
Merge branch 'master' into esp32s2_digitalio 2020-05-21 08:52:39 -07:00
George Waters 02d0881fca
Fix error when getting a pixelbuf slice 2020-05-20 17:56:08 -04:00
Scott Shawcroft ba724fffb4
Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalio 2020-05-20 10:48:27 -07:00
Scott Shawcroft 49090d1378
Fully implement digitalio and pin-in-use tracking.
Fixes #2901
2020-05-19 17:46:29 -07:00
Sean Cross 34f91f01c6 bleio: adapter: add advertising timeout and status
Add a field to allow specifying a timeout when initiating advertising.
As part of this, add a new property to determine if the device is still
advertising.

Additionally, have the `anonymous` property require a timeout, and set
the timeout to the maximum possible value if no timeout is specified.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19 15:01:19 +08:00
Sean Cross cfe65742a3 _bleio: support anonymous advertising
Add a new parameter to the `start_advertising()` function to enable
anonymous advertising.  This forces a call to `sd_ble_gap_privacy_set()`
with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and
`private_addr_type` set to
`BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`.

With this, addresses will cycle at a predefined rate (currently once
every 15 minutes).

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19 15:01:18 +08:00
Scott Shawcroft 2c2b53303d
Merge pull request #2837 from k0d/serial-debug
Add support for a debug console, such as ST-Link VCP.
2020-05-18 18:13:31 -07:00
Mark Olsson 007c92ee6a Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
warriorofwire dde66cadde remove a duplication in polygon.c 2020-05-18 13:32:06 -07:00
warriorofwire 4bbb80e31a vectorio: speed up polygon
This change takes polygon from 126k pixels per second fill to 240k pps fill
  on a reference 5 point star 50x66px polygon, updating both location and shape
  at 10hz.  Tested on an m4 express feather.

As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;`
  fills just shy of 375k pixels per second.
2020-05-18 13:32:06 -07:00
ppolk-nocimed c6406c74ec Added DigitalInOut suggestion 2020-05-16 13:21:34 -07:00
ppolk-nocimed f76ff1eb69 Fixed Optional[Pull] 2020-05-16 13:14:50 -07:00
ppolk-nocimed db924fb01e Digital In Out Type Hints 2020-05-16 12:47:49 -07:00
Thea Flowers 7d167560af Note that nvm.ByteArray is available at microcontroller.nvm
Fixes #2766
2020-05-15 14:53:14 -07:00
Scott Shawcroft 0d8bca92e2
Merge pull request #2810 from dherrada/master
Pyi integration
2020-05-15 10:31:05 -07:00
Sean Cross f9ed3acf6d aesio: specify writable buffers for destination buffers
When calling `AES.decrypt_into()` or `AES.encrypt_into()`, the
destination buffers may be any buffer kind.  However, we currently
aren't checking to make sure the destination buffer is actually
writable.

Specify `MP_BUFFER_WRITE` for the destination buffers of both of these
objects so we don't inadvertently write to immutable data.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-15 10:22:42 +08:00
Sean Cross aba36e4abf aesio: use bufinfo rather than mp_str_bytes
In order to accept both `bytes` objects and `bytearray` objects, use a
`bufinfo` construct to retrieve the data rather than
`mp_obj_str_get_data()`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-15 10:16:00 +08:00
Scott Shawcroft 15c2d16bf9
Fix help doc 2020-05-14 16:06:13 -07:00
Scott Shawcroft afc84c2fd1
Fix ulab, math and template. 2020-05-14 15:58:36 -07:00
dherrada b477c4812d
Fixed minor indentation issue 2020-05-14 16:58:25 -04:00
Scott Shawcroft db4dbe0752
Merge pull request #2889 from jepler/gamepad-tick
Gamepad, GamepadShift: Fix after lower-power by enabling supervisor tick
2020-05-13 11:53:23 -07:00
Scott Shawcroft 3ffa5604fc
Update countio to python stub docs 2020-05-13 08:36:16 -07:00
Scott Shawcroft 7546d47f77
Merge remote-tracking branch 'adafruit/master' into improve_verification 2020-05-13 08:23:55 -07:00
Jeff Epler 23ba58bbf5 Gamepad & GamepadShift: Initially allocate as long-lived
This makes less heap churn and decreases code size a tiny bit
2020-05-13 10:14:37 -05:00