RTC

The Real Time Clock (RTC) module is an API to access an MCUs integrated real time clock.

More information about accessing peripheral IO is in the Device Interface section.

Details

define RTC_VERSION

define RTC_IOC_IDENT_CHAR

define I_RTC_GETVERSION

define I_RTC_GETINFO

define I_RTC_SETATTR

define I_RTC_SETACTION

define I_RTC_SET

This request writes the value of the timer. For example:

rtc_time_t the_time;
ioctl(rtc_fd, I_RTC_SET, &the_time);

define I_RTC_GET

This request reads the value of the timer. For example:

rtc_time_t current_time;
ioctl(rtc_fd, I_RTC_GET, &current_time );

define I_RTC_TOTAL

enum rtc_flag_t
  • RTC_FLAG_NONE
  • RTC_FLAG_ENABLE Set the alarm
  • RTC_FLAG_DISABLE Set the alarm
  • RTC_FLAG_IS_SOURCE_EXTERNAL_32768 External 32.768KHz Crystal
  • RTC_FLAG_IS_SOURCE_INTERNAL_40000 Internal 40KHz Oscillator
  • RTC_FLAG_ENABLE_ALARM Enable the alarm
  • RTC_FLAG_DISABLE_ALARM Enable the alarm
  • RTC_FLAG_IS_ALARM_ONCE One time alarm
  • RTC_FLAG_IS_ALARM_MINUTE Alarm every minute
  • RTC_FLAG_IS_ALARM_HOURLY Alarm every hour
  • RTC_FLAG_IS_ALARM_DAILY Daily alarm
  • RTC_FLAG_IS_ALARM_WEEKLY Weekly alarm
  • RTC_FLAG_IS_ALARM_MONTHLY Monthly alarm
  • RTC_FLAG_IS_ALARM_YEARLY Yearly alarm
  • RTC_FLAG_ENABLE_COUNT_EVENT Enable a count event
  • RTC_FLAG_IS_COUNT_SECOND One time alarm
  • RTC_FLAG_IS_COUNT_MINUTE One time alarm
  • RTC_FLAG_IS_COUNT_HOUR One time alarm
  • RTC_FLAG_IS_COUNT_DAY_OF_WEEK One time alarm
  • RTC_FLAG_IS_COUNT_DAY_OF_MONTH One time alarm
  • RTC_FLAG_IS_COUNT_DAY_OF_YEAR One time alarm
  • RTC_FLAG_IS_COUNT_WEEK One time alarm
  • RTC_FLAG_IS_COUNT_MONTH One time alarm
  • RTC_FLAG_IS_COUNT_YEAR One time alarm
  • RTC_FLAG_DISABLE_COUNT_EVENT Enable a count event

enum rtc_day_of_week_t
  • RTC_DAY_SUNDAY Sunday
  • RTC_DAY_MONDAY Monday
  • RTC_DAY_TUESDAY Tuesday
  • RTC_DAY_WEDNESDAY Wednesday
  • RTC_DAY_THURSDAY Thursday
  • RTC_DAY_FRIDAY Friday
  • RTC_DAY_SATURDAY Saturday

This is a list of the valid days of the week.


enum rtc_mon_t
  • RTC_MON_JAN
  • RTC_MON_FEB February
  • RTC_MON_MAR March
  • RTC_MON_APR April
  • RTC_MON_MAY May
  • RTC_MON_JUN June
  • RTC_MON_JUL July
  • RTC_MON_AUG August
  • RTC_MON_SEP September
  • RTC_MON_OCT October
  • RTC_MON_NOV November
  • RTC_MON_DEC December

This is a list of the valid months of the year.


struct::rtc_time_t

This structure holds the time. It should be compatible with struct tm.

u32 useconds

u32 time_t

u32 use_time_t

struct::rtc_info_t

u32 o_flags

u32 o_events

rtc_time_t alarm

u32 resd

struct::rtc_attr_t

This data structure defines the structure used with I_RTC_ATTR and I_RTC_SETATTR ioctl requests on the RTC. It is also used when opening the RTC.

u32 o_flags

Bitmask for setting attributes

u32 freq

Calibration frequency for setting the pre-scalar

rtc_time_t time

u32 resd

X

Thanks for Coming!

Subscribe to news and updates