Commit Graph

773 Commits

Author SHA1 Message Date
microDev
2e41550770
Merge pull request #5210 from DavePutz/issue_5091
Change optimizer option so RP2040 DEBUG builds work
2021-08-24 12:24:01 +05:30
root
0e3aa27794 Change optimizer option so RP2040 DEBUG builds work 2021-08-23 21:37:34 -05:00
Scott Shawcroft
6d49a9f0c5
Merge pull request #5205 from jepler/deprecate-vertical-scroll
Deprecate Display's constructor arg set_vertical_scroll
2021-08-23 12:52:12 -07:00
Scott Shawcroft
935888927e
Merge pull request #5196 from dhalbert/samd-audio-fixes
improve SAMD audio DMA
2021-08-23 10:27:59 -07:00
Jeff Epler
379461df7d Deprecate Display's constructor arg set_vertical_scroll 2021-08-23 09:17:59 -05:00
Dan Halbert
b8b23c97d9 improve SAMD audio DMA 2021-08-21 14:34:37 -04:00
microDev
f6d1caabc9
Merge pull request #5182 from tannewt/fix_imx
Check background pending before sleep
2021-08-21 08:00:10 +05:30
Dan Halbert
419d374d3c
Merge pull request #5181 from kattni/macropad-speaker-enable
Add SPEAKER_ENABLE to MacroPad
2021-08-19 19:32:28 -04:00
Kattni Rembor
1185228b90 Remove SPEAKER_SHUTDOWN pin. 2021-08-19 15:18:19 -04:00
Scott Shawcroft
d2860b58b0
Check background pending before sleep
There is a race between when we run background tasks and when we
sleep. If an interrupt happens between the two, then we may delay
executing the background task. On some ports we checked this for
TinyUSB already. On iMX RT, we didn't which caused USB issues.
This PR makes it more generic for all background tasks including
USB.

Fixes #5086 and maybe others.
2021-08-19 12:18:13 -07:00
Kattni Rembor
ae923db06d Add SPEAKER_ENABLE pin to MacroPad. 2021-08-18 17:30:42 -04:00
Scott Shawcroft
0390f812be
Fix RP2040 I2C instance check 2021-08-18 08:55:52 -07:00
Scott Shawcroft
a5143d284b
Merge pull request #5161 from ZodiusInfuser/patch_micropy
Removed unnecessary defines from Pimoroni board files
2021-08-17 12:40:12 -07:00
Scott Shawcroft
abe8638f41
Merge pull request #5160 from ZodiusInfuser/patch_tiny2040
Removed default UART, SPI and I2C from Tiny2040 config
2021-08-16 14:54:52 -07:00
ZodiusInfuser
2255ab1486 Removed unnecessary Micropy and Ignore defines 2021-08-16 16:40:12 +01:00
ZodiusInfuser
5fb507c3ff Removed default UART SPI and I2C from Tiny2040 config 2021-08-16 16:31:31 +01:00
Scott Shawcroft
de796e2304
Move OneWire to onewireio from busio
This will allow finer grained inclusion in 8.0.0

Fixes #5135
2021-08-12 10:47:14 -07:00
Scott Shawcroft
9c77d2653f
Merge pull request #5099 from ZodiusInfuser/main
Added definitions for some upcoming Pimoroni LED driver boards
2021-08-12 09:27:21 -07:00
ZodiusInfuser
47c8ff0570 Removed unnecessary defines 2021-08-11 23:34:20 +01:00
Scott Shawcroft
0632a1e681
Merge pull request #5060 from cdwilson/cdwilson/circuitpython/sparkfun-stm32f405-micromod
stm/boards: Add support for SparkFun STM32 MicroMod Processor board.
2021-08-11 12:19:16 -07:00
Dan Halbert
4608877c12 address review comments 2021-08-11 12:10:49 -04:00
Dan Halbert
35aac3d26b display SPI now 10MHz; set PWM duty cycle to zero at stop to quiet output 2021-08-11 10:48:53 -04:00
Dan Halbert
24e61a7da8 Track more carefully which audio buffers to fill, based on interrupt channels 2021-08-10 22:00:09 -04:00
ZodiusInfuser
e587bd7dc0 Added final USB PIDs 2021-08-10 11:17:06 +01:00
Chris Wilson
e741330ca8 Consistent pin naming for SparkFun MicroMod processor boards. 2021-08-09 23:10:52 -07:00
Dan Halbert
2451c788f4 valid channels in audio_dma_stop; cleaner supervisor_ticks mgmt in keypad 2021-08-09 09:47:13 -04:00
Dan Halbert
59b89fdc5c Fix various audio DMA issues:
RP2040 and SAMD51:
- Detect when DMA has finished, and stop DMA audio explicitly.
- Do not accidentally reuse `first_buffer` supplied by WaveFile or RawSample. Always realloc `first_buffer` and `second_buffer`

