spi: Fix SPI Slave TX/RX bitlen configuring wrong registers
The maximum input length for the SPI Slave should be applied to the read
buffer configuration, not for the write buffer. Similarly, the output
configuration should also target the write buffer.
@@ -744,7 +744,7 @@ static inline void spi_ll_set_mosi_bitlen(spi_dev_t *hw, size_t bitlen)
*/
static inline void spi_ll_slave_set_rx_bitlen(spi_dev_t *hw, size_t bitlen)
{
- hw->slv_wrbuf_dlen.bit_len = bitlen - 1;
+ hw->slv_rdbuf_dlen.bit_len = bitlen - 1;
}
/**
@@ -755,7 +755,7 @@ static inline void spi_ll_slave_set_rx_bitlen(spi_dev_t *hw, size_t bitlen)
*/
static inline void spi_ll_slave_set_tx_bitlen(spi_dev_t *hw, size_t bitlen)
{
- hw->slv_rdbuf_dlen.bit_len = bitlen - 1;
+ hw->slv_wrbuf_dlen.bit_len = bitlen - 1;
}
/**
