arch/stm32f7: Fix nxstyle errors

arch/arm/src/stm32f7/stm32_config.h,
arch/arm/src/stm32f7/stm32_dma.h,
arch/arm/src/stm32f7/stm32_dma2d.h,
arch/arm/src/stm32f7/stm32_dtcm.h,
arch/arm/src/stm32f7/stm32_dumpgpio.c,
arch/arm/src/stm32f7/stm32_ethernet.h,
arch/arm/src/stm32f7/stm32_gpio.c,
arch/arm/src/stm32f7/stm32_gpio.h:

    * Fix nxstyle errors.
This commit is contained in:
Nathan Hartman 2021-02-24 10:38:29 -05:00 committed by Abdelatif Guettouche
parent 01699e00e0
commit 7c5174a53b
8 changed files with 146 additions and 117 deletions

View File

@ -48,6 +48,7 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* GPIO IRQs ****************************************************************/ /* GPIO IRQs ****************************************************************/
#ifndef CONFIG_STM32F7_GPIO_IRQ #ifndef CONFIG_STM32F7_GPIO_IRQ
@ -75,6 +76,7 @@
#endif #endif
/* UARTs ********************************************************************/ /* UARTs ********************************************************************/
/* Don't enable UARTs not supported by the chip. */ /* Don't enable UARTs not supported by the chip. */
#if STM32F7_NUART < 1 #if STM32F7_NUART < 1
@ -109,6 +111,7 @@
#endif #endif
/* USARTs *******************************************************************/ /* USARTs *******************************************************************/
/* If the USART is not being used as a UART, then it really isn't enabled /* If the USART is not being used as a UART, then it really isn't enabled
* for our purposes. * for our purposes.
*/ */
@ -145,6 +148,7 @@
#endif #endif
/* UART Flow Control ********************************************************/ /* UART Flow Control ********************************************************/
/* UARTs do not support flow control */ /* UARTs do not support flow control */
#undef CONFIG_UART0_IFLOWCONTROL #undef CONFIG_UART0_IFLOWCONTROL
@ -164,8 +168,11 @@
#endif #endif
/* Serial Console ***********************************************************/ /* Serial Console ***********************************************************/
/* Is there a serial console? There should be no more than one defined. It
* could be on any UARTn, n=1,..,STM32F7_NUART, or USARTn, n=1,.., STM32F7_NUSART /* Is there a serial console? There should be no more than one defined.
* It could be on any:
* UARTn, n=1..STM32F7_NUART, or
* USARTn, n=1..STM32F7_NUSART
*/ */
#undef HAVE_SERIAL_CONSOLE #undef HAVE_SERIAL_CONSOLE
@ -252,7 +259,8 @@
# undef CONFIG_USART2_SERIAL_CONSOLE # undef CONFIG_USART2_SERIAL_CONSOLE
#endif #endif
/* SPI ******************************************************************************/ /* SPI **********************************************************************/
/* Don't enable SPI peripherals not supported by the chip. */ /* Don't enable SPI peripherals not supported by the chip. */
#if CHIP_NSPI < 1 #if CHIP_NSPI < 1
@ -286,7 +294,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_CONFIG_H */ #endif /* __ARCH_ARM_SRC_STM32F7_STM32_CONFIG_H */

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* arch/arm/src/stm32f7/stm32_dma.h * arch/arm/src/stm32f7/stm32_dma.h
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015 Gregory Nutt. All rights reserved.
@ -31,22 +31,22 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F7_STM32_DMA_H #ifndef __ARCH_ARM_SRC_STM32F7_STM32_DMA_H
#define __ARCH_ARM_SRC_STM32F7_STM32_DMA_H #define __ARCH_ARM_SRC_STM32F7_STM32_DMA_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include "hardware/stm32_dma.h" #include "hardware/stm32_dma.h"
/* These definitions provide the bit encoding of the 'status' parameter passed to the /* These definitions provide the bit encoding of the 'status' parameter
* DMA callback function (see dma_callback_t). * passed to the DMA callback function (see dma_callback_t).
*/ */
#define DMA_STATUS_FEIF 0 /* Stream FIFO error (ignored) */ #define DMA_STATUS_FEIF 0 /* Stream FIFO error (ignored) */
@ -55,14 +55,14 @@
#define DMA_STATUS_HTIF DMA_STREAM_HTIF_BIT /* Stream Half Transfer */ #define DMA_STATUS_HTIF DMA_STREAM_HTIF_BIT /* Stream Half Transfer */
#define DMA_STATUS_TCIF DMA_STREAM_TCIF_BIT /* Stream Transfer Complete */ #define DMA_STATUS_TCIF DMA_STREAM_TCIF_BIT /* Stream Transfer Complete */
#define DMA_STATUS_ERROR (DMA_STATUS_FEIF|DMA_STATUS_DMEIF|DMA_STATUS_TEIF) #define DMA_STATUS_ERROR (DMA_STATUS_FEIF | DMA_STATUS_DMEIF | DMA_STATUS_TEIF)
#define DMA_STATUS_SUCCESS (DMA_STATUS_TCIF|DMA_STATUS_HTIF) #define DMA_STATUS_SUCCESS (DMA_STATUS_TCIF | DMA_STATUS_HTIF)
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/* DMA_HANDLE Provides an opaque are reference that can be used to represent a DMA /* DMA_HANDLE Provides an opaque are reference that can be used to represent
* a DMA stream. * a DMA stream.
*/ */
@ -70,16 +70,16 @@ typedef FAR void *DMA_HANDLE;
/* Description: /* Description:
* This is the type of the callback that is used to inform the user of the * This is the type of the callback that is used to inform the user of the
* completion of the DMA. NOTE: The DMA module does *NOT* perform any cache * completion of the DMA. NOTE: The DMA module does *NOT* perform any
* operations. It is the responsibility of the DMA client to invalidate DMA * cache operations. It is the responsibility of the DMA client to
* buffers after completion of the DMA RX operations. * invalidate DMA buffers after completion of the DMA RX operations.
* *
* Input Parameters: * Input Parameters:
* handle - Refers tot he DMA channel or stream * handle - Refers tot he DMA channel or stream
* status - A bit encoded value that provides the completion status. See the * status - A bit encoded value that provides the completion status. See
* DMASTATUS_* definitions above. * the DMASTATUS_* definitions above.
* arg - A user-provided value that was provided when stm32_dmastart() was * arg - A user-provided value that was provided when stm32_dmastart()
* called. * was called.
*/ */
typedef void (*dma_callback_t)(DMA_HANDLE handle, uint8_t status, void *arg); typedef void (*dma_callback_t)(DMA_HANDLE handle, uint8_t status, void *arg);
@ -96,9 +96,9 @@ struct stm32_dmaregs_s
uint32_t sfcr; uint32_t sfcr;
}; };
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
@ -111,9 +111,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Functions * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_dmachannel * Name: stm32_dmachannel
@ -158,11 +158,13 @@ DMA_HANDLE stm32_dmachannel(unsigned int chan);
* Name: stm32_dmafree * Name: stm32_dmafree
* *
* Description: * Description:
* Release a DMA channel. If another thread is waiting for this DMA channel * Release a DMA channel. If another thread is waiting for this DMA
* in a call to stm32_dmachannel, then this function will re-assign the * channel in a call to stm32_dmachannel, then this function will re-
* DMA channel to that thread and wake it up. NOTE: The 'handle' used * assign the DMA channel to that thread and wake it up.
* in this argument must NEVER be used again until stm32_dmachannel() is *
* called again to re-gain access to the channel. * NOTE: The 'handle' used in this argument must NEVER be used again
* until stm32_dmachannel() is called again to re-gain access to
* the channel.
* *
* Returned Value: * Returned Value:
* None * None
@ -237,15 +239,15 @@ size_t stm32_dmaresidual(DMA_HANDLE handle);
* Description: * Description:
* Check if the DMA controller can transfer data to/from given memory * Check if the DMA controller can transfer data to/from given memory
* address with the given configuration. This depends on the internal * address with the given configuration. This depends on the internal
* connections in the ARM bus matrix of the processor. Note that this * connections in the ARM bus matrix of the processor. Note that this only
* only applies to memory addresses, it will return false for any peripheral * applies to memory addresses, it will return false for any peripheral
* address. * address.
* *
* Input Parameters: * Input Parameters:
* *
* maddr - starting memory address * maddr - starting memory address
* count - number of unit8 or uint16 or uint32 items as defined by MSIZE of * count - number of unit8 or uint16 or uint32 items as defined by MSIZE
* ccr. * of ccr.
* ccr - DMA stream configuration register * ccr - DMA stream configuration register
* *
* Returned Value: * Returned Value:

