SAM RTC Driver (Calendar Mode)
Copyright (c) 2012-2020 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | rtc_calendar_alarm_time |
Alarm structure. More... | |
struct | rtc_calendar_config |
RTC configuration structure. More... | |
struct | rtc_calendar_events |
RTC Calendar event enable/disable structure. More... | |
struct | rtc_calendar_time |
Time structure. More... | |
Macros | |
#define | FEATURE_RTC_PERIODIC_INT |
Define port features set according to different device family. More... | |
#define | FEATURE_RTC_PRESCALER_OFF |
RTC prescaler is off. More... | |
#define | FEATURE_RTC_CLOCK_SELECTION |
RTC clock selection. More... | |
#define | FEATURE_RTC_GENERAL_PURPOSE_REG |
General purpose registers. More... | |
#define | FEATURE_RTC_TAMPER_DETECTION |
RTC tamper detection. More... | |
Functions | |
void | rtc_tamper_get_stamp (struct rtc_module *const module, struct rtc_calendar_time *const time) |
Get the tamper stamp value. More... | |
Configuration and Initialization | |
static void | rtc_calendar_get_time_defaults (struct rtc_calendar_time *const time) |
Initialize a time structure. More... | |
static void | rtc_calendar_get_config_defaults (struct rtc_calendar_config *const config) |
Gets the RTC default settings. More... | |
void | rtc_calendar_reset (struct rtc_module *const module) |
Resets the RTC module. More... | |
void | rtc_calendar_enable (struct rtc_module *const module) |
Enables the RTC module. More... | |
void | rtc_calendar_disable (struct rtc_module *const module) |
Disables the RTC module. More... | |
void | rtc_calendar_init (struct rtc_module *const module, Rtc *const hw, const struct rtc_calendar_config *const config) |
Initializes the RTC module with given configurations. More... | |
void | rtc_calendar_swap_time_mode (struct rtc_module *const module) |
Swaps between 12h and 24h clock mode. More... | |
enum status_code | rtc_calendar_frequency_correction (struct rtc_module *const module, const int8_t value) |
Calibrate for too-slow or too-fast oscillator. More... | |
Time and Alarm Management | |
uint32_t | rtc_calendar_time_to_register_value (struct rtc_module *const module, const struct rtc_calendar_time *const time) |
Convert time structure to register_value. More... | |
void | rtc_calendar_register_value_to_time (struct rtc_module *const module, const uint32_t register_value, struct rtc_calendar_time *const time) |
Convert register_value to time structure. More... | |
void | rtc_calendar_set_time (struct rtc_module *const module, const struct rtc_calendar_time *const time) |
Set the current calendar time to desired time. More... | |
void | rtc_calendar_get_time (struct rtc_module *const module, struct rtc_calendar_time *const time) |
Get the current calendar value. More... | |
enum status_code | rtc_calendar_set_alarm (struct rtc_module *const module, const struct rtc_calendar_alarm_time *const alarm, const enum rtc_calendar_alarm alarm_index) |
Set the alarm time for the specified alarm. More... | |
enum status_code | rtc_calendar_get_alarm (struct rtc_module *const module, struct rtc_calendar_alarm_time *const alarm, const enum rtc_calendar_alarm alarm_index) |
Get the current alarm time of specified alarm. More... | |
Status Flag Management | |
static bool | rtc_calendar_is_overflow (struct rtc_module *const module) |
Check if an RTC overflow has occurred. More... | |
static void | rtc_calendar_clear_overflow (struct rtc_module *const module) |
Clears the RTC overflow flag. More... | |
static bool | rtc_calendar_is_periodic_interval (struct rtc_module *const module, enum rtc_calendar_periodic_interval n) |
Check if an RTC periodic interval interrupt has occurred. More... | |
static void | rtc_calendar_clear_periodic_interval (struct rtc_module *const module, enum rtc_calendar_periodic_interval n) |
Clears the RTC periodic interval flag. More... | |
static bool | rtc_calendar_is_alarm_match (struct rtc_module *const module, const enum rtc_calendar_alarm alarm_index) |
Check the RTC alarm flag. More... | |
static enum status_code | rtc_calendar_clear_alarm_match (struct rtc_module *const module, const enum rtc_calendar_alarm alarm_index) |
Clears the RTC alarm match flag. More... | |
Event Management | |
static void | rtc_calendar_enable_events (struct rtc_module *const module, struct rtc_calendar_events *const events) |
Enables an RTC event output. More... | |
static void | rtc_calendar_disable_events (struct rtc_module *const module, struct rtc_calendar_events *const events) |
Disables an RTC event output. More... | |
RTC General Purpose Registers | |
static void | rtc_write_general_purpose_reg (struct rtc_module *const module, const uint8_t index, uint32_t value) |
Write a value into general purpose register. More... | |
static uint32_t | rtc_read_general_purpose_reg (struct rtc_module *const module, const uint8_t index) |
Read the value from general purpose register. More... | |