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

Hugues Larrive notifications at github.com
Wed Sep 1 04:15:17 CEST 2021


@hugueslarrive commented on this pull request.



> @@ -99,6 +99,38 @@ static uint32_t _xtimer_diff_usec(xtimer_ticks32_t stop, xtimer_ticks32_t start)
     return xtimer_usec_from_ticks(xtimer_diff(stop, start));
 }
 
+static int _print_arch_help(void)
+{
+#ifdef CLOCK_APB1 /* STM32 */
+#define HAS_ARBITRARY_BUS_SPEED
+    int clk, tmp;
+
+    for (int i = 0; i < (int)SPI_NUMOF; i++) {
+        printf("\t\tSPI_DEV(%i), ", i);
+        if (spi_config[i].apbbus == APB1) {
+            clk = CLOCK_APB1;
+            printf("CLOCK_APB1 = %luHz\n", (uint32_t)CLOCK_APB1);
+        }
+        else if (spi_config[i].apbbus == APB2) {
+            clk = CLOCK_APB2;
+            printf("CLOCK_APB2 = %luHz\n", (uint32_t)CLOCK_APB2);

Sorry but I gave up this part of the code, anyway thanks for the review.

-- 
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/16727#discussion_r699792962
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210831/971b4b3c/attachment.htm>


More information about the notifications mailing list