View File

@ -85,9 +85,8 @@ struct dma2d_layer_s
/* Name: fillcolor /* Name: fillcolor
* *
* Description: * Description:
* Fill a specific memory region with a color. * Fill a specific memory region with a color. The caller must ensure
* The caller must ensure that the memory region (area) is within the entire * that the memory region (area) is within the entire overlay.
* overlay.
* *
* Parameter: * Parameter:
* oinfo - Reference to overlay information * oinfo - Reference to overlay information
@ -106,9 +105,9 @@ struct dma2d_layer_s
* *
* Description: * Description:
* Copies memory from a source overlay (defined by sarea) to destination * Copies memory from a source overlay (defined by sarea) to destination
* overlay position (defined by destxpos and destypos) without pixelformat * overlay position (defined by destxpos and destypos) without
* conversion. The caller must ensure that the memory region (area) is * pixelformat conversion. The caller must ensure that the memory region
* within the entire overlay. * (area) is within the entire overlay.
* *
* Parameter: * Parameter:
* doverlay - Reference destination overlay * doverlay - Reference destination overlay
@ -159,7 +158,7 @@ struct dma2d_layer_s
}; };
/**************************************************************************** /****************************************************************************
* Public Functions * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************

View File

@ -49,7 +49,9 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/ /* Configuration ************************************************************/
/* Assume that we can support the DTCM heap */ /* Assume that we can support the DTCM heap */
#define HAVE_DTCM_HEAP 1 #define HAVE_DTCM_HEAP 1

