Commit Graph

370 Commits

Author SHA1 Message Date
root 91739de71a Increased max pulse to 65535 us 2021-04-26 18:52:15 -05:00
Scott Shawcroft 76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
root 5bd1da21a2 Increased possible pulsein length to 32 ms. 2021-04-25 21:38:57 -05:00
Jeff Epler 92919c25c2
Merge pull request #4666 from DavePutz/issue_4660
Reset buffer index in PulseIn clear
2021-04-25 20:33:58 -05:00
root d1861a6b9c Reset buffer index in PulseIn clear 2021-04-25 14:24:21 -05:00
Limor "Ladyada" Fried f7f6a42f3d
Merge pull request #4663 from zapwizard/patch-1
Update pins.c
2021-04-25 15:09:13 -04:00
zapwizard 889da596ff
Update pins.c
Both D0 and D1 were assigned to pin_GPIO7, fixed D0 to pin_GPIO6, which also matches the comment.
2021-04-25 13:10:52 -05:00
gamblor21 30f31639d3 Added statemachine deinit 2021-04-25 11:58:22 -05:00
Dan Halbert 9d1fcc3b14 merge from main 2021-04-25 10:27:52 -04:00
Dan Halbert 80f05c76a8
Merge pull request #4654 from dhalbert/6.2.x-merge-1
Port #4645 to main
2021-04-24 10:29:52 -04:00
Scott Shawcroft 80e8b4ac14
Merge pull request #4635 from jepler/pcc
WIP: Implement 'ParallelImageCapture' for samd51
2021-04-23 13:31:53 -07:00
Dan Halbert 454e78f41f merge #4645 from 6.2.x to main 2021-04-23 13:33:58 -04:00
Jeff Epler f838ff9528 raspberrypi: Remove debug prints 2021-04-23 09:44:01 -05:00
Jeff Epler 10fee3e673 raspberrypi: Increase PIO clock speed in ParallelImageCapture
.. this allows DIV_4 and DIV_2 resolutions to work without being
jumbled.
2021-04-22 12:14:44 -05:00
Jeff Epler 2def016fd0 raspberrypi: Use 32-bit elements in FIFO
.. these do come in the right
2021-04-22 12:14:03 -05:00
Jeff Epler 7fb751808f raspberrypi: Implement ParallelImageCapture using PIO
.. based on code from Phil B.
2021-04-22 12:02:51 -05:00
Dan Halbert 64e0958916 wip: descriptor building 2021-04-21 23:25:36 -04:00
Dan Halbert b3ffb3ab1f Return bytes written from RP2040 UART.write() 2021-04-21 18:38:35 -04:00
Limor "Ladyada" Fried 17e419f129
Merge pull request #4633 from ZodiusInfuser/main
Tweaked Pimoroni board names
2021-04-19 15:16:37 -04:00
ZodiusInfuser efdbc6be08 Tweaked board name 2021-04-19 10:38:07 +01:00
Limor "Ladyada" Fried b6fa90d0b5
Merge pull request #4625 from stonehippo/sparkfun_micromod_atp_rp2040
Added Sparkfun MicroMod RP2040
2021-04-18 21:14:47 -04:00
George White 5bd2e97865
Fix pin definitions
I missed a few pin definitions. Fixed those.
2021-04-17 18:43:49 -04:00
George White 493127f4bc pre-commit trailing space fixes 2021-04-17 17:43:13 -04:00
George White e0bb7385a1
Added Sparkfun MicroMod RP2040
Added board definition for the Sparkfun MicroMod RP2040.

