summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/sbc_harness/main.c')
-rw-r--r--cmd/sbc_harness/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c
index 9f32037..1200608 100644
--- a/cmd/sbc_harness/main.c
+++ b/cmd/sbc_harness/main.c
@@ -12,6 +12,7 @@
#include <libusb/usb_common.h>
#include "hw/rp2040_hwspi.h"
+#include "hw/w5500.h"
#include "usb_keyboard.h"
COROUTINE hello_world_cr(void *_chan) {
@@ -34,6 +35,19 @@ int main() {
/* initialization */
stdio_uart_init();
+ struct rp2040_hwspi dev_spi;
+ struct w5500 dev_w5500;
+ rp2040_hwspi_init(&dev_spi, "W5500", RP2040_HWSPI_0,
+ SPI_MODE_0, /* the W5500 supports mode 0 or mode 3 */
+ 80*1000*1000, /* run at the W5500's max rate of 80MHz */
+ 16, /* PIN_MISO */
+ 19, /* PIN_MOSI */
+ 18, /* PIN_CLK */
+ 17); /* PIN_CS */
+ w5500_init(&dev_w5500, "W5500", &dev_spi,
+ 21, /* PIN_INTR */
+ 20); /* PIN_RESET */
+
usb_common_earlyinit();
usb_keyboard_init();
usb_common_lateinit();