arch/arm/src/stm32fy: IO compensation is non longer an inline function, just a plain callable function. Not really necessary for the F7, but now the implementation is identical to the F2 and F4.

This commit is contained in:
Gregory Nutt
2018-07-16 09:50:10 -06:00
parent 871bface28
commit 4d648625e3
3 changed files with 65 additions and 45 deletions
+40 -1
View File
@@ -49,6 +49,8 @@
#include <nuttx/irq.h>
#include <arch/stm32f7/chip.h>
#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 */
+24 -43
View File
@@ -49,9 +49,7 @@
#include <nuttx/irq.h>
#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
*
+1 -1
View File
@@ -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 */