Mostly followed the format for pins from the MicroMod nRF52840 board
definition, as MicroMod tries to standardize pins across
microcontrollers.
2021-04-17 10:56:04 -04:00
Dan Halbert b2160bdddd
Add VBUS_SENSE (GP24) to board
Prompted by https://forums.adafruit.com/viewtopic.php?f=60&t=178237.
Also add some whitespace to make pin aliases stand out, and add GP23 as an alias for `SMPS_MODE`.
2021-04-17 08:51:20 -04:00
ZodiusInfuser efa9cfa5ec Tweaked board name 2021-04-16 18:02:10 +01:00
Dan Halbert f55d684057
Merge pull request #4612 from ZodiusInfuser/main
Added definitions for Pimoroni RP2040-based boards
2021-04-15 19:20:24 -04:00
ZodiusInfuser 1c700a82c9 Removed trailing whitespaces 2021-04-15 12:01:47 +01:00
ZodiusInfuser f69bf8beb9 Removed whitespaces 2021-04-15 11:57:27 +01:00
ZodiusInfuser d67ccb625c Added correct USB PIDs 2021-04-15 11:41:46 +01:00
ZodiusInfuser e4456bd756 Added definitions for PicoLipo boards 2021-04-14 23:09:10 +01:00
Scott Shawcroft 3978b50b8d
Merge pull request #4489 from gamblor21/audiomixer_rp2040
Add non M4 audiomixer support
2021-04-14 12:19:17 -07:00
Dan Halbert 11b9a5e605
Merge pull request #4577 from dglaude/patch-1
Respect product name: space between QT and Py
2021-04-09 13:10:19 -04:00
Dan Halbert 1b60c9d033
Merge pull request #4580 from jepler/incrementalencoder-refactor
IncrementalEncoder: factor out the quadrature state machine
2021-04-09 13:10:02 -04:00
Dan Halbert 61e33a5619 fix nrf ISR; make direction consistent across ports; save code size 2021-04-09 11:07:47 -04:00
Dan Halbert fdc5bb41f4
D3 pin should be GPIO26 2021-04-08 19:11:27 -04:00
Jeff Epler 3ce0b512f8 rasberrypi: IncrementalEncoder: factor out state machine 2021-04-08 16:25:47 -05:00
David Glaude 5d6bef569d
Respect product name: space between QT and Py
https://www.adafruit.com/product/4900 say "Adafruit QT Py RP2040"

This is also matching other "QT Py" product.
2021-04-08 21:50:16 +02:00
Scott Shawcroft 6097afdaa5
Merge pull request #4559 from jepler/rp2-rotary-encoder-fixes
raspberrypi: Several rotary encoder fixes
2021-04-06 10:00:26 -07:00
Jeff Epler 1a2ce27b73 raspberrypi: Drop support for auto-reversing swapped encoder 2021-04-06 09:22:59 -05:00
Scott Shawcroft 71eabe814c
Update StateMachine.c 2021-04-05 16:17:08 -07:00
Jeff Epler fc86475de5 IncrementalEncoder: support swapped pins
Closes: #4422
2021-04-04 13:49:50 -05:00
Jeff Epler 93d6ceedd9 IncrementalEncoder: Disconnect interrupt handler during deinit.
Closes: #4557
2021-04-04 13:49:41 -05:00
Jeff Epler bcd90dd927 IncrementalEncoder: There are no out pins.
Closes #4556
2021-04-04 13:49:21 -05:00
Jeff Epler cce8b2be07 raspberypi: Allow mpconfigboard to override additional items
This allows more options to be overridden to 0 in an mpconfigboard.mk.

Improved:
 * FRAMEBUFFERIO, FULL_BUILD, BITOPS, PWMIO, RGBMATRIX, OTARYIO, PULSEIO, WATCHDOG

Still problematic (pull requests welcome):
 * RP2PIO & NEOPIXEL_WRITE, possibly only if a status neopixel is defined
 * BITBANGIO, possibly only if BUSIO is enabled
 * RTC

Incidentally, with RP2PIO & NEOPIXEL_WRITE, BITBANGIO, and RTC re-enabled I get
```
323956 bytes used, 720524 bytes free in flash firmware space out of 1044480 bytes (1020.0kB).
12072 bytes used, 250072 bytes free in ram for stack and heap out of 262144 bytes (256.0kB).
```

