|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.dalsemi.system.Clock
This class provides access to the TINI Real-Time clock. The methods support
setting and getting the clock values. Getting the time involves calling
getRTC() and then accessing the public static ints
(i.e. year, month, hour,...) to get the clock values. Setting the time
involves setting the public static ints (i.e. year, month, hour,
...) and then calling setRTC(). A call to setTickCount can also
be used to set the real time clock.This class will be modified
at a later date to conform to Java clock/calendar classes.
| Field Summary | |
int |
date
Day of the month |
int |
day
Day of the week |
int |
hour
Hour |
int |
hundredth
Hundreths of seconds |
boolean |
is12Hour
12/24 hour flag |
int |
minute
Minute |
int |
month
Month |
boolean |
pm
PM/AM flag |
int |
second
Second |
int |
year
Year mod 100 |
| Constructor Summary | |
Clock()
Constructor |
|
| Method Summary | |
static int |
bcdToInt(int bcdVal)
Converts a BCD integer byte to its binary int value. |
static int |
calculateDayOfWeek(int month,
int date,
int fullYear)
This will calculate the correct day of the week given the month, day of the month, and year. |
boolean |
get12Hour()
Get the 12/24 hour mode for the Real Time Clock. |
int |
getDate()
Get the date value (day of the month) for the Real Time Clock. |
int |
getDay()
Get the day value for the Real Time Clock. |
int |
getHour()
Get the hour value for the Real Time Clock. |
int |
getHundredth()
Get the hundredth value for the Real Time Clock. |
int |
getMinute()
Get the minute value for the Real Time Clock. |
int |
getMonth()
Get the month value for the Real Time Clock. |
boolean |
getPm()
Get the AM/PM value for the Real Time Clock. |
void |
getRTC()
Reads Real time clock values from hardware clock and places them into Clock instance fields. |
int |
getSecond()
Get the second value for the Real Time Clock. |
long |
getTickCount()
Get the current time in milliseconds since midnight Jan 1, 1970, UTC. |
int |
getYear()
Get the year value for the Real Time Clock. |
static byte |
intToBCD(int intVal)
Converts a binary integer byte to its BCD value. |
void |
set12Hour(boolean is12Hour)
Sets the 12/24 hour mode of the Real Time Clock. |
void |
setDate(int Date)
Sets the date value (numerical day of the month) of the Real Time Clock. |
void |
setDay(int day)
Sets the day value of the Real Time Clock. |
void |
setHour(int hour)
Sets the hour value of the Real Time Clock. |
void |
setHundredth(int hundredth)
Sets the hundredth value of the Real Time Clock. |
void |
setMinute(int minute)
Sets the minute value of the Real Time Clock. |
void |
setMonth(int month)
Sets the month value of the Real Time Clock. |
void |
setPm(boolean pm)
Sets the AM/PM value of the Real Time Clock. |
void |
setRTC()
Reads real time clock values from static ints and writes them to the hardware clock. |
void |
setSecond(int second)
Sets the second value of the Real Time Clock. |
void |
setTickCount(long millis)
Set the current time from a value in milliseconds since Jan 1, 1970, UTC. |
void |
setYear(int year)
Sets the year value of the Real Time Clock. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public int year
public int month
public int day
public int date
public int hour
public int minute
public int second
public int hundredth
public boolean pm
public boolean is12Hour
| Constructor Detail |
public Clock()
| Method Detail |
public void setYear(int year)
setRTC
should be performed to actually set the real time clock.int - year - the year to be set.public int getYear()
public void setMonth(int month)
month - the month to be set.public int getMonth()
public void setDay(int day)
day - the day to be set.public int getDay()
public void setDate(int Date)
date - the day of the month to be set.public int getDate()
public void setHour(int hour)
hour - the hour to be set.public int getHour()
public void setMinute(int minute)
minute - the minute to be set.public int getMinute()
public void setSecond(int second)
second - the second to be set.public int getSecond()
public void setHundredth(int hundredth)
hundredth - the hundredths of seconds to be set.public int getHundredth()
public void setPm(boolean pm)
PM - true for PM, false for AMpublic boolean getPm()
true for PM, false for AMpublic void set12Hour(boolean is12Hour)
is12Hour - true for 12 hour clock, false
for 24 hour clock.public boolean get12Hour()
true for 12 hour clock, false for
24 hour clock.public void getRTC()
Clock instance fields.public long getTickCount()
public void setTickCount(long millis)
millis - number of milliseconds since midnight, Jan 1, 1970 UTC.public void setRTC()
public static int calculateDayOfWeek(int month,
int date,
int fullYear)
month - The month (1-12)date - The day of the monthfullYear - The yearpublic static int bcdToInt(int bcdVal)
public static byte intToBCD(int intVal)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||