Граф коммитов

13 коммитов

Автор SHA1 Сообщение Дата
soypat
d01d85930d rp2040: add spi busy waits on read and read/write transactions 2023-06-11 22:24:26 +02:00
Ayke van Laethem
3b4e543f4e rp2040: use DMA for send-only SPI transfers
This improves slightly. It also is some groundwork for better DMA
support in TinyGo in the future.

I'm not entirely sure why it improves performance (in theory the old
code should already saturate the SPI bus) but it does, so 🤷
2023-04-04 12:22:52 +02:00
Ayke van Laethem
7d83e76833 rp2040: use 4MHz as default frequency for SPI
This matches other SPI implementations. I think the original value of
115200 was from a confusion with UART.
2023-04-02 01:04:37 +02:00
Ayke van Laethem
6eda52a289 rp2040: remove SPI deadline
Removing it improves SPI performance by about 20% for me (updating the
display of a Gopher Badge).
2023-04-01 11:18:51 +02:00
Ayke van Laethem
568c2a4363 rp2040: remove SPI DataBits property
As discussed on Slack, I believe this property does more harm than good:

  * I don't think it's used anywhere. None of the drivers use it.
  * It is not fully implemented. While values <= 8 might work fine,
    values larger than 8 result in extra zero bits (instead of anything
    sensible).
  * Worse, it doesn't return an error when it's out of range. This is
    not an optional property: if the SPI peripheral doesn't support a
    particular number of bits, it should return an error instead of
    silently limiting the number of bits. This will be confusing to
    users.

Therefore, I propose we drop it. Maybe there are good uses for it
(perhaps for displays that use big endian 16-bit values?), but without a
good use case like a driver in tinygo.org/x/drivers, I think it's more
trouble than it's worth.
2023-03-29 09:30:16 +02:00
sago35
7ca45d61fc machine/rp2040: correct issue with spi pin validation 2023-03-07 21:11:57 +09:00
deadprogram
ad1da7d26f machine/rp2040: correct issue with spi pin validation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-02-24 01:05:58 +01:00
Patricio Whittingslow
96b70fd619
rp2040: provide better errors for invalid pins on i2c and spi (#3443)
machine/rp2040: provide better errors for invalid pins on i2c and spi
2023-02-23 13:26:14 +01:00
Yurii Soldak
8d4d3c6201 build: drop deprecated build tags 2022-12-19 23:20:11 +01:00
Ayke van Laethem
86ea216e7d machine: move SPI Tx function into separate file
This makes the code a bit cleaner because ErrTxInvalidSliceSize isn't
redefined in every file that uses SPI and Mode0/Mode1/Mode2/Mode3 is
defined for every target that uses SPI.
2022-09-21 06:52:42 +02:00
Ayke van Laethem
c7a23183e8 all: format code according to Go 1.19 rules
Go 1.19 started reformatting code in a way that makes it more obvious
how it will be rendered on pkg.go.dev. It gets it almost right, but not
entirely. Therefore, I had to modify some of the comments so that they
are formatted correctly.
2022-08-04 12:18:32 +02:00
Ayke van Laethem
77ec9b6369 all: update build constraints to Go 1.17
Do it all at once in preparation for Go 1.18 support.

To make this commit, I've simply modified the `fmt-check` Makefile
target to rewrite files instead of listing the differences. So this is a
fully mechanical change, it should not have introduced any errors.
2022-02-04 07:49:46 +01:00
soypat
98e70c9b19 machine/rp2040: add SPI support
spi working with loopback

SPI working

apply @deadprogram's suggestions

consolidate SPI board pin naming

fix up SPI configuration

add feather-rp2040 SPI pins

add arduino connect SPI pins

add SPI handle variables
2021-07-31 22:11:08 +02:00