Closes #4515
2021-03-31 09:40:48 -05:00
Dan Halbert 8e0834d74c Calculate RP2040 SDA hold time 2021-03-29 14:40:13 -04:00
Dan Halbert 03340a3fcd Incorporate https://github.com/adafruit/pico-sdk/pull/2 2021-03-26 18:55:45 -04:00
Dan Halbert 155b61f027
Merge pull request #4378 from Gadgetoid/patch-remove-rp2040-i2c-bitbang
RP2040: Remove short-write bitbang from I2C
2021-03-25 21:01:02 -04:00
gamblor21 0b212e2243 Add non M4 audiomixer support 2021-03-25 17:30:40 -05:00
Scott Shawcroft f79d60b205
Use GCC @file to shorten linker command length
This hopefully fixes linking on Windows with cmd.exe
2021-03-24 15:03:33 -07:00
Scott Shawcroft 36edc4bb89
Improve Winbond naming and correct board settings 2021-03-23 09:06:48 -07:00
Scott Shawcroft 7867632a81
Merge remote-tracking branch 'adafruit/main' into rp2040_flash 2021-03-22 15:29:43 -07:00
Scott Shawcroft f200e6a21e
Fix doc build and address feedback 2021-03-22 15:24:27 -07:00
lady ada 36ae69ab6f qtpy is more of a button than a switch! add itsybitsy rev C files 2021-03-21 18:44:32 -04:00
lady ada ebd6011633 add USBBOOT switch, move RX pin, re-enable UART (tested) 2021-03-21 14:58:18 -04:00
Scott Shawcroft 4aea7f8f52
Add requirements-dev.txt for python deps 2021-03-19 15:22:23 -07:00
Scott Shawcroft 5d2b60cbf6
Redo RP2040 flash settings
This switches stage2 to C and uses Jinja to change the C code based
on flash settings from https://github.com/adafruit/nvm.toml. It
produces the fastest settings for the given set of external flashes.
Flash size is no longer hard coded so switching flashes with similar
capabilities but different sizes should *just work*.

This PR also places "ITCM" code in RAM to save the XIP cache for
code execution. Further optimization is possible. A blink code.py
still requires a number of flash fetches every blink.

Fixes #4041
2021-03-18 16:55:42 -07:00
Scott Shawcroft 11e510a06a
Merge pull request #4419 from spe2/main
Add board definition for Sparkfun Pro Micro RP2040
2021-03-17 18:17:24 -07:00
Jeff Epler 719e8710f2
Merge pull request #4411 from mintakka/thingplus-rp2040
added board configuration for Sparkfun ThingPlus RP2040
2021-03-17 16:23:55 -05:00
Phil Howard b8d4f9655f RP2040: Only bitbang 0-byte writes
The I2C.c for RP2040 included a special case for writes <=2 bytes to match the MicroPython implementation,
however RP2040 does support 1 and 2 byte reads, with only 0 bytes being the exception.

