Commit Graph

62 Commits

Author SHA1 Message Date
Scott Shawcroft c9b494b79f
Merge pull request #6006 from DavePutz/issue_5980
Correct ping timeout for espressif
2022-02-10 10:18:14 -08:00
root 6563f71545 Correct ping timeout for espressif 2022-02-09 15:58:25 -06:00
Scott Gauche a8d8651873 Canonical C style for half_duplex = true/false 2022-02-08 23:13:22 -05:00
Scott Gauche 89ad767b8f add half_duplex to spi constructs in other ports but raise not implemented errors 2022-02-08 22:25:23 -05:00
Scott Shawcroft 2964e966b1
Merge pull request #5958 from dhalbert/i2c-common-hal-write-read
I2c common hal write read
2022-02-01 11:08:50 -08:00
Dan Halbert cc410ad6a3 common-hal I2C combined write_read 2022-01-31 22:03:30 -05:00
Scott Shawcroft db7e72b43d
Fix BLE scanning forever on ESP32-S3 2022-01-31 15:45:43 -08:00
Dan Halbert 83e6e6690a wip; works on espressif 2022-01-29 22:44:27 -05:00
Scott Shawcroft 019aecaa20
Support BLE advertising on ESP
Services and characteristics still won't work.

Progress on #5926
2022-01-27 17:40:37 -08:00
Dan Halbert fff68c9f86
Merge pull request #5927 from tannewt/esp_ble_scan
Add BLE scanning for S3 and C3.
2022-01-27 13:05:24 -05:00
Scott Shawcroft d9966c1724
Add TODOs and -Os for RISC-V 2022-01-26 17:07:20 -08:00
microDev fa2d156d14
return default cpu frequency on espressif 2022-01-26 12:32:48 +05:30
Scott Shawcroft b2e1dbd2df
Implement name and address get/set 2022-01-25 19:17:26 -08:00
Scott Shawcroft 5a6f456dbb
Add BLE scanning for S3 and C3.
Everything else should raise NotImplementedError.

First step in #5926
2022-01-25 16:28:46 -08:00
root 367a1d53c0 Fixes for pulsein on ESP32S3 2022-01-23 13:14:34 -06:00
Scott Shawcroft 35175715f9
Check target defined 2022-01-20 14:11:33 -08:00
Scott Shawcroft d99847b410
Refactor pin reset on ESP
This makes it easier to blanket never reset flash and USB pins. It
also allows us to set a custom state after reset. The first case
is for the double tap reset that needs to be pulled low.

Fixes #5893
2022-01-20 12:40:41 -08:00
Scott Shawcroft 13db65566d
ESP NeoPixel fixes
This tweaks the RMT timing to better match the 1/3 and 2/3 of 800khz
guideline for timing. It also ensures a delay of 300 microseconds
with the line low before reset.

Pin reset is now changed to the IDF default which pulls the pin up
rather than CircuitPython's old behavior of floating the pin.

Fixes #5679
2022-01-19 16:29:07 -08:00
Dan Halbert 11848b1826 use GPIO_MODE_ instead of GPIO_MODE_DEF 2022-01-15 23:05:33 -05:00
Dan Halbert c70c8a9390 fix espressif open-drain 2022-01-15 19:54:31 -05:00
Dan Halbert d166834e09
Merge pull request #5803 from dhalbert/countio-enhancements
countio: add selectable rise and fall detection, pulls
2021-12-31 23:45:59 -05:00
Dan Halbert 9d2a32d07e countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
microDev 4daa7b5180
update espressif port
- enable rgbmatrix for all esp soc
- bump idf to latest commit on v4.4 branch
2021-12-30 19:23:41 +05:30
Jeff Epler 900ec91fa6
Merge pull request #5761 from adafruit/7.1.x
Bring 7.1.x changes into main - cascadetoml undo + alarm fixes
2021-12-23 06:30:05 -07:00
Dan Halbert 3bb9a4439d Fix recording of wake_alarm 2021-12-21 21:48:36 -05:00
Tim Hawes 54e87d3660
Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-12-14 20:03:44 +00:00
Tim Hawes c325633f8e Add methods to ssl.SSLContext for handling self-signed certs 2021-12-14 01:00:50 +00:00
Tim Hawes ef414bf1bd Handle server_hostname argument in espressif SSLContext.wrap_socket 2021-12-14 01:00:50 +00:00
Tim Hawes a3c8760d41 Fix to error checking in espressif SSLSocket 2021-12-13 17:55:43 +00:00
Jeff Epler b722a2bca1
espressif: pwmout: get rid of not_first_reset special case 2021-12-06 10:08:44 -06:00
Jeff Epler fae6d47a45
espressif: keep never_reset_pins marked as in use 2021-12-06 10:08:44 -06:00
Jeff Epler 1a99ce5eb3 espressif: busio.SPI: Use SPI_DMA_CH_AUTO
All 3 micros we care about (S2, S3, C3) state in the documentation
that DMA channel can be specified as SPI_DMA_CH_AUTO.

Specifying a specific DMA channel explicitly doesn't _ever_ work on
ESP32-S3, so no SPI bus could be used.