RP2040:
- When audio playing is stopped, write a final zero to the output register. This prevents residual PWM tones.
- Handle buffer size for 8-bit samples properly for 16-bit output.
- Fail on some edge cases (which may not be possible at the moment).
2021-08-09 09:47:13 -04:00
Dan Halbert
2cd80d1074 wip, with debugging printf's 2021-08-09 09:47:13 -04:00
Dan Halbert
fd71d924d2 partial buffer mgmt fix 2021-08-09 09:47:13 -04:00
ZodiusInfuser
f707fa107a Tweaks to Interstate75 pinout 2021-08-05 15:00:47 +01:00
ZodiusInfuser
11ed759cf9 Tweaks to Plasma2040 pinout 2021-08-05 13:01:50 +01:00
Jeff Epler
ac4b10bcd9 It's "shared-module", not "shared-modules" 2021-08-03 10:37:47 -05:00
ZodiusInfuser
6663dacedb Added board configurations for Plasma and Interstate 2021-08-03 14:01:56 +01:00
Dan Halbert
a358e5f58a Add board-specific pico-sdk settings; set xosc multipler for Adafruit boards 2021-07-30 18:50:21 -04:00
Scott Shawcroft
9e54606ba1
Set output low in SIO 2021-07-28 09:00:36 -07:00
Scott Shawcroft
4be904fd4a
Switch to gpio mux to disable/enable pwm signal 2021-07-27 12:38:18 -07:00
Scott Shawcroft
e87e1d8175
Block when setting duty_cycle until the new value is taken 2021-07-27 12:37:35 -07:00
Scott Shawcroft
daf90aae83
Merge remote-tracking branch 'adafruit/main' into pulseout_switch 2021-07-26 18:48:59 -07:00
Scott Shawcroft
412eb87080
Switch to pin, frequency and duty_cycle PulseOut
Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0

This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than `- 1` everywhere. The latter is
more bug prone.

Most of the way for #3264

Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.
2021-07-26 18:35:49 -07:00
Tod Kurt
0d401e7bc8 fix whitespace on new flash chip for Arduino Nano RP2040 2021-07-24 13:22:02 -07:00
Tod Kurt
dcd5b5ab50 added Arduino Nano RP2040 Connect alternate flash chip 2021-07-24 13:12:44 -07:00
Nathan Young
04ce6a6e8c Check jmp_pin specified when JMP PIN opcodes used 2021-07-23 13:35:20 +02:00
Nathan Young
8221a12cf6 Added support for specifying the JMP pin (RP2 PIO) 2021-07-22 18:39:04 +02:00
Scott Shawcroft
109bd2886b
Fix Arduino RP2040 flash size
For RP2040 boards, we now change the default flash size based on
the configured flash. We will still try to read the size from the
flash first.

