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

Hugues Larrive notifications at github.com
Mon Sep 13 22:32:50 CEST 2021


> > Some MCU have SPI peripherals on different clock bus so we must add a bus parameter to the two new functions.
> 
> But since `spi_clk_t` is opaque and can be defined differently for reach MCU, this could even be a `struct` if needed.

But spi_clk_t is the output of spi_get_clk() which basically doing something like return a prescaler >= source_clock / target frequency. So it need to know which source_clock to use i.e. on same54-xpro (SAM0_GCLK_PERIPH / 2) for SPI_DEV(0), ( SAM0_GCLK_48MHZ / 2) for SPI_DEV(1), or SAM0_GCLK_MAIN for SPI_DEV(2) (SPI_ON_QSPI). Or on nucleo-f103rb APB2 (72MHz) for SPI_DEV(0) or APB1 (36MHz) for SPI_DEV(1). 

-- 
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#issuecomment-918553352
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210913/0bd2a203/attachment.htm>


More information about the notifications mailing list