Commit Graph

279 Commits

Author SHA1 Message Date
Scott Shawcroft 9c20eb58e9
Merge pull request #6450 from mwisslead/rp2040_pulsein_common_hal_construct
Rp2040 pulsein improvements
2022-06-08 08:15:29 -07:00
Scott Shawcroft 9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00
Paint Your Dragon c3f58193ca
Correctly scale analog reading per issue #4794 2022-05-24 08:46:39 -07:00
Michael Wisslead 2b0518233b rp2040 PulseIn improvements 2022-05-23 00:45:06 +00:00
Michael Wisslead 893fc66d16 Use common_hal_rp2pio_statemachine_construct for PulseIn 2022-05-23 00:45:06 +00:00
Dan Halbert f63b26c534 address jepler's comments and further squeezes 2022-05-20 10:10:55 -04:00
Dan Halbert a01dec1df9 message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
Dan Halbert bb46898572
Merge pull request #6361 from mwisslead/rp2040_pulsein_buffer_fix
Fix buffer issue for rp2040 PulseIn
2022-05-08 12:37:17 -04:00
Michael Wisslead b7882edd01 Fix buffer issue for rp2040 PulseIn 2022-05-07 00:57:10 +00:00
Jeff Epler b482a732c6
StateMachine: add swap flag
Always use DMA if swap flag is enabled.

Improve docs a bit
2022-05-06 15:22:43 -05:00
Jeff Epler 23c0fc8354
add ability to get, clear txstall flag
This can be used to make sure a PIO has actually finished all data
it was schedule to receive via a 'once' background_write
2022-05-06 15:22:43 -05:00
Jeff Epler f776749ca3
Key off len, not buf, to decide if anything to DMA 2022-05-06 15:22:43 -05:00
Jeff Epler 1a9034ff7c
rp2pio: Allow background_write(None) to terminate after complete loop 2022-05-06 15:22:42 -05:00
Jeff Epler a9d929627a
minor comment update 2022-05-05 14:40:49 -05:00
KurtE 1fad381513 [RP2040] Allow any GPIO pin for RS485 direction pin
As I mentioned in issue #6310 while investigating that the Teensy port
did not support RS485_dir pin on normal GPIO pins, I found that it
was not implemented either as well on some other ports.

So was curious to implement it for RP2040 using same approach as I did
for the MIMXRT in the Pull Request #6328

That is I setup the specified pin as a normal GPIO pin in output mode
and then when you do a write operation it sets the GPIO pin logically
high, and when the write completes I set it logically low.

Note: knowing when I can set it low can be tricky, as you need to make
sure the full output has completed otherwise the data will be corrupted.

I am using:         uart_tx_wait_blocking(self->uart);
Which looks like it is supposed to wait until the busy status is no
longer set, which the Reference manual mentioned, but this is leaving
the line logically set longer than I would like.

however I have tried running it with my hacked up version of the
Python Robotis DynamixelSDK and was able to talk to some AX servos.

I did have to change the library slightly for the RP2040, as the
library was erroring out when you did something like uart.read(5)
and it timed out without receiving anything.  The RP2040 returned
None whereas I think the Teensy returned an empty set, which is what
it looks like the PySerial original code expects.

Not sure if anyone is interested in this, but thought i would
put it out as PR and see.
2022-04-30 14:31:08 -07:00
Dan Halbert 63abd9a9cf
Merge pull request #6312 from dhalbert/adjust-neopixel-timings
test and adjust NeoPixel timings on multiple ports
2022-04-26 13:18:47 -04:00
Dan Halbert 3a8fb4e956
Merge pull request #5852 from jepler/floppy
Add floppyio
2022-04-26 11:40:19 -04:00
Dan Halbert 4eeaf41edc test and adjust NeoPixel timings on multiple products 2022-04-25 23:12:24 -04:00
Jeff Epler 989fb828d4
Revamp background writing
Now a 'once' and a 'loop' buffer can be specified.

'once' is useful for things like writing a neopixel strip in the background,
if you can guarantee the buffer contents are stable until the write is complete.

'loop' is useful for periodic things, like pwm & servos.

both together are useful for some special cases of pwm/servo, where a
transitional waveform needs to be played for one repetition and then
a new waveform needs to be played after that.

The API is renamed to reflect that it's a more generic 'background'
operation.
2022-04-23 13:09:36 -05:00
Jeff Epler ebc426d9e6
Remove debug prints, improve docs 2022-04-19 16:39:04 -05:00
Jeff Epler b128f180ca
switch to single single dma channel, fix some bugs 2022-04-19 16:33:51 -05:00
Jeff Epler 33d6d55675
the basics work
the sequence has to be a minimum length, 8 entries, but this problem
is not detected. I don't THINK this is an insurmountable problem.
2022-04-19 15:14:50 -05:00
Jeff Epler 33f5598acc
Stub 'continuous write' functionality 2022-04-19 11:35:43 -05:00
Jeff Epler f7be4345d9
Merge remote-tracking branch 'origin/main' into floppy 2022-04-07 08:37:46 -05:00
Dan Halbert 1a329cfd11
Merge pull request #6029 from jepler/pio-wrap
raspberry: StateMachine: Add support for wrap=, wrap_target=
2022-04-06 11:55:02 -04:00
Jeff Epler fe98248a3d
Merge remote-tracking branch 'origin/7.2.x' into merge-7.2.x 2022-04-05 08:45:13 -05:00
Dan Halbert 4cccc1a036 handle clearing both RXIC and RTIC interrupts 2022-04-04 23:55:08 -04:00
Radomir Dopieralski b69a06b2ed Also fix the read pin in the atmel and rp2040 ports 2022-03-06 11:33:07 +01:00
Jeff Epler a58bf235d8
raspberry: StateMachine: Add support for wrap=, wrap_target= 2022-02-13 16:38:53 -06: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 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 749bb99863
bump pico-sdk to 1.3.0 2022-02-02 17:15:33 -06: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
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
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
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
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
Jeff Epler 1986d2ee71
clear out interrupt flags when disabling timer too 2021-12-27 16:42:41 -06:00
Scott Shawcroft 827ad327a5
Only ignore warnings if in gcc >= 11 2021-12-22 18:21:18 -08:00