Package org.deepjava.runtime.mpc555
Class DateTime
- java.lang.Object
-
- org.deepjava.runtime.ppc32.Task
-
- org.deepjava.runtime.mpc555.DateTime
-
- All Implemented Interfaces:
Ippc32
,Actionable
public class DateTime extends Task
-
-
Field Summary
-
Fields inherited from class org.deepjava.runtime.ppc32.Task
done, firstErr, maxNofTasks, nofActivations, period, safe, time
-
Fields inherited from interface org.deepjava.runtime.ppc32.Ippc32
CR, CTR, DAR, DEC, DSISR, FPR0, FPR1, FPR10, FPR11, FPR12, FPR13, FPR14, FPR15, FPR16, FPR17, FPR18, FPR19, FPR2, FPR20, FPR21, FPR22, FPR23, FPR24, FPR25, FPR26, FPR27, FPR28, FPR29, FPR3, FPR30, FPR31, FPR4, FPR5, FPR6, FPR7, FPR8, FPR9, FPSCR, LR, MSR, R0, R1, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R2, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R3, R30, R31, R4, R5, R6, R7, R8, R9, SPR1, SPR18, SPR19, SPR22, SPR26, SPR268, SPR269, SPR27, SPR272, SPR273, SPR274, SPR275, SPR287, SPR8, SPR9, SPRG0, SPRG1, SPRG2, SPRG3, SRR0, SRR1, TBLread, TBUread, XER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action()
Action to be performed by the taskint
getDate()
Reads the actual date of the month.int
getHour()
Reads the actual hour.static DateTime
getInstance()
Get an instance from this class.int
getMin()
Read the actual minutes.int
getMonth()
Reads the actual month.int
getPackedTime()
Returns the actual Time as an integer.int
getSec()
Read the actual seconds.int
getString(char[] str)
Returns the date and time as a string.int
getYear()
Reads the actual year.void
setTime(int sec, int min, int hour, int date, int month, int year)
Sets the actual time and writes it to theDS1302Z
real time clock.
-
-
-
Method Detail
-
getInstance
public static DateTime getInstance()
Get an instance from this class.- Returns:
- The instance of this class.
-
action
public void action()
Description copied from class:Task
Action to be performed by the task- Specified by:
action
in interfaceActionable
- Overrides:
action
in classTask
- See Also:
Task.action()
-
getSec
public int getSec()
Read the actual seconds.- Returns:
- the actual seconds.
-
getMin
public int getMin()
Read the actual minutes.- Returns:
- the actual minutes.
-
getHour
public int getHour()
Reads the actual hour. The hour is represented with the 24 hours format.- Returns:
- the actual hour.
-
getDate
public int getDate()
Reads the actual date of the month.- Returns:
- the actual date.
-
getMonth
public int getMonth()
Reads the actual month.- Returns:
- the actual month.
-
getYear
public int getYear()
Reads the actual year.- Returns:
- the actual year.
-
setTime
public void setTime(int sec, int min, int hour, int date, int month, int year)
Sets the actual time and writes it to theDS1302Z
real time clock.- Parameters:
sec
- the actual seconds.min
- the actual minutes.hour
- the actual hour.date
- the actual date.month
- the actual month.year
- the actual year.
-
getPackedTime
public int getPackedTime()
Returns the actual Time as an integer. bits 0 - 4 = seconds / 2 bits 5 - 10 = minutes bits 11 - 15 = hour bits 16 - 20 = date bits 21 - 24 = month bits 25 - 31 = year - 1980- Returns:
- actual Time as an integer
-
getString
public int getString(char[] str)
Returns the date and time as a string. The format dd.mm.yyyy hh:mm:ss.- Parameters:
str
- date and time as string- Returns:
- The length of the string
-
-