Loading...
Searching...
No Matches
furi_hal_clock.h
1#pragma once
2
3#include <stm32wbxx_ll_rcc.h>
4#include <stdbool.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef enum {
11 FuriHalClockMcoLse,
12 FuriHalClockMcoSysclk,
13 FuriHalClockMcoMsi100k,
14 FuriHalClockMcoMsi200k,
15 FuriHalClockMcoMsi400k,
16 FuriHalClockMcoMsi800k,
17 FuriHalClockMcoMsi1m,
18 FuriHalClockMcoMsi2m,
19 FuriHalClockMcoMsi4m,
20 FuriHalClockMcoMsi8m,
21 FuriHalClockMcoMsi16m,
22 FuriHalClockMcoMsi24m,
23 FuriHalClockMcoMsi32m,
24 FuriHalClockMcoMsi48m,
25} FuriHalClockMcoSourceId;
26
27typedef enum {
28 FuriHalClockMcoDiv1 = LL_RCC_MCO1_DIV_1,
29 FuriHalClockMcoDiv2 = LL_RCC_MCO1_DIV_2,
30 FuriHalClockMcoDiv4 = LL_RCC_MCO1_DIV_4,
31 FuriHalClockMcoDiv8 = LL_RCC_MCO1_DIV_8,
32 FuriHalClockMcoDiv16 = LL_RCC_MCO1_DIV_16,
33} FuriHalClockMcoDivisorId;
34
36void furi_hal_clock_init_early(void);
37
39void furi_hal_clock_deinit_early(void);
40
42void furi_hal_clock_init(void);
43
45void furi_hal_clock_switch_hse2hsi(void);
46
48void furi_hal_clock_switch_hsi2hse(void);
49
54bool furi_hal_clock_switch_hse2pll(void);
55
60bool furi_hal_clock_switch_pll2hse(void);
61
63void furi_hal_clock_suspend_tick(void);
64
66void furi_hal_clock_resume_tick(void);
67
73void furi_hal_clock_mco_enable(FuriHalClockMcoSourceId source, FuriHalClockMcoDivisorId div);
74
76void furi_hal_clock_mco_disable(void);
77
78#ifdef __cplusplus
79}
80#endif