summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness/main.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-04 00:18:23 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-04 00:18:23 -0700
commit47cee5df1e5e63a8d0a5f1b634ac6d4e1ff00af7 (patch)
treed72daabeedecbc397cdce739639f8cf2cb947685 /cmd/sbc_harness/main.c
parent355d7a495b0ca1a622d600427a8c737f3207a803 (diff)
parent3f49a57b99e7fe5aafa73e70ed146d98b1ae174c (diff)
Merge branch 'lukeshu/dma'
Diffstat (limited to 'cmd/sbc_harness/main.c')
-rw-r--r--cmd/sbc_harness/main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c
index 6f1d0ca..c932ec0 100644
--- a/cmd/sbc_harness/main.c
+++ b/cmd/sbc_harness/main.c
@@ -168,11 +168,14 @@ COROUTINE init_cr(void *) {
rp2040_hwspi_init(&globals.dev_spi, "W5500", RP2040_HWSPI_0,
SPI_MODE_0, /* the W5500 supports mode 0 or mode 3 */
- 60*1000*1000, /* as close to the W5500's max rate of 80MHz as we can without hwspi borking */
- 16, /* PIN_MISO */
- 19, /* PIN_MOSI */
- 18, /* PIN_CLK */
- 17); /* PIN_CS */
+ 42500000, /* min(w5500, hwspi); w5500=80MHz; hwspi=42.5MHz, see rp2040_hwspi.h for a comment about why this is so low */
+ 30, /* W5500 datasheet says min(T_CS = SCSn High Time) = 30ns */
+ 0, /* bogus write write data when doing a read */
+ 16, /* PIN_MISO */
+ 19, /* PIN_MOSI */
+ 18, /* PIN_CLK */
+ 17, /* PIN_CS */
+ 0, 1, 2, 3); /* DMA channels */
w5500_init(&globals.dev_w5500, "W5500",
lo_box_rp2040_hwspi_as_spi(&globals.dev_spi),
21, /* PIN_INTR */