Commit Graph

264 Commits

Author SHA1 Message Date
Jeff Epler d4913b04e0 rgbmatrix: update protomatter
and re-organize so that esp32 s2/s3 don't do as much at reset

.. it's not necessary (because most data is in esp-idf managed memory)
and doing this saves me from having to debug why reconstruct isn't working
properly on that platform.

This needs to be tested on other platforms again before being merged!
2023-06-08 10:43:32 -05:00
Scott Shawcroft 66edcf5d03
Add PicoDVI support
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
2023-04-19 15:14:02 -07:00
Jeff Epler 05cf5213e2
Allow disabling each class in keypad
.. for boards like pewpewm4 which need a specific kind. And need
some space.
2023-04-01 19:22:52 -05:00
Jeff Epler 13e17e6dcd
Make synthio debuggable in unix coverage port 2023-04-01 11:46:36 -05:00
Jeff Epler 02f8a45dfa
synthio: allow increasing number of channels
12 channels works well on metro m7
2023-04-01 11:46:27 -05:00
hathach 8c1095b268
Merge branch 'main' into add-codespell 2023-03-23 14:09:57 +07:00
hathach fecc1bdedb
fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
Scott Shawcroft 5bb8a7a7c6
Improve iMX RT performance
* Enable dcache for OCRAM where the VM heap lives.
* Add CIRCUITPY_SWO_TRACE for pushing program counters out over the
  SWO pin via the ITM module in the CPU. Exempt some functions from
  instrumentation to reduce traffic and allow inlining.
* Place more functions in ITCM to handle errors using code in RAM-only
  and speed up CP.
* Use SET and CLEAR registers for digitalio. The SDK does read, mask
  and write.
* Switch to 2MiB reserved for CircuitPython code. Up from 1MiB.
* Run USB interrupts during flash erase and write.
* Allow storage writes from CP if the USB drive is disabled.
* Get perf bench tests running on CircuitPython and increase timeouts
  so it works when instrumentation is active.
2023-03-14 12:30:58 -07:00
Dan Halbert b6a7613350
Merge pull request #7470 from microdev1/espnow
Add ESP-NOW Support
2023-03-10 12:21:56 -05:00
Scott Shawcroft a8b34bd067
Merge pull request #7549 from gamblor21/gif_displayio_support
Animated GIF support
2023-02-21 11:39:29 -08:00
Mark fa435468fa
Merge branch 'main' into gif_displayio_support 2023-02-13 18:30:51 -06:00
Dan Halbert d8231f1588 Implement safemode.py 2023-02-13 18:26:38 -05:00
gamblor21 0c95e6a08e Moving to gifio module 2023-02-12 11:17:34 -06:00
MicroDev 14c3b52b8d
Merge branch 'main' into espnow 2023-02-03 01:37:07 +05:30
Neradoc f0058774d0 add CIRCUITPY_SKIP_SAFE_MODE_WAIT to circuitpy_mpconfig.mk
use #if (also a CIRCUITPY_ULAB)
2023-01-29 00:56:16 +01:00
MicroDev cda5689263
move `esp32_camera` to `espcamera` 2023-01-27 22:05:43 +05:30
MicroDev 7330c638b9
minimal changes to make espnow work 2023-01-20 14:12:55 +05:30
Dan Halbert 03b43b7b3f complete rework for microcontroller.cpu.frequency and wifi.radio MAC addresses 2023-01-02 11:45:58 -05:00
Scott Shawcroft f8ac1d9261
Rework the coproc API
It is now a generic `memorymap` API and an ESP specific `espulp` module.

Fixes #7218. Fixes #3234. Fixes #7300.
2022-12-19 14:08:38 -05:00
Jeff Epler 3459fe322b
Withdraw the _environ module
This existed solely for testing, so expose it a different way during
the unix coverage build

Also turn off os.getenv support on samd21.
2022-12-08 15:33:10 -06:00
Jeff Epler ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
Jeff Epler f5c637dc10
Add adafruit_pixelmap.PixelMap
.. a fast helper for animations. It is similar to and inspired by the
PixelMap helper in Adafruit LED Animation library, but with an extremely
fast 'paste' method for setting a series of pixels. This is a common
operation for many animations, and can give a substantial speed improvement.

