[riot-notifications] [RIOT-OS/RIOT] stm32/spi : Add check for GPIO_UNDEF (#16625)

Akshai M (Augustus Diode) notifications at github.com
Wed Jul 7 18:34:08 CEST 2021


@akshaim commented on this pull request.



> +    if (gpio_is_valid(spi_config[bus].mosi_pin)) {
+        gpio_init(spi_config[bus].mosi_pin, GPIO_OUT);
+        gpio_init_af(spi_config[bus].mosi_pin, spi_config[bus].mosi_af);
+    }
+
+    if (gpio_is_valid(spi_config[bus].miso_pin)) {
+        gpio_init(spi_config[bus].miso_pin, GPIO_IN);
+        gpio_init_af(spi_config[bus].miso_pin, spi_config[bus].miso_af);
+    }
+
+    if (gpio_is_valid(spi_config[bus].sclk_pin)) {
+        gpio_init(spi_config[bus].sclk_pin, GPIO_OUT);
+        gpio_init_af(spi_config[bus].sclk_pin, spi_config[bus].sclk_af);
+    }

The catch here is what if I am using both `PERIPH` and `GPIO` ?

-- 
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/16625#discussion_r665534359
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210707/ba9a8af6/attachment.htm>


More information about the notifications mailing list