mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
For STM32 boards, rename up_spiinitialize to stm32_spibus_initialize
This commit is contained in:
@@ -220,14 +220,14 @@
|
|||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board.
|
* 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
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -73,13 +73,13 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3)
|
||||||
if (stm32_spiinitialize)
|
if (stm32_spidev_initialize)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -85,14 +85,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the cloudctrl board.
|
* 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.
|
/* NOTE: Clocking for SPI1 and/or SPI3 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
# include <nuttx/fs/nxffs.h>
|
# include <nuttx/fs/nxffs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "stm32_spi.h"
|
||||||
#include "cloudctrl.h"
|
#include "cloudctrl.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -103,7 +104,7 @@ int stm32_w25initialize(int minor)
|
|||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = up_spiinitialize(1);
|
spi = stm32_spibus_initialize(1);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
||||||
|
|||||||
@@ -273,14 +273,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the M3 Wildfire board.
|
* 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
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -72,13 +72,13 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
||||||
if (stm32_spiinitialize)
|
if (stm32_spidev_initialize)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
#include "stm32_spi.h"
|
||||||
|
|
||||||
#include "fire-stm32v2.h"
|
#include "fire-stm32v2.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ENC28J60
|
#ifdef CONFIG_ENC28J60
|
||||||
@@ -183,7 +185,7 @@ void up_netinitialize(void)
|
|||||||
* 2) Clocking for the SPI1 peripheral was also provided earlier in boot-up.
|
* 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)
|
if (!spi)
|
||||||
{
|
{
|
||||||
nlldbg("Failed to initialize SPI port %d\n", ENC28J60_SPI_PORTNO);
|
nlldbg("Failed to initialize SPI port %d\n", ENC28J60_SPI_PORTNO);
|
||||||
|
|||||||
@@ -84,14 +84,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the M3 Wildfire board.
|
* 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.
|
/* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
# include <nuttx/fs/nxffs.h>
|
# include <nuttx/fs/nxffs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "stm32_spi.h"
|
||||||
#include "fire-stm32v2.h"
|
#include "fire-stm32v2.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -102,7 +103,7 @@ int stm32_w25initialize(int minor)
|
|||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = up_spiinitialize(1);
|
spi = stm32_spibus_initialize(1);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
||||||
|
|||||||
@@ -115,14 +115,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the Hy-Mini STM32v board.
|
* 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
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -73,13 +73,13 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
||||||
if (stm32_spiinitialize)
|
if (stm32_spidev_initialize)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -85,14 +85,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the HY-MiniSTM32 board.
|
* 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.
|
/* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* board:
|
||||||
*
|
*
|
||||||
@@ -123,9 +123,9 @@ void stm32_spiinitialize(void)
|
|||||||
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ int board_tsc_setup(int minor)
|
|||||||
|
|
||||||
idbg("minor %d\n", minor);
|
idbg("minor %d\n", minor);
|
||||||
|
|
||||||
dev = up_spiinitialize(1);
|
dev = stm32_spibus_initialize(1);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
idbg("Failed to initialize SPI bus\n");
|
idbg("Failed to initialize SPI bus\n");
|
||||||
|
|||||||
@@ -105,14 +105,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins.
|
* Called to configure SPI chip select GPIO pins.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void stm32_spiinitialize(void);
|
void stm32_spidev_initialize(void);
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_usbinitialize
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ void stm32_boardinitialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ FAR int board_lcd_initialize(void)
|
|||||||
lcddbg("Initializing lcd\n");
|
lcddbg("Initializing lcd\n");
|
||||||
|
|
||||||
lcddbg("init spi1\n");
|
lcddbg("init spi1\n");
|
||||||
spi = up_spiinitialize(1);
|
spi = stm32_spibus_initialize(1);
|
||||||
DEBUGASSERT(spi);
|
DEBUGASSERT(spi);
|
||||||
|
|
||||||
lcddbg("configure related io\n");
|
lcddbg("configure related io\n");
|
||||||
|
|||||||
@@ -87,14 +87,14 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the maple board.
|
* 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.
|
/* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -205,14 +205,14 @@
|
|||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the mikroe-stm32f4 board.
|
* 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
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -83,13 +83,13 @@ void stm32_boardinitialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 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
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ int board_app_initialize(void)
|
|||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
syslog(LOG_INFO, "Initializing SPI port 3\n");
|
syslog(LOG_INFO, "Initializing SPI port 3\n");
|
||||||
spi = up_spiinitialize(3);
|
spi = stm32_spibus_initialize(3);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 3\n");
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 3\n");
|
||||||
|
|||||||
@@ -90,14 +90,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the mikroe_stm32f4 board.
|
* 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
|
#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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the board.
|
* Called to configure SPI chip select GPIO pins for the board.
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_SPI
|
#ifdef CONFIG_SPI
|
||||||
void weak_function stm32_spiinitialize(void);
|
void weak_function stm32_spidev_initialize(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -80,9 +80,9 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SPI
|
#ifdef CONFIG_SPI
|
||||||
if (stm32_spiinitialize != NULL)
|
if (stm32_spidev_initialize != NULL)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -87,14 +87,14 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the board.
|
* 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)
|
#if defined(CONFIG_LCD_SSD1351)
|
||||||
(void)stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */
|
(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
|
* must be provided by board-specific logic. They are implementations of
|
||||||
* the select and status methods of the SPI interface defined by struct
|
* 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
|
* 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:
|
* common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide logic in stm32_boardinitialize() to configure SPI chip select
|
* 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
|
* in your board-specific logic. These functions will perform chip
|
||||||
* selection and status operations using GPIOs in the way your board is
|
* selection and status operations using GPIOs in the way your board is
|
||||||
* configured.
|
* 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
|
* 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
|
* the SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -50,6 +50,8 @@
|
|||||||
#include <nuttx/lcd/ssd1351.h>
|
#include <nuttx/lcd/ssd1351.h>
|
||||||
|
|
||||||
#include "stm32_gpio.h"
|
#include "stm32_gpio.h"
|
||||||
|
#include "stm32_spi.h"
|
||||||
|
|
||||||
#include "nucleo-f303re.h"
|
#include "nucleo-f303re.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LCD_SSD1351
|
#ifdef CONFIG_LCD_SSD1351
|
||||||
@@ -109,7 +111,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
|
|
||||||
/* Get the SPI1 port interface */
|
/* Get the SPI1 port interface */
|
||||||
|
|
||||||
spi = up_spiinitialize(1);
|
spi = stm32_spibus_initialize(1);
|
||||||
if (spi == NULL)
|
if (spi == NULL)
|
||||||
{
|
{
|
||||||
lcddbg("Failed to initialize SPI port 1\n");
|
lcddbg("Failed to initialize SPI port 1\n");
|
||||||
|
|||||||
@@ -289,14 +289,14 @@ extern struct sdio_dev_s *g_sdio;
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins.
|
* Called to configure SPI chip select GPIO pins.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void stm32_spiinitialize(void);
|
void stm32_spidev_initialize(void);
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_usbinitialize
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -82,11 +82,11 @@ void stm32_boardinitialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function
|
/* 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)
|
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3)
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
||||||
|
|||||||
@@ -47,9 +47,9 @@
|
|||||||
#include <nuttx/spi/spi.h>
|
#include <nuttx/spi/spi.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include <up_arch.h>
|
#include "up_arch.h"
|
||||||
#include <chip.h>
|
#include "chip.h"
|
||||||
#include <stm32.h>
|
#include "stm32.h"
|
||||||
|
|
||||||
#include "nucleo-f4x1re.h"
|
#include "nucleo-f4x1re.h"
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ struct spi_dev_s *g_spi2;
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the Nucleo-F401RE and
|
* 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
|
#ifdef CONFIG_STM32_SPI1
|
||||||
/* Configure SPI-based devices */
|
/* Configure SPI-based devices */
|
||||||
|
|
||||||
g_spi1 = up_spiinitialize(1);
|
g_spi1 = stm32_spibus_initialize(1);
|
||||||
if (!g_spi1)
|
if (!g_spi1)
|
||||||
{
|
{
|
||||||
spidbg("[boot] FAILED to initialize SPI port 1\n");
|
spidbg("[boot] FAILED to initialize SPI port 1\n");
|
||||||
@@ -126,7 +126,7 @@ void weak_function stm32_spiinitialize(void)
|
|||||||
#ifdef CONFIG_STM32_SPI2
|
#ifdef CONFIG_STM32_SPI2
|
||||||
/* Configure SPI-based devices */
|
/* Configure SPI-based devices */
|
||||||
|
|
||||||
g_spi2 = up_spiinitialize(2);
|
g_spi2 = stm32_spibus_initialize(2);
|
||||||
|
|
||||||
/* Setup CS, EN & IRQ line IOs */
|
/* 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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ int wireless_archinitialize(size_t max_rx_size)
|
|||||||
|
|
||||||
/* Get an instance of the SPI interface */
|
/* Get an instance of the SPI interface */
|
||||||
|
|
||||||
spi = up_spiinitialize(CONFIG_CC3000_SPIDEV);
|
spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
|
idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
|
||||||
|
|||||||
@@ -75,14 +75,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the M3 Wildfire board.
|
* 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 /* __ASSEMBLY__ */
|
||||||
#endif /* __CONFIGS_OLIMEX_STM32_P107_SRC_H */
|
#endif /* __CONFIGS_OLIMEX_STM32_P107_SRC_H */
|
||||||
|
|||||||
@@ -69,13 +69,13 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI3)
|
||||||
if (stm32_spiinitialize)
|
if (stm32_spidev_initialize)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,8 @@
|
|||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
#include "stm32_spi.h"
|
||||||
|
|
||||||
#include "olimex-stm32-p107.h"
|
#include "olimex-stm32-p107.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ENCX24J600
|
#ifdef CONFIG_ENCX24J600
|
||||||
@@ -175,7 +177,7 @@ void up_netinitialize(void)
|
|||||||
* 2) Clocking for the SPI1 peripheral was also provided earlier in boot-up.
|
* 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)
|
if (!spi)
|
||||||
{
|
{
|
||||||
nlldbg("Failed to initialize SPI port %d\n", ENCX24J600_SPI_PORTNO);
|
nlldbg("Failed to initialize SPI port %d\n", ENCX24J600_SPI_PORTNO);
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "stm32.h"
|
#include "stm32.h"
|
||||||
|
|
||||||
#include "olimex-stm32-p107.h"
|
#include "olimex-stm32-p107.h"
|
||||||
|
|
||||||
#if defined(CONFIG_STM32_SPI3)
|
#if defined(CONFIG_STM32_SPI3)
|
||||||
@@ -84,14 +85,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the Olimex stm32-p107 board.
|
* 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.
|
/* NOTE: Clocking for SPI3 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins.
|
* Called to configure SPI chip select GPIO pins.
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
|
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
|
||||||
defined(CONFIG_STM32_SPI3)
|
defined(CONFIG_STM32_SPI3)
|
||||||
void weak_function stm32_spiinitialize(void);
|
void weak_function stm32_spidev_initialize(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
@@ -95,12 +95,12 @@ void stm32_boardinitialize(void)
|
|||||||
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
|
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \
|
||||||
defined(CONFIG_STM32_SPI3)
|
defined(CONFIG_STM32_SPI3)
|
||||||
/* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function
|
/* 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
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ int composite_archinitialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = up_spiinitialize(OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
spi = stm32_spibus_initialize(OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -86,14 +86,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the board.
|
* 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 */
|
/* Setup CS */
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ void weak_function stm32_spiinitialize(void)
|
|||||||
* must be provided by board-specific logic. They are implementations of
|
* must be provided by board-specific logic. They are implementations of
|
||||||
* the select and status methods of the SPI interface defined by struct
|
* 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
|
* 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:
|
* common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide logic in stm32_boardinitialize() to configure SPI chip
|
* 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
|
* in your board-specific logic. These functions will perform chip
|
||||||
* selection and status operations using GPIOs in the way your board
|
* selection and status operations using GPIOs in the way your board
|
||||||
* is configured.
|
* 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
|
* 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
|
* the SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int usbmsc_archinitialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = up_spiinitialize(OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
spi = stm32_spibus_initialize(OLIMEXINO_STM32_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -413,14 +413,14 @@
|
|||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the STM3240G-EVAL board.
|
* 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
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -72,13 +72,13 @@
|
|||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* 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 defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3)
|
||||||
if (stm32_spiinitialize)
|
if (stm32_spidev_initialize)
|
||||||
{
|
{
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
#include <nuttx/spi/spi.h>
|
#include <nuttx/spi/spi.h>
|
||||||
#include <nuttx/mmcsd.h>
|
#include <nuttx/mmcsd.h>
|
||||||
|
|
||||||
|
#include "stm32_spi.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -95,7 +97,7 @@ int stm32_sdinitialize(int minor)
|
|||||||
|
|
||||||
fvdbg("Initializing SPI port %d\n", STM32_MMCSDSPIPORTNO);
|
fvdbg("Initializing SPI port %d\n", STM32_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = up_spiinitialize(STM32_MMCSDSPIPORTNO);
|
spi = stm32_spibus_initialize(STM32_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("Failed to initialize SPI port %d\n", STM32_MMCSDSPIPORTNO);
|
fdbg("Failed to initialize SPI port %d\n", STM32_MMCSDSPIPORTNO);
|
||||||
|
|||||||
@@ -84,14 +84,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the Shenzhou board.
|
* 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.
|
/* NOTE: Clocking for SPI1 and/or SPI3 was already provided in stm32_rcc.c.
|
||||||
* Configurations of SPI pins is performed in stm32_spi.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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ int board_tsc_setup(int minor)
|
|||||||
|
|
||||||
/* Get an instance of the SPI interface */
|
/* Get an instance of the SPI interface */
|
||||||
|
|
||||||
dev = up_spiinitialize(CONFIG_ADS7843E_SPIDEV);
|
dev = stm32_spibus_initialize(CONFIG_ADS7843E_SPIDEV);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
|
idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
|
||||||
|
|||||||
@@ -50,6 +50,8 @@
|
|||||||
# include <nuttx/spi/spi.h>
|
# include <nuttx/spi/spi.h>
|
||||||
# include <nuttx/mtd/mtd.h>
|
# include <nuttx/mtd/mtd.h>
|
||||||
# include <nuttx/fs/nxffs.h>
|
# include <nuttx/fs/nxffs.h>
|
||||||
|
|
||||||
|
# include "stm32_spi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "shenzhou.h"
|
#include "shenzhou.h"
|
||||||
@@ -102,7 +104,7 @@ int stm32_w25initialize(int minor)
|
|||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = up_spiinitialize(1);
|
spi = stm32_spibus_initialize(1);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
fdbg("ERROR: Failed to initialize SPI port 2\n");
|
||||||
|
|||||||
@@ -246,14 +246,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins.
|
* Called to configure SPI chip select GPIO pins.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void stm32_spiinitialize(void);
|
void stm32_spidev_initialize(void);
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_usbinitialize
|
* Name: stm32_usbinitialize
|
||||||
|
|||||||
@@ -83,11 +83,11 @@ void stm32_boardinitialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function
|
/* 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)
|
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3)
|
||||||
stm32_spiinitialize();
|
stm32_spidev_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ static int do_composite_archinitialize(void)
|
|||||||
|
|
||||||
fvdbg("Initializing SPI port %d\n", CONFIG_SPARK_FLASH_SPI);
|
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)
|
if (!spi)
|
||||||
{
|
{
|
||||||
fdbg("ERROR: Failed to initialize SPI port %d\n",
|
fdbg("ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ int board_app_initialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
CONFIG_SPARK_FLASH_SPI);
|
CONFIG_SPARK_FLASH_SPI);
|
||||||
|
|
||||||
spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI);
|
spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -90,14 +90,14 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_spiinitialize
|
* Name: stm32_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the Spark board.
|
* 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
|
#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
|
* 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
|
* 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
|
* 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
|
* are provided by common STM32 logic. To use this common SPI logic on your
|
||||||
* board:
|
* 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
|
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* board-specific logic. These functions will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* 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
|
* 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
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ int wireless_archinitialize(size_t max_rx_size)
|
|||||||
|
|
||||||
/* Get an instance of the SPI interface */
|
/* Get an instance of the SPI interface */
|
||||||
|
|
||||||
spi = up_spiinitialize(CONFIG_CC3000_SPIDEV);
|
spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
|
idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user