diff --git a/arch/arm/src/stm32f7/stm32_gpio.c b/arch/arm/src/stm32f7/stm32_gpio.c index 7666c77f3b4..af861578cfd 100644 --- a/arch/arm/src/stm32f7/stm32_gpio.c +++ b/arch/arm/src/stm32f7/stm32_gpio.c @@ -49,6 +49,8 @@ #include #include +#include "up_arch.h" +#include "chip/stm32_syscfg.h" #include "stm32_gpio.h" /* Content of this file requires verification before it is used with other @@ -426,4 +428,41 @@ bool stm32_gpioread(uint32_t pinset) return 0; } -#endif /* CONFIG_STM32F7_STM32F74XX || CONFIG_STM32F7_STM32F75XX */ +/**************************************************************************** + * Name: stm32_iocompensation + * + * Description: + * Enable I/O compensation. + * + * 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 + * 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. + * + * The I/O compensation cell can be used only when the supply voltage ranges + * from 2.4 to 3.6 V. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void stm32_iocompensation(void) +{ + /* Enable I/O Compensation. Writing '1' to the CMPCR power-down bit + * enables the I/O compensation cell. + */ + + putreg32(SYSCFG_CMPCR_CMPPD, STM32_SYSCFG_CMPCR); + + /* Wait for compensation cell to become ready */ + + while ((getreg32(STM32_SYSCFG_CMPCR) & SYSCFG_CMPCR_READY) == 0) + { + } +} + +#endif /* CONFIG_STM32F7_STM32F72XX || ... || CONFIG_STM32F7_STM32F77XX */ diff --git a/arch/arm/src/stm32f7/stm32_gpio.h b/arch/arm/src/stm32f7/stm32_gpio.h index 4477caf7001..e3b49e81303 100644 --- a/arch/arm/src/stm32f7/stm32_gpio.h +++ b/arch/arm/src/stm32f7/stm32_gpio.h @@ -49,9 +49,7 @@ #include -#include "up_arch.h" #include "chip.h" -#include "chip/stm32_syscfg.h" #include "chip/stm32_gpio.h" /************************************************************************************ @@ -255,47 +253,6 @@ extern "C" EXTERN const uint32_t g_gpiobase[STM32F7_NGPIO]; -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: syscfg_iocompensation - * - * Description: - * Enable I/O compensation. - * - * 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 - * 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. - * - * The I/O compensation cell can be used only when the supply voltage ranges - * from 2.4 to 3.6 V. - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ****************************************************************************/ - -static inline void syscfg_iocompensation(void) -{ - /* Enable I/O Compensation. Writing '1' to the CMPCR power-down bit - * enables the I/O compensation cell. - */ - - putreg32(SYSCFG_CMPCR_CMPPD, STM32_SYSCFG_CMPCR); - - /* Wait for compensation cell to become ready */ - - while ((getreg32(STM32_SYSCFG_CMPCR) & SYSCFG_CMPCR_READY) == 0) - { - } -} - /************************************************************************************ * Public Function Prototypes ************************************************************************************/ @@ -358,6 +315,30 @@ void stm32_gpiowrite(uint32_t pinset, bool value); bool stm32_gpioread(uint32_t pinset); +/**************************************************************************** + * Name: stm32_iocompensation + * + * Description: + * Enable I/O compensation. + * + * 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 + * 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. + * + * The I/O compensation cell can be used only when the supply voltage ranges + * from 2.4 to 3.6 V. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void stm32_iocompensation(void); + /**************************************************************************** * Name: stm32_gpiosetevent * diff --git a/arch/arm/src/stm32f7/stm32_rcc.c b/arch/arm/src/stm32f7/stm32_rcc.c index 1685548171f..27396e5ecea 100644 --- a/arch/arm/src/stm32f7/stm32_rcc.c +++ b/arch/arm/src/stm32f7/stm32_rcc.c @@ -141,7 +141,7 @@ void stm32_clockconfig(void) #ifdef CONFIG_STM32F7_SYSCFG_IOCOMPENSATION /* Enable I/O Compensation */ - syscfg_iocompensation(); + stm32_iocompensation(); #endif /* Enable peripheral clocking */