Commit Graph

15 Commits

Author SHA1 Message Date
Dan Halbert
b3ffb3ab1f Return bytes written from RP2040 UART.write() 2021-04-21 18:38:35 -04: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
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Dan Halbert
fb7a0f7efc add 1sec timeouts for I2C read and write 2021-03-03 09:43:57 -05:00
Dan Halbert
e3ab394cd6 works on nearly all sensors 2021-03-02 23:27:37 -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
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
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
microDev
5d7fdafcde
implement suggested changes
- add internal buffering
- rtc initialization fix
2021-02-25 00:48:36 +05:30
microDev
b12ccefbe6
uart implementation for rp2040 2021-02-19 18:36:00 +05:30
Dan Halbert
53a002a096 Initial fix, but bitbangio timing may be off 2021-02-18 13:14:51 -05:00
BiffoBear
2656c84b01 Initial commit. Edited error messages in .c files 2021-02-03 05:49:40 +07:00
Scott Shawcroft
b42e94ee2c
Raise an error on UART use 2021-01-26 08:48:30 -08:00
Scott Shawcroft
733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00