[riot-notifications] [RIOT-OS/RIOT] periph/spi: add support for printing and testing SPI clock rate (#16727)

Marian Buschsieweke notifications at github.com
Thu Sep 23 10:42:35 CEST 2021

OK, you convinced me that adding a getter function for the maximum and minimum SPI frequency makes sense. (It will have to be a function or a function-like macro, since some MCUs support different frequencies for their SPI peripherals. E.g. they might have an high speed QSPI that can be used to connect flash to it that is used as regular SPI in RIOT, and a normal SPI (without Quad-) that runs at a lower clock.)

The reason I was skeptical to this is that I observed that niche features in periph APIs often lead to some of the implementations not implementing it consistently, correctly, or at all. For that reason I'm always in favor of keeping peripheral APIs as slim as possible and rather implement convenience features on top of it.

But I agree that dynamically adapting the clock frequency is something where you don't want to run in an `assert()`, but rather just keep the SPI at the lowest frequency and hope for conditions to improve over time.

I don't think that a getter for a maximum frequency is strictly needed, but as it is trivial to automatically test its correctness, it should be a piece of cake to maintain.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210923/c49a30b9/attachment-0001.htm>

More information about the notifications mailing list