Commit Graph

158 Commits

Author SHA1 Message Date
Jeff Epler 4869dbdc67 canio: rename from _canio
This reflects our belief that the API is stable enough to avoid incompatible changes during 6.x.
2020-09-21 16:44:26 -05:00
Jeff Epler a2e1867f69 _canio: Minimal implementation for SAM E5x MCUs
Tested & working:

 * Send standard packets
 * Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and
MicroPython running on STM32F405 Feather with an external
transceiver was also tested.

Many other aspects of a full implementation are not yet present,
such as error detection and recovery.
2020-09-21 16:44:26 -05:00
Kamil Tomaszewski 064c597b60 camera: Implement new library for camera 2020-09-14 13:11:15 +02:00
Scott Shawcroft 683462c1b1
Merge pull request #3326 from tannewt/native_wifi
Add native wifi API with ESP32S2 support
2020-09-10 11:20:44 -07:00
Jeff Epler 73858ea682 circuitpy_mpconfig: enable 3-arg pow() with CIRCUITPY_FULL_BUILD
This is needed for a port of python3's decimal.py module.
2020-09-06 10:07:57 -05:00
Scott Shawcroft 8b71e26abd
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-08-25 16:39:23 -07:00
Scott Shawcroft 1034cc1217
Add espidf module. 2020-08-19 14:23:28 -07:00
Scott Shawcroft 430530c74b
SSL works until it runs out of memory 2020-08-19 14:23:28 -07:00
Scott Shawcroft 3860991111
Ping work and start to add socketpool 2020-08-19 14:22:13 -07:00
Scott Shawcroft c53a72d3f5
Fix ipaddress import and parse ipv4 strings 2020-08-19 14:22:13 -07:00
Scott Shawcroft c62ab6e09a
Add ipaddress 2020-08-19 14:22:12 -07:00
Scott Shawcroft c5b8401a15
First crack at native wifi API 2020-08-19 14:21:59 -07:00
Scott Shawcroft 6857f98426
Split pulseio.PWMOut into pwmio
This gives us better granularity when implementing new ports because
PWMOut is commonly implemented before PulseIn and PulseOut.

Fixes #3211
2020-08-18 13:08:33 -07:00
Scott Shawcroft d01f5dc0bd
Turn off terminalio for ja and ko
The font is missing many characters and the build needs the space.
We can optimize font storage when we get a good font.

The serial output will work as usual.
2020-08-17 17:17:59 -07:00
Jeff Epler c1400bae9b sharpmemory: Implement support for Sharp Memory Displays in framebufferio 2020-08-12 07:32:18 -05:00
Jerry Needell 2bdd62220e adjust stack for SAMD21 to accomodate larger pystack -- update frozen module adafruit_busdevice 2020-07-27 21:50:36 -04:00
Scott Shawcroft 1ec3580946
Merge branch 'main' into memmonitor 2020-07-22 12:24:19 -07:00
Scott Shawcroft 518d909b2c
Add memorymonitor module 2020-07-17 17:15:03 -07:00
Scott Shawcroft 1160635608
Enable PYSTACK to keep function state out of the heap 2020-07-17 17:03:42 -07:00
Jeff Epler 05837b2841 sdioio: Add shared-bindings
There is no implementation yet.
2020-06-26 11:50:25 -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
Kamil Tomaszewski 84f424f631 gnss: Implement new library for GNSS 2020-06-24 11:14:44 +02:00
Scott Shawcroft 2fd7a43f2f
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-05-29 10:16:24 -07:00
Scott Shawcroft 796373b8be
A number of small ESP32S2 fixes:
* Fix flash writes that don't end on a sector boundary. Fixes #2944
* Fix enum incompatibility with IDF.
* Fix printf output so it goes out debug UART.
* Increase stack size to 8k.
* Fix sleep of less than a tick so it doesn't crash.
2020-05-28 15:43:55 -07: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 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
Scott Shawcroft acf4b1bede
Remove reverse methods from per-board defs 2020-05-19 11:43:57 -07:00
Scott Shawcroft 6aaab005c5
Initial ESP32S2 port.
Basic blinky works but doesn't check pins.
2020-05-15 15:36:16 -07:00
Scott Shawcroft 277e8d528b
Merge branch 'master' into Optical-Encoder-Module 2020-05-12 18:22:57 -07:00
Daniel Pollard ee2cb703c8 merged master 2020-05-12 14:41:28 +10:00
warriorofwire 1c6e646f56 vectorio: fix mpconfig definition for disabled boards 2020-05-09 17:58:01 -07:00
warriorofwire 206d0e598a Add vectorio: for drawing shapes
vectorio builds on m4 express feather

Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.

