[FL-1818] System setting and debug options. RTC HAL refactoring. (#902)
* FuriHal: RTC API refactoring. System Setting application. FuriCore: adjustable log levels. Minor code cleanup. * Storage: change logging levels for internal storage. * FuriCore: fix broken trace logging level
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @file furi-hal-rtc.h
|
||||
* Furi Hal RTC API
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <main.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
// Time
|
||||
uint8_t hour; /**< Hour in 24H format: 0-23 */
|
||||
uint8_t minute; /**< Minute: 0-59 */
|
||||
uint8_t second; /**< Second: 0-59 */
|
||||
// Date
|
||||
uint8_t day; /**< Current day: 1-31 */
|
||||
uint8_t month; /**< Current month: 1-12 */
|
||||
uint16_t year; /**< Current year: 2000-2099 */
|
||||
uint8_t weekday;/**< Current weekday: 1-7 */
|
||||
} FuriHalRtcDateTime;
|
||||
|
||||
typedef enum {
|
||||
FuriHalRtcFlagDebug = (1<<0),
|
||||
FuriHalRtcFlagFactoryReset = (1<<1),
|
||||
} FuriHalRtcFlag;
|
||||
|
||||
/** Initialize RTC subsystem */
|
||||
void furi_hal_rtc_init();
|
||||
|
||||
void furi_hal_rtc_set_log_level(uint8_t level);
|
||||
|
||||
uint8_t furi_hal_rtc_get_log_level();
|
||||
|
||||
void furi_hal_rtc_set_flag(FuriHalRtcFlag flag);
|
||||
|
||||
void furi_hal_rtc_reset_flag(FuriHalRtcFlag flag);
|
||||
|
||||
bool furi_hal_rtc_is_flag_set(FuriHalRtcFlag flag);
|
||||
|
||||
void furi_hal_rtc_set_datetime(FuriHalRtcDateTime* datetime);
|
||||
|
||||
void furi_hal_rtc_get_datetime(FuriHalRtcDateTime* datetime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user