From 5a84ba2361cecade0343b88f696b6a63454cc3c6 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 23 Feb 2025 09:24:31 -0700 Subject: Pull out libhw/generic/io.h, have it enforce iovecs everywhere --- libhw/rp2040_hwspi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libhw/rp2040_hwspi.c') diff --git a/libhw/rp2040_hwspi.c b/libhw/rp2040_hwspi.c index 23f3e8c..8c87666 100644 --- a/libhw/rp2040_hwspi.c +++ b/libhw/rp2040_hwspi.c @@ -12,6 +12,7 @@ #define IMPLEMENTATION_FOR_LIBHW_RP2040_HWSPI_H YES #include +LO_IMPLEMENTATION_C(io_duplex_readwriter, struct rp2040_hwspi, rp2040_hwspi, static) LO_IMPLEMENTATION_C(spi, struct rp2040_hwspi, rp2040_hwspi, static) void _rp2040_hwspi_init(struct rp2040_hwspi *self, @@ -83,7 +84,7 @@ void _rp2040_hwspi_init(struct rp2040_hwspi *self, self->pin_cs = pin_cs; } -static void rp2040_hwspi_readwritev(struct rp2040_hwspi *self, const struct bidi_iovec *iov, int iovcnt) { +static void rp2040_hwspi_readwritev(struct rp2040_hwspi *self, const struct duplex_iovec *iov, int iovcnt) { assert(self); spi_inst_t *inst = self->inst; @@ -101,7 +102,7 @@ static void rp2040_hwspi_readwritev(struct rp2040_hwspi *self, const struct bidi else if (iov[i].iov_read_dst) spi_read_blocking(inst, 0, iov[i].iov_read_dst, iov[i].iov_len); else - assert_notreached("bidi_iovec is neither read nor write"); + assert_notreached("duplex_iovec is neither read nor write"); } gpio_put(self->pin_cs, 1); } -- cgit v1.2.3-2-g168b