From 1d5b1a3fcc148c500fb666e5955ae32864b176ad Mon Sep 17 00:00:00 2001 From: Matt Mets Date: Fri, 3 Mar 2023 16:52:45 +0100 Subject: [PATCH] Add SPI frequency option to call --- iceprog/rpi_pico_interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iceprog/rpi_pico_interface.c b/iceprog/rpi_pico_interface.c index 9e82caa..f224cb3 100644 --- a/iceprog/rpi_pico_interface.c +++ b/iceprog/rpi_pico_interface.c @@ -160,13 +160,15 @@ static void set_spi_pins( uint8_t sck_pin, uint8_t cs_pin, uint8_t mosi_pin, - uint8_t miso_pin) { + uint8_t miso_pin, + uint8_t speed_mhz) { - uint8_t buf[4]; + uint8_t buf[5]; buf[0] = sck_pin; buf[1] = cs_pin; buf[2] = mosi_pin; buf[3] = miso_pin; + buf[4] = speed_mhz; usb_write(FLASHER_REQUEST_SPI_PINS_SET, buf, sizeof(buf)); } @@ -347,7 +349,7 @@ void rpi_pico_interface_init() { pin_write(PIN_POWER, true); - set_spi_pins(PIN_SCK, PIN_SS, PIN_MOSI, PIN_MISO); + set_spi_pins(PIN_SCK, PIN_SS, PIN_MOSI, PIN_MISO, 15); } // ********* API ****************