Commit Graph

158 Commits

Author SHA1 Message Date
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
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
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
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
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