Signed-off-by: Philip Howard <phil@pimoroni.com>
2021-03-17 16:25:54 +00:00
mintakka 337727ba0c renamed board folder to match board name in boards.yml 2021-03-16 21:10:10 -04:00
spe2 dcd9a8ab91
Update ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/mpconfigboard.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-16 10:54:20 -07:00
spe2 5bc132a209
Update ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/mpconfigboard.h
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-16 10:54:15 -07:00
mintakka b5333f2bdf
Update ports/raspberrypi/boards/sparkfun_thingplus_rp2040/mpconfigboard.h
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-16 13:47:33 -04:00
mintakka 3d15877639
Update ports/raspberrypi/boards/sparkfun_thingplus_rp2040/mpconfigboard.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-16 13:47:21 -04:00
gamblor21 3b01a65743 Fixed formatting 2021-03-16 08:14:49 -05:00
spe2 9de40f56f3
Add board config files 2021-03-15 22:08:19 -06:00
spe2 c9427780b3
Create pins.c 2021-03-15 22:07:24 -06:00
mintakka 49baa94446 added sparkfun_thingplus_rp2040 to .github/workflows/boards.yml and renamed board folder to include chip 2021-03-15 23:00:24 -04:00
mintakka 288415f867
Update ports/raspberrypi/boards/sparkfun_thingplus/mpconfigboard.h
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-15 21:07:31 -04:00
mintakka 30a74b3d92
Update ports/raspberrypi/boards/sparkfun_thingplus/mpconfigboard.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-03-15 21:07:24 -04:00
Mark e326d7ca80
Merge branch 'main' into rp_dp_parallel 2021-03-15 20:00:13 -05:00
Scott Shawcroft f7a988b9b3
Merge pull request #4405 from DavePutz/issue_4237
Issue 4237 - Changed initial setting in program_struct
2021-03-15 17:51:36 -07:00
mintakka 0567d06936 added board configuration for Sparkfun ThingPlus RP2040 2021-03-15 10:27:21 -04:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
root 9a83501982 Fixed initial settings for program_struct to allow more than 1 program per pio 2021-03-14 15:05:56 -05:00
Dan Halbert 8e425a9354
Merge pull request #4393 from tannewt/raise_default_flash_speed
Speed up a bit more
2021-03-13 12:50:29 -05:00
Scott Shawcroft 1b106de4e0
Merge pull request #4262 from DavePutz/issue_4111
Issue 4111 - Implement pulseio(pulsein) for RP2040
2021-03-12 16:48:57 -08:00
Scott Shawcroft 45487f14a0
Speed up a bit more 2021-03-12 16:00:16 -08:00
DavePutz 96ce43e6d6
Added the correct files 2021-03-12 16:18:33 -06:00
DavePutz 6628f49852
Use StateMachine.c interrupt setup and simplify SM program 2021-03-12 16:06:57 -06:00
Scott Shawcroft aec03a409f
Lower default flash speed.
/ 6 leads to ~40mhz. 2M and 4M have a max 0x03 read speed of 60mhz.
If the divisor is / 4 then the speed is just over 60mhz.

Fixes #4377
2021-03-12 11:06:39 -08:00
gamblor21 307d2a99fe Fix after rebase 2021-03-11 20:06:50 -06:00
gamblor21 5689307798 Changed frequency to match PIO having 2 instructions 2021-03-11 19:32:44 -06:00
gamblor21 b02b1e9979 Set frequency default 60Mhz 2021-03-11 19:32:44 -06:00
gamblor21 1658fe04f9 Set the statemachine to never reset so REPL works 2021-03-11 19:32:44 -06:00
gamblor21 c384ebe5c0 Updated to initalize pindirs 2021-03-11 19:32:44 -06:00
gamblor21 56a219911f Add frequency support to parallel bus 2021-03-11 19:32:43 -06:00
gamblor21 b080d6207b Removing debug info and clean up 2021-03-11 19:32:43 -06:00
gamblor21 c6aaab6f64 Initial commit 2021-03-11 19:32:43 -06:00
Jeff Epler 24f4d981bd
Merge pull request #4380 from jepler/rp2040-audiomp3
raspberrypi: Enable mp3 playback
2021-03-11 12:53:46 -06:00
Jeff Epler 16bfe3b41c raspberrypi: RTC: Ensure a time is set
Until a time is set, the RTC is not running, and rtc_get_datetime()
returns false without assigning to the out-parameter.

In CircuitPython, this would manifest as arbitrary values being returned,
since uninitialized storage on the stack was being converted into a timestamp.
2021-03-10 20:20:40 -06:00
Jeff Epler c95def0b32 raspberrypi: Enable mp3 playback
The rp2040 is _very_ marginal for mp3 playback, and currently sometimes triggers a bug that gives garbled audio output.  However, it does work for some limited situations.
2021-03-10 18:44:10 -06:00
hathach 58fb011070 clean up 2021-03-10 19:03:27 +07:00
hathach d1c6bb0927 rp2040 add double reset to uf2, also update pico-sdk to 1.1.0 2021-03-10 18:58:23 +07:00
DavePutz a3c3e8a0fa
fix trailing whitespace 2021-03-09 22:41:08 -06:00
DavePutz 0c58cc4772
Moved pin wait to an initial exec 2021-03-09 16:37:29 -06:00
DavePutz f0e3274a33
Update to agree with modified StateMachine.h 2021-03-09 11:13:09 -06:00
DavePutz 6f4510d7aa
Merge branch 'main' into issue_4111 2021-03-08 23:28:21 -06:00
root 576da73a17 Added check for maxlen 2021-03-08 23:23:51 -06:00
root 95b7a59156 Merge branch 'issue_4111' of https://github.com/DavePutz/circuitpython into issue_4111 2021-03-08 23:22:05 -06:00
root 3db0fec267 Added check for maxlen 2021-03-08 23:20:57 -06:00
DavePutz 88650bc4d0
Removed leftover debug code 2021-03-08 22:48:57 -06:00
Jeff Epler cd1f19020f raspberrypi: move landmine Makefile comments 2021-03-05 12:59:55 -06:00
Jeff Epler 2ae1e7de61 WIPrp2040: Implement IncrementalEncoder
Any two consecutive pins can be used for an IncrementalEncoder

