rename back without f7
This commit is contained in:
parent
88b51683bb
commit
f12f115598
@ -51,7 +51,7 @@ CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_idle.c up_initialize.c
|
||||
CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c up_modifyreg8.c
|
||||
CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c
|
||||
CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c
|
||||
CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_unblocktask.c up_usestack.c
|
||||
CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_systemreset.c up_unblocktask.c up_usestack.c
|
||||
CMN_CSRCS += up_doirq.c up_hardfault.c up_svcall.c up_vfork.c
|
||||
|
||||
# Configuration-dependent common files
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include <arch/irq.h>
|
||||
#include <arch/stm32f7/chip.h>
|
||||
#include "chip/stm32_memorymap.h"
|
||||
#include "chip/stm32_pinmap.h"
|
||||
|
||||
/* If the common ARMv7-M vector handling logic is used, then it expects the
|
||||
* following definition in this file that provides the number of supported external
|
||||
|
@ -82,6 +82,7 @@
|
||||
|
||||
|
||||
#define STM32_SYSMEM_AXIM 0x1ff00000 /* 0x1ff00000-0x1ff0edbf: System memory (AXIM) */
|
||||
#define STM32_SYSMEM_UID 0x1ff0f420 /* The 96-bit unique device identifier */
|
||||
#define STM32_OTP_ICTM 0x0010f000 /* 0x0010f000-0x0010edbf: OTP (ITCM) */
|
||||
#define STM32_OTP_AXIM 0x1ff0f000 /* 0x1ff00000-0x1ff0f41f: OTP (AXIM) */
|
||||
|
||||
@ -207,5 +208,7 @@
|
||||
* address range
|
||||
*/
|
||||
|
||||
#define STM32_DEBUGMCU_BASE 0xe0042000
|
||||
|
||||
#endif /* CONFIG_STM32F7_STM32F74XX || CONFIG_STM32F7_STM32F75XX */
|
||||
#endif /* __ARCH_ARM_SRC_STM32F7_CHIP_STM32F74XXX75XXX_MEMORYMAP_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/************************************************************************************
|
||||
* arch/arm/src/stm32f7/chip/stm32f7_spi.h
|
||||
* arch/arm/src/stm32f7/chip/stm32f74xx75xx_spi.h
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -2485,7 +2485,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *stm32f7_i2cbus_initialize(int port)
|
||||
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port)
|
||||
{
|
||||
struct stm32_i2c_priv_s * priv = NULL; /* private data of device with multiple instances */
|
||||
struct stm32_i2c_inst_s * inst = NULL; /* device, single instance */
|
||||
@ -2559,7 +2559,7 @@ FAR struct i2c_master_s *stm32f7_i2cbus_initialize(int port)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int stm32f7_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
|
||||
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s * dev)
|
||||
{
|
||||
int irqs;
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32f7_i2cbus_initialize
|
||||
* Name: stm32_i2cbus_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the selected I2C port. And return a unique instance of struct
|
||||
@ -82,16 +82,16 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *stm32f7_i2cbus_initialize(int port);
|
||||
FAR struct i2c_master_s *stm32_i2cbus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32f7_i2cbus_uninitialize
|
||||
* Name: stm32_i2cbus_uninitialize
|
||||
*
|
||||
* Description:
|
||||
* De-initialize the selected I2C port, and power down the device.
|
||||
*
|
||||
* Input Parameter:
|
||||
* Device structure as returned by the stm32f7_i2cbus_initialize()
|
||||
* Device structure as returned by the stm32_i2cbus_initialize()
|
||||
*
|
||||
* Returned Value:
|
||||
* OK on success, ERROR when internal reference count mismatch or dev
|
||||
@ -99,6 +99,6 @@ FAR struct i2c_master_s *stm32f7_i2cbus_initialize(int port);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32f7_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32F7_STM32F7_I2C_H */
|
||||
|
@ -34,21 +34,21 @@
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* The external functions, stm32f7_spi1/2/3select and stm32f7_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
|
||||
* and status methods of the SPI interface defined by struct spi_ops_s (see
|
||||
* include/nuttx/spi/spi.h). All other methods (including stm32f7_spibus_initialize())
|
||||
* 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:
|
||||
*
|
||||
* 1. Provide logic in stm32f7_boardinitialize() to configure SPI chip select
|
||||
* 1. Provide logic in stm32_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
* 2. Provide stm32f7_spi1/2/3select() and stm32f7_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
|
||||
* status operations using GPIOs in the way your board is configured.
|
||||
* 3. Add a calls to stm32f7_spibus_initialize() 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 stm32f7_spibus_initialize() 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).
|
||||
@ -162,7 +162,7 @@
|
||||
* Private Types
|
||||
************************************************************************************/
|
||||
|
||||
struct stm32f7_spidev_s
|
||||
struct stm32_spidev_s
|
||||
{
|
||||
struct spi_dev_s spidev; /* Externally visible part of the SPI interface */
|
||||
uint32_t spibase; /* SPIn base address */
|
||||
@ -195,28 +195,28 @@ struct stm32f7_spidev_s
|
||||
|
||||
/* Helpers */
|
||||
|
||||
static inline uint16_t spi_getreg(FAR struct stm32f7_spidev_s *priv, uint8_t offset);
|
||||
static inline void spi_putreg(FAR struct stm32f7_spidev_s *priv, uint8_t offset,
|
||||
static inline uint16_t spi_getreg(FAR struct stm32_spidev_s *priv, uint8_t offset);
|
||||
static inline void spi_putreg(FAR struct stm32_spidev_s *priv, uint8_t offset,
|
||||
uint16_t value);
|
||||
static inline uint16_t spi_readword(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline void spi_writeword(FAR struct stm32f7_spidev_s *priv, uint16_t byte);
|
||||
static inline bool spi_16bitmode(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline uint16_t spi_readword(FAR struct stm32_spidev_s *priv);
|
||||
static inline void spi_writeword(FAR struct stm32_spidev_s *priv, uint16_t byte);
|
||||
static inline bool spi_16bitmode(FAR struct stm32_spidev_s *priv);
|
||||
|
||||
/* DMA support */
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmarxwait(FAR struct stm32f7_spidev_s *priv);
|
||||
static void spi_dmatxwait(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline void spi_dmarxwakeup(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline void spi_dmatxwakeup(FAR struct stm32f7_spidev_s *priv);
|
||||
static void spi_dmarxwait(FAR struct stm32_spidev_s *priv);
|
||||
static void spi_dmatxwait(FAR struct stm32_spidev_s *priv);
|
||||
static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv);
|
||||
static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv);
|
||||
static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t isr, void *arg);
|
||||
static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t isr, void *arg);
|
||||
static void spi_dmarxsetup(FAR struct stm32f7_spidev_s *priv,
|
||||
static void spi_dmarxsetup(FAR struct stm32_spidev_s *priv,
|
||||
FAR void *rxbuffer, FAR void *rxdummy, size_t nwords);
|
||||
static void spi_dmatxsetup(FAR struct stm32f7_spidev_s *priv,
|
||||
static void spi_dmatxsetup(FAR struct stm32_spidev_s *priv,
|
||||
FAR const void *txbuffer, FAR const void *txdummy, size_t nwords);
|
||||
static inline void spi_dmarxstart(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline void spi_dmatxstart(FAR struct stm32f7_spidev_s *priv);
|
||||
static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv);
|
||||
static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv);
|
||||
#endif
|
||||
|
||||
/* SPI methods */
|
||||
@ -237,7 +237,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer,
|
||||
|
||||
/* Initialization */
|
||||
|
||||
static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv);
|
||||
static void spi_bus_initialize(FAR struct stm32_spidev_s *priv);
|
||||
|
||||
/************************************************************************************
|
||||
* Private Data
|
||||
@ -247,16 +247,16 @@ static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv);
|
||||
static const struct spi_ops_s g_spi1ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi1select,
|
||||
.select = stm32_spi1select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
.hwfeatures = 0, /* Not supported */
|
||||
#endif
|
||||
.status = stm32f7_spi1status,
|
||||
.status = stm32_spi1status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi1cmddata,
|
||||
.cmddata = stm32_spi1cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -266,13 +266,13 @@ static const struct spi_ops_s g_spi1ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi1register, /* Provided externally */
|
||||
.registercallback = stm32_spi1register, /* Provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* Not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi1dev =
|
||||
static struct stm32_spidev_s g_spi1dev =
|
||||
{
|
||||
.spidev = { &g_spi1ops },
|
||||
.spibase = STM32_SPI1_BASE,
|
||||
@ -292,13 +292,13 @@ static struct stm32f7_spidev_s g_spi1dev =
|
||||
static const struct spi_ops_s g_spi2ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi2select,
|
||||
.select = stm32_spi2select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
.status = stm32f7_spi2status,
|
||||
.status = stm32_spi2status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi2cmddata,
|
||||
.cmddata = stm32_spi2cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -308,13 +308,13 @@ static const struct spi_ops_s g_spi2ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi2register, /* provided externally */
|
||||
.registercallback = stm32_spi2register, /* provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi2dev =
|
||||
static struct stm32_spidev_s g_spi2dev =
|
||||
{
|
||||
.spidev = { &g_spi2ops },
|
||||
.spibase = STM32_SPI2_BASE,
|
||||
@ -333,13 +333,13 @@ static struct stm32f7_spidev_s g_spi2dev =
|
||||
static const struct spi_ops_s g_spi3ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi3select,
|
||||
.select = stm32_spi3select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
.status = stm32f7_spi3status,
|
||||
.status = stm32_spi3status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi3cmddata,
|
||||
.cmddata = stm32_spi3cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -349,13 +349,13 @@ static const struct spi_ops_s g_spi3ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi3register, /* provided externally */
|
||||
.registercallback = stm32_spi3register, /* provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi3dev =
|
||||
static struct stm32_spidev_s g_spi3dev =
|
||||
{
|
||||
.spidev = { &g_spi3ops },
|
||||
.spibase = STM32_SPI3_BASE,
|
||||
@ -374,16 +374,16 @@ static struct stm32f7_spidev_s g_spi3dev =
|
||||
static const struct spi_ops_s g_spi4ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi4select,
|
||||
.select = stm32_spi4select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
.hwfeatures = 0, /* Not supported */
|
||||
#endif
|
||||
.status = stm32f7_spi4status,
|
||||
.status = stm32_spi4status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi4cmddata,
|
||||
.cmddata = stm32_spi4cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -393,13 +393,13 @@ static const struct spi_ops_s g_spi4ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi4register, /* Provided externally */
|
||||
.registercallback = stm32_spi4register, /* Provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* Not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi4dev =
|
||||
static struct stm32_spidev_s g_spi4dev =
|
||||
{
|
||||
.spidev = { &g_spi4ops },
|
||||
.spibase = STM32_SPI4_BASE,
|
||||
@ -419,16 +419,16 @@ static struct stm32f7_spidev_s g_spi4dev =
|
||||
static const struct spi_ops_s g_spi5ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi5select,
|
||||
.select = stm32_spi5select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
.hwfeatures = 0, /* Not supported */
|
||||
#endif
|
||||
.status = stm32f7_spi5status,
|
||||
.status = stm32_spi5status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi5cmddata,
|
||||
.cmddata = stm32_spi5cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -438,13 +438,13 @@ static const struct spi_ops_s g_spi5ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi5register, /* Provided externally */
|
||||
.registercallback = stm32_spi5register, /* Provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* Not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi5dev =
|
||||
static struct stm32_spidev_s g_spi5dev =
|
||||
{
|
||||
.spidev = { &g_spi5ops },
|
||||
.spibase = STM32_SPI5_BASE,
|
||||
@ -464,16 +464,16 @@ static struct stm32f7_spidev_s g_spi5dev =
|
||||
static const struct spi_ops_s g_spi6ops =
|
||||
{
|
||||
.lock = spi_lock,
|
||||
.select = stm32f7_spi6select,
|
||||
.select = stm32_spi6select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.setmode = spi_setmode,
|
||||
.setbits = spi_setbits,
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
.hwfeatures = 0, /* Not supported */
|
||||
#endif
|
||||
.status = stm32f7_spi6status,
|
||||
.status = stm32_spi6status,
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
.cmddata = stm32f7_spi6cmddata,
|
||||
.cmddata = stm32_spi6cmddata,
|
||||
#endif
|
||||
.send = spi_send,
|
||||
#ifdef CONFIG_SPI_EXCHANGE
|
||||
@ -483,13 +483,13 @@ static const struct spi_ops_s g_spi6ops =
|
||||
.recvblock = spi_recvblock,
|
||||
#endif
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
.registercallback = stm32f7_spi6register, /* Provided externally */
|
||||
.registercallback = stm32_spi6register, /* Provided externally */
|
||||
#else
|
||||
.registercallback = 0, /* Not implemented */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct stm32f7_spidev_s g_spi6dev =
|
||||
static struct stm32_spidev_s g_spi6dev =
|
||||
{
|
||||
.spidev = { &g_spi6ops },
|
||||
.spibase = STM32_SPI6_BASE,
|
||||
@ -529,7 +529,7 @@ static struct stm32f7_spidev_s g_spi6dev =
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline uint16_t spi_getreg(FAR struct stm32f7_spidev_s *priv, uint8_t offset)
|
||||
static inline uint16_t spi_getreg(FAR struct stm32_spidev_s *priv, uint8_t offset)
|
||||
{
|
||||
return getreg16(priv->spibase + offset);
|
||||
}
|
||||
@ -550,7 +550,7 @@ static inline uint16_t spi_getreg(FAR struct stm32f7_spidev_s *priv, uint8_t off
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline void spi_putreg(FAR struct stm32f7_spidev_s *priv, uint8_t offset,
|
||||
static inline void spi_putreg(FAR struct stm32_spidev_s *priv, uint8_t offset,
|
||||
uint16_t value)
|
||||
{
|
||||
putreg16(value, priv->spibase + offset);
|
||||
@ -571,7 +571,7 @@ static inline void spi_putreg(FAR struct stm32f7_spidev_s *priv, uint8_t offset,
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline uint8_t spi_getreg8(FAR struct stm32f7_spidev_s *priv, uint8_t offset)
|
||||
static inline uint8_t spi_getreg8(FAR struct stm32_spidev_s *priv, uint8_t offset)
|
||||
{
|
||||
return getreg8(priv->spibase + offset);
|
||||
}
|
||||
@ -589,7 +589,7 @@ static inline uint8_t spi_getreg8(FAR struct stm32f7_spidev_s *priv, uint8_t off
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline void spi_putreg8(FAR struct stm32f7_spidev_s *priv, uint8_t offset,
|
||||
static inline void spi_putreg8(FAR struct stm32_spidev_s *priv, uint8_t offset,
|
||||
uint8_t value)
|
||||
{
|
||||
putreg8(value, priv->spibase + offset);
|
||||
@ -609,7 +609,7 @@ static inline void spi_putreg8(FAR struct stm32f7_spidev_s *priv, uint8_t offset
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline uint16_t spi_readword(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline uint16_t spi_readword(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
/* Wait until the receive buffer is not empty */
|
||||
|
||||
@ -634,7 +634,7 @@ static inline uint16_t spi_readword(FAR struct stm32f7_spidev_s *priv)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline uint8_t spi_readbyte(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline uint8_t spi_readbyte(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
/* Wait until the receive buffer is not empty */
|
||||
|
||||
@ -660,7 +660,7 @@ static inline uint8_t spi_readbyte(FAR struct stm32f7_spidev_s *priv)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline void spi_writeword(FAR struct stm32f7_spidev_s *priv, uint16_t word)
|
||||
static inline void spi_writeword(FAR struct stm32_spidev_s *priv, uint16_t word)
|
||||
{
|
||||
/* Wait until the transmit buffer is empty */
|
||||
|
||||
@ -686,7 +686,7 @@ static inline void spi_writeword(FAR struct stm32f7_spidev_s *priv, uint16_t wor
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline void spi_writebyte(FAR struct stm32f7_spidev_s *priv, uint8_t byte)
|
||||
static inline void spi_writebyte(FAR struct stm32_spidev_s *priv, uint8_t byte)
|
||||
{
|
||||
/* Wait until the transmit buffer is empty */
|
||||
|
||||
@ -711,7 +711,7 @@ static inline void spi_writebyte(FAR struct stm32f7_spidev_s *priv, uint8_t byte
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static inline bool spi_16bitmode(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline bool spi_16bitmode(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
uint8_t bits = priv->nbits;
|
||||
|
||||
@ -740,7 +740,7 @@ static inline bool spi_16bitmode(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmarxwait(FAR struct stm32f7_spidev_s *priv)
|
||||
static void spi_dmarxwait(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
/* Take the semaphore (perhaps waiting). If the result is zero, then the DMA
|
||||
* must not really have completed???
|
||||
@ -766,7 +766,7 @@ static void spi_dmarxwait(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmatxwait(FAR struct stm32f7_spidev_s *priv)
|
||||
static void spi_dmatxwait(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
/* Take the semaphore (perhaps waiting). If the result is zero, then the DMA
|
||||
* must not really have completed???
|
||||
@ -792,7 +792,7 @@ static void spi_dmatxwait(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static inline void spi_dmarxwakeup(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline void spi_dmarxwakeup(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
(void)sem_post(&priv->rxsem);
|
||||
}
|
||||
@ -807,7 +807,7 @@ static inline void spi_dmarxwakeup(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static inline void spi_dmatxwakeup(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline void spi_dmatxwakeup(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
(void)sem_post(&priv->txsem);
|
||||
}
|
||||
@ -824,7 +824,7 @@ static inline void spi_dmatxwakeup(FAR struct stm32f7_spidev_s *priv)
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t isr, void *arg)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)arg;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)arg;
|
||||
|
||||
/* Wake-up the SPI driver */
|
||||
|
||||
@ -844,7 +844,7 @@ static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t isr, void *arg)
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t isr, void *arg)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)arg;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)arg;
|
||||
|
||||
/* Wake-up the SPI driver */
|
||||
|
||||
@ -862,7 +862,7 @@ static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t isr, void *arg)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmarxsetup(FAR struct stm32f7_spidev_s *priv, FAR void *rxbuffer,
|
||||
static void spi_dmarxsetup(FAR struct stm32_spidev_s *priv, FAR void *rxbuffer,
|
||||
FAR void *rxdummy, size_t nwords)
|
||||
{
|
||||
/* 8- or 16-bit mode? */
|
||||
@ -898,7 +898,7 @@ static void spi_dmarxsetup(FAR struct stm32f7_spidev_s *priv, FAR void *rxbuffer
|
||||
|
||||
/* Configure the RX DMA */
|
||||
|
||||
stm32f7_dmasetup(priv->rxdma, priv->spibase + STM32F7_SPI_DR_OFFSET,
|
||||
stm32_dmasetup(priv->rxdma, priv->spibase + STM32F7_SPI_DR_OFFSET,
|
||||
(uint32_t)rxbuffer, nwords, priv->rxccr);
|
||||
}
|
||||
#endif
|
||||
@ -912,7 +912,7 @@ static void spi_dmarxsetup(FAR struct stm32f7_spidev_s *priv, FAR void *rxbuffer
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static void spi_dmatxsetup(FAR struct stm32f7_spidev_s *priv, FAR const void *txbuffer,
|
||||
static void spi_dmatxsetup(FAR struct stm32_spidev_s *priv, FAR const void *txbuffer,
|
||||
FAR const void *txdummy, size_t nwords)
|
||||
{
|
||||
/* 8- or 16-bit mode? */
|
||||
@ -948,7 +948,7 @@ static void spi_dmatxsetup(FAR struct stm32f7_spidev_s *priv, FAR const void *tx
|
||||
|
||||
/* Setup the TX DMA */
|
||||
|
||||
stm32f7_dmasetup(priv->txdma, priv->spibase + STM32F7_SPI_DR_OFFSET,
|
||||
stm32_dmasetup(priv->txdma, priv->spibase + STM32F7_SPI_DR_OFFSET,
|
||||
(uint32_t)txbuffer, nwords, priv->txccr);
|
||||
}
|
||||
#endif
|
||||
@ -962,10 +962,10 @@ static void spi_dmatxsetup(FAR struct stm32f7_spidev_s *priv, FAR const void *tx
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static inline void spi_dmarxstart(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
priv->rxresult = 0;
|
||||
stm32f7_dmastart(priv->rxdma, spi_dmarxcallback, priv, false);
|
||||
stm32_dmastart(priv->rxdma, spi_dmarxcallback, priv, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -978,10 +978,10 @@ static inline void spi_dmarxstart(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMA
|
||||
static inline void spi_dmatxstart(FAR struct stm32f7_spidev_s *priv)
|
||||
static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
priv->txresult = 0;
|
||||
stm32f7_dmastart(priv->txdma, spi_dmatxcallback, priv, false);
|
||||
stm32_dmastart(priv->txdma, spi_dmatxcallback, priv, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1001,7 +1001,7 @@ static inline void spi_dmatxstart(FAR struct stm32f7_spidev_s *priv)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static void spi_modifycr(uint32_t addr, FAR struct stm32f7_spidev_s *priv, uint16_t setbits, uint16_t clrbits)
|
||||
static void spi_modifycr(uint32_t addr, FAR struct stm32_spidev_s *priv, uint16_t setbits, uint16_t clrbits)
|
||||
{
|
||||
uint16_t cr;
|
||||
|
||||
@ -1034,7 +1034,7 @@ static void spi_modifycr(uint32_t addr, FAR struct stm32f7_spidev_s *priv, uint1
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
|
||||
if (lock)
|
||||
{
|
||||
@ -1073,7 +1073,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint16_t setbits;
|
||||
uint32_t actual;
|
||||
|
||||
@ -1181,7 +1181,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
|
||||
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
|
||||
@ -1247,7 +1247,7 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint16_t setbits1, setbits2;
|
||||
uint16_t clrbits1, clrbits2;
|
||||
int savbits = nbits;
|
||||
@ -1325,7 +1325,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
|
||||
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint32_t regval;
|
||||
uint16_t ret;
|
||||
|
||||
@ -1395,7 +1395,7 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
#endif
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
|
||||
spivdbg("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords);
|
||||
@ -1495,11 +1495,11 @@ static void spi_exchange_nodma(FAR struct spi_dev_s *dev, FAR const void *txbuff
|
||||
static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = (FAR struct stm32f7_spidev_s *)dev;
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
|
||||
#ifdef CONFIG_STM32F7_DMACAPABLE
|
||||
if ((txbuffer && !stm32f7_dmacapable((uint32_t)txbuffer, nwords, priv->txccr)) ||
|
||||
(rxbuffer && !stm32f7_dmacapable((uint32_t)rxbuffer, nwords, priv->rxccr)))
|
||||
if ((txbuffer && !stm32_dmacapable((uint32_t)txbuffer, nwords, priv->txccr)) ||
|
||||
(rxbuffer && !stm32_dmacapable((uint32_t)rxbuffer, nwords, priv->rxccr)))
|
||||
{
|
||||
/* Unsupported memory region, fall back to non-DMA method. */
|
||||
|
||||
@ -1600,7 +1600,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, size_t
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv)
|
||||
static void spi_bus_initialize(FAR struct stm32_spidev_s *priv)
|
||||
{
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
@ -1645,16 +1645,16 @@ static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv)
|
||||
sem_init(&priv->rxsem, 0, 0);
|
||||
sem_init(&priv->txsem, 0, 0);
|
||||
|
||||
/* Get DMA channels. NOTE: stm32f7_dmachannel() will always assign the DMA channel.
|
||||
* if the channel is not available, then stm32f7_dmachannel() will block and wait
|
||||
/* Get DMA channels. NOTE: stm32_dmachannel() will always assign the DMA channel.
|
||||
* if the channel is not available, then stm32_dmachannel() will block and wait
|
||||
* until the channel becomes available. WARNING: If you have another device sharing
|
||||
* a DMA channel with SPI and the code never releases that channel, then the call
|
||||
* to stm32f7_dmachannel() will hang forever in this function! Don't let your
|
||||
* to stm32_dmachannel() will hang forever in this function! Don't let your
|
||||
* design do that!
|
||||
*/
|
||||
|
||||
priv->rxdma = stm32f7_dmachannel(priv->rxch);
|
||||
priv->txdma = stm32f7_dmachannel(priv->txch);
|
||||
priv->rxdma = stm32_dmachannel(priv->rxch);
|
||||
priv->txdma = stm32_dmachannel(priv->txch);
|
||||
DEBUGASSERT(priv->rxdma && priv->txdma);
|
||||
|
||||
spi_putreg(priv, STM32F7_SPI_CR2_OFFSET, SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN);
|
||||
@ -1670,7 +1670,7 @@ static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32f7_spibus_initialize
|
||||
* Name: stm32_spibus_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the selected SPI bus
|
||||
@ -1683,9 +1683,9 @@ static void spi_bus_initialize(FAR struct stm32f7_spidev_s *priv)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *stm32f7_spibus_initialize(int bus)
|
||||
FAR struct spi_dev_s *stm32_spibus_initialize(int bus)
|
||||
{
|
||||
FAR struct stm32f7_spidev_s *priv = NULL;
|
||||
FAR struct stm32_spidev_s *priv = NULL;
|
||||
|
||||
irqstate_t flags = enter_critical_section();
|
||||
|
||||
|
@ -72,7 +72,7 @@ enum spi_dev_e;
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32f7_spibus_initialize
|
||||
* Name: stm32_spibus_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the selected SPI bus
|
||||
@ -85,31 +85,31 @@ enum spi_dev_e;
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *stm32f7_spibus_initialize(int bus);
|
||||
FAR struct spi_dev_s *stm32_spibus_initialize(int bus);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32f7_spi1/2/...select and stm32f7_spi1/2/...status
|
||||
* Name: stm32_spi1/2/...select and stm32_spi1/2/...status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, stm32f7_spi1/2/...select, stm32f7_spi1/2/...status, and
|
||||
* stm32f7_spi1/2/...cmddata must be provided by board-specific logic. These are
|
||||
* The external functions, stm32_spi1/2/...select, stm32_spi1/2/...status, and
|
||||
* stm32_spi1/2/...cmddata must be provided by board-specific logic. These are
|
||||
* implementations of the select, status, and cmddata methods of the SPI interface
|
||||
* defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods
|
||||
* (including stm32f7_spibus_initialize()) are provided by common STM32 logic. To use this
|
||||
* (including stm32_spibus_initialize()) are provided by common STM32 logic. To use this
|
||||
* common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in stm32f7_boardinitialize() to configure SPI chip select
|
||||
* 1. Provide logic in stm32_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
* 2. Provide stm32f7_spi1/2/...select() and stm32f7_spi1/2/...status() functions in your
|
||||
* 2. Provide stm32_spi1/2/...select() and stm32_spi1/2/...status() 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. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration file, then
|
||||
* provide stm32f7_spi1/2/...cmddata() functions in your board-specific logic.
|
||||
* provide stm32_spi1/2/...cmddata() functions in your board-specific logic.
|
||||
* These functions will perform cmd/data selection operations using GPIOs in the
|
||||
* way your board is configured.
|
||||
* 4. Add a calls to stm32f7_spibus_initialize() in your low level application
|
||||
* 4. Add a calls to stm32_spibus_initialize() in your low level application
|
||||
* initialization logic
|
||||
* 5. The handle returned by stm32f7_spibus_initialize() may then be used to bind the
|
||||
* 5. 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).
|
||||
@ -117,43 +117,43 @@ FAR struct spi_dev_s *stm32f7_spibus_initialize(int bus);
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI1
|
||||
void stm32f7_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI2
|
||||
void stm32f7_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI3
|
||||
void stm32f7_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI4
|
||||
void stm32f7_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI5
|
||||
void stm32f7_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI6
|
||||
void stm32f7_spi6select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32f7_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32f7_spi6cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
void stm32_spi6select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
uint8_t stm32_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
int stm32_spi6cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32f7_spi1/2/...register
|
||||
* Name: stm32_spi1/2/...register
|
||||
*
|
||||
* Description:
|
||||
* If the board supports a card detect callback to inform the SPI-based MMC/SD
|
||||
@ -174,32 +174,32 @@ int stm32f7_spi6cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm
|
||||
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
#ifdef CONFIG_STM32F7_SPI1
|
||||
int stm32f7_spi1register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi1register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI2
|
||||
int stm32f7_spi2register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi2register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI3
|
||||
int stm32f7_spi3register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi3register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI4
|
||||
int stm32f7_spi4register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi4register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI5
|
||||
int stm32f7_spi5register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi5register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI6
|
||||
int stm32f7_spi6register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
int stm32_spi6register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -47,12 +47,12 @@
|
||||
#include "stm32f746-ws.h"
|
||||
#include "stm32_i2c.h"
|
||||
|
||||
static void stm32f7_i2c_register(int bus)
|
||||
static void stm32_i2c_register(int bus)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
|
||||
i2c = stm32f7_i2cbus_initialize(bus);
|
||||
i2c = stm32_i2cbus_initialize(bus);
|
||||
if (i2c == NULL)
|
||||
{
|
||||
dbg("ERROR: Failed to get I2C%d interface\n", bus);
|
||||
@ -63,14 +63,14 @@ static void stm32f7_i2c_register(int bus)
|
||||
if (ret < 0)
|
||||
{
|
||||
dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret);
|
||||
stm32f7_i2cbus_uninitialize(i2c);
|
||||
stm32_i2cbus_uninitialize(i2c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void stm32f7_i2ctool(void)
|
||||
static void stm32_i2ctool(void)
|
||||
{
|
||||
stm32f7_i2c_register(1);
|
||||
stm32_i2c_register(1);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -91,7 +91,7 @@ int board_app_initialize(void)
|
||||
{
|
||||
/* Register I2C drivers on behalf of the I2C tool */
|
||||
|
||||
stm32f7_i2ctool();
|
||||
stm32_i2ctool();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
@ -116,72 +116,72 @@ void weak_function stm32_spidev_initialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI1
|
||||
void stm32f7_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI2
|
||||
void stm32f7_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI3
|
||||
void stm32f7_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI4
|
||||
void stm32f7_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI5
|
||||
void stm32f7_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI6
|
||||
void stm32f7_spi6select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
void stm32_spi6select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||
{
|
||||
spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t stm32f7_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
uint8_t stm32_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -212,42 +212,42 @@ uint8_t stm32f7_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
#ifdef CONFIG_STM32F7_SPI1
|
||||
int stm32f7_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI2
|
||||
int stm32f7_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI3
|
||||
int stm32f7_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI4
|
||||
int stm32f7_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI5
|
||||
int stm32f7_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI6
|
||||
int stm32f7_spi6cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
int stm32_spi6cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user