You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design-documents/hal/0000-spi-overhaul.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,10 @@ void spi_free(spi_t *obj);
163
163
- if `ssel` is `NC` the hal implementation ignores this pin.
164
164
- if `ssel` is not `NC` then the hal implementation owns the pin and its management.
165
165
- When managed by the hal implementation, `ssel` is always considered active low.
166
+
- When managed by the hal implementation, `ssel` must be asserted for the whole duration of the spi transmission.
167
+
- When managed by the hal implementation, the delay from the chip select assert to the first clock edge must be at least half spi clock period.
168
+
- When managed by the hal implementation, the delay from the last clock edge to the chip select de-assert to must be at least half spi clock period.
169
+
- If hardware can not handle all `ssel` related requirements, then device capabilities should indicate that `ssel` cannot be managed by hardware.
166
170
- When the hardware supports the half-duplex (3-wire) mode, if `miso` (exclusive) or `mosi` is missing in any function that expects pins, the bus is assumed to be half-duplex.
167
171
- `spi_free()` resets the pins to their default state.
168
172
- `spi_free()` disables the peripheral clock.
@@ -178,7 +182,6 @@ void spi_free(spi_t *obj);
178
182
- `spi_frequency()` sets the frequency to use during the transfer.
179
183
- `spi_frequency()` returns the actual frequency that will be used.
180
184
- `spi_frequency()` updates the baud rate generator leaving other configurations unchanged.
181
-
- `spi_init()`, `spi_frequency()` and `spi_format()` must be called at least once each before initiating any transfer.
182
185
- `spi_transfer()` :
183
186
- writes `tx_len` symbols to the bus.
184
187
- reads `rx_len` symbols from the bus.
@@ -227,6 +230,7 @@ void spi_free(spi_t *obj);
227
230
- Passing an invalid pointer as `handler` to `spi_transfer_async`.
228
231
- Calling `spi_transfer_async_abort()` while no async transfer is being processed (no transfer or a synchronous transfer).
229
232
- In half-duplex mode, any mechanism (if any is present) to detect or prevent collision is implementation defined.
233
+
- Initiating any transfer after `spi_init()` but before both the frequency and format have been set with `spi_frequency()` and `spi_format()`
230
234
231
235
### Updated flow
232
236
The IRQ flow has slightly changed. In the new API the flow is as follow :
0 commit comments