View File

@ -65,6 +65,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* Port letters for prettier debug output */ /* Port letters for prettier debug output */
static const char g_portchar[STM32F7_NGPIO] = static const char g_portchar[STM32F7_NGPIO] =

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* arch/arm/src/stm32f7/stm32_ethernet.h * arch/arm/src/stm32f7/stm32_ethernet.h
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015 Gregory Nutt. All rights reserved.
@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F7_STM32_ETHERNET_H #ifndef __ARCH_ARM_SRC_STM32F7_STM32_ETHERNET_H
#define __ARCH_ARM_SRC_STM32F7_STM32_ETHERNET_H #define __ARCH_ARM_SRC_STM32F7_STM32_ETHERNET_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -47,9 +47,9 @@
#if STM32F7_NETHERNET > 0 #if STM32F7_NETHERNET > 0
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/************************************************************************************ /****************************************************************************
* Public Functions * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@ -60,38 +60,40 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Function: stm32_ethinitialize * Function: stm32_ethinitialize
* *
* Description: * Description:
* Initialize the Ethernet driver for one interface. If the STM32 chip supports * Initialize the Ethernet driver for one interface. If the STM32 chip
* multiple Ethernet controllers, then board specific logic must implement * supports multiple Ethernet controllers, then board specific logic must
* arm_netinitialize() and call this function to initialize the desired interfaces. * implement arm_netinitialize() and call this function to initialize the
* desired interfaces.
* *
* Input Parameters: * Input Parameters:
* intf - In the case where there are multiple EMACs, this value identifies which * intf - In the case where there are multiple EMACs, this value
* EMAC is to be initialized. * identifies which EMAC is to be initialized.
* *
* Returned Value: * Returned Value:
* OK on success; Negated errno on failure. * OK on success; Negated errno on failure.
* *
* Assumptions: * Assumptions:
* *
************************************************************************************/ ****************************************************************************/
#if STM32F7_NETHERNET > 1 || defined(CONFIG_NETDEV_LATEINIT) #if STM32F7_NETHERNET > 1 || defined(CONFIG_NETDEV_LATEINIT)
int stm32_ethinitialize(int intf); int stm32_ethinitialize(int intf);
#endif #endif
/************************************************************************************ /****************************************************************************
* Function: stm32_phy_boardinitialize * Function: stm32_phy_boardinitialize
* *
* Description: * Description:
* Some boards require specialized initialization of the PHY before it can be used. * Some boards require specialized initialization of the PHY before it can
* This may include such things as configuring GPIOs, resetting the PHY, etc. If * be used. This may include such things as configuring GPIOs, resetting
* CONFIG_STM32F7_PHYINIT is defined in the configuration then the board specific * the PHY, etc. If CONFIG_STM32F7_PHYINIT is defined in the
* logic must provide stm32_phyinitialize(); The STM32 Ethernet driver will call * configuration then the board specific logic must provide
* this function one time before it first uses the PHY. * stm32_phyinitialize(); The STM32 Ethernet driver will call this
* function one time before it first uses the PHY.
* *
* Input Parameters: * Input Parameters:
* intf - Always zero for now. * intf - Always zero for now.
@ -101,7 +103,7 @@ int stm32_ethinitialize(int intf);
* *
* Assumptions: * Assumptions:
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_STM32F7_PHYINIT #ifdef CONFIG_STM32F7_PHYINIT
int stm32_phy_boardinitialize(int intf); int stm32_phy_boardinitialize(int intf);

View File

@ -64,6 +64,7 @@
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
/* Base addresses for each GPIO block */ /* Base addresses for each GPIO block */
const uint32_t g_gpiobase[STM32F7_NGPIO] = const uint32_t g_gpiobase[STM32F7_NGPIO] =
@ -164,7 +165,10 @@ int stm32_configgpio(uint32_t cfgset)
break; break;
case GPIO_OUTPUT: /* General purpose output mode */ case GPIO_OUTPUT: /* General purpose output mode */
stm32_gpiowrite(cfgset, (cfgset & GPIO_OUTPUT_SET) != 0); /* Set the initial output value */
/* Set the initial output value */
stm32_gpiowrite(cfgset, (cfgset & GPIO_OUTPUT_SET) != 0);
pinmode = GPIO_MODER_OUTPUT; pinmode = GPIO_MODER_OUTPUT;
break; break;
@ -294,18 +298,22 @@ int stm32_configgpio(uint32_t cfgset)
putreg32(regval, base + STM32_GPIO_OTYPER_OFFSET); putreg32(regval, base + STM32_GPIO_OTYPER_OFFSET);
/* Otherwise, it is an input pin. Should it configured as an EXTI interrupt? */ /* Otherwise, it is an input pin. Should it configured as an EXTI
* interrupt?
*/
if (pinmode != GPIO_MODER_OUTPUT && (cfgset & GPIO_EXTI) != 0) if (pinmode != GPIO_MODER_OUTPUT && (cfgset & GPIO_EXTI) != 0)
{ {
/* "In STM32 F1 the selection of the EXTI line source is performed through /* "In STM32 F1 the selection of the EXTI line source is performed
* the EXTIx bits in the AFIO_EXTICRx registers, while in F2 series this * through the EXTIx bits in the AFIO_EXTICRx registers, while in F2
* selection is done through the EXTIx bits in the SYSCFG_EXTICRx registers. * series this selection is done through the EXTIx bits in the
* SYSCFG_EXTICRx registers.
* *
* "Only the mapping of the EXTICRx registers has been changed, without any * "Only the mapping of the EXTICRx registers has been changed,
* changes to the meaning of the EXTIx bits. However, the range of EXTI * without any changes to the meaning of the EXTIx bits. However, the
* bits values has been extended to 0b1000 to support the two ports added * range of EXTI bits values has been extended to 0b1000 to support
* in F2, port H and I (in F1 series the maximum value is 0b0110)." * the two ports added in F2, port H and I (in F1 series the maximum
* value is 0b0110)."
*/ */
uint32_t regaddr; uint32_t regaddr;
@ -330,14 +338,15 @@ int stm32_configgpio(uint32_t cfgset)
* Name: stm32_unconfiggpio * Name: stm32_unconfiggpio
* *
* Description: * Description:
* Unconfigure a GPIO pin based on bit-encoded description of the pin, set it * Unconfigure a GPIO pin based on bit-encoded description of the pin, set
* into default HiZ state (and possibly mark it's unused) and unlock it whether * it into default HiZ state (and possibly mark it's unused) and unlock it
* it was previously selected as alternative function (GPIO_ALT|GPIO_CNF_AFPP|...). * whether it was previously selected as alternative function
* (GPIO_ALT|GPIO_CNF_AFPP|...).
* *
* This is a safety function and prevents hardware from schocks, as unexpected * This is a safety function and prevents hardware from schocks, as
* write to the Timer Channel Output GPIO to fixed '1' or '0' while it should * unexpected write to the Timer Channel Output GPIO to fixed '1' or '0'
* operate in PWM mode could produce excessive on-board currents and trigger * while it should operate in PWM mode could produce excessive on-board
* over-current/alarm function. * currents and trigger over-current/alarm function.
* *
* Returned Value: * Returned Value:
* OK on success * OK on success
@ -425,6 +434,7 @@ bool stm32_gpioread(uint32_t pinset)
pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT; pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
return ((getreg32(base + STM32_GPIO_IDR_OFFSET) & (1 << pin)) != 0); return ((getreg32(base + STM32_GPIO_IDR_OFFSET) & (1 << pin)) != 0);
} }
return 0; return 0;
} }
@ -437,10 +447,11 @@ bool stm32_gpioread(uint32_t pinset)
* By default the I/O compensation cell is not used. However when the I/O * By default the I/O compensation cell is not used. However when the I/O
* output buffer speed is configured in 50 MHz or 100 MHz mode, it is * output buffer speed is configured in 50 MHz or 100 MHz mode, it is
* recommended to use the compensation cell for slew rate control on I/O * recommended to use the compensation cell for slew rate control on I/O
* tf(IO)out)/tr(IO)out commutation to reduce the I/O noise on power supply. * tf(IO)out)/tr(IO)out commutation to reduce the I/O noise on power
* supply.
* *
* The I/O compensation cell can be used only when the supply voltage ranges * The I/O compensation cell can be used only when the supply voltage
* from 2.4 to 3.6 V. * ranges from 2.4 to 3.6 V.
* *
* Input Parameters: * Input Parameters:
* None * None

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* arch/arm/src/stm32f7/stm32_gpio.h * arch/arm/src/stm32f7/stm32_gpio.h
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015 Gregory Nutt. All rights reserved.
@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32F7_STM32_GPIO_H #ifndef __ARCH_ARM_SRC_STM32F7_STM32_GPIO_H
#define __ARCH_ARM_SRC_STM32F7_STM32_GPIO_H #define __ARCH_ARM_SRC_STM32F7_STM32_GPIO_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -52,14 +52,14 @@
#include "chip.h" #include "chip.h"
#include "hardware/stm32_gpio.h" #include "hardware/stm32_gpio.h"
/************************************************************************************ /****************************************************************************
* Pre-Processor Declarations * Pre-Processor Declarations
************************************************************************************/ ****************************************************************************/
/* Bit-encoded input to stm32_configgpio() */ /* Bit-encoded input to stm32_configgpio() */
/* Each port bit of the general-purpose I/O (GPIO) ports can be individually configured /* Each port bit of the general-purpose I/O (GPIO) ports can be individually
* by software in several modes: * configured by software in several modes:
* *
* - Input floating * - Input floating
* - Input pull-up * - Input pull-up
@ -162,7 +162,9 @@
#define GPIO_OPENDRAIN (1 << 9) /* Bit9: 1=Open-drain output */ #define GPIO_OPENDRAIN (1 << 9) /* Bit9: 1=Open-drain output */
#define GPIO_PUSHPULL (0) /* Bit9: 0=Push-pull output */ #define GPIO_PUSHPULL (0) /* Bit9: 0=Push-pull output */
/* If the pin is a GPIO digital output, then this identifies the initial output value. /* If the pin is a GPIO digital output, then this identifies the initial
* output value.
*
* If the pin is an input, this bit is overloaded to provide the qualifier to * If the pin is an input, this bit is overloaded to provide the qualifier to
* distinguish input pull-up and -down: * distinguish input pull-up and -down:
* *
@ -234,9 +236,9 @@
# define GPIO_PIN14 (14 << GPIO_PIN_SHIFT) # define GPIO_PIN14 (14 << GPIO_PIN_SHIFT)
# define GPIO_PIN15 (15 << GPIO_PIN_SHIFT) # define GPIO_PIN15 (15 << GPIO_PIN_SHIFT)
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
@ -253,11 +255,11 @@ extern "C"
EXTERN const uint32_t g_gpiobase[STM32F7_NGPIO]; EXTERN const uint32_t g_gpiobase[STM32F7_NGPIO];
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Name: stm32_configgpio * Name: stm32_configgpio
* *
* Description: * Description:
@ -270,48 +272,49 @@ EXTERN const uint32_t g_gpiobase[STM32F7_NGPIO];
* OK on success * OK on success
* ERROR on invalid port, or when pin is locked as ALT function. * ERROR on invalid port, or when pin is locked as ALT function.
* *
************************************************************************************/ ****************************************************************************/
int stm32_configgpio(uint32_t cfgset); int stm32_configgpio(uint32_t cfgset);
/************************************************************************************ /****************************************************************************
* Name: stm32_unconfiggpio * Name: stm32_unconfiggpio
* *
* Description: * Description:
* Unconfigure a GPIO pin based on bit-encoded description of the pin, set it * Unconfigure a GPIO pin based on bit-encoded description of the pin, set
* into default HiZ state (and possibly mark it's unused) and unlock it whether * it into default HiZ state (and possibly mark it's unused) and unlock it
* it was previously selected as alternative function (GPIO_ALT|GPIO_CNF_AFPP|...). * whether it was previously selected as alternative function
* (GPIO_ALT|GPIO_CNF_AFPP|...).
* *
* This is a safety function and prevents hardware from schocks, as unexpected * This is a safety function and prevents hardware from schocks, as
* write to the Timer Channel Output GPIO to fixed '1' or '0' while it should * unexpected write to the Timer Channel Output GPIO to fixed '1' or '0'
* operate in PWM mode could produce excessive on-board currents and trigger * while it should operate in PWM mode could produce excessive on-board
* over-current/alarm function. * currents and trigger over-current/alarm function.
* *
* Returned Value: * Returned Value:
* OK on success * OK on success
* ERROR on invalid port * ERROR on invalid port
* *
************************************************************************************/ ****************************************************************************/
int stm32_unconfiggpio(uint32_t cfgset); int stm32_unconfiggpio(uint32_t cfgset);
/************************************************************************************ /****************************************************************************
* Name: stm32_gpiowrite * Name: stm32_gpiowrite
* *
* Description: * Description:
* Write one or zero to the selected GPIO pin * Write one or zero to the selected GPIO pin
* *
************************************************************************************/ ****************************************************************************/
void stm32_gpiowrite(uint32_t pinset, bool value); void stm32_gpiowrite(uint32_t pinset, bool value);
/************************************************************************************ /****************************************************************************
* Name: stm32_gpioread * Name: stm32_gpioread
* *
* Description: * Description:
* Read one or zero from the selected GPIO pin * Read one or zero from the selected GPIO pin
* *
************************************************************************************/ ****************************************************************************/
bool stm32_gpioread(uint32_t pinset); bool stm32_gpioread(uint32_t pinset);
@ -324,10 +327,11 @@ bool stm32_gpioread(uint32_t pinset);
* By default the I/O compensation cell is not used. However when the I/O * By default the I/O compensation cell is not used. However when the I/O
* output buffer speed is configured in 50 MHz or 100 MHz mode, it is * output buffer speed is configured in 50 MHz or 100 MHz mode, it is
* recommended to use the compensation cell for slew rate control on I/O * recommended to use the compensation cell for slew rate control on I/O
* tf(IO)out)/tr(IO)out commutation to reduce the I/O noise on power supply. * tf(IO)out)/tr(IO)out commutation to reduce the I/O noise on power
* supply.
* *
* The I/O compensation cell can be used only when the supply voltage ranges * The I/O compensation cell can be used only when the supply voltage
* from 2.4 to 3.6 V. * ranges from 2.4 to 3.6 V.
* *
* Input Parameters: * Input Parameters:
* None * None
@ -357,18 +361,18 @@ void stm32_iocompensation(void);
* Zero (OK) on success; a negated errno value on failure indicating the * Zero (OK) on success; a negated errno value on failure indicating the
* nature of the failure. * nature of the failure.
* *
************************************************************************************/ ****************************************************************************/
int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
bool event, xcpt_t func, void *arg); bool event, xcpt_t func, void *arg);
/************************************************************************************ /****************************************************************************
* Function: stm32_dumpgpio * Function: stm32_dumpgpio
* *
* Description: * Description:
* Dump all GPIO registers associated with the provided base address * Dump all GPIO registers associated with the provided base address
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_GPIO_INFO #ifdef CONFIG_DEBUG_GPIO_INFO
int stm32_dumpgpio(uint32_t pinset, const char *msg); int stm32_dumpgpio(uint32_t pinset, const char *msg);