drivers/rtc/rtc.h
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 
37 #ifndef RTC_H_INCLUDED
38 #define RTC_H_INCLUDED
39 
40 #include "compiler.h"
41 
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 
50 void rtc_set_hour_mode(Rtc *p_rtc, uint32_t ul_mode);
51 uint32_t rtc_get_hour_mode(Rtc *p_rtc);
52 void rtc_enable_interrupt(Rtc *p_rtc, uint32_t ul_sources);
53 void rtc_disable_interrupt(Rtc *p_rtc, uint32_t ul_sources);
54 uint32_t rtc_get_interrupt_mask(Rtc *p_rtc);
55 void rtc_get_time(Rtc *p_rtc, uint32_t *pul_hour, uint32_t *pul_minute,
56  uint32_t *pul_second);
57 uint32_t rtc_set_time(Rtc *p_rtc, uint32_t ul_hour, uint32_t ul_minute,
58  uint32_t ul_second);
59 uint32_t rtc_set_time_alarm(Rtc *p_rtc,
60  uint32_t ul_hour_flag, uint32_t ul_hour,
61  uint32_t ul_minute_flag, uint32_t ul_minute,
62  uint32_t ul_second_flag, uint32_t ul_second);
63 void rtc_get_date(Rtc *p_rtc, uint32_t *pul_year, uint32_t *pul_month,
64  uint32_t *pul_day, uint32_t *pul_week);
65 uint32_t rtc_set_date(Rtc *p_rtc, uint32_t ul_year, uint32_t ul_month,
66  uint32_t ul_day, uint32_t ul_week);
67 uint32_t rtc_set_date_alarm(Rtc *p_rtc,
68  uint32_t ul_month_flag, uint32_t ul_month,
69  uint32_t ul_day_flag, uint32_t ul_day);
70 void rtc_clear_time_alarm(Rtc *p_rtc);
71 void rtc_clear_date_alarm(Rtc *p_rtc);
72 uint32_t rtc_get_status(Rtc *p_rtc);
73 void rtc_clear_status(Rtc *p_rtc, uint32_t ul_clear);
74 uint32_t rtc_get_valid_entry(Rtc *p_rtc);
75 void rtc_set_time_event(Rtc *p_rtc, uint32_t ul_selection);
76 void rtc_set_calendar_event(Rtc *p_rtc, uint32_t ul_selection);
77 
78 #if ((SAM3S8) || (SAM3SD8) || (SAM4S) || (SAM4N) || (SAM4C) || (SAMG) || (SAM4CP) || (SAM4CM) || defined(__DOXYGEN__))
79 void rtc_set_calendar_mode(Rtc *p_rtc, uint32_t ul_mode);
80 uint32_t rtc_get_calendar_mode(Rtc *p_rtc);
81 void rtc_set_calibration(Rtc *p_rtc, uint32_t ul_direction_ppm,
82  uint32_t ul_correction, uint32_t ul_range_ppm);
83 #endif
84 
85 #if ((SAM3S8) || (SAM3SD8) || (SAM4S) || (SAM4C) || (SAMG) || (SAM4CP) || (SAM4CM) || SAMV71 || SAMV70 || SAME70 || SAMS70 || defined(__DOXYGEN__))
86 void rtc_set_waveform(Rtc *p_rtc, uint32_t ul_channel, uint32_t ul_value);
87 #if ((SAM3S8) || (SAM3SD8) || (SAM4S) || (SAM4C)|| (SAM4CP) || (SAM4CM) || SAMV71 || SAMV70 || SAME70 || SAMS70 || defined(__DOXYGEN__))
88 void rtc_set_pulse_parameter(Rtc *p_rtc, uint32_t ul_time_high,
89  uint32_t ul_period);
90 #endif
91 #endif
92 
93 #if ((SAM3N) || (SAM3U) || (SAM3XA) || defined(__DOXYGEN__))
94 void rtc_set_writeprotect(Rtc *p_rtc, uint32_t ul_enable);
95 #endif /* ((SAM3N) || (SAM3U) || (SAM3XA)) */
96 
97 #if ((SAM4C) || (SAM4CP) || (SAM4CM) || defined(__DOXYGEN__))
98 void rtc_get_tamper_time(Rtc *p_rtc, uint32_t *pul_hour, uint32_t *pul_minute,
99  uint32_t *pul_second, uint8_t reg_num);
100 void rtc_get_tamper_date(Rtc *p_rtc, uint32_t *pul_year, uint32_t *pul_month,
101  uint32_t *pul_day, uint32_t *pul_week, uint8_t reg_num);
102 uint32_t rtc_get_tamper_source(Rtc *p_rtc, uint8_t reg_num);
103 uint32_t rtc_get_tamper_event_counter(Rtc *p_rtc);
104 bool rtc_is_tamper_occur_in_backup_mode(Rtc *p_rtc, uint8_t reg_num);
105 #endif
106 
107 #if (SAMG55 || defined(__DOXYGEN__))
108 uint32_t rtc_get_milliseconds(Rtc *p_rtc);
109 #endif
110 
174 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 
182 #endif /* RTC_H_INCLUDED */
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.
Definition: rtc.c:191
void rtc_enable_interrupt(Rtc *p_rtc, uint32_t ul_sources)
Enable RTC interrupts.
Definition: rtc.c:110
uint32_t rtc_get_hour_mode(Rtc *p_rtc)
Get the RTC hour mode.
Definition: rtc.c:93
void rtc_get_time(Rtc *p_rtc, uint32_t *pul_hour, uint32_t *pul_minute, uint32_t *pul_second)
Get the RTC time value.
Definition: rtc.c:146
uint32_t rtc_get_status(Rtc *p_rtc)
Get the RTC status.
Definition: rtc.c:456
void rtc_clear_time_alarm(Rtc *p_rtc)
Clear the RTC time alarm setting.
Definition: rtc.c:433
void rtc_clear_date_alarm(Rtc *p_rtc)
Clear the RTC date alarm setting.
Definition: rtc.c:443
void rtc_set_calendar_event(Rtc *p_rtc, uint32_t ul_selection)
Set the RTC calendar event selection.
Definition: rtc.c:502
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.
Definition: rtc.c:247
Commonly used includes, types and macros.
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.
Definition: rtc.c:347
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.
Definition: rtc.c:402
void rtc_set_time_event(Rtc *p_rtc, uint32_t ul_selection)
Set the RTC time event selection.
Definition: rtc.c:490
void rtc_disable_interrupt(Rtc *p_rtc, uint32_t ul_sources)
Disable RTC interrupts.
Definition: rtc.c:121
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.
Definition: rtc.c:296
void rtc_set_hour_mode(Rtc *p_rtc, uint32_t ul_mode)
Set the RTC hour mode.
Definition: rtc.c:77
uint32_t rtc_get_interrupt_mask(Rtc *p_rtc)
Read RTC interrupt mask.
Definition: rtc.c:133
uint32_t rtc_get_valid_entry(Rtc *p_rtc)
Get the RTC valid entry.
Definition: rtc.c:479
void rtc_clear_status(Rtc *p_rtc, uint32_t ul_clear)
Set the RTC SCCR to clear status bits.
Definition: rtc.c:467
Rtc hardware registers.


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58