Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67c78b9

Browse files
committed
[WB] Move HSE Capacitor Tuning api to clock api file
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent64b7d90 commit67c78b9

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

‎cores/arduino/stm32/clock.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ uint32_t getCurrentMillis(void);
6262
uint32_tgetCurrentMicros(void);
6363

6464
voidenableClock(sourceClock_tsource);
65+
voidconfigHSECapacitorTuning(void);
66+
6567
#ifdef__cplusplus
6668
}
6769
#endif

‎libraries/SrcWrapper/src/stm32/clock.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
*/
3838
#include"backup.h"
3939
#include"clock.h"
40+
#include"otp.h"
4041
#include"stm32yyxx_ll_cortex.h"
42+
#include"stm32yyxx_ll_rcc.h"
4143

4244
#ifdef__cplusplus
4345
extern"C" {
@@ -160,6 +162,18 @@ void enableClock(sourceClock_t source)
160162
}
161163
}
162164

165+
voidconfigHSECapacitorTuning(void)
166+
{
167+
#if defined(OTP_AREA_BASE)&& defined(STM32WBxx)
168+
OTP_BT_t*p_otp;
169+
/* Read HSE_Tuning from OTP with index 0 */
170+
p_otp= (OTP_BT_t*)OTP_Read(0);
171+
if (p_otp) {
172+
LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
173+
}
174+
#endif
175+
}
176+
163177
#ifdef__cplusplus
164178
}
165179
#endif

‎variants/PNUCLEO_WB55RG/variant.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
#include"pins_arduino.h"
20-
#include"otp.h"
20+
#include"clock.h"
2121

2222
#ifdef __cplusplus
2323
extern"C" {
@@ -89,19 +89,6 @@ const PinName digitalPin[] = {
8989
extern"C" {
9090
#endif
9191

92-
staticvoidConfig_HSE(void)
93-
{
94-
OTP_BT_t *p_otp;
95-
96-
/**
97-
* Read HSE_Tuning from OTP
98-
*/
99-
p_otp = (OTP_BT_t *)OTP_Read(0);
100-
if (p_otp) {
101-
LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning);
102-
}
103-
}
104-
10592
/**
10693
* @brief System Clock Configuration
10794
* @param None
@@ -113,7 +100,7 @@ WEAK void SystemClock_Config(void)
113100
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
114101
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
115102

116-
Config_HSE();
103+
configHSECapacitorTuning();
117104

118105
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
119106
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp