Skip to content

Commit 355858e

Browse files
committed
Fix typo in Description and add details about initialisation behaviours
1 parent 432b698 commit 355858e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hal/rfcs/0000-spi-overhaul.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
This updates targets the SPI HAL as the first step of a wide plan for all HAL APIs.
5+
This update targets the SPI HAL as the first step of a wide plan for all HAL APIs.
66

77
## Motivation
88

@@ -137,7 +137,7 @@ void spi_free(spi_t *obj);
137137
- At least a symbol width of 8bit must be supported.
138138
- The supported frequency range must include the range [0.2..2] MHz.
139139
- The shortest part of the duty cycle must not be shorter than 50% of the expected period.
140-
- `spi_init()` initializes the pins.
140+
- `spi_init()` initializes the pins leaving the configuration registers unchanged.
141141
- `spi_init()` ignores the `SS` pin if `is_slave` is false.
142142
- `spi_free()` resets the pins to their default state.
143143
- `spi_free()` disables the peripheral clock.
@@ -149,8 +149,11 @@ void spi_free(spi_t *obj);
149149
2. Clock idle state is *high*, data are sampled when the clock becomes *active* (polarity = 1, phase = 0)
150150
3. Clock idle state is *high*, data are sampled when the clock becomes *inactive* (polarity = 1, phase = 1)
151151
- the bit ordering (lsb/msb first).
152+
- `spi_format()` updates the configuration of the peripheral except the baud rate generator.
152153
- `spi_frequency()` sets the frequency to use during the transfer.
153154
- `spi_frequency()` returns the actual frequency that will be used.
155+
- `spi_frequency()` updates the baud rate generator leaving other configurations unchanged.
156+
- `spi_init()`, `spi_frequency()` and `spi_format()` must be called at least once each before initiating any transfer.
154157
- `spi_transfer()` :
155158
- writes `tx_len` symbols to the bus.
156159
- reads `rx_len` symbols from the bus.

0 commit comments

Comments
 (0)