Fixes #4874
2021-07-21 11:02:55 -07:00
Scott Shawcroft
8723a0335f
Merge pull request #5032 from DavePutz/multi_pulseout
Moved global variables to support multiple RP2040 PulseOuts
2021-07-21 10:26:17 -07:00
Scott Shawcroft
e14923028f
Merge pull request #5030 from dhalbert/update-to-raspberrypi-pico-sdk-1.2.0
Update pico-sdk to 1.2.0, using raspberrypi repo
2021-07-21 08:14:13 -07:00
root
b2d6203c63 fix formatting 2021-07-21 10:05:09 -05:00
root
0559fcd1c0 Moved global variables to support multiple PulseOuts 2021-07-21 09:52:17 -05:00
Scott Shawcroft
db0adf1253
Merge pull request #5025 from DavePutz/issue_5016
Turn off PWM pin during PulseOut construct
2021-07-20 17:25:10 -07:00
root
8fe4fa0114 Turn off PWN pin during PulseOut construct 2021-07-20 17:17:41 -05:00
Dan Halbert
0293ec261a Update pico-sdk to 1.2.0, using raspberrypi repo 2021-07-20 17:31:29 -04:00
Dan Halbert
128bedae7e
Merge pull request #5019 from DavePutz/issue_5016
Ensure RP2040 pin is left low after PulseOut
2021-07-19 17:57:42 -04:00
Dan Halbert
d2f2afe57b
Merge pull request #4925 from microDev1/update-run-mode
Add RunMode.UF2 and update esp32s2 run-modes
2021-07-19 16:37:46 -04:00
root
8d79d4e5ee Ensure pin is left low after PulseOut 2021-07-19 11:46:09 -05:00
microDev
3c25d8e2a0
Merge pull request #5013 from DavePutz/issue_5012
Issue #5012 - RP2040 moved globals to PulseIn object to fix multiple instances
2021-07-19 00:21:55 +05:30
root
43275e0b0d Made suggested changes (mostly) 2021-07-18 12:00:37 -05:00
microDev
9ac607dffa
update run-mode
- add microcontroller.RunMode.UF2
- add UF2, NORMAL and BOOTLOADER run-modes to esp32s2
2021-07-18 00:00:58 +05:30
root
1c80696746 iFix formatting 2021-07-16 17:18:06 -05:00
root
588a19a1ab Issue #5012 - Moved globals to PulseIn object to fix multiple instances 2021-07-16 15:59:08 -05:00
Scott Shawcroft
bba611336c
Merge pull request #4964 from DavePutz/issue_4937
Fix for issue #4937 - Implement minimum PulseOut time
2021-07-16 11:29:32 -07:00
root
eebddbb16d Change min pulse calculation 2021-07-15 21:27:23 -05:00
Scott Shawcroft
c2685970af
Merge pull request #4987 from DavePutz/issue_4983
Fix for Issue #4983 - stop state machine before restarting
2021-07-13 12:16:33 -07:00
root
5c9823d8cb Change order of operations in restart 2021-07-13 11:17:03 -05:00
root
490f263a41 Added code to reset SM program counter during a restart 2021-07-12 14:09:11 -05:00
root
9d5fbea7a3 Fix for Issue #4983 - stop state machine before restarting 2021-07-11 21:02:28 -05:00
root
0ea750b2d0 Fix handling of short pulses 2021-07-11 16:38:24 -05:00
DavePutz
25e799e51a
Add LED and GP25 for Cytron Maker Pi Pico 2021-07-09 20:49:59 -05:00
Scott Shawcroft
58fdf9e940
Merge pull request #4975 from DavePutz/issue_4945
Issue #4945 - handle multiple PulseIns
2021-07-09 11:03:16 -07:00
root
4046b0fb0a Issue #4945 - handle multiple PulseIns 2021-07-08 14:09:21 -05:00
Dan Halbert
ab52a92704 Disallow ctrl-C interrupts of RP2040 SPI and PIO 2021-07-08 13:42:24 -04:00
Dan Halbert
a843b8a0d4 Merge remote-tracking branch 'adafruit/main' into rp2040-audio-and-spi-fixes 2021-07-08 08:22:21 -04:00
Dan Halbert
bd6826496c Fix various RP2040 audio dma things: (see detailed commit message)
1. Check for correct error values from dma_claim_unused_channel.
2. Introduce a .stereo flag for simplicity.
3. Clarify PWM carrier frequency choice.
4. Start introducing quiescent audio value. Still need to ramp up/down.
5. Redo audio stop logic a bit.
6. Fix (unrelated) displayio dependency things.

There is still an interference problem between other DMA users and audio. Still debugging this.
2021-07-08 08:14:49 -04:00
root
f98ec0cfd6 Fix formatting 2021-07-06 14:43:46 -05:00
root
bfa777c55a Add check for timer success 2021-07-06 14:34:15 -05:00
Daniel Griswold
2519b06478 fix spi definition 2021-07-06 01:15:32 -04:00
root
b2e72b2912 fix formatting 2021-07-05 23:13:18 -05:00
root
6e4613f1a1 Fix formatting 2021-07-05 12:30:26 -05:00
root
9814386d2e Fix for issue #4937 - Implement minimum pulseout time 2021-07-05 11:38:05 -05:00
Dan Halbert
33bbb8b1f4 RP2040 PWMAudioOut: Release DMA channels after play has finished. 2021-07-01 17:36:29 -04:00
Radomir Dopieralski
b8c4f7d685 MacroPad RP2040: Add initialization for the OLED display 2021-06-29 17:38:14 +02:00
Kattni Rembor
2c2d541e7c Adding pins to match silk and other RP2040 boards. 2021-06-28 17:10:15 -04:00
Scott Shawcroft
061d3a16ff
Merge pull request #4911 from DavePutz/issue_4908
Fix for issue #4908 - pulseout leaving line high
2021-06-24 15:32:48 -07:00
Dan Halbert
836db4e4a1
Merge pull request #4816 from hierophect/rp2040-alarms
RP2040: add Alarm module
2021-06-24 08:15:57 -04:00
root
ab1d7429f1 Fix for issue #4908 - pulseout leaving line high 2021-06-23 21:09:27 -05:00
Lucian Copeland
1f3d69d87c Clean up sleep memory, mark as not-implemented 2021-06-20 17:57:51 -04:00
Jeff Epler
268717e427 ParallelImageCapture: Switch to taking a list of pins
.. adopting validate_pins from RGBMatrix into shared-bindings

