Furi Hal RTC API. More...
#include <stdint.h>
#include <stdbool.h>
#include <datetime/datetime.h>
#include <core/common_defines.h>
Go to the source code of this file.
Typedefs | |
typedef void(* | FuriHalRtcAlarmCallback) (void *context) |
Furi HAL RTC alarm callback signature. | |
Functions | |
void | furi_hal_rtc_init_early (void) |
Early initialization. | |
void | furi_hal_rtc_deinit_early (void) |
Early de-initialization. | |
void | furi_hal_rtc_init (void) |
Initialize RTC subsystem. | |
void | furi_hal_rtc_prepare_for_shutdown (void) |
Prepare system for shutdown. | |
void | furi_hal_rtc_sync_shadow (void) |
Force sync shadow registers. | |
void | furi_hal_rtc_reset_registers (void) |
Reset ALL RTC registers content. | |
uint32_t | furi_hal_rtc_get_register (FuriHalRtcRegister reg) |
Get RTC register content. | |
void | furi_hal_rtc_set_register (FuriHalRtcRegister reg, uint32_t value) |
Set register content. | |
void | furi_hal_rtc_set_log_level (uint8_t level) |
Set Log Level value. | |
uint8_t | furi_hal_rtc_get_log_level (void) |
Get Log Level value. | |
void | furi_hal_rtc_set_log_device (FuriHalRtcLogDevice device) |
Set logging device. | |
FuriHalRtcLogDevice | furi_hal_rtc_get_log_device (void) |
Get logging device. | |
void | furi_hal_rtc_set_log_baud_rate (FuriHalRtcLogBaudRate baud_rate) |
Set logging baud rate. | |
FuriHalRtcLogBaudRate | furi_hal_rtc_get_log_baud_rate (void) |
Get logging baud rate. | |
void | furi_hal_rtc_set_flag (FuriHalRtcFlag flag) |
Set RTC Flag. | |
void | furi_hal_rtc_reset_flag (FuriHalRtcFlag flag) |
Reset RTC Flag. | |
bool | furi_hal_rtc_is_flag_set (FuriHalRtcFlag flag) |
Check if RTC Flag is set. | |
void | furi_hal_rtc_set_boot_mode (FuriHalRtcBootMode mode) |
Set RTC boot mode. | |
FuriHalRtcBootMode | furi_hal_rtc_get_boot_mode (void) |
Get RTC boot mode. | |
void | furi_hal_rtc_set_heap_track_mode (FuriHalRtcHeapTrackMode mode) |
Set Heap Track mode. | |
FuriHalRtcHeapTrackMode | furi_hal_rtc_get_heap_track_mode (void) |
Get RTC Heap Track mode. | |
void | furi_hal_rtc_set_locale_units (FuriHalRtcLocaleUnits value) |
Set locale units. | |
FuriHalRtcLocaleUnits | furi_hal_rtc_get_locale_units (void) |
Get RTC Locale Units. | |
void | furi_hal_rtc_set_locale_timeformat (FuriHalRtcLocaleTimeFormat value) |
Set RTC Locale Time Format. | |
FuriHalRtcLocaleTimeFormat | furi_hal_rtc_get_locale_timeformat (void) |
Get RTC Locale Time Format. | |
void | furi_hal_rtc_set_locale_dateformat (FuriHalRtcLocaleDateFormat value) |
Set RTC Locale Date Format. | |
FuriHalRtcLocaleDateFormat | furi_hal_rtc_get_locale_dateformat (void) |
Get RTC Locale Date Format. | |
void | furi_hal_rtc_set_datetime (DateTime *datetime) |
Set RTC Date Time. | |
void | furi_hal_rtc_get_datetime (DateTime *datetime) |
Get RTC Date Time. | |
void | furi_hal_rtc_set_alarm (const DateTime *datetime, bool enabled) |
Set alarm. | |
bool | furi_hal_rtc_get_alarm (DateTime *datetime) |
Get alarm. | |
void | furi_hal_rtc_set_alarm_callback (FuriHalRtcAlarmCallback callback, void *context) |
Set alarm callback. | |
void | furi_hal_rtc_set_fault_data (uint32_t value) |
Set RTC Fault Data. | |
uint32_t | furi_hal_rtc_get_fault_data (void) |
Get RTC Fault Data. | |
void | furi_hal_rtc_set_pin_fails (uint32_t value) |
Set PIN Fails count. | |
uint32_t | furi_hal_rtc_get_pin_fails (void) |
Get PIN Fails count. | |
void | furi_hal_rtc_set_pin_value (uint32_t value) |
Set encoded PIN value. | |
uint32_t | furi_hal_rtc_get_pin_value (void) |
Get the current PIN encoded value. | |
uint32_t | furi_hal_rtc_get_timestamp (void) |
Get UNIX Timestamp. | |
Furi Hal RTC API.
enum FuriHalRtcBootMode |
enum FuriHalRtcLogDevice |
enum FuriHalRtcRegister |
bool furi_hal_rtc_get_alarm | ( | DateTime * | datetime | ) |
Get alarm.
datetime | Pointer to DateTime object |
FuriHalRtcBootMode furi_hal_rtc_get_boot_mode | ( | void | ) |
Get RTC boot mode.
void furi_hal_rtc_get_datetime | ( | DateTime * | datetime | ) |
Get RTC Date Time.
datetime | The datetime |
uint32_t furi_hal_rtc_get_fault_data | ( | void | ) |
Get RTC Fault Data.
FuriHalRtcHeapTrackMode furi_hal_rtc_get_heap_track_mode | ( | void | ) |
Get RTC Heap Track mode.
FuriHalRtcLocaleDateFormat furi_hal_rtc_get_locale_dateformat | ( | void | ) |
Get RTC Locale Date Format.
FuriHalRtcLocaleTimeFormat furi_hal_rtc_get_locale_timeformat | ( | void | ) |
Get RTC Locale Time Format.
FuriHalRtcLocaleUnits furi_hal_rtc_get_locale_units | ( | void | ) |
Get RTC Locale Units.
FuriHalRtcLogBaudRate furi_hal_rtc_get_log_baud_rate | ( | void | ) |
Get logging baud rate.
FuriHalRtcLogDevice furi_hal_rtc_get_log_device | ( | void | ) |
Get logging device.
uint8_t furi_hal_rtc_get_log_level | ( | void | ) |
Get Log Level value.
uint32_t furi_hal_rtc_get_pin_fails | ( | void | ) |
Get PIN Fails count.
uint32_t furi_hal_rtc_get_register | ( | FuriHalRtcRegister | reg | ) |
Get RTC register content.
[in] | reg | The register identifier |
uint32_t furi_hal_rtc_get_timestamp | ( | void | ) |
Get UNIX Timestamp.
bool furi_hal_rtc_is_flag_set | ( | FuriHalRtcFlag | flag | ) |
Check if RTC Flag is set.
[in] | flag | The flag to check |
void furi_hal_rtc_prepare_for_shutdown | ( | void | ) |
Prepare system for shutdown.
This function must be called before system sent to transport mode(power off). FlipperZero implementation configures and enables ALARM output on pin PC13 (Back button). This allows the system to wake-up charger from transport mode.
void furi_hal_rtc_reset_flag | ( | FuriHalRtcFlag | flag | ) |
Reset RTC Flag.
[in] | flag | The flag to reset |
void furi_hal_rtc_set_alarm | ( | const DateTime * | datetime, |
bool | enabled ) |
Set alarm.
[in] | datetime | The date time to set or NULL if time change is not needed |
[in] | enabled | Indicates if alarm must be enabled or disabled |
void furi_hal_rtc_set_alarm_callback | ( | FuriHalRtcAlarmCallback | callback, |
void * | context ) |
Set alarm callback.
Use it to subscribe to alarm trigger event. Setting alarm callback is independent from setting alarm.
[in] | callback | The callback |
context | The context |
void furi_hal_rtc_set_boot_mode | ( | FuriHalRtcBootMode | mode | ) |
Set RTC boot mode.
[in] | mode | The mode to set |
void furi_hal_rtc_set_datetime | ( | DateTime * | datetime | ) |
Set RTC Date Time.
datetime | The date time to set |
void furi_hal_rtc_set_fault_data | ( | uint32_t | value | ) |
Set RTC Fault Data.
[in] | value | The value |
void furi_hal_rtc_set_flag | ( | FuriHalRtcFlag | flag | ) |
Set RTC Flag.
[in] | flag | The flag to set |
void furi_hal_rtc_set_heap_track_mode | ( | FuriHalRtcHeapTrackMode | mode | ) |
Set Heap Track mode.
[in] | mode | The mode to set |
void furi_hal_rtc_set_locale_dateformat | ( | FuriHalRtcLocaleDateFormat | value | ) |
Set RTC Locale Date Format.
[in] | value | The RTC Locale Date Format |
void furi_hal_rtc_set_locale_timeformat | ( | FuriHalRtcLocaleTimeFormat | value | ) |
Set RTC Locale Time Format.
[in] | value | The RTC Locale Time Format |
void furi_hal_rtc_set_locale_units | ( | FuriHalRtcLocaleUnits | value | ) |
Set locale units.
[in] | value | The RTC Locale Units |
void furi_hal_rtc_set_log_baud_rate | ( | FuriHalRtcLogBaudRate | baud_rate | ) |
Set logging baud rate.
[in] | baud_rate | The baud rate |
void furi_hal_rtc_set_log_device | ( | FuriHalRtcLogDevice | device | ) |
Set logging device.
[in] | device | The device |
void furi_hal_rtc_set_log_level | ( | uint8_t | level | ) |
Set Log Level value.
[in] | level | The level to store |
void furi_hal_rtc_set_pin_fails | ( | uint32_t | value | ) |
Set PIN Fails count.
[in] | value | The PIN Fails count |
void furi_hal_rtc_set_pin_value | ( | uint32_t | value | ) |
Set encoded PIN value.
[in] | value | new PIN code value to be set |
void furi_hal_rtc_set_register | ( | FuriHalRtcRegister | reg, |
uint32_t | value ) |
Set register content.
[in] | reg | The register identifier |
[in] | value | The value to store into register |