mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-12 13:27:18 +03:00
917410a0a8
* fbt: reworking targets & assets handling WIP * fbt: dist fixes * fbt: moved SD card resources to owning apps * unit_tests: moved resources to app folder * github: updated unit_tests paths * github: packaging fixes * unit_tests: fixes * fbt: assets: internal cleanup * fbt: reworked assets handling * github: unit_tests: reintroducing fixes * minor cleanup * fbt: naming changes to reflect private nature of scons tools * fbt: resources: fixed dist archive paths * docs: updated paths * docs: updated more paths * docs: included "resources" parameter in app manifest docs; updated assets readme * updated gitignore for assets * github: updated action versions * unit_tests: restored timeout; scripts: assets: logging changes * gh: don't upload desktop animations for unit test run Co-authored-by: あく <alleteam@gmail.com>
81 lines
1.9 KiB
C
81 lines
1.9 KiB
C
#pragma once
|
|
|
|
#include <stm32wbxx_ll_rcc.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
FuriHalClockMcoLse,
|
|
FuriHalClockMcoSysclk,
|
|
FuriHalClockMcoMsi100k,
|
|
FuriHalClockMcoMsi200k,
|
|
FuriHalClockMcoMsi400k,
|
|
FuriHalClockMcoMsi800k,
|
|
FuriHalClockMcoMsi1m,
|
|
FuriHalClockMcoMsi2m,
|
|
FuriHalClockMcoMsi4m,
|
|
FuriHalClockMcoMsi8m,
|
|
FuriHalClockMcoMsi16m,
|
|
FuriHalClockMcoMsi24m,
|
|
FuriHalClockMcoMsi32m,
|
|
FuriHalClockMcoMsi48m,
|
|
} FuriHalClockMcoSourceId;
|
|
|
|
typedef enum {
|
|
FuriHalClockMcoDiv1 = LL_RCC_MCO1_DIV_1,
|
|
FuriHalClockMcoDiv2 = LL_RCC_MCO1_DIV_2,
|
|
FuriHalClockMcoDiv4 = LL_RCC_MCO1_DIV_4,
|
|
FuriHalClockMcoDiv8 = LL_RCC_MCO1_DIV_8,
|
|
FuriHalClockMcoDiv16 = LL_RCC_MCO1_DIV_16,
|
|
} FuriHalClockMcoDivisorId;
|
|
|
|
/** Early initialization */
|
|
void furi_hal_clock_init_early();
|
|
|
|
/** Early deinitialization */
|
|
void furi_hal_clock_deinit_early();
|
|
|
|
/** Initialize clocks */
|
|
void furi_hal_clock_init();
|
|
|
|
/** Switch clock from HSE to HSI */
|
|
void furi_hal_clock_switch_hse2hsi();
|
|
|
|
/** Switch clock from HSI to HSE */
|
|
void furi_hal_clock_switch_hsi2hse();
|
|
|
|
/** Switch clock from HSE to PLL
|
|
*
|
|
* @return true if changed, false if failed or not possible at this moment
|
|
*/
|
|
bool furi_hal_clock_switch_hse2pll();
|
|
|
|
/** Switch clock from PLL to HSE
|
|
*
|
|
* @return true if changed, false if failed or not possible at this moment
|
|
*/
|
|
bool furi_hal_clock_switch_pll2hse();
|
|
|
|
/** Stop SysTick counter without resetting */
|
|
void furi_hal_clock_suspend_tick();
|
|
|
|
/** Continue SysTick counter operation */
|
|
void furi_hal_clock_resume_tick();
|
|
|
|
/** Enable clock output on MCO pin
|
|
*
|
|
* @param source MCO clock source
|
|
* @param div MCO clock division
|
|
*/
|
|
void furi_hal_clock_mco_enable(FuriHalClockMcoSourceId source, FuriHalClockMcoDivisorId div);
|
|
|
|
/** Disable clock output on MCO pin */
|
|
void furi_hal_clock_mco_disable();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|