Testing performed: On the ESP32-S3-DevKitC, used neopixel_spi to
turn the onboard neopixel red, green, and blue
2021-12-04 09:12:38 -06:00
microDev 554a62955b
Merge branch 'main' into espressif 2021-11-26 22:40:22 +05:30
microDev 7ba5513f9a
update espressif port
- update esp-idf to v4.4
- add esp32s3 support
- add analogio on esp32c3
- disable rgbmatrix on all espressif soc

Co-authored-by: Scott Shawcroft <scott@adafruit.com>
Co-authored-by: Seon Rozenblum <seon@unexpectedmaker.com>
2021-11-24 18:01:34 +05:30
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
anecdata 193e936807 like #5571, but for AP 2021-11-16 12:21:50 -06:00
anecdata 31d45a3f32 fix old bug that was masking new bug 2021-11-12 16:27:13 -06:00
anecdata e4f06f69cd maybe fewer bytes 2021-11-11 23:23:52 -06:00
anecdata bb8e9ef483 tweak exception messages (re-tested) 2021-11-11 21:54:41 -06:00
anecdata 18f2019300 Set Station MAC address & validate connect SSID len 2021-11-11 17:04:35 -06:00
Scott Shawcroft c1177662cd
Merge pull request #5537 from microDev1/monitor-mode
Add Monitor Mode
2021-11-11 10:10:39 -08:00
microDev a62675a81a
fix wifi reset and monitor deinit routine 2021-11-10 23:38:44 +05:30
Jeff Epler c9475adb00
Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
microDev b435e7b56a
update wifi monitor
- rename loss method to lost
- add method to get queued packet count

Co-authored-by: anecdata <16617689+anecdata@users.noreply.github.com>
2021-11-04 16:21:18 +05:30
Jeff Epler a8614a61dc ParallelImageCapture: Add continuous capture on espressif
By having a pair of buffers, the capture hardware can fill one buffer while
Python code (including displayio, etc) operates on the other buffer.  This
increases the responsiveness of camera-using code.

On the Kaluga it makes the following improvements:
 * 320x240 viewfinder at 30fps instead of 15fps using directio
 * 240x240 animated gif capture at 10fps instead of 7.5fps

As discussed at length on Discord, the "usual end user" code will look like
this:

    camera = ...

    with camera.continuous_capture(buffer1, buffer2) as capture:
        for frame in capture:
            # Do something with frame

However, rather than presenting a context manager, the core code consists of
three new functions to start & stop continuous capture, and to get the next
frame.  The reason is twofold.  First, it's simply easier to implement the
context manager object in pure Python.  Second, for more advanced usage, the
context manager may be too limiting, and it's easier to iterate on the right
design in Python code.  In particular, I noticed that adapting the
JPEG-capturing programs to use continuous capture mode needed a change in
program structure.

The camera app was structured as
```python
while True:
    if shutter button was just pressed:
        capture a jpeg frame
    else:
        update the viewfinder
```

However, "capture a jpeg frame" needs to (A) switch the camera settings and (B)
capture into a different, larger buffer then (C) return to the earlier
settings. This can't be done during continuous capture mode. So just
restructuring it as follows isn't going to work:

```python
with camera.continuous_capture(buffer1, buffer2) as capture:
    for frame in capture:
        if shutter button was just pressed:
            capture a jpeg frame, without disturbing continuous capture mode
        else:
            update the viewfinder
```

The continuous mode is only implemented in the espressif port; others
will throw an exception if the associated methods are invoked.  It's not
impossible to implement there, just not a priority, since these micros don't
have enough RAM for two framebuffer copies at any resonable sizes.

The capture code, including single-shot capture, now take mp_obj_t in the
common-hal layer, instead of a buffer & length.  This was done for the
continuous capture mode because it has to identify & return to the user the
proper Python object representing the original buffer.  In the Espressif port,
it was convenient to implement single capture in terms of a multi-capture,
which is why I changed the singleshot routine's signature too.
2021-11-03 11:02:46 -05:00
microDev 27b137f931
Merge branch 'main' into monitor-mode 2021-11-02 13:56:56 +05:30
microDev 4e207853f0
rearrange hostname 2021-11-02 12:33:11 +05:30
microDev 95172cf3ce
add monitor class
Co-authored-by: anecdata <16617689+anecdata@users.noreply.github.com>
2021-11-02 12:32:09 +05:30
Jeff Epler 9eebb3dbab rotaryio: Add the ability to set the divisor
At present, Adafruit's rotary encoders all move 1 quadrature cycle per
detent, so we originally hard-coded division-by-4.  However, other
encoders exist, including ones without detents, ones with 2 detents per
cycle, and others with 4 detents per cycle.

The new `divisor` property and constructor argument allows selecting
a divisor of 1, 2, or 4; with the default of 4 giving backward
compatibility.

The property is not supported (yet?) on espressif MCUs; it throws an
error if a value other than 4 is set.
2021-10-16 09:43:45 -05:00
Dan Halbert 23d2c96476
Merge pull request #5466 from jepler/merge-1.17
Merge 1.17
2021-10-15 23:34:31 -04:00