VectorShape provides transpose and x/y positioning for shape implementations.

Included Shapes:

* Circle
  - A radius; Circle is positioned at its axis in the VectorShape.
  - You can freely modify the radius to grow and shrink the circle in-place.

* Polygon
  - An ordered list of points.
  - Beteween each successive point an edge is inferred.  A final edge closing the shape is inferred between the last
    point and the first point.
  - You can modify the points in a Polygon.  The points' coordinate system is relative to (0, 0) so if you'd like a
      top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape
      x and y properties will position the rectangle relative to its top center point

* Rectangle
  A width and a height.
2020-05-09 15:38:22 -07:00
Sean Cross b168784fa0 aesio: add basic AES encryption and decryption
This adds initial support for an AES module named aesio.  This
implementation supports only a subset of AES modes, namely
ECB, CBC, and CTR modes.

Example usage:

```
>>> import aesio
>>>
>>> key = b'Sixteen byte key'
>>> cipher = aesio.AES(key, aesio.MODE_ECB)
>>> output = bytearray(16)
>>> cipher.encrypt_into(b'Circuit Python!!', output)
>>> output
bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n')
>>>
```

This key is 16-bytes, so it uses AES128.  If your key is 24- or 32-
bytes long, it will switch to AES192 or AES256 respectively.

This has been tested with many of the official NIST test vectors,
such as those used in `pycryptodome` at
39626a5b01/lib/Crypto/SelfTest/Cipher/test_vectors/AES

