diff --git a/configs/cloudctrl/src/cloudctrl.h b/configs/cloudctrl/src/cloudctrl.h index 13cf202567c..44042435af1 100644 --- a/configs/cloudctrl/src/cloudctrl.h +++ b/configs/cloudctrl/src/cloudctrl.h @@ -220,14 +220,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/cloudctrl/src/stm32_boot.c b/configs/cloudctrl/src/stm32_boot.c index e2eca93070d..63d250c4cc9 100644 --- a/configs/cloudctrl/src/stm32_boot.c +++ b/configs/cloudctrl/src/stm32_boot.c @@ -73,13 +73,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/cloudctrl/src/stm32_spi.c b/configs/cloudctrl/src/stm32_spi.c index c72c09d9651..6cabaff2727 100644 --- a/configs/cloudctrl/src/stm32_spi.c +++ b/configs/cloudctrl/src/stm32_spi.c @@ -85,14 +85,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the cloudctrl board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI3 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -120,7 +120,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -129,9 +129,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/cloudctrl/src/stm32_w25.c b/configs/cloudctrl/src/stm32_w25.c index 4feea296e22..da059d35b96 100644 --- a/configs/cloudctrl/src/stm32_w25.c +++ b/configs/cloudctrl/src/stm32_w25.c @@ -53,6 +53,7 @@ # include #endif +#include "stm32_spi.h" #include "cloudctrl.h" /**************************************************************************** @@ -103,7 +104,7 @@ int stm32_w25initialize(int minor) /* Get the SPI port */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { fdbg("ERROR: Failed to initialize SPI port 2\n"); diff --git a/configs/fire-stm32v2/src/fire-stm32v2.h b/configs/fire-stm32v2/src/fire-stm32v2.h index 8d11298406b..5309f751355 100644 --- a/configs/fire-stm32v2/src/fire-stm32v2.h +++ b/configs/fire-stm32v2/src/fire-stm32v2.h @@ -273,14 +273,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the M3 Wildfire board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/fire-stm32v2/src/stm32_boot.c b/configs/fire-stm32v2/src/stm32_boot.c index 401b50012de..852fba85304 100644 --- a/configs/fire-stm32v2/src/stm32_boot.c +++ b/configs/fire-stm32v2/src/stm32_boot.c @@ -72,13 +72,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/fire-stm32v2/src/stm32_enc28j60.c b/configs/fire-stm32v2/src/stm32_enc28j60.c index 4c009a1dd06..40d7954b69c 100644 --- a/configs/fire-stm32v2/src/stm32_enc28j60.c +++ b/configs/fire-stm32v2/src/stm32_enc28j60.c @@ -63,6 +63,8 @@ #include "chip.h" #include "up_arch.h" #include "up_internal.h" +#include "stm32_spi.h" + #include "fire-stm32v2.h" #ifdef CONFIG_ENC28J60 @@ -183,7 +185,7 @@ void up_netinitialize(void) * 2) Clocking for the SPI1 peripheral was also provided earlier in boot-up. */ - spi = up_spiinitialize(ENC28J60_SPI_PORTNO); + spi = stm32_spibus_initialize(ENC28J60_SPI_PORTNO); if (!spi) { nlldbg("Failed to initialize SPI port %d\n", ENC28J60_SPI_PORTNO); diff --git a/configs/fire-stm32v2/src/stm32_spi.c b/configs/fire-stm32v2/src/stm32_spi.c index c407495aeaf..e5f04979572 100644 --- a/configs/fire-stm32v2/src/stm32_spi.c +++ b/configs/fire-stm32v2/src/stm32_spi.c @@ -84,14 +84,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the M3 Wildfire board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -138,7 +138,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -147,9 +147,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/fire-stm32v2/src/stm32_w25.c b/configs/fire-stm32v2/src/stm32_w25.c index cf5ef01f670..3fad2929b24 100644 --- a/configs/fire-stm32v2/src/stm32_w25.c +++ b/configs/fire-stm32v2/src/stm32_w25.c @@ -52,6 +52,7 @@ # include #endif +#include "stm32_spi.h" #include "fire-stm32v2.h" /**************************************************************************** @@ -102,7 +103,7 @@ int stm32_w25initialize(int minor) /* Get the SPI port */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { fdbg("ERROR: Failed to initialize SPI port 2\n"); diff --git a/configs/hymini-stm32v/src/hymini-stm32v.h b/configs/hymini-stm32v/src/hymini-stm32v.h index 10197ab17e9..f821d03465d 100644 --- a/configs/hymini-stm32v/src/hymini-stm32v.h +++ b/configs/hymini-stm32v/src/hymini-stm32v.h @@ -115,14 +115,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Hy-Mini STM32v board. * ************************************************************************************/ -extern void weak_function stm32_spiinitialize(void); +extern void weak_function stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/hymini-stm32v/src/stm32_boot.c b/configs/hymini-stm32v/src/stm32_boot.c index 010a05ebc01..4692aae53bc 100644 --- a/configs/hymini-stm32v/src/stm32_boot.c +++ b/configs/hymini-stm32v/src/stm32_boot.c @@ -73,13 +73,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/hymini-stm32v/src/stm32_spi.c b/configs/hymini-stm32v/src/stm32_spi.c index 4c4d7bea65f..0f1852dd061 100644 --- a/configs/hymini-stm32v/src/stm32_spi.c +++ b/configs/hymini-stm32v/src/stm32_spi.c @@ -85,14 +85,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the HY-MiniSTM32 board. * ************************************************************************************/ -void stm32_spiinitialize(void) +void stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -114,7 +114,7 @@ void stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -123,9 +123,9 @@ void stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/hymini-stm32v/src/stm32_ts.c b/configs/hymini-stm32v/src/stm32_ts.c index c9782b44756..1344c245cd5 100644 --- a/configs/hymini-stm32v/src/stm32_ts.c +++ b/configs/hymini-stm32v/src/stm32_ts.c @@ -155,7 +155,7 @@ int board_tsc_setup(int minor) idbg("minor %d\n", minor); - dev = up_spiinitialize(1); + dev = stm32_spibus_initialize(1); if (!dev) { idbg("Failed to initialize SPI bus\n"); diff --git a/configs/maple/src/maple.h b/configs/maple/src/maple.h index 1e1fd5c87da..775678f05a0 100644 --- a/configs/maple/src/maple.h +++ b/configs/maple/src/maple.h @@ -105,14 +105,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins. * ************************************************************************************/ -void stm32_spiinitialize(void); +void stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/maple/src/stm32_boot.c b/configs/maple/src/stm32_boot.c index e9ac97d7e83..ab0beb6f97b 100644 --- a/configs/maple/src/stm32_boot.c +++ b/configs/maple/src/stm32_boot.c @@ -79,11 +79,11 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) - stm32_spiinitialize(); + stm32_spidev_initialize(); #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not diff --git a/configs/maple/src/stm32_lcd.c b/configs/maple/src/stm32_lcd.c index 7d39662eec6..71108039f4f 100644 --- a/configs/maple/src/stm32_lcd.c +++ b/configs/maple/src/stm32_lcd.c @@ -193,7 +193,7 @@ FAR int board_lcd_initialize(void) lcddbg("Initializing lcd\n"); lcddbg("init spi1\n"); - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); DEBUGASSERT(spi); lcddbg("configure related io\n"); diff --git a/configs/maple/src/stm32_spi.c b/configs/maple/src/stm32_spi.c index 1b5e7b29ed5..22c106a1e4a 100644 --- a/configs/maple/src/stm32_spi.c +++ b/configs/maple/src/stm32_spi.c @@ -87,14 +87,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the maple board. * ****************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -112,7 +112,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -121,9 +121,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/mikroe-stm32f4/src/mikroe-stm32f4.h b/configs/mikroe-stm32f4/src/mikroe-stm32f4.h index 7c8c5acae70..473d0a61fbc 100644 --- a/configs/mikroe-stm32f4/src/mikroe-stm32f4.h +++ b/configs/mikroe-stm32f4/src/mikroe-stm32f4.h @@ -205,14 +205,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the mikroe-stm32f4 board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/mikroe-stm32f4/src/stm32_boot.c b/configs/mikroe-stm32f4/src/stm32_boot.c index 2ec3e6fd1a7..5bd7b9798e4 100644 --- a/configs/mikroe-stm32f4/src/stm32_boot.c +++ b/configs/mikroe-stm32f4/src/stm32_boot.c @@ -83,13 +83,13 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/mikroe-stm32f4/src/stm32_nsh.c b/configs/mikroe-stm32f4/src/stm32_nsh.c index c7278de8a3b..ec3cebc3570 100644 --- a/configs/mikroe-stm32f4/src/stm32_nsh.c +++ b/configs/mikroe-stm32f4/src/stm32_nsh.c @@ -181,7 +181,7 @@ int board_app_initialize(void) /* Get the SPI port */ syslog(LOG_INFO, "Initializing SPI port 3\n"); - spi = up_spiinitialize(3); + spi = stm32_spibus_initialize(3); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 3\n"); diff --git a/configs/mikroe-stm32f4/src/stm32_spi.c b/configs/mikroe-stm32f4/src/stm32_spi.c index 2bd824ba3c4..f56a0758491 100644 --- a/configs/mikroe-stm32f4/src/stm32_spi.c +++ b/configs/mikroe-stm32f4/src/stm32_spi.c @@ -90,14 +90,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the mikroe_stm32f4 board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI3 @@ -128,7 +128,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -137,9 +137,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/nucleo-f303re/src/nucleo-f303re.h b/configs/nucleo-f303re/src/nucleo-f303re.h index 6871c2c33dd..f9eade6cfce 100644 --- a/configs/nucleo-f303re/src/nucleo-f303re.h +++ b/configs/nucleo-f303re/src/nucleo-f303re.h @@ -122,7 +122,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the board. @@ -130,7 +130,7 @@ ****************************************************************************/ #ifdef CONFIG_SPI -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); #endif /**************************************************************************** diff --git a/configs/nucleo-f303re/src/stm32_boot.c b/configs/nucleo-f303re/src/stm32_boot.c index 7776c133ed1..783a231f7c3 100644 --- a/configs/nucleo-f303re/src/stm32_boot.c +++ b/configs/nucleo-f303re/src/stm32_boot.c @@ -80,9 +80,9 @@ void stm32_boardinitialize(void) { #ifdef CONFIG_SPI - if (stm32_spiinitialize != NULL) + if (stm32_spidev_initialize != NULL) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/nucleo-f303re/src/stm32_spi.c b/configs/nucleo-f303re/src/stm32_spi.c index a14cba6c302..51297ba4260 100644 --- a/configs/nucleo-f303re/src/stm32_spi.c +++ b/configs/nucleo-f303re/src/stm32_spi.c @@ -87,14 +87,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the board. * ****************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #if defined(CONFIG_LCD_SSD1351) (void)stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ @@ -110,7 +110,7 @@ void weak_function stm32_spiinitialize(void) * must be provided by board-specific logic. They are implementations of * the select and status methods of the SPI interface defined by struct * spi_ops_s (see include/nuttx/spi/spi.h). All other methods (including - * up_spiinitialize()) are provided by common STM32 logic. To use this + * stm32_spibus_initialize()) are provided by common STM32 logic. To use this * common SPI logic on your board: * * 1. Provide logic in stm32_boardinitialize() to configure SPI chip select @@ -119,9 +119,9 @@ void weak_function stm32_spiinitialize(void) * in your board-specific logic. These functions will perform chip * selection and status operations using GPIOs in the way your board is * configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind * the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/nucleo-f303re/src/stm32_ssd1351.c b/configs/nucleo-f303re/src/stm32_ssd1351.c index f4ccf495e60..417c4f4e8bb 100644 --- a/configs/nucleo-f303re/src/stm32_ssd1351.c +++ b/configs/nucleo-f303re/src/stm32_ssd1351.c @@ -50,6 +50,8 @@ #include #include "stm32_gpio.h" +#include "stm32_spi.h" + #include "nucleo-f303re.h" #ifdef CONFIG_LCD_SSD1351 @@ -109,7 +111,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (spi == NULL) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h index 9f231e8f481..21e5f7b09d2 100644 --- a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h +++ b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h @@ -289,14 +289,14 @@ extern struct sdio_dev_s *g_sdio; ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins. * ************************************************************************************/ -void stm32_spiinitialize(void); +void stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/nucleo-f4x1re/src/stm32_boot.c b/configs/nucleo-f4x1re/src/stm32_boot.c index 0eee168c4a5..6e4cad3ed6b 100644 --- a/configs/nucleo-f4x1re/src/stm32_boot.c +++ b/configs/nucleo-f4x1re/src/stm32_boot.c @@ -82,11 +82,11 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - stm32_spiinitialize(); + stm32_spidev_initialize(); #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not diff --git a/configs/nucleo-f4x1re/src/stm32_spi.c b/configs/nucleo-f4x1re/src/stm32_spi.c index 70571dc9354..9a1a0a17f31 100644 --- a/configs/nucleo-f4x1re/src/stm32_spi.c +++ b/configs/nucleo-f4x1re/src/stm32_spi.c @@ -47,9 +47,9 @@ #include #include -#include -#include -#include +#include "up_arch.h" +#include "chip.h" +#include "stm32.h" #include "nucleo-f4x1re.h" @@ -95,7 +95,7 @@ struct spi_dev_s *g_spi2; ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Nucleo-F401RE and @@ -103,12 +103,12 @@ struct spi_dev_s *g_spi2; * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 /* Configure SPI-based devices */ - g_spi1 = up_spiinitialize(1); + g_spi1 = stm32_spibus_initialize(1); if (!g_spi1) { spidbg("[boot] FAILED to initialize SPI port 1\n"); @@ -126,7 +126,7 @@ void weak_function stm32_spiinitialize(void) #ifdef CONFIG_STM32_SPI2 /* Configure SPI-based devices */ - g_spi2 = up_spiinitialize(2); + g_spi2 = stm32_spibus_initialize(2); /* Setup CS, EN & IRQ line IOs */ @@ -145,7 +145,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -154,9 +154,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/nucleo-f4x1re/src/stm32_wireless.c b/configs/nucleo-f4x1re/src/stm32_wireless.c index 37457c9c2d8..29b70855264 100644 --- a/configs/nucleo-f4x1re/src/stm32_wireless.c +++ b/configs/nucleo-f4x1re/src/stm32_wireless.c @@ -292,7 +292,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Get an instance of the SPI interface */ - spi = up_spiinitialize(CONFIG_CC3000_SPIDEV); + spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV); if (!spi) { idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); diff --git a/configs/olimex-stm32-p107/src/olimex-stm32-p107.h b/configs/olimex-stm32-p107/src/olimex-stm32-p107.h index 143129e097d..4b4b2240e90 100644 --- a/configs/olimex-stm32-p107/src/olimex-stm32-p107.h +++ b/configs/olimex-stm32-p107/src/olimex-stm32-p107.h @@ -75,14 +75,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the M3 Wildfire board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_OLIMEX_STM32_P107_SRC_H */ diff --git a/configs/olimex-stm32-p107/src/stm32_boot.c b/configs/olimex-stm32-p107/src/stm32_boot.c index 1547143f390..c1ae4152a83 100644 --- a/configs/olimex-stm32-p107/src/stm32_boot.c +++ b/configs/olimex-stm32-p107/src/stm32_boot.c @@ -69,13 +69,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/olimex-stm32-p107/src/stm32_encx24j600.c b/configs/olimex-stm32-p107/src/stm32_encx24j600.c index 37f1321b28b..9f377819909 100644 --- a/configs/olimex-stm32-p107/src/stm32_encx24j600.c +++ b/configs/olimex-stm32-p107/src/stm32_encx24j600.c @@ -51,6 +51,8 @@ #include "chip.h" #include "up_arch.h" #include "up_internal.h" +#include "stm32_spi.h" + #include "olimex-stm32-p107.h" #ifdef CONFIG_ENCX24J600 @@ -175,7 +177,7 @@ void up_netinitialize(void) * 2) Clocking for the SPI1 peripheral was also provided earlier in boot-up. */ - spi = up_spiinitialize(ENCX24J600_SPI_PORTNO); + spi = stm32_spibus_initialize(ENCX24J600_SPI_PORTNO); if (!spi) { nlldbg("Failed to initialize SPI port %d\n", ENCX24J600_SPI_PORTNO); diff --git a/configs/olimex-stm32-p107/src/stm32_spi.c b/configs/olimex-stm32-p107/src/stm32_spi.c index 70d950e9a6c..8fea7b1ac9a 100644 --- a/configs/olimex-stm32-p107/src/stm32_spi.c +++ b/configs/olimex-stm32-p107/src/stm32_spi.c @@ -49,6 +49,7 @@ #include "up_arch.h" #include "chip.h" #include "stm32.h" + #include "olimex-stm32-p107.h" #if defined(CONFIG_STM32_SPI3) @@ -84,14 +85,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Olimex stm32-p107 board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI3 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -114,7 +115,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -123,9 +124,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/olimexino-stm32/src/olimexino-stm32.h b/configs/olimexino-stm32/src/olimexino-stm32.h index c06149f9b16..ebbd656019f 100644 --- a/configs/olimexino-stm32/src/olimexino-stm32.h +++ b/configs/olimexino-stm32/src/olimexino-stm32.h @@ -135,7 +135,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins. @@ -144,7 +144,7 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \ defined(CONFIG_STM32_SPI3) -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); #endif /************************************************************************************ diff --git a/configs/olimexino-stm32/src/stm32_boot.c b/configs/olimexino-stm32/src/stm32_boot.c index 2c05dfb4a3f..8e36447b142 100644 --- a/configs/olimexino-stm32/src/stm32_boot.c +++ b/configs/olimexino-stm32/src/stm32_boot.c @@ -95,12 +95,12 @@ void stm32_boardinitialize(void) #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \ defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/olimexino-stm32/src/stm32_composite.c b/configs/olimexino-stm32/src/stm32_composite.c index 3ba7cf423e1..a8de8fd3d8b 100644 --- a/configs/olimexino-stm32/src/stm32_composite.c +++ b/configs/olimexino-stm32/src/stm32_composite.c @@ -103,7 +103,7 @@ int composite_archinitialize(void) syslog(LOG_INFO, "Initializing SPI port %d\n", OLIMEXINO_STM32_MMCSDSPIPORTNO); - spi = up_spiinitialize(OLIMEXINO_STM32_MMCSDSPIPORTNO); + spi = stm32_spibus_initialize(OLIMEXINO_STM32_MMCSDSPIPORTNO); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n", diff --git a/configs/olimexino-stm32/src/stm32_spi.c b/configs/olimexino-stm32/src/stm32_spi.c index 6312f3d4174..59dc0db8922 100644 --- a/configs/olimexino-stm32/src/stm32_spi.c +++ b/configs/olimexino-stm32/src/stm32_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* Setup CS */ @@ -114,7 +114,7 @@ void weak_function stm32_spiinitialize(void) * must be provided by board-specific logic. They are implementations of * the select and status methods of the SPI interface defined by struct * spi_ops_s (see include/nuttx/spi/spi.h). All other methods (including - * up_spiinitialize()) are provided by common STM32 logic. To use this + * stm32_spibus_initialize()) are provided by common STM32 logic. To use this * common SPI logic on your board: * * 1. Provide logic in stm32_boardinitialize() to configure SPI chip @@ -123,9 +123,9 @@ void weak_function stm32_spiinitialize(void) * in your board-specific logic. These functions will perform chip * selection and status operations using GPIOs in the way your board * is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind * the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/olimexino-stm32/src/stm32_usbmsc.c b/configs/olimexino-stm32/src/stm32_usbmsc.c index 5b942c31773..ded0980a1da 100644 --- a/configs/olimexino-stm32/src/stm32_usbmsc.c +++ b/configs/olimexino-stm32/src/stm32_usbmsc.c @@ -105,7 +105,7 @@ int usbmsc_archinitialize(void) syslog(LOG_INFO, "Initializing SPI port %d\n", OLIMEXINO_STM32_MMCSDSPIPORTNO); - spi = up_spiinitialize(OLIMEXINO_STM32_MMCSDSPIPORTNO); + spi = stm32_spibus_initialize(OLIMEXINO_STM32_MMCSDSPIPORTNO); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n", diff --git a/configs/shenzhou/src/shenzhou.h b/configs/shenzhou/src/shenzhou.h index 4bf26bcd261..c66f333361b 100644 --- a/configs/shenzhou/src/shenzhou.h +++ b/configs/shenzhou/src/shenzhou.h @@ -413,14 +413,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/shenzhou/src/stm32_boot.c b/configs/shenzhou/src/stm32_boot.c index 16aea859187..3f52669f7e2 100644 --- a/configs/shenzhou/src/stm32_boot.c +++ b/configs/shenzhou/src/stm32_boot.c @@ -72,13 +72,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/shenzhou/src/stm32_mmcsd.c b/configs/shenzhou/src/stm32_mmcsd.c index 983ef01bb9e..a585e31ad39 100644 --- a/configs/shenzhou/src/stm32_mmcsd.c +++ b/configs/shenzhou/src/stm32_mmcsd.c @@ -46,6 +46,8 @@ #include #include +#include "stm32_spi.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -95,7 +97,7 @@ int stm32_sdinitialize(int minor) fvdbg("Initializing SPI port %d\n", STM32_MMCSDSPIPORTNO); - spi = up_spiinitialize(STM32_MMCSDSPIPORTNO); + spi = stm32_spibus_initialize(STM32_MMCSDSPIPORTNO); if (!spi) { fdbg("Failed to initialize SPI port %d\n", STM32_MMCSDSPIPORTNO); diff --git a/configs/shenzhou/src/stm32_spi.c b/configs/shenzhou/src/stm32_spi.c index d9850d6ed62..48949d686a4 100644 --- a/configs/shenzhou/src/stm32_spi.c +++ b/configs/shenzhou/src/stm32_spi.c @@ -84,14 +84,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Shenzhou board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI3 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -124,7 +124,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -133,9 +133,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/shenzhou/src/stm32_touchscreen.c b/configs/shenzhou/src/stm32_touchscreen.c index 4cdc6338cda..abfe6ebdd7b 100644 --- a/configs/shenzhou/src/stm32_touchscreen.c +++ b/configs/shenzhou/src/stm32_touchscreen.c @@ -260,7 +260,7 @@ int board_tsc_setup(int minor) /* Get an instance of the SPI interface */ - dev = up_spiinitialize(CONFIG_ADS7843E_SPIDEV); + dev = stm32_spibus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); diff --git a/configs/shenzhou/src/stm32_w25.c b/configs/shenzhou/src/stm32_w25.c index 3065dcb2ab9..fe27c8a1d7b 100644 --- a/configs/shenzhou/src/stm32_w25.c +++ b/configs/shenzhou/src/stm32_w25.c @@ -50,6 +50,8 @@ # include # include # include + +# include "stm32_spi.h" #endif #include "shenzhou.h" @@ -102,7 +104,7 @@ int stm32_w25initialize(int minor) /* Get the SPI port */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { fdbg("ERROR: Failed to initialize SPI port 2\n"); diff --git a/configs/spark/src/spark.h b/configs/spark/src/spark.h index 19661fe78cb..4eb5ed6a840 100644 --- a/configs/spark/src/spark.h +++ b/configs/spark/src/spark.h @@ -246,14 +246,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins. * ************************************************************************************/ -void stm32_spiinitialize(void); +void stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/spark/src/stm32_boot.c b/configs/spark/src/stm32_boot.c index 3ad21b4b18d..092a0b2a4a1 100644 --- a/configs/spark/src/stm32_boot.c +++ b/configs/spark/src/stm32_boot.c @@ -83,11 +83,11 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - stm32_spiinitialize(); + stm32_spidev_initialize(); #endif diff --git a/configs/spark/src/stm32_composite.c b/configs/spark/src/stm32_composite.c index c9f51295c20..b555a46fa63 100644 --- a/configs/spark/src/stm32_composite.c +++ b/configs/spark/src/stm32_composite.c @@ -141,7 +141,7 @@ static int do_composite_archinitialize(void) fvdbg("Initializing SPI port %d\n", CONFIG_SPARK_FLASH_SPI); - spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI); + spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI); if (!spi) { fdbg("ERROR: Failed to initialize SPI port %d\n", diff --git a/configs/spark/src/stm32_nsh.c b/configs/spark/src/stm32_nsh.c index f737d022536..0b50bd383a5 100644 --- a/configs/spark/src/stm32_nsh.c +++ b/configs/spark/src/stm32_nsh.c @@ -146,7 +146,7 @@ int board_app_initialize(void) syslog(LOG_INFO, "Initializing SPI port %d\n", CONFIG_SPARK_FLASH_SPI); - spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI); + spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n", diff --git a/configs/spark/src/stm32_spi.c b/configs/spark/src/stm32_spi.c index 42cb2449f36..0dd71f1c167 100644 --- a/configs/spark/src/stm32_spi.c +++ b/configs/spark/src/stm32_spi.c @@ -90,14 +90,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Spark board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI2 @@ -123,7 +123,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -132,9 +132,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/spark/src/stm32_wireless.c b/configs/spark/src/stm32_wireless.c index cd7dfa369de..86cfd7f0af9 100644 --- a/configs/spark/src/stm32_wireless.c +++ b/configs/spark/src/stm32_wireless.c @@ -293,7 +293,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Get an instance of the SPI interface */ - spi = up_spiinitialize(CONFIG_CC3000_SPIDEV); + spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV); if (!spi) { idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); diff --git a/configs/stm3210e-eval/src/stm3210e-eval.h b/configs/stm3210e-eval/src/stm3210e-eval.h index 58c7f78c3c7..b0711d0c6c4 100644 --- a/configs/stm3210e-eval/src/stm3210e-eval.h +++ b/configs/stm3210e-eval/src/stm3210e-eval.h @@ -166,14 +166,14 @@ extern const uint16_t g_commonconfig[NCOMMON_CONFIG]; ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3210E-EVAL board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/stm3210e-eval/src/stm32_boot.c b/configs/stm3210e-eval/src/stm32_boot.c index a458fb23506..1f2a1a7dc01 100644 --- a/configs/stm3210e-eval/src/stm32_boot.c +++ b/configs/stm3210e-eval/src/stm32_boot.c @@ -78,13 +78,13 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm3210e-eval/src/stm32_nsh.c b/configs/stm3210e-eval/src/stm32_nsh.c index d2a0f9c27ea..466152ffb13 100644 --- a/configs/stm3210e-eval/src/stm32_nsh.c +++ b/configs/stm3210e-eval/src/stm32_nsh.c @@ -137,7 +137,7 @@ int board_app_initialize(void) /* Get the SPI port */ syslog(LOG_INFO, "Initializing SPI port 1\n"); - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n"); diff --git a/configs/stm3210e-eval/src/stm32_spi.c b/configs/stm3210e-eval/src/stm32_spi.c index 2b554558cf9..b64df8d679a 100644 --- a/configs/stm3210e-eval/src/stm32_spi.c +++ b/configs/stm3210e-eval/src/stm32_spi.c @@ -84,14 +84,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3210E-EVAL board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -113,7 +113,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -122,9 +122,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm3220g-eval/src/stm3220g-eval.h b/configs/stm3220g-eval/src/stm3220g-eval.h index 2881276c5d0..c259586e8a2 100644 --- a/configs/stm3220g-eval/src/stm3220g-eval.h +++ b/configs/stm3220g-eval/src/stm3220g-eval.h @@ -207,14 +207,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3220G-EVAL board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/stm3220g-eval/src/stm32_boot.c b/configs/stm3220g-eval/src/stm32_boot.c index 2a9aa806fc6..841f2778aa1 100644 --- a/configs/stm3220g-eval/src/stm32_boot.c +++ b/configs/stm3220g-eval/src/stm32_boot.c @@ -72,13 +72,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm3220g-eval/src/stm32_nsh.c b/configs/stm3220g-eval/src/stm32_nsh.c index 8950fd0c661..a7461bb4de1 100644 --- a/configs/stm3220g-eval/src/stm32_nsh.c +++ b/configs/stm3220g-eval/src/stm32_nsh.c @@ -149,7 +149,7 @@ int board_app_initialize(void) #ifdef CONFIG_STM32_SPI1 /* Get the SPI port */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n"); diff --git a/configs/stm3220g-eval/src/stm32_spi.c b/configs/stm3220g-eval/src/stm32_spi.c index 22780c5fba9..5f6332c7fca 100644 --- a/configs/stm3220g-eval/src/stm32_spi.c +++ b/configs/stm3220g-eval/src/stm32_spi.c @@ -84,14 +84,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3220G-EVAL board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #warning "Missing logic" } @@ -103,7 +103,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -112,9 +112,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm3240g-eval/src/stm3240g-eval.h b/configs/stm3240g-eval/src/stm3240g-eval.h index 70008e2977f..29d7b37d1d2 100644 --- a/configs/stm3240g-eval/src/stm3240g-eval.h +++ b/configs/stm3240g-eval/src/stm3240g-eval.h @@ -208,14 +208,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/stm3240g-eval/src/stm32_boot.c b/configs/stm3240g-eval/src/stm32_boot.c index f1dd2a6b278..6a9856048a0 100644 --- a/configs/stm3240g-eval/src/stm32_boot.c +++ b/configs/stm3240g-eval/src/stm32_boot.c @@ -210,12 +210,12 @@ void stm32_boardinitialize(void) { #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm3240g-eval/src/stm32_nsh.c b/configs/stm3240g-eval/src/stm32_nsh.c index 6a41f83a8c6..31ee1ccbaec 100644 --- a/configs/stm3240g-eval/src/stm32_nsh.c +++ b/configs/stm3240g-eval/src/stm32_nsh.c @@ -155,7 +155,7 @@ int board_app_initialize(void) #ifdef CONFIG_STM32_SPI1 /* Get the SPI port */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n"); diff --git a/configs/stm3240g-eval/src/stm32_spi.c b/configs/stm3240g-eval/src/stm32_spi.c index 5f39600da80..5e247d8c357 100644 --- a/configs/stm3240g-eval/src/stm32_spi.c +++ b/configs/stm3240g-eval/src/stm32_spi.c @@ -84,14 +84,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #warning "Missing logic" } @@ -103,7 +103,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -112,9 +112,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32_tiny/src/stm32_boot.c b/configs/stm32_tiny/src/stm32_boot.c index c42e9fc04cd..898b8590fb1 100644 --- a/configs/stm32_tiny/src/stm32_boot.c +++ b/configs/stm32_tiny/src/stm32_boot.c @@ -79,11 +79,11 @@ void stm32_boardinitialize(void) #endif /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) - stm32_spiinitialize(); + stm32_spidev_initialize(); #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not diff --git a/configs/stm32_tiny/src/stm32_spi.c b/configs/stm32_tiny/src/stm32_spi.c index 68651a7fbf7..0af60595084 100644 --- a/configs/stm32_tiny/src/stm32_spi.c +++ b/configs/stm32_tiny/src/stm32_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the HY-MiniSTM32 board. * ************************************************************************************/ -void stm32_spiinitialize(void) +void stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -117,7 +117,7 @@ void stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -126,9 +126,9 @@ void stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32_tiny/src/stm32_tiny.h b/configs/stm32_tiny/src/stm32_tiny.h index b967189faad..daadcf2605c 100644 --- a/configs/stm32_tiny/src/stm32_tiny.h +++ b/configs/stm32_tiny/src/stm32_tiny.h @@ -114,14 +114,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Hy-Mini STM32v board. * ************************************************************************************/ -extern void stm32_spiinitialize(void); +extern void stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize diff --git a/configs/stm32_tiny/src/stm32_wireless.c b/configs/stm32_tiny/src/stm32_wireless.c index dfa440dbb6f..5a8b6b0da95 100644 --- a/configs/stm32_tiny/src/stm32_wireless.c +++ b/configs/stm32_tiny/src/stm32_wireless.c @@ -111,7 +111,7 @@ void stm32_wlinitialize(void) /* Init SPI bus */ - spidev = up_spiinitialize(2); + spidev = stm32_spibus_initialize(2); if (!spidev) { dbg("Failed to initialize SPI bus\n"); diff --git a/configs/stm32f3discovery/src/stm32_boot.c b/configs/stm32f3discovery/src/stm32_boot.c index f7b420491b8..cc66383cfaa 100644 --- a/configs/stm32f3discovery/src/stm32_boot.c +++ b/configs/stm32f3discovery/src/stm32_boot.c @@ -72,13 +72,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm32f3discovery/src/stm32_spi.c b/configs/stm32f3discovery/src/stm32_spi.c index 0a287fae0e1..6c8b28869eb 100644 --- a/configs/stm32f3discovery/src/stm32_spi.c +++ b/configs/stm32f3discovery/src/stm32_spi.c @@ -85,14 +85,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f3discovery board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 (void)stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ @@ -108,7 +108,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -117,9 +117,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32f3discovery/src/stm32f3discovery.h b/configs/stm32f3discovery/src/stm32f3discovery.h index aa10bd06f69..eb35061c01c 100644 --- a/configs/stm32f3discovery/src/stm32f3discovery.h +++ b/configs/stm32f3discovery/src/stm32f3discovery.h @@ -140,14 +140,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f3discovery board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize diff --git a/configs/stm32f429i-disco/src/stm32_boot.c b/configs/stm32f429i-disco/src/stm32_boot.c index a9ca7b006e4..5f389b06f42 100644 --- a/configs/stm32f429i-disco/src/stm32_boot.c +++ b/configs/stm32f429i-disco/src/stm32_boot.c @@ -76,12 +76,12 @@ void stm32_boardinitialize(void) defined(CONFIG_STM32_SPI3) || defined(CONFIG_STM32_SPI4) || \ defined(CONFIG_STM32_SPI5) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm32f429i-disco/src/stm32_nsh.c b/configs/stm32f429i-disco/src/stm32_nsh.c index 56bfeb85858..397f753d97c 100644 --- a/configs/stm32f429i-disco/src/stm32_nsh.c +++ b/configs/stm32f429i-disco/src/stm32_nsh.c @@ -157,7 +157,7 @@ int board_app_initialize(void) syslog(LOG_INFO, "Initializing SPI port 4\n"); - spi = up_spiinitialize(4); + spi = stm32_spibus_initialize(4); if (!spi) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 4\n"); diff --git a/configs/stm32f429i-disco/src/stm32_spi.c b/configs/stm32f429i-disco/src/stm32_spi.c index 11852a67cb9..5021da51089 100644 --- a/configs/stm32f429i-disco/src/stm32_spi.c +++ b/configs/stm32f429i-disco/src/stm32_spi.c @@ -95,14 +95,14 @@ FAR struct spi_dev_s *g_spidev5 = NULL; ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f429i-disco board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI5 (void)stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ @@ -122,7 +122,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -131,9 +131,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). @@ -296,7 +296,7 @@ int stm32_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd) * * Description: * Initialize the selected SPI port. - * As long as the method up_spiinitialize recognized the initialized state of + * As long as the method stm32_spibus_initialize recognized the initialized state of * the spi device by the spi enable flag of the cr1 register, it isn't safe to * disable the spi device outside of the nuttx spi interface structure. But * this has to be done as long as the nuttx spi interface doesn't support @@ -317,7 +317,7 @@ FAR struct spi_dev_s *stm32_spi5initialize(void) { if (!g_spidev5) { - g_spidev5 = up_spiinitialize(5); + g_spidev5 = stm32_spibus_initialize(5); } return g_spidev5; diff --git a/configs/stm32f429i-disco/src/stm32f429i-disco.h b/configs/stm32f429i-disco/src/stm32f429i-disco.h index c4c6d21c184..789929facd7 100644 --- a/configs/stm32f429i-disco/src/stm32f429i-disco.h +++ b/configs/stm32f429i-disco/src/stm32f429i-disco.h @@ -136,14 +136,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f429i-disco board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: stm32_usbinitialize @@ -245,16 +245,17 @@ FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void); * * Description: * Initialize the selected SPI port. - * As long as the method up_spiinitialize recognized the initialized state of - * the spi device by the spi enable flag of the cr1 register, it isn't safe to - * disable the spi device outside of the nuttx spi interface structure. But - * this has to be done as long as the nuttx spi interface doesn't support - * bidirectional data transfer for multiple devices share one spi bus. This - * wrapper does nothing else than store the initialized state of the spi - * device after the first initializing and should be used by each driver who - * shares the spi5 bus. + * As long as the method stm32_spibus_initialize() recognized the + * initialized state of the spi device by the spi enable flag of the cr1 + * register, it isn't safe to disable the spi device outside of the nuttx + * spi interface structure. But this has to be done as long as the nuttx + * spi interface doesn't support bidirectional data transfer for multiple + * devices share one spi bus. This wrapper does nothing else than store the + * initialized state of the spi device after the first initializing and + * should be used by each driver who shares the spi5 bus. * * Input Parameter: + * None * * Returned Value: * Valid SPI device structure reference on succcess; a NULL on failure diff --git a/configs/stm32f4discovery/src/stm32_boot.c b/configs/stm32f4discovery/src/stm32_boot.c index b903f2655f0..888317b1cee 100644 --- a/configs/stm32f4discovery/src/stm32_boot.c +++ b/configs/stm32f4discovery/src/stm32_boot.c @@ -73,12 +73,12 @@ void stm32_boardinitialize(void) { #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm32f4discovery/src/stm32_max31855.c b/configs/stm32f4discovery/src/stm32_max31855.c index 8b020af8827..4422b5e7b3e 100644 --- a/configs/stm32f4discovery/src/stm32_max31855.c +++ b/configs/stm32f4discovery/src/stm32_max31855.c @@ -80,7 +80,7 @@ int stm32_max31855initialize(FAR const char *devpath) FAR struct spi_dev_s *spi; int ret; - spi = up_spiinitialize(MAX31855_SPI_PORTNO); + spi = stm32_spibus_initialize(MAX31855_SPI_PORTNO); if (!spi) { diff --git a/configs/stm32f4discovery/src/stm32_max6675.c b/configs/stm32f4discovery/src/stm32_max6675.c index 4b4325f5e1d..6f356aaaf82 100644 --- a/configs/stm32f4discovery/src/stm32_max6675.c +++ b/configs/stm32f4discovery/src/stm32_max6675.c @@ -80,7 +80,7 @@ int stm32_max6675initialize(FAR const char *devpath) FAR struct spi_dev_s *spi; int ret; - spi = up_spiinitialize(MAX6675_SPI_PORTNO); + spi = stm32_spibus_initialize(MAX6675_SPI_PORTNO); if (!spi) { diff --git a/configs/stm32f4discovery/src/stm32_spi.c b/configs/stm32f4discovery/src/stm32_spi.c index 32c7b2a15e1..f057b874d4e 100644 --- a/configs/stm32f4discovery/src/stm32_spi.c +++ b/configs/stm32f4discovery/src/stm32_spi.c @@ -50,6 +50,7 @@ #include "up_arch.h" #include "chip.h" #include "stm32.h" + #include "stm32f4discovery.h" #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) @@ -85,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f4discovery board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 (void)stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ @@ -122,7 +123,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -131,9 +132,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32f4discovery/src/stm32_ssd1351.c b/configs/stm32f4discovery/src/stm32_ssd1351.c index 04aaeee937c..26e77e8ee05 100644 --- a/configs/stm32f4discovery/src/stm32_ssd1351.c +++ b/configs/stm32f4discovery/src/stm32_ssd1351.c @@ -50,6 +50,8 @@ #include #include "stm32_gpio.h" +#include "stm32_spi.h" + #include "stm32f4discovery.h" #ifdef CONFIG_LCD_SSD1351 @@ -109,7 +111,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (spi == NULL) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c index e5afad76306..24e5c840341 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c @@ -47,6 +47,8 @@ #include #include "stm32_gpio.h" +#include "stm32_spi.h" + #include "stm32f4discovery.h" #ifdef CONFIG_LCD_UG2864AMBAG01 @@ -131,7 +133,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c index a17bd6d83ea..78c24bc3683 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c @@ -47,6 +47,8 @@ #include #include "stm32_gpio.h" +#include "stm32_spi.h" + #include "stm32f4discovery.h" #ifdef CONFIG_LCD_UG2864HSWEG01 @@ -131,7 +133,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(1); + spi = stm32_spibus_initialize(1); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/stm32f4discovery/src/stm32f4discovery.h b/configs/stm32f4discovery/src/stm32f4discovery.h index 58a9e3d7d00..6caa848e927 100644 --- a/configs/stm32f4discovery/src/stm32f4discovery.h +++ b/configs/stm32f4discovery/src/stm32f4discovery.h @@ -343,7 +343,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f4discovery @@ -351,7 +351,7 @@ * ****************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************** * Name: stm32_bmp180initialize diff --git a/configs/stm32f746g-disco/src/stm32_boot.c b/configs/stm32f746g-disco/src/stm32_boot.c index a9e8dffa1ba..d474f3c8a32 100644 --- a/configs/stm32f746g-disco/src/stm32_boot.c +++ b/configs/stm32f746g-disco/src/stm32_boot.c @@ -75,12 +75,12 @@ void stm32_boardinitialize(void) defined(CONFIG_STM32F7_SPI3) || defined(CONFIG_STM32F7_SPI4) || \ defined(CONFIG_STM32F7_SPI5) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm32f746g-disco/src/stm32_spi.c b/configs/stm32f746g-disco/src/stm32_spi.c index e33e284e784..38f62be076b 100644 --- a/configs/stm32f746g-disco/src/stm32_spi.c +++ b/configs/stm32f746g-disco/src/stm32_spi.c @@ -49,6 +49,8 @@ #include "up_arch.h" #include "chip.h" +#include "stm32_spi.h" + #include "stm32f746g-disco.h" #if defined(CONFIG_STM32F7_SPI1) || defined(CONFIG_STM32F7_SPI2) || \ @@ -85,14 +87,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f746g-disco board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { } @@ -103,7 +105,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -112,9 +114,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32f746g-disco/src/stm32f746g-disco.h b/configs/stm32f746g-disco/src/stm32f746g-disco.h index ca4ca33cfc1..434700743bb 100644 --- a/configs/stm32f746g-disco/src/stm32f746g-disco.h +++ b/configs/stm32f746g-disco/src/stm32f746g-disco.h @@ -101,14 +101,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32f746g-disco board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************************************** * Name: arch_sporadic_initialize diff --git a/configs/stm32ldiscovery/src/stm32_boot.c b/configs/stm32ldiscovery/src/stm32_boot.c index da056360942..375d9de3297 100644 --- a/configs/stm32ldiscovery/src/stm32_boot.c +++ b/configs/stm32ldiscovery/src/stm32_boot.c @@ -72,13 +72,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/stm32ldiscovery/src/stm32_spi.c b/configs/stm32ldiscovery/src/stm32_spi.c index ef0f0975e0b..b56ed221fb7 100644 --- a/configs/stm32ldiscovery/src/stm32_spi.c +++ b/configs/stm32ldiscovery/src/stm32_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32ldiscovery board. * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { #ifdef CONFIG_STM32_SPI1 (void)stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ @@ -109,7 +109,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -118,9 +118,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/stm32ldiscovery/src/stm32ldiscovery.h b/configs/stm32ldiscovery/src/stm32ldiscovery.h index 4f420103043..1bd424f3762 100644 --- a/configs/stm32ldiscovery/src/stm32ldiscovery.h +++ b/configs/stm32ldiscovery/src/stm32ldiscovery.h @@ -234,14 +234,14 @@ ****************************************************************************************************/ /**************************************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the stm32ldiscovery board. * ****************************************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_STM32F3DISCOVERY_SRC_STM32F3DISCOVERY_H */ diff --git a/configs/viewtool-stm32f107/src/stm32_boot.c b/configs/viewtool-stm32f107/src/stm32_boot.c index c7bf19ad061..6a6cdd3ca52 100644 --- a/configs/viewtool-stm32f107/src/stm32_boot.c +++ b/configs/viewtool-stm32f107/src/stm32_boot.c @@ -69,13 +69,13 @@ void stm32_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) + if (stm32_spidev_initialize) { - stm32_spiinitialize(); + stm32_spidev_initialize(); } #endif diff --git a/configs/viewtool-stm32f107/src/stm32_mpl115a.c b/configs/viewtool-stm32f107/src/stm32_mpl115a.c index 0189634c0d0..45cce7e9c5e 100644 --- a/configs/viewtool-stm32f107/src/stm32_mpl115a.c +++ b/configs/viewtool-stm32f107/src/stm32_mpl115a.c @@ -80,7 +80,7 @@ int stm32_mpl115ainitialize(FAR const char *devpath) FAR struct spi_dev_s *spi; int ret; - spi = up_spiinitialize(MPL115A_SPI_PORTNO); + spi = stm32_spibus_initialize(MPL115A_SPI_PORTNO); if (!spi) { diff --git a/configs/viewtool-stm32f107/src/stm32_spi.c b/configs/viewtool-stm32f107/src/stm32_spi.c index 1c58fa8a516..6f9cca78b21 100644 --- a/configs/viewtool-stm32f107/src/stm32_spi.c +++ b/configs/viewtool-stm32f107/src/stm32_spi.c @@ -84,7 +84,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Viewtool stm32f103/107 @@ -92,7 +92,7 @@ * ************************************************************************************/ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPIx was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -120,7 +120,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -129,9 +129,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/viewtool-stm32f107/src/stm32_touchscreen.c b/configs/viewtool-stm32f107/src/stm32_touchscreen.c index 5c3302f03a0..9475d2f6c3c 100644 --- a/configs/viewtool-stm32f107/src/stm32_touchscreen.c +++ b/configs/viewtool-stm32f107/src/stm32_touchscreen.c @@ -52,6 +52,7 @@ #include "up_arch.h" #include "stm32_gpio.h" +#include "stm32_spi.h" #include "viewtool_stm32f107.h" @@ -275,7 +276,7 @@ int board_tsc_setup(int minor) /* Get an instance of the SPI interface for the touchscreen chip select */ - dev = up_spiinitialize(TSC_DEVNUM); + dev = stm32_spibus_initialize(TSC_DEVNUM); if (!dev) { idbg("Failed to initialize SPI%d\n", TSC_DEVNUM); diff --git a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h index c67edee4d50..4b69730dcc6 100644 --- a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h +++ b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h @@ -292,14 +292,14 @@ #ifndef __ASSEMBLY__ /**************************************************************************** - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the M3 Wildfire board. * ****************************************************************************/ -void weak_function stm32_spiinitialize(void); +void weak_function stm32_spidev_initialize(void); /**************************************************************************** * Name: stm32_led_initialize diff --git a/configs/vsn/src/boot.c b/configs/vsn/src/boot.c index 4058a99d567..ce56d5bf90c 100644 --- a/configs/vsn/src/boot.c +++ b/configs/vsn/src/boot.c @@ -64,11 +64,11 @@ void stm32_boardinitialize(void) vsn_muxbus_init(); /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * stm32_spiinitialize() has been brought into the link. + * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) - if (stm32_spiinitialize) stm32_spiinitialize(); + if (stm32_spidev_initialize) stm32_spidev_initialize(); #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not diff --git a/configs/vsn/src/sif.c b/configs/vsn/src/sif.c index d970b9a4e89..65612291773 100644 --- a/configs/vsn/src/sif.c +++ b/configs/vsn/src/sif.c @@ -63,6 +63,10 @@ * SNP Message descriptor. */ +/************************************************************************************ + * Included Files + ************************************************************************************/ + #include #include @@ -82,8 +86,10 @@ #include #include -#include "vsn.h" #include "stm32_gpio.h" +#include "stm32_spi.h" + +#include "vsn.h" /**************************************************************************** * Declarations and Structures @@ -316,7 +322,7 @@ int sif_anout_init(void) vsn_sif.i2c1 = up_i2cinitialize(1); vsn_sif.i2c2 = up_i2cinitialize(2); - vsn_sif.spi2 = up_spiinitialize(2); + vsn_sif.spi2 = stm32_spibus_initialize(2); return OK; } diff --git a/configs/vsn/src/spi.c b/configs/vsn/src/spi.c index 36ebbf183b9..5f237cac85d 100644 --- a/configs/vsn/src/spi.c +++ b/configs/vsn/src/spi.c @@ -1,6 +1,5 @@ /************************************************************************************ * configs/vsn/src/spi.c - * arch/arm/src/board/spi.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2011 Uros Platise. All rights reserved. @@ -37,11 +36,9 @@ * ************************************************************************************/ -/** \file - * \author Gregory Nutt, Uros Platise - * \brief SPI Slave Selects - */ - +/************************************************************************************ + * Included Files + ************************************************************************************/ #include #include @@ -61,7 +58,6 @@ #include "stm32_waste.h" #include "vsn.h" - /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ @@ -93,7 +89,7 @@ /** Called to configure SPI chip select GPIO pins for the VSN board. */ -void weak_function stm32_spiinitialize(void) +void weak_function stm32_spidev_initialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 and SPI3 was already provided in stm32_rcc.c. * Configurations of SPI pins is performed in stm32_spi.c. @@ -114,7 +110,7 @@ void weak_function stm32_spiinitialize(void) * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be * provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) + * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize()) * are provided by common STM32 logic. To use this common SPI logic on your * board: * @@ -123,9 +119,9 @@ void weak_function stm32_spiinitialize(void) * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application + * 3. Add a calls to stm32_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/vsn/src/vsn.h b/configs/vsn/src/vsn.h index 00b55881cd0..290d7d95823 100644 --- a/configs/vsn/src/vsn.h +++ b/configs/vsn/src/vsn.h @@ -180,14 +180,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_spiinitialize + * Name: stm32_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the VSN board. * ************************************************************************************/ -extern void weak_function stm32_spiinitialize(void); +extern void weak_function stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize