[riot-notifications] [RIOT-OS/RIOT] [RFC, WIP] drivers/periph_spi: improve API of spi_acquire (#15904)

Hugues Larrive notifications at github.com
Wed Sep 1 16:45:49 CEST 2021


@hugueslarrive commented on this pull request.



>   *                      select should not be handled by the SPI driver
- * @param[in] mode      mode to use for the new transaction
- * @param[in] clk       bus clock speed to use for the transaction
- *
- * @return              SPI_OK on success
- * @return              SPI_NOMODE if given mode is not supported
- * @return              SPI_NOCLK if given clock speed is not supported
+ * @param[in]   mode    mode to use for the new transaction
+ * @param[in]   clk     maximum bus clock to use in Hz
+ *
+ * @return  The actually used clock frequency in Hz

In some case this lead into additional computation and we don't need this information every time spi_acquire is called so what do you think of a dedicated function as in #16727. Moreover this allow to retrieve the resulting speeds without providing mode and cs parameters as in the cmd_init function's help in tests/periph_spi.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15904#pullrequestreview-744027764
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210901/81ca83d2/attachment.htm>


More information about the notifications mailing list