.. updating other platforms for API change
2021-06-10 11:15:18 -05:00
Ben Clifford
5c835adb10 Correct pull-down direction in parameter documentation for rp2pio 2021-06-09 20:39:56 +00:00
Limor "Ladyada" Fried
c1c101ca2d
Merge pull request #4864 from ladyada/main
macropad rev B definion and fix for SH110x addressing
2021-06-07 21:59:56 -04:00
Lucian Copeland
b6a268fca4 Further deinit additions 2021-06-07 14:13:59 -04:00
Lucian Copeland
63c1791d87 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-06-07 14:11:41 -04:00
Lucian Copeland
f2149edbd2 Add deinit to new boards 2021-06-07 12:48:12 -04:00
lady ada
2ff9e9766f handclang 2021-06-07 12:39:59 -04:00
Limor "Ladyada" Fried
c4f685aab1
Merge pull request #4865 from ZodiusInfuser/pimoroni_boards
Added definition for upcoming Pimoroni RP2040 board
2021-06-07 11:13:01 -04:00
lady ada
3890271f19 turn off all neopix when booting 2021-06-06 18:30:17 -04:00
lady ada
01195c2089 update to rev B 2021-06-06 15:57:41 -04:00
Scott Shawcroft
bc014cecb5
Merge pull request #4859 from DavePutz/hcsr04_fix
Fix pulsein pause and resume functions to handle HCSR04
2021-06-04 13:26:05 -07:00
root
57334c812e Fix pulsein pause and resume functions to handle HCSR04 2021-06-04 12:10:41 -05:00
ZodiusInfuser
af7557b53b
Updated with final USB PID 2021-06-04 16:02:32 +01:00
Jeff Epler
a99eba35b8
Merge pull request #4809 from DavePutz/issue_4266
Fix for Issue #4266 - second PWMAudioOut interferes with the first one
2021-06-03 19:08:28 -05:00
ZodiusInfuser
6011db3aec Added board definition 2021-06-03 15:49:23 +01:00
Dan Halbert
6af36757a7 lengthen RP2040 xosc startup time 2021-06-02 08:50:20 -04:00
root
8761e4bfd7 Initialize pacing timer 2021-05-30 12:12:38 -05:00
Kong Wai Weng
b06ec0a776 Added libraries dependency. 2021-05-30 09:57:00 +08:00
root
a2b220370e Fix formatting issue 2021-05-29 12:26:41 -05:00
root
760e8c77bd Changes to correct repeat playing on a channel 2021-05-29 11:55:10 -05:00
Kong Wai Weng
ebe4d90ac3 Updated the copyright information. 2021-05-29 10:12:22 +08:00
Lucian Copeland
feff243e8f Add RTC deep sleep alarm support 2021-05-28 13:52:05 -04:00
Kong Wai Weng
ebda9e07f4 Use 4 spaces instead of tab. 2021-05-29 01:04:13 +08:00
Kong Wai Weng
bfcb8c5896 Do not use neopixel as status LED. Also removed the unused definition. 2021-05-29 00:47:14 +08:00
Kong Wai Weng
5920ac647a Modified the essential files for Maker Pi RP2040. 2021-05-28 22:42:54 +08:00
Kong Wai Weng
321e5dd16f Use underscore instead of dash for board name. 2021-05-28 18:01:02 +08:00
Lucian Copeland
24041f34b0 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-05-27 18:40:40 -04:00
Lucian Copeland
8e1892ac6f Implement RP2040 Alarm module
Adds light and deep sleep functionality for the TimeAlarm and PinAlarm
alarm categories. Adds board deinit for all platforms.
2021-05-27 18:33:29 -04:00
Kong Wai Weng
da7c74f614 Initial commit. 2021-05-27 18:02:52 +08:00
root
24e641a834 Fix for Issue #4266 2021-05-25 16:06:00 -05:00
Scott Shawcroft
038c9d6194
Merge pull request #4796 from Neradoc/nera-pwmrgb-status-pimoroni
Enable the PWM status LED on Pimoroni Tiny 2040 and PicoSystem
2021-05-24 13:30:55 -07:00
lady ada
2e90d5ed07 clang a bit 2021-05-22 12:39:42 -04:00
lady ada
d52f149e84 add ESP CS pin to make wifi demos easier 2021-05-22 12:22:28 -04:00
lady ada
ac855afb48 Some pin neatening and updated PID to unused Adafruit one! 2021-05-22 11:57:46 -04:00
BlitzCityDIY
14dbec7c04 Merge branch 'main' of https://github.com/blitzcitydiy/circuitpython into main 2021-05-22 01:02:21 -04:00
BlitzCityDIY
9f4eb48e70 Updating MISO
While testing WIFI realized MISO was defined incorrectly
2021-05-22 01:02:06 -04:00
BlitzCityDIY
352281e23e Adding Arduino Nano RP2040 Connect
Re-commiting to fix local GitHub config issues. Adding CircuitPython support for the Arduino Nano RP2040 Connect. Have tested all digital and analog I/O, I2C, onboard LSM6DSOX. Uses the AT25SF128A external flash.
2021-05-21 20:44:11 -04:00
Neradoc
6808d04d53 enable the PWM status LED on Pimonoroni Tiny 2040 and PicoSystem 2021-05-21 20:13:30 +02:00
Scott Shawcroft
5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
Scott Shawcroft
642fbcf87a
Handle status led power
This no longer turns on status LED power before running user code.
Therefore, use of the status LED on some boards will also have to
enable the power.
2021-05-19 10:57:14 -07:00
Scott Shawcroft
9dabe882f1
Fix safe mode on rp2040 2021-05-19 10:18:43 -07:00
Limor "Ladyada" Fried
b667736110 Merge branch 'adafruit:main' into main 2021-05-18 20:55:55 -04:00
lady ada
d8b895f1d7 add LED and speaker - natch! 2021-05-18 20:53:13 -04:00
ladyada
cec9015e19 iz makropad with oled 2021-05-18 11:09:03 -04:00
root
9393467819 Update comment for spelling 2021-05-17 22:13:00 -05:00
root
ff4b1b28d2 iFormatting fixes 2021-05-17 16:43:55 -05:00
root
11ef36d09d Implement pulseout for RP2040 2021-05-17 16:24:45 -05:00
Scott Shawcroft
689ec86225
Merge pull request #4754 from dhalbert/fix-endpoint-checking
Fix endpoint checking; Clean up safe mode printing
2021-05-14 11:25:01 -07:00
Dan Halbert
fa6c06fb38 count in/out endpoints; allow more usb modules on low-endpoint boards 2021-05-13 21:59:02 -04:00
Scott Shawcroft
1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
lady ada
502b66eac0 moar trinkz 2021-05-11 22:03:05 -04:00
nm3210
a3de9bda5f Swap mis-labelled D0/D1 pins on SparkFun Pro Micro RP2040 2021-05-08 21:35:37 -04:00
Scott Shawcroft
42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Scott Shawcroft
3fda0c0a1b
Fix board builds and use MP_ERROR_TEXT in py and extmod 2021-05-05 17:51:52 -07:00
Dan Halbert
d2b558993e merge from main, including MicroPython 1.12 merge 2021-05-03 20:56:04 -04:00
Dan Halbert
8b8968101d
Merge pull request #4691 from nm3210/sparkfunthingplusrp2040_boardupdate
Update Sparkfun Thing Plus RP2040 pins to match board breakouts
2021-05-03 09:27:19 -04:00
Jeff Epler
da19e8e2d7 Merge remote-tracking branch 'origin/main' into fix-codeformat-subdirs 2021-04-30 15:31:08 -05:00
nm3210
929ee8d3b4 Fix pre-commit whitespace error 2021-04-30 14:16:13 -04:00
Scott Shawcroft
d93a9a1dbc
Merge pull request #4683 from DavePutz/issue_4661
Issue #4661 - Wrap pulsein values when maxlen is exceeded.
2021-04-30 11:07:54 -07:00
Jeff Epler
e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
nm3210
9c1466a330 Update Sparkfun Thing Plus RP2040 pins to match board
This fixes some missing and incorrectly-assigned pins for the SparkFun Thing Plus RP2040 protoboard so that they actually match what the board says. This also changes the default SPI pins from the SD card pins to the breakout pins on the side of the board.
2021-04-30 09:37:37 -04:00
Kattni Rembor
4d97680cae Fix board definition. 2021-04-29 13:45:39 -04:00
DavePutz
1ec59cd534
Fix up indentation 2021-04-29 12:38:13 -05:00
Kattni Rembor
0bf747870a Fixing board definition. 2021-04-29 12:41:23 -04:00
Dan Halbert
f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
root
cfac07c1cc Wrap pulsein when maxlen is exceeded 2021-04-28 11:20:13 -05:00
Scott Shawcroft
17fcd499b2
Merge pull request #4649 from tannewt/merge_1.11_2
Merge MicroPython v1.11 into CircuitPython
2021-04-27 11:02:02 -07:00
Scott Shawcroft
f99deeda68
Merge pull request #4668 from DavePutz/issue_4659
Increased possible pulsein length to ~65 ms.
2021-04-27 11:01:51 -07:00
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
gamblor21
d7bc8a46a5 Added counters per slice 2021-02-27 15:17:27 -06:00
root
29c89a2487 Removed more includes 2021-02-26 22:35:38 -06:00
root
f3515502b7 Removed unecessary includes 2021-02-26 22:33:50 -06:00
root
6374408c06 Changed reset_rp2pio_statemachine to clean up any PIO interrupts. 2021-02-26 22:28:50 -06:00
Jonny Bergdahl
f7eac46c78
Update StateMachine.c
Changed woring to use max instead
2021-02-27 00:07:30 +01:00
Scott Shawcroft
776301c932
Typo fix: direcion -> direction 2021-02-26 15:03:56 -08:00
Scott Shawcroft
888a0c5f08
Merge pull request #4224 from microDev1/busio-uart-rp
RP2040: Support for UART
2021-02-26 14:57:23 -08:00
Dan Halbert
d9234ffa82 need to gpio_set_dir() at some point 2021-02-26 15:27:35 -05:00
root
7942932176 Requested changes 2021-02-26 14:14:55 -06:00
Scott Shawcroft
2e6e91dc5c
Merge pull request #4253 from tannewt/rp2040_fix_pwm_reuse
Fix second shared PWM
2021-02-26 11:53:54 -08:00
Scott Shawcroft
7c8d7d77dd
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp 2021-02-26 09:04:42 -08:00
Limor "Ladyada" Fried
caedc3bba6
Merge pull request #4270 from tannewt/rp2040_feather_pinout
Update RP2040 Feather pinout for production rev
2021-02-26 11:11:44 -05:00
Jeff Epler
1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Scott Shawcroft
3f08cb47b8
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp 2021-02-25 16:59:15 -08:00
Scott Shawcroft
52bc935fa7
A few minor fixes for corner cases
* Always clear the peripheral interrupt so we don't hang when full
* Store the ringbuf in the object so it gets collected when we're alive
* Make UART objects have a finaliser so they are deinit when their
  memory is freed