CTR has not been tested as NIST does not provide test vectors for it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-06 17:40:06 +08:00
Daniel Pollard bfa5cd9c13 refactor countio based on feedback 2020-05-05 15:23:38 +10:00
Lucian Copeland c6c77726e7 Merge remote-tracking branch 'upstream/master' into stm32-docfix 2020-04-23 13:39:48 -04: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
Jeff Epler 5fcc6d6286 RGBMatrix: finish renaming from Protomatter
This gets all the purely internal references.  Some uses of
protomatter/Protomatter/PROTOMATTER remain, as they are references
to symbols in the Protomatter C library itself.
2020-04-17 18:44:07 -05:00
Jeff Epler 3d6258f63d Rename Protomatter -> RGBMatrix
This is a quick rename, it changes the user-facing names but not the
internal names of things.
2020-04-17 18:43:57 -05:00
Jeff Epler a32337718d Rename _protomatter -> protomatter
I originally believed that there would be a wrapper library around it,
like with _pixelbuf; but this proves not to be the case, as there's
too little for the library to do.
2020-04-17 18:43:57 -05:00
Jeff Epler 09dc46a984 Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
Jeff Epler d6342af980 ulab: rename enable macro so it appears in the support matrix 2020-03-17 09:33:03 -05:00
Jeff Epler 473e9c5ffb f-strings: Make optional, defaulting to !CIRCUITPY_MINIMAL_BUILD
This should reclaim *most* code space added to handle f-strings.
However, there may be some small code growth as parse_string_literal
takes a new parameter (which will always be 0, so hopefully the optimizer
eliminates it)
2020-03-09 09:03:25 -05:00
Jeff Epler fa3b9eba92 ulab: Incorporate it 2020-02-27 11:03:03 -06:00
Dan Halbert e31ac710be Enable _bleio adapter when _bleio is imported 2020-02-20 21:55:04 -05:00
James Bowman acef93a253 Rename eveL to _eve, EVEL to _EVE 2020-02-05 18:17:58 -08:00
James Bowman 7fd30e7d20 First draft of eveL, the low-level module of the Gameduino (and BridgeTek EVE) bindings.
[adafruit/circuitpython#2578]
2020-02-03 16:46:14 -08:00
Hierophect 10eed78dd8 use CFLAG to properly set define 2020-01-08 17:37:20 -05:00
Marius-450 3ad3d49959 changes only for monster m4sk 2020-01-04 12:32:49 -05:00
Marius-450 d2b2cf0add CIRCUITPY_DISPLAY_LIMIT = 2 2020-01-04 12:20:32 -05:00
Scott Shawcroft b859e2b710
Remove `re` from CPX Displayio build to make space. 2019-12-20 11:43:56 -08:00
Dan Halbert 68ae47907c merge from upstream 2019-12-10 21:04:46 -05:00
Jeff Epler a08d9e6d8e audiocore: Add MP3File using Adafruit_MP3 library 2019-12-10 14:03:06 -06:00
Dan Halbert d628d2a261 atmel-samd working 2019-12-06 15:18:20 -05:00
Dan Halbert 40434d6919 wip 2019-12-05 22:45:53 -05:00
Scott Shawcroft 17c8356b8c
Add connection interval and debugging
This also sets TinyUSB to master and to not include its submodules.

It also fixes an old displayio example comment and retries gattc
reads.
2019-12-04 14:39:02 -08:00
Jeff Epler 568636d562 run_background_tasks: Do nothing unless there has been a tick
This improves performance of running python code by 34%, based
on the "pystone" benchmark on metro m4 express at 5000 passes
(1127.65 -> 1521.6 passes/second).

In addition, by instrumenting the tick function and monitoring on an
oscilloscope, the time actually spent in run_background_tasks() on
the metro m4 decreases from average 43% to 0.5%. (however, there's
some additional overhead that is moved around and not accounted for
in that "0.5%" figure, each time supervisor_run_background_tasks_if_tick
is called but no tick has occurred)

On the CPB, it increases pystone from 633 to 769, a smaller percentage
increase of 21%.  I did not measure the time actually spent in
run_background_tasks() on CPB.

Testing performed: on metro m4 and cpb, run pystone adapted from python3.4
(change time.time to time.monotonic for sub-second resolution)

Besides running a 5000 pass test, I also ran a 50-pass test while
scoping how long an output pin was set.  Average: 34.59ms or 1445/s on m4,
67.61ms or 739/s on cbp, both matching the other pystone result reasonably
well.

import pystone
import board
import digitalio
import time

d = digitalio.DigitalInOut(board.D13)
d.direction = digitalio.Direction.OUTPUT

while True:
    d.value = 0
    time.sleep(.01)
    d.value = 1
    pystone.main(50)
2019-11-18 11:26:48 -06:00
Jeff Epler 7f744a2369 Supervisor: move most of systick to the supervisor
This code is shared by most parts, except where not all the #ifdefs
inside the tick function were present in all ports.  This mostly would
have broken gamepad tick support on non-samd ports.

The "ms32" and "ms64" variants of the tick functions are introduced
because there is no 64-bit atomic read.  Disabling interrupts avoids
a low probability bug where milliseconds could be off by ~49.5 days
once every ~49.5 days (2^32 ms).

Avoiding disabling interrupts when only the low 32 bits are needed is a minor
optimization.

Testing performed: on metro m4 express, USB still works and
time.monotonic_ns() still counts up
2019-11-18 11:01:23 -06:00
Jeff Epler 45d1b290ee circuitpy_mpconfig.h: Express HOOKS in terms of RUN_BACKGROUND_TASKS
.. this means that when we want to modify RUN_BACKGROUND_TASKS, only one
change is needed instead of 3
2019-11-18 11:00:24 -06:00
Jeff Epler acde22a436 circuitpy_mpconfig.h: Move includes after include-guard
To benefit from gcc's "once-only headers" implementation, the
"wrapper-#ifndef" must be the first non-comment part of the file,
according to the manual for various gcc/cpp versions.
2019-11-18 11:00:24 -06:00
Thea Flowers c7195c4bc5
Allow boards to enable the `micropython.native` decorator
Adds the `CIRCUITPY_ENABLE_MPY_NATIVE` for `mpconfigboard.mk` that enables
the `micropython.native` decorator.
2019-11-05 14:27:53 -08:00
Dan Halbert 1505da784f wip 2019-10-28 18:15:02 -04:00
Dan Halbert 7b79ac3739 Parameterize linker script 2019-10-20 23:50:12 -04:00
sommersoft b1c3d47413 Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-09-01 21:16:12 -05:00
sommersoft 8120f5cdad Merge branch 'master' of https://github.com/adafruit/circuitpython into mixer_voice 2019-08-29 22:14:53 -05:00
Dan Halbert 7a64af9280 rename bleio module to _bleio 2019-08-29 18:44:27 -04:00
sommersoft df5568d993 move Mixer & MixerVoice from 'audiocore' to 'audiomixer' 2019-08-24 23:36:18 -05:00
Scott Shawcroft 7324b70a7c
Rework based on Dan's review 2019-08-23 15:27:21 -07:00
Scott Shawcroft 9993a99906
Add initial Monster M4SK build 2019-08-22 14:24:32 -07:00
Scott Shawcroft c247e7df9c
Begin refresh rework. 2019-08-22 14:08:33 -07:00
Dan Halbert e3dc5e3a66 Merge remote-tracking branch 'adafruit/master' into run-background-tasks
Restore dependencies indicated by indentation in circuitpy_mpconfig.h.
2019-08-19 12:41:20 -04:00
Scott Shawcroft b3de7efc07
Fix I2CDisplay lifecycle and splash lifecycle.
Fixes https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306/issues/2
2019-08-14 15:53:58 -07:00
Jeff Epler 076cbcc4f8 cicuitpy_mpconfg.h: Define RUN_BACKGROUND_TASKS
In #2013, @danh says:
    My choice of where to put the semicolon is deliberate,
    so that we can say

        RUN_BACKGROUND_TASKS;

    not have a redundant semicolon, and not confuse C code formatting.
2019-08-11 08:53:02 -05:00
Jeff Epler 568dfc73a9 cicuitpy_mpconfg.h: Alphebetize and standardize indentation
.. no semantic change intended
2019-08-11 08:53:02 -05:00
Jeff Epler 54cde56ec5 audiopwmio: Add the shared files for this new module 2019-07-26 07:52:37 -05:00
Jeff Epler 6b44e40ee8 audiocore: Factor from audioio
When nrf pwm audio is introduced, it will be called `audiopwmio`.  To
enable code sharing with the existing (dac-based) `audioio`, factor
the sample and mixer types to `audiocore`.

INCOMPATIBLE CHANGE: Now, `Mixer`, `RawSample` and `WaveFile` must
be imported from `audiocore`, not `audioio`.
2019-07-25 06:44:26 -05:00
Dan Halbert ea760c042b Turn on MICROPY_OPT_COMPUTED_GOTO for 5x CPU-bound speedup 2019-06-11 12:43:48 -04:00
Elvis Pfützenreuter 1da8d4b4da Add PS/2 support -- ps2io module 2019-06-04 18:05:46 -03:00
Dan Halbert da77eedafa Enable MICROPY_PY_BUILTINS_ROUND_INT; make round() work beter when it's disabled as well 2019-05-17 15:56:40 -04:00
Scott Shawcroft 6132a05fd9
Include cleanup and style tweaks 2019-04-16 10:19:07 -07:00
Scott Shawcroft 0e03a321e4
Fully split gamepadshift from gamepad 2019-04-16 10:11:54 -07:00
Scott Shawcroft c927e6b938
Split GamePadShift from GamePad to save space on most boards. 2019-04-15 15:40:06 -07:00
Scott Shawcroft 0f003ac5b8
Reorganize board busses into shared-bindings and shared-module. 2019-04-08 16:58:50 -07:00
Dan Halbert c9571fe1ea ROTARYIO_MODULE mistakenly omitted from module list 2019-04-01 17:59:59 -04:00
Dan Halbert 4c1849ae7c turn on reversed() for all builds 2019-03-26 22:15:26 -04:00
Scott Shawcroft 2c93ce5a28
Merge pull request #1672 from dhalbert/regular-fs-flush
flush flash filesystem once a second
2019-03-26 13:47:43 -07:00
Dan Halbert 26262cd477
Merge pull request #1670 from tannewt/fontio
Move Glyph and BuiltinFont into fontio
2019-03-20 17:36:04 -04:00
Dan Halbert fbf166af1a enable MICROPY_CPYTHON_COMPAT for most builds except CIRCUITPY_SMALL_BUILD; remove a few other things to make fit 2019-03-20 14:36:24 -04:00
Dan Halbert 2459eabd66 flush flash filesystem once a second 2019-03-20 12:21:36 -04:00
Scott Shawcroft 5e2fec714c
Move Glyph and BuiltinFont into fontio
It was confusing in displayio.

Fixes #1662
2019-03-19 16:22:09 -07:00
sommersoft a44bfc2730 Merge branch 'master' of https://github.com/adafruit/circuitpython into new_freq_in 2019-03-01 21:24:30 -06:00
Radomir Dopieralski 89b2788d11 Apply review fixes:
* fix formatting
* fix copyrights
* fix CIRCUITPYTHON_GAMEPAD guards
* add CIRCUITPYTHON_PEW guards to reset
* fix module list order
2019-03-01 16:05:15 +01:00
Radomir Dopieralski 45fea86554 Rebase on top of CircuitPython 4.x 2019-03-01 14:59:21 +01:00
Radomir Dopieralski 88e40193ae Add a _pew module 2019-02-28 23:32:58 +01:00
sommersoft 9d3fcf9a0d add frequencyio to circuipy_ configs 2019-02-24 18:05:51 -06:00
Scott Shawcroft 0261c57d32
Merge pull request #1582 from dhalbert/remove-u-names
rename ure, ujson, and uerrno to re, json, and errno
2019-02-21 13:24:07 -08:00
Dan Halbert 10d3a20f8a Add CIRCUITPY macro; rename u* only when CIRCUITPY=1 2019-02-21 11:09:44 -05:00
Scott Shawcroft 46fd60c703
Prevent infinite display update recursion and fix VFS mounting
Fixes #1529
2019-02-19 14:50:31 -08:00