mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
arch/stm32h7: Fix nxstyle errors
arch/arm/src/stm32h7/stm32_rcc.c:
arch/arm/src/stm32h7/stm32_rcc.h:
* Fix nxstyle issues.
This commit is contained in:
committed by
Xiang Xiao
parent
ca0932f842
commit
095d99717b
@@ -66,7 +66,7 @@
|
|||||||
#define HSERDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC)
|
#define HSERDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Include chip-specific clocking initialization logic */
|
/* Include chip-specific clocking initialization logic */
|
||||||
@@ -92,8 +92,8 @@
|
|||||||
* and enable peripheral clocking for all peripherals enabled in the NuttX
|
* and enable peripheral clocking for all peripherals enabled in the NuttX
|
||||||
* configuration file.
|
* configuration file.
|
||||||
*
|
*
|
||||||
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking
|
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be
|
||||||
* will be enabled by an externally provided, board-specific function called
|
* enabled by an externally provided, board-specific function called
|
||||||
* stm32_board_clockconfig().
|
* stm32_board_clockconfig().
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void stm32_clockconfig(void)
|
void stm32_clockconfig(void)
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,9 @@ void stm32_clockconfig(void)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Invoke standard, fixed clock configuration based on definitions in board.h */
|
/* Invoke standard, fixed clock configuration based on definitions in
|
||||||
|
* board.h
|
||||||
|
*/
|
||||||
|
|
||||||
stm32_stdclockconfig();
|
stm32_stdclockconfig();
|
||||||
|
|
||||||
@@ -136,21 +138,21 @@ void stm32_clockconfig(void)
|
|||||||
rcc_enableperipherals();
|
rcc_enableperipherals();
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_clockenable
|
* Name: stm32_clockenable
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Re-enable the clock and restore the clock settings based on settings in board.h.
|
* Re-enable the clock and restore the clock settings based on settings in
|
||||||
* This function is only available to support low-power modes of operation: When
|
* board.h. This function is only available to support low-power modes of
|
||||||
* re-awakening from deep-sleep modes, it is necessary to re-enable/re-start the
|
* operation: When re-awakening from deep-sleep modes, it is necessary to
|
||||||
* PLL
|
* re-enable/re-start the PLL
|
||||||
*
|
*
|
||||||
* This functional performs a subset of the operations performed by
|
* This functional performs a subset of the operations performed by
|
||||||
* stm32_clockconfig(): It does not reset any devices, and it does not reset the
|
* stm32_clockconfig(): It does not reset any devices, and it does not
|
||||||
* currently enabled peripheral clocks.
|
* reset the currently enabled peripheral clocks.
|
||||||
*
|
*
|
||||||
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be enabled
|
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be
|
||||||
* by an externally provided, board-specific function called
|
* enabled by an externally provided, board-specific function called
|
||||||
* stm32_board_clockconfig().
|
* stm32_board_clockconfig().
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -159,7 +161,7 @@ void stm32_clockconfig(void)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
void stm32_clockenable(void)
|
void stm32_clockenable(void)
|
||||||
@@ -172,7 +174,9 @@ void stm32_clockenable(void)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Invoke standard, fixed clock configuration based on definitions in board.h */
|
/* Invoke standard, fixed clock configuration based on definitions in
|
||||||
|
* board.h
|
||||||
|
*/
|
||||||
|
|
||||||
stm32_stdclockconfig();
|
stm32_stdclockconfig();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/stm32h7/stm32_rcc.h
|
* arch/arm/src/stm32h7/stm32_rcc.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
@@ -16,14 +16,14 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ARCH_ARM_SRC_STM32H7_STM32_RCC_H
|
#ifndef __ARCH_ARM_SRC_STM32H7_STM32_RCC_H
|
||||||
#define __ARCH_ARM_SRC_STM32H7_STM32_RCC_H
|
#define __ARCH_ARM_SRC_STM32H7_STM32_RCC_H
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@
|
|||||||
|
|
||||||
#include "hardware/stm32_rcc.h"
|
#include "hardware/stm32_rcc.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
@@ -46,29 +46,30 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This symbol references the Cortex-M7 vector table (as positioned by the linker
|
/* This symbol references the Cortex-M7 vector table (as positioned by the
|
||||||
* script). The standard location for the vector table is at the beginning of FLASH
|
* linker script). The standard location for the vector table is at the
|
||||||
* at address 0x0800:0000. If we are using the STMicro DFU bootloader, then the
|
* beginning of FLASH at address 0x0800:0000. If we are using the STMicro
|
||||||
* vector table will be offset to a different location in FLASH and we will need to
|
* DFU bootloader, then the vector table will be offset to a different
|
||||||
* set the NVIC vector location to this alternative location.
|
* location in FLASH and we will need to set the NVIC vector location to
|
||||||
|
* this alternative location.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern uint32_t _vectors[]; /* See armv7-m/arm_vectors.c */
|
extern uint32_t _vectors[]; /* See armv7-m/arm_vectors.c */
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Inline Functions
|
* Inline Functions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_mco1config
|
* Name: stm32_mco1config
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Selects the clock source to output on MCO1 pin (PA8). PA8 should be configured
|
* Selects the clock source to output on MCO1 pin (PA8). PA8 should be
|
||||||
* in alternate function mode.
|
* configured in alternate function mode.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* source - One of the definitions for the RCC_CFGR_MCO1 definitions from
|
* source - One of the definitions for the RCC_CFGR_MCO1 definitions from
|
||||||
@@ -81,24 +82,24 @@ extern uint32_t _vectors[]; /* See armv7-m/arm_vectors.c */
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline void stm32_mco1config(uint32_t source, uint32_t div)
|
static inline void stm32_mco1config(uint32_t source, uint32_t div)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
regval = getreg32(STM32_RCC_CFGR);
|
regval = getreg32(STM32_RCC_CFGR);
|
||||||
regval &= ~(RCC_CFGR_MCO1_MASK|RCC_CFGR_MCO1PRE_MASK);
|
regval &= ~(RCC_CFGR_MCO1_MASK | RCC_CFGR_MCO1PRE_MASK);
|
||||||
regval |= (source | div);
|
regval |= (source | div);
|
||||||
putreg32(regval, STM32_RCC_CFGR);
|
putreg32(regval, STM32_RCC_CFGR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_mco2config
|
* Name: stm32_mco2config
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Selects the clock source to output on MCO2 pin (PC9). PC9 should be configured
|
* Selects the clock source to output on MCO2 pin (PC9). PC9 should be
|
||||||
* in alternate function mode.
|
* configured in alternate function mode.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* source - One of the definitions for the RCC_CFGR_MCO2 definitions from
|
* source - One of the definitions for the RCC_CFGR_MCO2 definitions from
|
||||||
@@ -111,33 +112,33 @@ static inline void stm32_mco1config(uint32_t source, uint32_t div)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline void stm32_mco2config(uint32_t source, uint32_t div)
|
static inline void stm32_mco2config(uint32_t source, uint32_t div)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
regval = getreg32(STM32_RCC_CFGR);
|
regval = getreg32(STM32_RCC_CFGR);
|
||||||
regval &= ~(RCC_CFGR_MCO2_MASK|RCC_CFGR_MCO2PRE_MASK);
|
regval &= ~(RCC_CFGR_MCO2_MASK | RCC_CFGR_MCO2PRE_MASK);
|
||||||
regval |= (source | div);
|
regval |= (source | div);
|
||||||
putreg32(regval, STM32_RCC_CFGR);
|
putreg32(regval, STM32_RCC_CFGR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_clockconfig
|
* Name: stm32_clockconfig
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to establish the clock settings based on the values in board.h. This
|
* Called to establish the clock settings based on the values in board.h.
|
||||||
* function (by default) will reset most everything, enable the PLL, and enable
|
* This function (by default) will reset most everything, enable the PLL,
|
||||||
* peripheral clocking for all peripherals enabled in the NuttX configuration
|
* and enable peripheral clocking for all peripherals enabled in the NuttX
|
||||||
* file.
|
* configuration file.
|
||||||
*
|
*
|
||||||
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be enabled
|
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be
|
||||||
* by an externally provided, board-specific function called
|
* enabled by an externally provided, board-specific function called
|
||||||
* stm32_board_clockconfig().
|
* stm32_board_clockconfig().
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -146,38 +147,38 @@ static inline void stm32_mco2config(uint32_t source, uint32_t div)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void stm32_clockconfig(void);
|
void stm32_clockconfig(void);
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_board_clockconfig
|
* Name: stm32_board_clockconfig
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Any STM32 board may replace the "standard" board clock configuration logic with
|
* Any STM32 board may replace the "standard" board clock configuration
|
||||||
* its own, custom clock configuration logic.
|
* logic with its own, custom clock configuration logic.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_STM32H7_CUSTOM_CLOCKCONFIG
|
#ifdef CONFIG_STM32H7_CUSTOM_CLOCKCONFIG
|
||||||
void stm32_board_clockconfig(void);
|
void stm32_board_clockconfig(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_clockenable
|
* Name: stm32_clockenable
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Re-enable the clock and restore the clock settings based on settings in board.h.
|
* Re-enable the clock and restore the clock settings based on settings in
|
||||||
* This function is only available to support low-power modes of operation: When
|
* board.h. This function is only available to support low-power modes of
|
||||||
* re-awakening from deep-sleep modes, it is necessary to re-enable/re-start the
|
* operation: When re-awakening from deep-sleep modes, it is necessary to
|
||||||
* PLL
|
* re-enable/re-start the PLL
|
||||||
*
|
*
|
||||||
* This functional performs a subset of the operations performed by
|
* This functional performs a subset of the operations performed by
|
||||||
* stm32_clockconfig(): It does not reset any devices, and it does not reset the
|
* stm32_clockconfig(): It does not reset any devices, and it does not
|
||||||
* currently enabled peripheral clocks.
|
* reset the currently enabled peripheral clocks.
|
||||||
*
|
*
|
||||||
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will
|
* If CONFIG_STM32H7_CUSTOM_CLOCKCONFIG is defined, then clocking will be
|
||||||
* be enabled by an externally provided, board-specific function called
|
* enabled by an externally provided, board-specific function called
|
||||||
* stm32_board_clockconfig().
|
* stm32_board_clockconfig().
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -186,13 +187,13 @@ void stm32_board_clockconfig(void);
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
void stm32_clockenable(void);
|
void stm32_clockenable(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_rcc_enablelse
|
* Name: stm32_rcc_enablelse
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -204,7 +205,7 @@ void stm32_clockenable(void);
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void stm32_rcc_enablelse(void);
|
void stm32_rcc_enablelse(void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user