Commit Graph

620 Commits

Author SHA1 Message Date
ZodiusInfuser d0bbaddcb3 Board definitions for upcoming EInk board 2022-02-21 11:23:55 +00:00
Jeff Epler 729fcf749e
Fix doc markup 2022-02-15 16:03:52 -06:00
Jeff Epler a58bf235d8
raspberry: StateMachine: Add support for wrap=, wrap_target= 2022-02-13 16:38:53 -06:00
Scott Shawcroft 22928fec55
Explain read and write size to/from PIO FIFOs 2022-02-10 10:55:04 -08:00
Dan Halbert da035fe958
Merge pull request #5990 from sgauche/stm_spi_3wire
Add support for half-duplex SPI to CPy
2022-02-09 13:11:37 -05:00
Scott Gauche a8d8651873 Canonical C style for half_duplex = true/false 2022-02-08 23:13:22 -05:00
Scott Gauche 309f4fb2b9 add half_duplex false param to spi construct function call in some board files 2022-02-08 22:59:26 -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
root ce191327e8 RP2040 PDMIn frequency based on sample rate 2022-02-08 10:10:02 -06:00
Dan Halbert 1c17dc9348 ports/raspberrypi/common-hal/busio/SPI.c 2022-02-07 17:07:47 -05:00
Dan Halbert 566f8bed99
Merge pull request #5984 from DavePutz/issue_5967
Correcting order of sideset parameters in function call
2022-02-05 21:58:30 -05:00
root 8c10148b21 Correcting order of sideset parameters in function call 2022-02-05 16:15:12 -06:00
Jeff Epler 07e710b0a0
Merge remote-tracking branch 'origin/main' into floppy 2022-02-04 09:01:36 -06:00
Jeff Epler 6a7742ba88
Merge remote-tracking branch 'origin/main' into floppy 2022-02-04 09:00:32 -06:00
Jeff Epler 749bb99863
bump pico-sdk to 1.3.0 2022-02-02 17:15:33 -06:00
Dan Halbert a04cd6444b
Merge pull request #5966 from Neradoc/add-alias-stemma-i2c
Add alias board.STEMMA_I2C for all boards with qwiic/stemma/QT
2022-02-02 11:08:13 -05:00
Neradoc b2c8fd3938 add board.STEMMA_I2C alias to some boards 2022-02-02 01:18:46 +01:00
Jeff Epler bf57f3606a
rp2pio: Add pull up/down support for the "jmp pin"
This is needed so that the floppy flux reader can enable the pull up
on the index pin while using it as a pio jmp pin.

Also fixes a doc bug where the `jmp_pin` was omitted in one spot in the docs.
2022-02-01 10:19:17 -06:00
Dan Halbert cc410ad6a3 common-hal I2C combined write_read 2022-01-31 22:03:30 -05:00
Dan Halbert 5933c04499
Merge pull request #5899 from tannewt/rp2040_winbond
Add winbond to Feather RP2040
2022-01-21 16:44:52 -05:00
Scott Shawcroft c598ede84e
Add winbond to Feather RP2040 2022-01-21 10:34:38 -08:00
microDev 67293c265c
Merge branch 'main' into board-bus 2022-01-21 10:08:39 +05:30
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
Jeff Epler 8e895e1986
Add floppyio for rp2040
Tested on RP2040 Feather with a 3.5" Prodigy diskette, the whole
surface reads 100% across 3+ trials.
2022-01-17 16:34:47 -06:00
Neradoc 784a5edc4b
Define default SPI pins on kb2040
Fixes #5875
2022-01-17 06:52:08 +01:00
Jeff Epler db5f99c63e
Add a function to get low level register access
The port is free to return NULL for any/all of these, and the caller has
to check.

This will be used in the floppy code, because aside from getting the
registers, it looks like all is independent of MCU.
2022-01-13 15:29:03 -06:00
Scott Shawcroft ae58858036
Merge pull request #5820 from CharString/waveshare_rp2040_zero
Waveshare RP2040-Zero board definition
2022-01-12 10:56:55 -08:00
Chris Wesseling 8226fb8e0b Bring pins in line with board documentation.
This brings the pins in line with the documented [pinouts]. The only
"special" pins:

 - GP0, GP1 are mentioned as the default UART, so we init them as
   such and give them the TX and RX alternative names.
 - GP16 is connected to the onboard neopixel DIN line and we assign it
   the NEOPIXEL name. (Power of the neopixel is connected to the 3.3V
   rail, not a pin. See [schematic].)
 - GP26, GP27, GP28, GP29 have unambiguous ADC designations in the
   [pinouts], so we assign the `A` analogue names as the Pico board
   definition does.

  [pinouts]: https://www.waveshare.com/wiki/RP2040-Zero#Pinouts
  [schematic]: https://www.waveshare.com/w/upload/4/4c/RP2040_Zero.pdf
