feat(driver_spi): slave driver support config different tx/rx length

This commit is contained in:
wanckl
2026-06-10 14:41:13 +08:00
parent ecb4123afd
commit 875b7ab7c0
7 changed files with 103 additions and 66 deletions
@@ -67,7 +67,9 @@ typedef struct {
*/
struct spi_slave_transaction_t {
uint32_t flags; ///< Bitwise OR of SPI_SLAVE_TRANS_* flags
size_t length; ///< Total data length, in bits
size_t length; ///< Total data length, in bits. It both for TX and RX, do NOT use together with independent length
size_t tx_length; ///< Independent Tx data length, in bits, using with tx_buffer. do NOT use together with `length`
size_t rx_length; ///< Independent Rx data length, in bits, using with rx_buffer. do NOT use together with `length`
size_t trans_len; ///< Transaction data length, in bits
const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase
void *rx_buffer; /**< Pointer to receive buffer, or NULL for no MISO phase.