Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

RTC - Real Time Clock Library


Files

file  otRTC.h
 Real Time Clock Library for BF51x.

Modules

 Version History
 RTC - Code example

Enumerations

enum  RtcInterrupts {
  Rtc_Stopwatch = 1, Rtc_Alarm = 2, Rtc_Seconds = 4, Rtc_Minutes = 8,
  Rtc_Hours = 16, Rtc_24_Hours = 32, Rtc_Day_Alarm = 64
}

Functions

U32 RtcGetTime (U8 *h, U8 *m, U8 *s)
 Get current time.
void RtcSetTime (U8 h, U8 m, U8 s)
 Set current time.
U32 RtcGetDate (int *year, int *month, int *day)
 Get current date.
void RtcSetDate (int year, int month, int day)
 Set date.
void RtcSetAlarm (U8 h, U8 m, U8 s)
 Set a time at which an interrupt will be triggered. Only hours, minutes, seconds are used.
void RtcSetDayAlarm (int year, int month, int day, U8 h, U8 m, U8 s)
 Set a time at which an interrupt will be triggered.
void RtcOn ()
void RtcSetInterruptService (void(*pCallback)(void))
void RtcInterruptEnable (U16 intSource, bool ena)
void RtcSetCountDown (U16 val)
 Set a value for the stopwatch.
U16 RtcGetCountDown ()

Enumeration Type Documentation

enum RtcInterrupts
 

Enumeration values:
Rtc_Stopwatch  Interrupt will be generated when STOPWATCH reach 0.
Rtc_Alarm  Interrupt will be generated at HH:MM:SS value see RtcSetAlarm.
Rtc_Seconds  Interrupt will be generated every second.
Rtc_Minutes  Interrupt will be generated every minute.
Rtc_Hours  Interrupt will be generated every hour.
Rtc_24_Hours  Interrupt will be generated every 24 hours.
Rtc_Day_Alarm  Interrupt will be generated at YEAR/MONTH/DAY HH:MM:SS value see RtcSetDayAlarm.


Function Documentation

U16 RtcGetCountDown  ) 
 

Read current stopwatch value

U32 RtcGetDate int *  year,
int *  month,
int *  day
 

Parameters:
year Pointer to year variable
month Pointer to month variable
day Pointer to day variable
Returns:
Store in year,month,day current date

U32 RtcGetTime U8 h,
U8 m,
U8 s
 

Parameters:
h Pointer to hour variable
m Pointer to minute variable
s Pointer to second variable
Returns:
Store in h,m,s current time

void RtcInterruptEnable U16  intSource,
bool  ena
 

Enable or disable a specific RTC interrupt, see RtcInterrupts

void RtcOn  ) 
 

This function should be performed each time the RTC is powered for the first time. Performing this function when the RTC is always powered (even with backup battery) is useless.

void RtcSetAlarm U8  h,
U8  m,
U8  s
 

Parameters:
h Hour
m Minute
s Second

void RtcSetCountDown U16  val  ) 
 

void RtcSetDate int  year,
int  month,
int  day
 

Parameters:
year Year
month Month
day Day

void RtcSetDayAlarm int  year,
int  month,
int  day,
U8  h,
U8  m,
U8  s
 

Parameters:
year Year
month Month
day Day
h Hour
m Minute
s Second

void RtcSetInterruptService void(*)(void)  pCallback  ) 
 

Specifies a function that is executed at each interrupt generated by the RTC.

void RtcSetTime U8  h,
U8  m,
U8  s
 

Parameters:
h Hour
m Minute
s Second
footer

otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0