It's named `adafruit_pixelmap` so that we can package a compatible version
in pure Python for systems that can't fit it in C in flash, or for
Blinka.

This is a proof of concept and can make a very fast comet animation:
```python
import time
import adafruit_pixelbuf
import adafruti_pixelmap
import board
import neopixel
from supervisor import ticks_ms
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation import color

pixel_pin = board.GP0
pixel_num = 96

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB")

evens = adafruit_pixelmap.PixelMap(pixels, tuple(range(0, pixel_num, 2)))
odd_indices = tuple((i, i+2) for i in range(1, pixel_num, 4))
print(odd_indices)
odds = adafruit_pixelbuf.PixelMap(pixels, odd_indices)
assert len(odds) == len(odd_indices)


comet_length = 16

comet1 = [color.calculate_intensity(color.GREEN, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]
comet2 = [color.calculate_intensity(color.PURPLE, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]

pos1 = 0
pos2 = 96//4

while True:
    evens.paste(comet1, pos1, wrap=True, reverse=False, others=0)
    pos1 = (pos1 + 1) % len(evens)

    odds.paste(comet2, pos2, wrap=True, reverse=True, others=0)
    pos2 = (pos2 - 1) % len(odds)
    pixels.show()

    m = ticks_ms()
    if m % 2000 > 1000:
        time.sleep(.02)
```
2022-11-11 07:54:33 -06:00
microDev 5232e3f6c3
add coproc module 2022-10-20 09:09:44 +05:30
Dan Halbert 7e4b2a09eb
Merge pull request #7000 from MicroDev1/storage-extend
Add Storage Extension Support
2022-10-13 10:05:55 -04:00
Jeff Epler dcb650c513 pico w: add ssl module
Note: at this time, the ssl module on pico_w never verifies the server
certificate. This means it does not actually provide a higher security
level than regular socket / http protocols.
2022-10-05 13:12:43 -04:00
Dan Halbert ed87579a65 add missing native modules to support matrix 2022-10-04 19:22:18 -04:00
microDev 9fe7308b88
conditionally add storage extension 2022-10-04 17:26:28 +05:30
Dan Halbert db065a299f
Merge pull request #6933 from jepler/🥧🐮
Implement a useful subset of `wifi` and `socketpool` modules on 🥧🐮
2022-09-28 18:09:24 -04:00
Jeff Epler 346fff2e7c
cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00
Dan Halbert c567b43441 add CIRCUITPY_USB_IDENTIFICATION to turn off on smallest builds 2022-09-20 14:32:38 -04:00
Dan Halbert 6bb47038d5 Merge remote-tracking branch 'adafruit/main' into adcdma 2022-09-15 20:42:51 -04:00
Jeff Epler 56112e00a1 Give fontio its own enable
.. the default is intended to be the equivalent of the original,
implementing `DISPLAYIO && TERMINALIO`.

This is a possible alternative to #6889, if I understand the intent.
2022-09-11 08:09:14 -05:00
latkinso42 a1856ea3e9 Renaming module from adcbuffer to analogbufio 2022-09-05 12:11:49 -04:00
Lee Atkinson f5655dd48c Fixing Build errors/ DMA Xfer Rate 2022-08-21 11:44:40 -04:00
Lee Atkinson d3c3c9eac4 Tidy a few things 2022-08-18 19:10:16 -04:00
Lee Atkinson f91af513b7 Introduced odule adcbuffer / removed analogio/AnalogFastIn 2022-08-18 16:23:17 -04:00
Lee Atkinson c53c1c0927 Adding py/circuitpy_mpconfig.mk 2022-08-14 18:49:59 -04:00
Scott Shawcroft 554063a817
Merge branch 'main' into espressif-camera-2 2022-08-09 14:07:14 -07:00
Dan Halbert 84807cd6eb Change I2C terminology from "peripheral" to "target" 2022-08-09 13:13:19 -04:00
Jeff Epler 1a11ff864a
Merge remote-tracking branch 'origin/main' into espressif-camera-2 2022-08-05 21:08:12 -05:00
Scott Shawcroft 3a2bcbc5c7
Enable title bar on all builds
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to #2791
* Update the title bar after terminal is started. Fixes #6078

