Macros | Functions
Real-Time Clock (RTC)

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...
 
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_status (Rtc *p_rtc)
 Get the RTC status. 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...
 
void rtc_set_calendar_event (Rtc *p_rtc, uint32_t ul_selection)
 Set the RTC calendar event selection. 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...
 
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...
 

Detailed Description

See Quickstart guide for SAM RTC driver.

The RTC provides a full binary-coded decimal (BCD) clock that includes century (19/20), year (with leap years), month, date, day, hour, minute and second.

Macro Definition Documentation

◆ BCD_FACTOR

#define BCD_FACTOR   10

Definition at line 69 of file rtc.c.

◆ BCD_MASK

#define BCD_MASK   0xfu

Definition at line 66 of file rtc.c.

◆ BCD_SHIFT

#define BCD_SHIFT   4

Definition at line 63 of file rtc.c.

◆ RTC_WP_KEY

#define RTC_WP_KEY   (0x525443)

Definition at line 60 of file rtc.c.

Function Documentation

◆ rtc_clear_date_alarm()

void rtc_clear_date_alarm ( Rtc p_rtc)

Clear the RTC date alarm setting.

Parameters
p_rtcPointer to an RTC instance.

Definition at line 443 of file rtc.c.

◆ rtc_clear_status()

void rtc_clear_status ( Rtc p_rtc,
uint32_t  ul_clear 
)

Set the RTC SCCR to clear status bits.

Parameters
p_rtcPointer to an RTC instance.
ul_clearSome flag bits which will be cleared.

Definition at line 467 of file rtc.c.

◆ rtc_clear_time_alarm()

void rtc_clear_time_alarm ( Rtc p_rtc)

Clear the RTC time alarm setting.

Parameters
p_rtcPointer to an RTC instance.

Definition at line 433 of file rtc.c.

◆ rtc_disable_interrupt()

void rtc_disable_interrupt ( Rtc p_rtc,
uint32_t  ul_sources 
)

Disable RTC interrupts.

Parameters
p_rtcPointer to an RTC instance.
ul_sourcesInterrupts to be disabled.

Definition at line 121 of file rtc.c.

◆ rtc_enable_interrupt()

void rtc_enable_interrupt ( Rtc p_rtc,
uint32_t  ul_sources 
)

Enable RTC interrupts.

Parameters
p_rtcPointer to an RTC instance.
ul_sourcesInterrupts to be enabled.

Definition at line 110 of file rtc.c.

◆ rtc_get_date()

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.

Parameters
p_rtcPointer to an RTC instance.
pul_yearCurrent year.
pul_monthCurrent month.
pul_dayCurrent day.
pul_weekCurrent day in current week.

Definition at line 296 of file rtc.c.

◆ rtc_get_hour_mode()

uint32_t rtc_get_hour_mode ( Rtc p_rtc)

Get the RTC hour mode.

Parameters
p_rtcPointer to an RTC instance.
Returns
1 for 12-hour mode, 0 for 24-hour mode.

Definition at line 93 of file rtc.c.

◆ rtc_get_interrupt_mask()

uint32_t rtc_get_interrupt_mask ( Rtc p_rtc)

Read RTC interrupt mask.

Parameters
p_rtcPointer to an RTC instance.
Returns
The interrupt mask value.

Definition at line 133 of file rtc.c.

◆ rtc_get_status()

uint32_t rtc_get_status ( Rtc p_rtc)

Get the RTC status.

Parameters
p_rtcPointer to an RTC instance.
Returns
Status of the RTC.

Definition at line 456 of file rtc.c.

◆ rtc_get_time()

void rtc_get_time ( Rtc p_rtc,
uint32_t *  pul_hour,
uint32_t *  pul_minute,
uint32_t *  pul_second 
)

Get the RTC time value.

Parameters
p_rtcPointer to an RTC instance.
pul_hourCurrent hour, 24-hour mode.
pul_minuteCurrent minute.
pul_secondCurrent second.

Definition at line 146 of file rtc.c.

◆ rtc_get_valid_entry()

uint32_t rtc_get_valid_entry ( Rtc p_rtc)

Get the RTC valid entry.

Parameters
p_rtcPointer to an RTC instance.
Returns
0 for no invalid data, else has contained invalid data.

Definition at line 479 of file rtc.c.

◆ rtc_set_calendar_event()

void rtc_set_calendar_event ( Rtc p_rtc,
uint32_t  ul_selection 
)

Set the RTC calendar event selection.

Parameters
p_rtcPointer to an RTC instance.
ul_selectionCalendar event selection to be enabled..

Definition at line 502 of file rtc.c.

◆ rtc_set_date()

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.

Parameters
p_rtcPointer to an RTC instance.
ul_yearCurrent year.
ul_monthCurrent month.
ul_dayCurrent day.
ul_weekCurrent day in current week.
Returns
0 for OK, else invalid setting.

Definition at line 347 of file rtc.c.

◆ rtc_set_date_alarm()

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.

Parameters
p_rtcPointer to an RTC instance.
ul_month_flag1 for setting, 0 for not setting.
ul_monthAlarm month value.
ul_day_flag1 for setting, 0 for not setting.
ul_dayAlarm day value.
Returns
0 for OK, else invalid setting.

Definition at line 402 of file rtc.c.

◆ rtc_set_hour_mode()

void rtc_set_hour_mode ( Rtc p_rtc,
uint32_t  ul_mode 
)

Set the RTC hour mode.

Parameters
p_rtcPointer to an RTC instance.
ul_mode1 for 12-hour mode, 0 for 24-hour mode.

Definition at line 77 of file rtc.c.

◆ rtc_set_time()

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.

Parameters
p_rtcPointer to an RTC instance.
ul_hourCurrent hour, 24-hour mode.
ul_minuteCurrent minute.
ul_secondCurrent second.
Returns
0 for OK, else invalid setting.

Definition at line 191 of file rtc.c.

◆ rtc_set_time_alarm()

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.

Parameters
p_rtcPointer to an RTC instance.
ul_hour_flag1 for setting, 0 for not setting.
ul_hourAlarm hour value, 24-hour mode.
ul_minute_flag1 for setting, 0 for not setting.
ul_minuteAlarm minute value.
ul_second_flag1 for setting, 0 for not setting.
ul_secondAlarm second value.
Returns
0 for OK, else invalid setting.

Definition at line 247 of file rtc.c.

◆ rtc_set_time_event()

void rtc_set_time_event ( Rtc p_rtc,
uint32_t  ul_selection 
)

Set the RTC time event selection.

Parameters
p_rtcPointer to an RTC instance.
ul_selectionTime event selection to be enabled.

Definition at line 490 of file rtc.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:01