Skip to content

Commit 7eb7df9

Browse files
committed
spi-overhaul: add exceptions for spi async API
Handling buffers of a different sizes or half-duplex transfer in asyc mode might be very tricky and is a potential place for many problems. This PR changes the documentation to allow only equal buffer sizes and full duplex transfer in async mode.
1 parent 0892667 commit 7eb7df9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/design-documents/hal/0000-spi-overhaul.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ void spi_free(spi_t *obj);
196196
- In Half-duplex mode :
197197
- as master, `spi_transfer()` sends `tx_len` symbols and then reads `rx_len` symbols.
198198
- as slave, `spi_transfer()` receives `rx_len` symbols and then sends `tx_len` symbols.
199-
- `spi_transter_async()` schedules a transfer to be process the same way `spi_transfer()` would have but asynchronously.
199+
- `spi_transter_async()` schedules a transfer to be process the same way `spi_transfer()` would have but asynchronously with the following exceptions:
200+
- in async mode only transfers of the same size are allowed (tx size must be equal to rx size)
201+
- async mode only supports full-duplex mode
200202
- `spi_transter_async()` returns immediately with a boolean indicating whether the transfer was successfully scheduled or not.
201203
- The callback given to `spi_transfer_async()` is invoked when the transfer completes (with a success or an error).
202204
- `spi_transfer_async()` saves the handler and the `ctx` pointer.

0 commit comments

Comments
 (0)