2022-01-12 12:27:54 +01:00
arturo182 9b825869c5
raspberrypi : Check UART before claiming pins, claim it after
Co-authored-by: Scott Shawcroft <scott@adafruit.com>
2022-01-11 22:02:47 +01:00
arturo182 2251d0f4b0
raspberrypi: Claim UART after checking pins
If, for some reason, you mix up TX and RX when calling `busio.UART` (who would do that ;) ), you get `Invalid pins`. When you go to try again, you'll get `All UART peripherals are in use` because the interface was claimed as busy before pins are verified. This should fix that issue.
2022-01-11 15:13:36 +01:00
Pontus Oldberg e23b272595 Added missing LDO control pin (SARA_PWR) 2022-01-08 16:39:48 +01:00
Chris Wesseling 783106545c Remove LED pin.
There's just the NEOPIXEL on this board, no other LED.
2022-01-07 23:25:50 +01:00
Chris Wesseling d8f18d36a4 Initial Waveshare RP2040-Zero board definition
`board.NEOPIXEL` works. Once you have an LED cycling colours, you're 99%
done. :-)
2022-01-07 23:20:10 +01:00
Dan Halbert 9d2a32d07e countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
Dan Halbert 8aafc734a4
Merge pull request #5789 from adafruit/7.1.x
Merge latest changes from 7.1.x
2021-12-28 18:12:29 -05:00
Scott Shawcroft 08d09ac493
Merge pull request #5613 from jepler/issue5418
clear out interrupt when freeing the timer
2021-12-28 10:57:58 -08:00
Dan Halbert 3bc48802b1
Merge pull request #5783 from jepler/longint-config
Centralize LONGINT_IMPL handling
2021-12-28 12:55:26 -05:00
Jeff Epler 1986d2ee71
clear out interrupt flags when disabling timer too 2021-12-27 16:42:41 -06:00
Jeff Epler f5fa4ae237
Merge pull request #5764 from dannystaple/patch-1
Fix RST formatting for readthedocs
2021-12-27 09:41:46 -07:00
Jeff Epler 1d13c4ccd1
Centralize LONGINT_IMPL handling
This closes #5782
2021-12-27 10:21:47 -06:00
Jeff Epler c1236fb4d6
Merge pull request #5766 from tannewt/rp2040_sideset_enable
Add sideset_enable support to PIO
2021-12-22 20:17:33 -07:00
Scott Shawcroft 827ad327a5
Only ignore warnings if in gcc >= 11 2021-12-22 18:21:18 -08:00
Scott Shawcroft 674c845fb6
Merge pull request #5760 from jepler/rename_under_typing
circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing
2021-12-22 14:05:04 -08:00
Scott Shawcroft 3e13d4f5b5
Add sideset_enable support to PIO
This allows for UART TX via PIO
2021-12-22 12:00:19 -08:00
Jeff Epler 166793f843 circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing
Installing stubs for a module named `_typing` seems like a dubious
decision.
2021-12-22 11:14:21 -06:00
Danny Staple 174a2cbf25
Fix RST formatting for readthedocs
And also a typo/grammar thing.
2021-12-22 17:03:58 +00:00
Scott Shawcroft 7c2e7bfeaa
Add alternative clock pin name to match silkscreen 2021-12-15 14:41:42 -08:00
Pierre Constantineau f3ec6ee760 tested hardware and cleaned-up commented out pin defs 2021-12-14 21:46:04 -06:00
Pierre Constantineau 162e253949 finalizing pin assignments prior to final hardware test 2021-12-14 09:45:39 -06:00
Pierre Constantineau 9119a32a5d fixed row0 and added encoder pins 2021-12-13 13:31:00 -06:00
microDev 5939c11406
add secondary i2c singleton on adafruit_qtpy_rp2040 2021-12-11 23:14:22 +05:30
Pierre Constantineau 86ddecfd4f merge main and resolve conflict 2021-12-10 16:57:50 -06:00
Pierre Constantineau dac71e684d moved aliased boards down to actual builds 2021-12-10 16:34:06 -06:00
Pierre Constantineau a043f65352 adding Pykey family of boards 2021-12-09 23:25:48 -06:00
Michael Himing d72311f76a Update xiao rp2040 pins 2021-12-10 09:39:31 +11:00
Scott Shawcroft b12d2063d0
Merge remote-tracking branch 'adafruit/7.1.x' into merge_7.1 2021-12-08 10:50:22 -08:00
Scott Shawcroft 3c8a05ebbf
Merge pull request #5673 from CytronTechnologies/add-maker-nano-rp2040-7.1.x
Add new board Maker Nano RP2040 to branch 7.1.x.
2021-12-08 10:33:57 -08:00
ZodiusInfuser 3ea1619816
Merge branch 'adafruit:main' into tiny2mb 2021-12-08 16:51:47 +00:00
ZodiusInfuser 201fae8342
Added final USB PID 2021-12-08 16:48:32 +00:00
Scott Shawcroft 121b22b0c5
Merge pull request #5666 from skerr92/add-odt-castaway2040
Add odt castaway2040
2021-12-06 14:44:33 -08:00
Scott Shawcroft 309faee334
Merge pull request #5519 from jpconstantineau/seeduino-xiao-rp2040
Add New Board - Seeeduino XIAO RP2040
2021-12-06 13:08:22 -08:00
Kong Wai Weng ee1987d34b Added Maker Nano RP2040 to branch 7.1.x. 2021-12-06 23:12:53 +08:00
Kong Wai Weng 7ee825370e Use 4x space instead of tab. 2021-12-06 17:28:45 +08:00
Kong Wai Weng bde65d0f28 Added Maker Nano RP2040 2021-12-06 17:26:00 +08:00
Dan Halbert 5fe4c3bec9 fix mistaken use of PWM channel for slice 2021-12-05 21:16:46 -05:00
Seth Kerr e352048db9 Add ODT Cast-Away RP2040 2021-12-05 14:49:48 -07:00
Dan Halbert 4de6c7cf6f
Merge pull request #5656 from dhalbert/rp2040-i2c-zero-write-bitbang-timeout
Use a longer clock stretching timeout for RP2040 zero-byte I2C writes
2021-12-04 19:40:48 -05:00
foamyguy fa37ee6484 limit disable interrupts to flash calls 2021-12-04 14:14:23 -06:00
foamyguy 5e7c1328b0 disable interrupts inside of write_page and erase_write_sector 2021-12-04 12:21:51 -06:00
foamyguy f49271b472 disable interrupts inside of ports raspberrypi common hal 2021-12-04 11:34:49 -06:00
Dan Halbert 80abd2d645 Use a longer clock stretching timeout for RP2040 zero-byte I2C writes 2021-12-03 18:19:13 -05:00
Kattni Rembor 3b6011d551 Update pin order to match silk. 2021-12-03 11:40:40 -05:00
ZodiusInfuser 0e56c5aa8a Added definitions for 2MB Tiny2040 2021-12-02 16:45:43 +00:00
Jeff Epler b1a3ccb36c
clear out interrupt when freeing the timer
Closes #5418
2021-11-23 13:03:01 -06:00
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
Pierre Constantineau ce7cd22116 updated pins.c to enable support for PyKey87 2021-11-14 21:56:18 -06:00
Pierre Constantineau 2c3557d4af
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-14 21:44:10 -06:00
Jeff Epler 340d6b9213
more missing-prototypes fixes 2021-11-10 21:00:17 -06:00
Jeff Epler 017b52c455
further raspberrypi fixes 2021-11-10 12:11:06 -06:00
Jeff Epler 621953c960
Additional missing-prototypes fixes
I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
2021-11-10 10:55:53 -06:00
lady ada 02573676e7 add KB2040 and fix Trinkey QT2040 pid 2021-11-05 12:43:44 -04:00
Pierre Constantineau f3eb9ea5e1
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-03 14:07:45 -06:00
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
Pierre Constantineau a75473af96 update to EXTERNAL_FLASH_DEVICES to Puya P25Q16H 2021-11-02 20:52:58 -06:00
Kong Wai Weng 36459c8a5a Fixed whitespace issues. 2021-11-01 16:50:46 +08:00
Kong Wai Weng e0332c1e49 Using 4x spaces instead of a tab. 2021-11-01 16:47:02 +08:00
Kong Wai Weng b64ec36418 Using GP0 as default LED pin. 2021-11-01 16:43:13 +08:00
Kong Wai Weng 0034472778 Reversal of PR #4981. GPIO25 on Maker Pi RP2040 is not connected to anything. 2021-11-01 16:26:40 +08:00
Pierre Constantineau ceeec6f1a0 updated USB PID to match one received from MengDu from Seeed 2021-10-27 08:10:47 -06:00
Pierre Constantineau c9f834f3a1 added LEDs 2021-10-26 21:55:38 -06:00
Pierre Constantineau 0f9e3eed01 initial commit for Seeed Review 2021-10-26 21:48:11 -06:00
Scott Shawcroft de45382599
Merge pull request #5504 from solderparty/rp2040_stamp
Add the Solder Party RP2040 Stamp board
2021-10-25 14:08:04 -07:00
Dan Halbert 644272ee8b
Merge pull request #5509 from DavePutz/issue_5469
Added reset of pulsein buffer pointer
2021-10-25 16:35:24 -04:00
root d2febfaf20 Added reset of pulsein buffer pointer 2021-10-24 20:46:18 -05:00
Pierre Constantineau 3425bcc910 added startup delay multiplier 2021-10-24 14:20:07 -06:00
arturo182 915275e5fd Add the Solder Party RP2040 Stamp board 2021-10-24 17:13:41 +02:00
Pierre Constantineau 40326ab3f9 fix pre-commit 2021-10-22 18:35:38 -06:00
Pierre Constantineau d6e9e9c3c9 added neopixel to mpconfigboard.h 2021-10-22 18:32:21 -06:00
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