You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.5 KiB
64 lines
1.5 KiB
#ifndef _MODULE_RTC_h
|
|
#define _MODULE_RTC_h
|
|
|
|
#include "watchos_consts.h"
|
|
#include "watchos_types.h"
|
|
|
|
#include "Task.h"
|
|
#include "IRunnable.h"
|
|
|
|
/// <summary>
|
|
/// Module responsible for managing RTC hardware and alarms and generating events
|
|
/// </summary>
|
|
class Module_RTC : public Task, public IRunnable
|
|
{
|
|
/// <summary>
|
|
/// Refresh our in-memory time from the RTC
|
|
/// </summary>
|
|
void refresh();
|
|
|
|
public:
|
|
Module_RTC();
|
|
void initialize();
|
|
void start();
|
|
void suspend();
|
|
void tick();
|
|
|
|
/// <summary>
|
|
/// Get the hours component of the current time
|
|
/// </summary>
|
|
/// <returns>current hour; 0-23</returns>
|
|
int getHour();
|
|
/// <summary>
|
|
/// Get the minutes component of the current time
|
|
/// </summary>
|
|
/// <returns>current minute; 0-59</returns>
|
|
int getMinute();
|
|
/// <summary>
|
|
/// Get the seconds component of the current time
|
|
/// </summary>
|
|
/// <returns>current seconds; 0-59</returns>
|
|
int getSecond();
|
|
/// <summary>
|
|
/// Get the year component of the current date
|
|
/// </summary>
|
|
/// <returns>current year; e.g., 2021</returns>
|
|
int getYear();
|
|
/// <summary>
|
|
/// Get the month component of the current date
|
|
/// </summary>
|
|
/// <returns>current month; 1-12</returns>
|
|
int getMonth();
|
|
/// <summary>
|
|
/// Get the day component of the current date
|
|
/// </summary>
|
|
/// <returns>current day; 1-31</returns>
|
|
int getDay();
|
|
/// <summary>
|
|
/// Get the day of week component of the current date
|
|
/// </summary>
|
|
/// <returns>current day of week; Sunday-Saturday</returns>
|
|
char* getDayOfWeek();
|
|
};
|
|
|
|
#endif
|
|
|