* Copy bytes into the ringbuf from the FIFO after we read to ensure
  the interrupt is enabled ASAP
* Copy bytes into the ringbuf from the FIFO before measuring our
  rx available because the interrupt is based on a threshold (not
  > 0). For example, a single byte won't trigger an interrupt.
2021-02-25 16:50:57 -08:00
Scott Shawcroft
f0432b9d6f
Remove neopixel power 2021-02-25 16:37:34 -08:00
Dan Halbert
d0f1cfb039 address review; use gpio_set() carefully 2021-02-25 18:41:22 -05:00
Scott Shawcroft
2b163ccd6a
Fix incorrect deinit mask 2021-02-25 14:57:46 -08:00
Scott Shawcroft
1b00d94b23
Fix second shared PWM
Fixes #4210
2021-02-25 14:49:09 -08:00
Scott Shawcroft
80f7972f72
Update RP2040 Feather pinout for production rev 2021-02-25 14:46:08 -08:00
Jeff Epler
22276710e6 rp2pio: Fix writing where the stride was 2 or 4
The wrong stride value was being checked.
2021-02-25 15:50:49 -06:00
Dan Halbert
199a8ce8b0 change DigitalInOut direction only when necessary; strong drive strength 2021-02-25 14:10:19 -05:00
root
f8eb5bc275 Cleanup PIOs and State Machines on soft reset 2021-02-25 12:38:43 -06:00
microDev
8170e26a86
more uart improvements
- address suggested changes
- refine uart instance availibility checks
- improve pin validation and rx buffer handling
2021-02-25 23:46:00 +05:30
root
86e60f5f35 Clean up formatting 2021-02-24 17:26:35 -06:00
root
17ff5dcc99 Return NotImplementedError for PulseOut 2021-02-24 17:04:05 -06:00
root
8e15f36baa pulseio (pulsein) for RP2040 2021-02-24 16:58:29 -06:00
microDev
5d7fdafcde
implement suggested changes
- add internal buffering
- rtc initialization fix
2021-02-25 00:48:36 +05:30
Mark
b935dcafdc
Merge branch 'main' into rp2040_countio 2021-02-23 19:46:41 -06:00
gamblor21
379f454ce6 Adding countio to rp2040 2021-02-23 19:38:05 -06:00
Scott Shawcroft
abbbb91fa8
Add state machine divisor check
This causes an exception when setting a state machine too slow or
too fast.