Testing performed: Put a synthesized (few hundred counts per second) quadrature signal into GP2/3 and read the encoder out.  Performed filesystem operations at the same time to stress test it.

The reasons for not using common_hal_rp2pio_statemachine_readinto are commented on.
2021-03-05 10:31:29 -06:00
DavePutz a4dda3a5ba
Merge branch 'main' into issue_4111 2021-03-04 14:38:00 -06:00
DavePutz c5c297d2c0
Update PulseOut.c 2021-03-04 13:53:19 -06:00
DavePutz b7f03f9487
Update PulseOut.h 2021-03-04 13:52:40 -06:00
DavePutz 2d941b070f
Changed interrupt to per-word basis; cleaned up other small items 2021-03-04 13:51:46 -06:00
Jeff Epler bc14ed31f6 StateMachine.h: Add header for declaration of mcu_pin_obj_t typedef 2021-03-04 12:28:46 -06:00
Jeff Epler c023ec03ff PDMIn: Add missing deinit call 2021-03-04 12:28:06 -06:00
Jeff Epler bd01d31542 rp2pio: Add pins_are_sequential
This can be used where the standard API calls for a list of pins, to check that they satisfy the requirements of the rp2pio state machine, e.g.,
```python
    def __init__(self, pin_a, pin_b):
        if not rp2pio.pins_are_sequential([pin_a, pin_b]):
            raise ValueError("Pins must be sequential")
```
2021-03-04 11:26:33 -06:00
Jeff Epler ff62b0d2c0 StateMachine: Add pull up/down for inputs 2021-03-04 11:26:29 -06:00
Jeff Epler 68ac14b309 StateMachine: Add in_available property
I named the property `in_available` because it is similar to pyserial.
However, it indicates the number of words in the fifo, not the number
of bytes.
2021-03-04 11:14:09 -06:00
hathach 6f99026a64 rp2040 use normal usb_irq_handler() 2021-03-04 21:29:04 +07:00
Dan Halbert 71c43ca2dd
Merge pull request #4319 from jepler/feather-default-uart
feather rp2040: enable default board.UART
2021-03-03 16:46:00 -05:00
Jeff Epler b0fca4fcda feather rp2040: enable default board.UART 2021-03-03 13:13:06 -06:00
Dan Halbert cd48c5ee83
Merge pull request #4315 from dhalbert/rp2040-i2c-short-writes
RP2040: Implement short I2C writes (2 bytes or less) using bitbangio
2021-03-03 12:42:47 -05:00
DavePutz 88353f2f5b
Update mpconfigport.mk 2021-03-03 11:00:58 -06:00
DavePutz ced707ed32
Update call to rp2pio_statemachine_construct 2021-03-03 10:55:08 -06:00
Scott Shawcroft 514b73bcf8
Merge pull request #4254 from gamblor21/rp2040_countio
Rp2040 countio
2021-03-03 08:47:24 -08:00
Scott Shawcroft 1d8933dd05
Merge pull request #4265 from DavePutz/pio_soft_reset
Clear out PIOs and State Machines on RP2040 soft reset
2021-03-03 08:43:57 -08:00
Dan Halbert fb7a0f7efc add 1sec timeouts for I2C read and write 2021-03-03 09:43:57 -05:00
gamblor21 98075c5255 Fixed merge 2021-03-02 22:32:59 -06:00
Dan Halbert e3ab394cd6 works on nearly all sensors 2021-03-02 23:27:37 -05:00
Dan Halbert 4167778bbc
Merge pull request #4312 from jepler/feather-rp2040-led
feather rp2040: add board.LED
2021-03-02 23:19:14 -05:00
DavePutz 9b96bae668
Update mpconfigport.mk 2021-03-02 21:36:00 -06:00
DavePutz 30d491e136
Update mpconfigport.mk 2021-03-02 21:30:49 -06:00
DavePutz 58fb7b9b32
Update mpconfigport.mk to get builds working 2021-03-02 21:27:46 -06:00
DavePutz 6046d37f31
Update PulseIn.c 2021-03-02 21:23:45 -06:00
Mark 37ee18349f
Merge branch 'main' into rp2040_countio 2021-03-02 19:47:53 -06:00
gamblor21 4246cc3f6d Counter and PWMOut slice conflict check 2021-03-02 19:32:06 -06:00
Jeff Epler b27afad9cb move LED to the right spot in the file 2021-03-02 19:02:38 -06:00
Jeff Epler efc2667b5f
Merge pull request #4186 from jepler/update-protomatter-rp2
Enable protomatter on RP2040 builds
2021-03-02 19:01:37 -06:00
Dan Halbert 15615effc2
Merge pull request #4276 from bergdahl/patch-1
Update StateMachine.c
2021-03-02 17:11:45 -05:00
Dan Halbert f31b472309 Merge remote-tracking branch 'adafruit/main' into rp2040-i2c-short-writes 2021-03-02 15:17:12 -05:00
Dan Halbert 9939c59caa wip 2021-03-02 15:16:55 -05:00
Jeff Epler 8bfd308d37 feather rp2040: add board.LED 2021-03-02 13:16:09 -06:00
Scott Shawcroft ce70b95990
Merge pull request #4177 from microDev1/nvm-rp
RP2040: Support for NVM
2021-03-02 09:57:36 -08:00
Dan Halbert f41fb6fafc
Apply suggestions from code review
copyediting
2021-03-02 12:01:50 -05:00
Scott Shawcroft 2651e15a52
Merge pull request #4309 from jepler/rp2040-interrupt-pio
rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall)
2021-03-02 08:55:27 -08:00
Jeff Epler f560b5f3a3 raspberry: switch pico back to the boot2 for W25Q16
Presumably, switching it to generic hurt performance a bit.

