2021-10-03 10:36:05 +00:00
|
|
|
/**
|
|
|
|
* @file furi-hal-boot.h
|
|
|
|
* Bootloader HAL API
|
|
|
|
*/
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
#pragma once
|
2021-10-03 10:36:05 +00:00
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Boot modes */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalBootModeNormal,
|
|
|
|
FuriHalBootModeDFU
|
|
|
|
} FuriHalBootMode;
|
|
|
|
|
|
|
|
/** Boot flags */
|
|
|
|
typedef enum {
|
|
|
|
FuriHalBootFlagDefault=0,
|
|
|
|
FuriHalBootFlagFactoryReset=1,
|
|
|
|
} FuriHalBootFlag;
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Initialize boot subsystem
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_boot_init();
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Set boot mode
|
|
|
|
*
|
|
|
|
* @param[in] mode FuriHalBootMode
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_boot_set_mode(FuriHalBootMode mode);
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Set boot flags
|
|
|
|
*
|
|
|
|
* @param[in] flags FuriHalBootFlag
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_boot_set_flags(FuriHalBootFlag flags);
|
|
|
|
|
2021-10-03 10:36:05 +00:00
|
|
|
/** Get boot flag
|
|
|
|
*
|
|
|
|
* @return FuriHalBootFlag
|
|
|
|
*/
|
2021-08-08 18:03:25 +00:00
|
|
|
FuriHalBootFlag furi_hal_boot_get_flags();
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|