Fixes #6668
2022-08-04 16:33:10 -07:00
Jeff Epler 5db6db0128
add esp32-camera
This uses the esp32-camera code instead of our own homebrewed camera code.
In theory it supports esp32, esp32-s2 and esp32-s3, as long as they have
PSRAM.

This is very basic and doesn't support changing any camera parameters,
including switching resolution or pixelformat.

This is tested on the Kaluga (ESP32-S2) and ESP32-S3-Eye boards.

First, reserve some PSRAM by putting this line in `CIRCUITPY/_env`:
```
CIRCUITPY_RESERVED_PSRAM=524288
```
and hard-reset the board for it to take effect.

Now, the following script will take a very low-resolution jpeg file and print
it in the REPL in escape coded form:

```python
import board
import esp32_camera

c = esp32_camera.Camera(
    data_pins=board.CAMERA_DATA,
    external_clock_pin=board.CAMERA_XCLK,
    pixel_clock_pin=board.CAMERA_PCLK,
    vsync_pin=board.CAMERA_VSYNC,
    href_pin=board.CAMERA_HREF,
    pixel_format=esp32_camera.PixelFormat.JPEG,
    i2c=board.I2C(),
    external_clock_frequency=20_000_000)

m = c.take()
if m is not None:
    print(bytes(m))
```

Then on desktop open a python repl and run something like
```python
>>> with open("my.jpg", "wb") as f: f.write(<BIG PASTE FROM REPL>)
```
and open my.jpg in a viewer.
2022-08-04 15:11:50 -05:00
Scott Shawcroft ac460dd1e1
Merge branch 'main' into esp32 2022-07-13 15:30:53 -07:00
Scott Shawcroft 8093f8e555
Default gifio to camera setting 2022-07-12 14:12:25 -07:00
Dan Halbert d869b441f4 further ESP32 sdkconfig fixes; add CIRCUITPY_STATUS_BAR 2022-07-08 15:27:00 -04:00
Scott Shawcroft 07b2697ae3
WIP websocket to serial 2022-07-01 16:57:10 -07:00
Dan Halbert 8bb369cac5 refactor debug UART to console UART; get working on ESP32 2022-06-30 23:16:46 -04:00
Scott Shawcroft 1a3d2a5b5e
Shrink nrf52833 builds
Make them CIRCUITPY_FULL_BUILD = 0 and rework the boards to have
the same modules enabled (ish.)

Also make ZLIB require FULL_BUILD and disable advanced `micropython`
module APIs by default on all builds.
2022-06-13 15:36:15 -07:00
Scott Shawcroft 6446010753
Wi-Fi autoconnect and title bar status
This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD
in `/.env`. When both are defined, CircuitPython will attempt to
connect to the network even when user code isn't running. If the
user code attempts to a network with the same SSID, it will return
immediately. Connecting to another SSID will disconnect from the
auto-connected network. If the user code initiates the connection,
then it will be shutdown after user code exits. (Should match <8
behavior.)

This PR also reworks the default displayio terminal. It now supports
a title bar TileGrid in addition to the (newly renamed) scroll area.
The default title bar is the top row of the display and is positioned
to the right of the Blinka logo when it is enabled. The scroll area
is now below the Blinka logo.

The Wi-Fi auto-connect code now uses the title bar to show its
state including the IP address when connected. It does this through
the "standard" OSC control sequence `ESC ] 0 ; <s> ESC \` where <s>
is the title bar string. This is commonly supported by terminals
so it should work over USB and UART as well.

Related to #6174
2022-06-09 14:55:54 -07:00
Scott Shawcroft dc5565a5ce
Merge pull request #6436 from dhalbert/judicious-lto
LTO: Use -flto and -flto-partition only as needed
2022-05-27 10:31:06 -07:00