Real-Time Clock (RTC) driver for SAM.
Copyright (c) 2011-2019 Microchip Technology Inc. and its subsidiaries.
#include "rtc.h"
Macros | |
#define | BCD_FACTOR 10 |
#define | BCD_MASK 0xfu |
#define | BCD_SHIFT 4 |
#define | RTC_WP_KEY (0x525443) |
Functions | |
void | rtc_clear_date_alarm (Rtc *p_rtc) |
Clear the RTC date alarm setting. More... | |
void | rtc_clear_status (Rtc *p_rtc, uint32_t ul_clear) |
Set the RTC SCCR to clear status bits. More... | |
void | rtc_clear_time_alarm (Rtc *p_rtc) |
Clear the RTC time alarm setting. More... | |
void | rtc_disable_interrupt (Rtc *p_rtc, uint32_t ul_sources) |
Disable RTC interrupts. More... | |
void | rtc_enable_interrupt (Rtc *p_rtc, uint32_t ul_sources) |
Enable RTC interrupts. More... | |
uint32_t | rtc_get_calendar_mode (Rtc *p_rtc) |
Get the RTC calendar mode. More... | |
void | rtc_get_date (Rtc *p_rtc, uint32_t *pul_year, uint32_t *pul_month, uint32_t *pul_day, uint32_t *pul_week) |
Get the RTC date value. More... | |
uint32_t | rtc_get_hour_mode (Rtc *p_rtc) |
Get the RTC hour mode. More... | |
uint32_t | rtc_get_interrupt_mask (Rtc *p_rtc) |
Read RTC interrupt mask. More... | |
uint32_t | rtc_get_milliseconds (Rtc *p_rtc) |
Get the RTC milliseconds value. More... | |
uint32_t | rtc_get_status (Rtc *p_rtc) |
Get the RTC status. More... | |
void | rtc_get_tamper_date (Rtc *p_rtc, uint32_t *pul_year, uint32_t *pul_month, uint32_t *pul_day, uint32_t *pul_week, uint8_t reg_num) |
Get the RTC tamper date. More... | |
uint32_t | rtc_get_tamper_event_counter (Rtc *p_rtc) |
Get the RTC tamper event counter. More... | |
uint32_t | rtc_get_tamper_source (Rtc *p_rtc, uint8_t reg_num) |
Get the RTC tamper source. More... | |
void | rtc_get_tamper_time (Rtc *p_rtc, uint32_t *pul_hour, uint32_t *pul_minute, uint32_t *pul_second, uint8_t reg_num) |
Get the RTC tamper time value. More... | |
void | rtc_get_time (Rtc *p_rtc, uint32_t *pul_hour, uint32_t *pul_minute, uint32_t *pul_second) |
Get the RTC time value. More... | |
uint32_t | rtc_get_valid_entry (Rtc *p_rtc) |
Get the RTC valid entry. More... | |
bool | rtc_is_tamper_occur_in_backup_mode (Rtc *p_rtc, uint8_t reg_num) |
Check the system is in backup mode when RTC tamper event happen. More... | |
void | rtc_set_calendar_event (Rtc *p_rtc, uint32_t ul_selection) |
Set the RTC calendar event selection. More... | |
void | rtc_set_calendar_mode (Rtc *p_rtc, uint32_t ul_mode) |
Set the RTC calendar mode. More... | |
void | rtc_set_calibration (Rtc *p_rtc, uint32_t ul_direction_ppm, uint32_t ul_correction, uint32_t ul_range_ppm) |
Set the RTC calibration. More... | |
uint32_t | rtc_set_date (Rtc *p_rtc, uint32_t ul_year, uint32_t ul_month, uint32_t ul_day, uint32_t ul_week) |
Set the RTC date. More... | |
uint32_t | rtc_set_date_alarm (Rtc *p_rtc, uint32_t ul_month_flag, uint32_t ul_month, uint32_t ul_day_flag, uint32_t ul_day) |
Set the RTC alarm date value. More... | |
void | rtc_set_hour_mode (Rtc *p_rtc, uint32_t ul_mode) |
Set the RTC hour mode. More... | |
void | rtc_set_pulse_parameter (Rtc *p_rtc, uint32_t ul_time_high, uint32_t ul_period) |
Set the pulse output waveform parameters. More... | |
uint32_t | rtc_set_time (Rtc *p_rtc, uint32_t ul_hour, uint32_t ul_minute, uint32_t ul_second) |
Set the RTC time value. More... | |
uint32_t | rtc_set_time_alarm (Rtc *p_rtc, uint32_t ul_hour_flag, uint32_t ul_hour, uint32_t ul_minute_flag, uint32_t ul_minute, uint32_t ul_second_flag, uint32_t ul_second) |
Set the RTC alarm time value. More... | |
void | rtc_set_time_event (Rtc *p_rtc, uint32_t ul_selection) |
Set the RTC time event selection. More... | |
void | rtc_set_waveform (Rtc *p_rtc, uint32_t ul_channel, uint32_t ul_value) |
Set the RTC output waveform. More... | |
void | rtc_set_writeprotect (Rtc *p_rtc, uint32_t ul_enable) |
Enable or disable write protection of RTC registers. More... | |