diff options
Diffstat (limited to 'cmd/sbc_harness/hw/rp2040_hwspi.c')
-rw-r--r-- | cmd/sbc_harness/hw/rp2040_hwspi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/sbc_harness/hw/rp2040_hwspi.c b/cmd/sbc_harness/hw/rp2040_hwspi.c index e6e4566..dd9a577 100644 --- a/cmd/sbc_harness/hw/rp2040_hwspi.c +++ b/cmd/sbc_harness/hw/rp2040_hwspi.c @@ -10,9 +10,11 @@ #include <hardware/spi.h> /* pico-sdk:hardware_spi */ #include <hardware/gpio.h> /* pico-sdk:hardware_gpio5 */ +#include <libmisc/vcall.h> + #include "hw/rp2040_hwspi.h" -static void rp2040_hwspi_readwritev(struct spi *_self, const struct bidi_iovec *iov, int iovcnt); +static void rp2040_hwspi_readwritev(implements_spi *, const struct bidi_iovec *iov, int iovcnt); struct spi_vtable rp2040_hwspi_vtable = { .readwritev = rp2040_hwspi_readwritev, @@ -96,8 +98,8 @@ void _rp2040_hwspi_init(struct rp2040_hwspi *self, self->pin_cs = pin_cs; } -static void rp2040_hwspi_readwritev(struct spi *_self, const struct bidi_iovec *iov, int iovcnt) { - struct rp2040_hwspi *self = (struct rp2040_hwspi *)_self; +static void rp2040_hwspi_readwritev(implements_spi *_self, const struct bidi_iovec *iov, int iovcnt) { + struct rp2040_hwspi *self = VCALL_SELF(struct rp2040_hwspi, implements_spi, _self); assert(self); spi_inst_t *inst = self->inst; |