Fixes #4222
2021-02-23 16:30:46 -08:00
Scott Shawcroft
360475e266
Implement audiobusio and enhance PIO for it
This adds I2SOut and PDMIn support via PIO.

StateMachines can now:
 * read and read while writing
 * transfer in 1, 2 or 4 byte increments
 * init pins based on expected defaults automatically
 * be stopped and restarted
 * rxfifo can be cleared and rxstalls detected (good for tracking when
   the reading code isn't keeping up)

Fixes #4162
2021-02-23 15:50:00 -08:00
Scott Shawcroft
001d7299b2
Merge pull request #4228 from ZodiusInfuser/rp2040-boards
Added definitions for Pimoroni RP2040-based boards
2021-02-23 10:00:19 -08:00
ZodiusInfuser
1a0bf4c33f
Added flash size for PicoSystem 2021-02-23 11:04:20 +00:00
ZodiusInfuser
a9951c9b6c
Added flash size for Keybow2040 2021-02-23 11:01:40 +00:00
ZodiusInfuser
ca9b7debe0
Added flash size for Tiny2040 2021-02-23 10:43:35 +00:00
Scott Shawcroft
3fdf29e773
More parens 2021-02-22 18:35:09 -08:00
Scott Shawcroft
863981a5b8
Parens 2021-02-22 18:31:45 -08:00
Scott Shawcroft
0aafeac209
Board specific flash sizes for RP2040
Stop-gap solution for #4041. Comment is there to provide info
needed in the future. (We currently run the generic "safe" settings.)
2021-02-22 17:19:18 -08:00
ZodiusInfuser
52f2fd6d53
Removed trailing white space 2021-02-20 17:25:26 +00:00
ZodiusInfuser
417173b752
Removed trailing white space 2021-02-20 17:24:26 +00:00
ZodiusInfuser
9a4b8c5ed9
Removed trailing white space 2021-02-20 17:23:23 +00:00
ZodiusInfuser
dea498a51f
Added new line 2021-02-20 17:20:28 +00:00
ZodiusInfuser
9fbeb0baea
Added new line 2021-02-20 17:20:06 +00:00
ZodiusInfuser
03577ec81c
Added new line 2021-02-20 17:19:45 +00:00
ZodiusInfuser
dac81ea545
Added new line 2021-02-20 17:19:31 +00:00
ZodiusInfuser
0a00f91979
Added new line 2021-02-20 17:15:42 +00:00
ZodiusInfuser
f1df07002f
Added new line 2021-02-20 17:15:20 +00:00
ZodiusInfuser
27bc5492f5
Added other files for PicoSystem 2021-02-20 13:37:08 +00:00
ZodiusInfuser
e9c7af1dee
Added board.c for PicoSystem 2021-02-20 13:36:46 +00:00
ZodiusInfuser
fb7cce6503
Added other files for Keybow2040 2021-02-20 13:35:27 +00:00
ZodiusInfuser
7ac20bfb8b
Added board.c for Keybow2040 2021-02-20 13:35:06 +00:00
ZodiusInfuser
66dd74cd12
Added other files for Tiny2040 2021-02-20 13:33:54 +00:00
ZodiusInfuser
ad8916499d
Added board.c for Tiny2040 2021-02-20 13:32:54 +00:00
Dan Halbert
67406488d1 merge from upstream; re-alphabetize 2021-02-19 14:22:50 -05:00
ZodiusInfuser
ee5a48fece
Delete pimoroni_tiny2040 2021-02-19 18:30:29 +00:00
ZodiusInfuser
db102ab1ad
Create pimoroni_tiny2040 2021-02-19 18:29:57 +00:00
microDev
b12ccefbe6
uart implementation for rp2040 2021-02-19 18:36:00 +05:30
Jeff Epler
1cd4e4552e
Merge pull request #4219 from jepler/bit_transpose
Add Bit transpose function to support piopixl8
2021-02-18 20:29:05 -06:00
Jeff Epler
7fd4567893 bitops: rename from _bit_transpose, describe the algorithm 2021-02-18 15:41:23 -06:00
Dan Halbert
53a002a096 Initial fix, but bitbangio timing may be off 2021-02-18 13:14:51 -05:00
Jeff Epler
9cf7d73c6c core: add bit_transpose function
.. this version can only handle exactly 8 bits "across".  The restriction
may be relaxed in a future revision.
2021-02-18 11:32:47 -06:00
microDev
696d212dc7
fix nvm rewrite 2021-02-18 18:42:00 +05:30
Jeff Epler
ab5eb86118 raspberrypi: implement os.urandom
Since the datasheet cast some doubt on the strength of the "rosc_hw->randombit",
I use the SHA256 hash function to create a high quality random seed
from random values of uncertain entropy, as well as to generate a sequence
of random values from that seed using SHA256 as a cryptographically-secure
random number generator.

In practice, it produces over 100kB/s of random data which does not
have any gross problems according to _PractRand_.
2021-02-17 17:49:25 -06:00
Dan Halbert
0b8f1b9a90 wip: usb_cdc.serials 2021-02-15 20:06:18 -05:00
Dan Halbert
93d788543c Merge remote-tracking branch 'adafruit/main' into secondary-cdc 2021-02-15 20:03:53 -05:00
Dan Halbert
0ec99b37e0 handle 100% duty cycle; improve actual_frequency calc 2021-02-13 13:16:49 -05:00
Dan Halbert
d54b5861a3 wip 2021-02-12 19:01:14 -05:00
Dan Halbert
3e4328140c fix off-by-one PWM top issue 2021-02-12 15:53:31 -05:00
Jeff Epler
ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
microDev
f2d7a5f1e1
Merge branch 'main' into nvm-rp 2021-02-12 18:36:54 +05:30
microDev
527b11f99e
implement suggested changes
- update FLASH_FIRMWARE length
- use linker script define value
2021-02-12 18:28:48 +05:30
Dan Halbert
08f30fedf5
Merge pull request #4188 from ladyada/main
QT Py with RP2040
2021-02-11 22:19:56 -05:00
lady ada
6c914b8722 QT Py with RP2040 2021-02-11 19:21:42 -05:00
Dan Halbert
f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
microDev
205837c47b
nvm implementation for rp2040 2021-02-11 12:48:36 +05:30
Scott Shawcroft
191b143e7b
Add PWM based audio playback
See
https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out
to get started.

Fixes #4037
2021-02-09 15:38:33 -08:00
Scott Shawcroft
b19c700d4a
Merge pull request #4165 from DavePutz/issue_4143
Issue 4143 - Fixed marking a PWM slice incorrectly as variable frequency
2021-02-09 14:30:39 -08:00
root
9a28f0bf45 Fix check for variable PWM frequency 2021-02-09 15:22:59 -06:00
Dan Halbert
3c99b09993
Merge pull request #4160 from gamblor21/rp2040_neopixel_pin_fix
RP2040 Set the neopixel pin as output after PIO use
2021-02-08 17:57:30 -05:00
Dan Halbert
b0ed258302
Merge pull request #4155 from jepler/rpi-pio-background
rp2pio: Transfer up to 32 bytes before checking background tasks
2021-02-08 16:34:16 -05:00
gamblor21
386b49c3e1 Set the pin as output after PIO use 2021-02-08 15:13:37 -06:00
Jeff Epler
5423e4966c rp2pio: Transfer up to 32 bytes before checking background tasks
@Jerryneedell noticed that this problem affected strips short enough
to not use the DMA peripheral, thanks for the hot tip!

Instead of checking for background tasks after every byte transfer,
try up to 32 transfers before attending to background tasks.

This fixes the problem I was seeing on my 5-pixel circuit.

Closes #4135.
2021-02-08 08:35:07 -06:00
Jason Nichols
ae262cde55 Fix maximum PIO instructions 2021-02-06 10:54:25 -05:00
Scott Shawcroft
22dc7d5359
Update to the very latest SDK w/GP15 restore
Also adds unique id support

Fixes #4039 and hopefully #4107
2021-02-05 18:44:06 -08:00
Scott Shawcroft
c6a7b00030
Merge pull request #4137 from ferret-guy/smps-mode-pin-rpi-pico
Add SMPS mode pin to Raspi Pico pins.c
2021-02-05 12:12:55 -08:00
Scott Shawcroft
e7438c481e
Merge pull request #4125 from xorbit/main
Add A3 pin to Raspberry Pi Pico
2021-02-05 12:08:35 -08:00
Mark Omo
1292c35d59
Add SMPS mode pin to Raspi Pico pins.c
Add SMPS mode pin to Raspi Pico pins.c; see section "4.3. Using the ADC" of the Pico datasheet for discussion. 

Driving this pin high forces the onboard regulator into a lower noise PWM mode.
2021-02-05 11:09:40 -07:00
Patrick Van Oosterwijck
a158dde628 Add alternate name VOLTAGE_MONITOR for A3 2021-02-05 10:55:03 -07:00
Dan Halbert
0802b22ed6 usb descriptors all set; rework of enabling for USB devices 2021-02-04 19:23:40 -05:00
Jeff Epler
6e153d9948 raspberrypi: implement reset, reset_to_bootloader
This makes all the following work:
 * normal microcontroller.reset()
 * reset into safe mode or UF2 bootloader via microcontroller.on_next_reset()
 * reset into UF2 bootloader via the "1200 baud trick"

The implementation of reset_cpu is from micropython.
2021-02-04 12:07:50 -06:00
Patrick Van Oosterwijck
d357a05870 Add A3 pin to Raspberry Pi Pico
We want to be able to use this to measure VSYS.
2021-02-04 10:44:37 -07:00
BiffoBear
2656c84b01 Initial commit. Edited error messages in .c files 2021-02-03 05:49:40 +07:00
Scott Shawcroft
8789a2c8a9
Merge pull request #4110 from microDev1/rtc-rp
RP2040: Support for RTC
2021-02-01 19:47:44 -08:00
microDev
ec03267035
rtc implementation for rp2040 2021-02-02 00:00:00 +05:30
Dan Halbert
459f323247
Merge pull request #4087 from DavePutz/cpu_temp_doc
Fixing microcontroller.cpu on multi-core cpus and adding microcontroller.cpus
2021-02-01 12:50:37 -05:00
Scott Shawcroft
17cf03c8e4
Merge pull request #4083 from microDev1/watchdog-rp
RP2040: Support for WatchDog
2021-01-31 19:45:38 -08:00