I verified that the build-raspberry_pi_pico/boot2_padded_checksummed.S
built file has the same checksum as the old
bs2_default_padded_checksummed.S
2021-03-02 08:08:41 -06:00
microDev b029031286
minor structural modification 2021-03-02 14:36:28 +05:30
Jeff Epler 5a00862b1d raspberrypi: allow directly specifying the original boot .S file
.. all the necessary steps to transform it into a padded, checksummed
file are now done by the build system.

Since it is assigned by "?=", it _should_ be the case that individual
builds can override it.

I did not "test" this per se, but it gives the same content and checksum
(except for the identifying comment with a path) as #4302.
2021-03-01 21:08:19 -06:00
Jeff Epler 4b63a8c9b4 rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall) 2021-03-01 21:07:04 -06:00
Scott Shawcroft 21a8752166
Merge pull request #4297 from adafruit/tannewt-patch-1
Update flash sizes for Adafruit RP2040 boards
2021-03-01 13:19:50 -08:00
Jeff Epler 238484ec26 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-03-01 15:18:32 -06:00
Scott Shawcroft 532e7db293
Merge pull request #4267 from dhalbert/rp2040-digitalinout-fixes
RP2040: change DigitalInOut direction only when necessary; strong drive strength
2021-03-01 13:14:13 -08:00
Scott Shawcroft af9dfccab1
Update QT Py flash size 2021-03-01 10:34:25 -08:00
Scott Shawcroft dac047db61
Update Feather RP2040 to 8MB 2021-03-01 10:33:04 -08:00