diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-17 14:31:03 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-17 14:31:03 -0600 |
commit | f132dab76a07473d41e14f5f4fb1857a3229ec6a (patch) | |
tree | 621a8f1ae6cb15d360cd47c0bccd08a1c2226f4e /cmd/sbc_harness/hw/rp2040_hwspi.c | |
parent | a1fb6a6103cc7d38d54270bcdb9779982d329c9e (diff) |
libmisc
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; |