For STM32 boards, rename up_spiinitialize to stm32_spibus_initialize

This commit is contained in:
Gregory Nutt 2016-01-26 12:21:39 -06:00
parent 4819fc2e8d
commit 9f2a839ac3
96 changed files with 292 additions and 266 deletions

View File

@ -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

View File

@ -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

View File

@ -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).

View File

@ -53,6 +53,7 @@
# include <nuttx/fs/nxffs.h>
#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");

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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).

View File

@ -52,6 +52,7 @@
# include <nuttx/fs/nxffs.h>
#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");

View File

@ -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

View File

@ -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

View File

@ -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).

View File

@ -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");

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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).

View File

@ -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
/****************************************************************************

View File

@ -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

View File

@ -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).

View File

@ -50,6 +50,8 @@
#include <nuttx/lcd/ssd1351.h>
#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");

View File

@ -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

View File

@ -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

View File

@ -47,9 +47,9 @@
#include <nuttx/spi/spi.h>
#include <arch/board/board.h>
#include <up_arch.h>
#include <chip.h>
#include <stm32.h>
#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).

View File

@ -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);

View File

@ -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 */

View File

@ -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

View File

@ -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);

View File

@ -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).

View File

@ -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
/************************************************************************************

View File

@ -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

View File

@ -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",

View File

@ -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).

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -46,6 +46,8 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#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);

View File

@ -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).

View File

@ -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);

View File

@ -50,6 +50,8 @@
# include <nuttx/spi/spi.h>
# include <nuttx/mtd/mtd.h>
# include <nuttx/fs/nxffs.h>
# 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");

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -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",

View File

@ -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).

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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).

View File

@ -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

View File

@ -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).

View File

@ -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

View File

@ -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");

View File

@ -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

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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).

View File

@ -50,6 +50,8 @@
#include <nuttx/lcd/ssd1351.h>
#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");

View File

@ -47,6 +47,8 @@
#include <nuttx/lcd/ug-2864ambag01.h>
#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");

View File

@ -47,6 +47,8 @@
#include <nuttx/lcd/ssd1306.h>
#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");

View File

@ -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

View File

@ -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

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -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).

View File

@ -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 */

View File

@ -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

View File

@ -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)
{

View File

@ -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).

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -63,6 +63,10 @@
* SNP Message descriptor.
*/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
@ -82,8 +86,10 @@
#include <nuttx/sensors/lis331dl.h>
#include <nuttx/wireless/cc1101.h>
#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;
}

View File

@ -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 <nuttx/config.h>
#include <nuttx/spi/spi.h>
@ -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).

View File

@ -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