Contains necessary classes and functions for ELEC351

/media/uploads/Luka_Danilovic/elec_315_prototype_assembly.jpg

Committer:
Luka_Danilovic
Date:
Sun Dec 24 21:36:31 2017 +0000
Revision:
0:f44c89c33601
Child:
2:e2b885367ba8
Date & Time: FINISHED; GetDT:  FINISHED; SetT:  FINISHED; SetD:  FINISHED

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Luka_Danilovic 0:f44c89c33601 1 #ifndef __dateAndTime__ //Inclusion safeguards
Luka_Danilovic 0:f44c89c33601 2 #define __dateAndTime__
Luka_Danilovic 0:f44c89c33601 3
Luka_Danilovic 0:f44c89c33601 4
Luka_Danilovic 0:f44c89c33601 5 typedef struct __attribute__ ((packed)) { // Store one after another
Luka_Danilovic 0:f44c89c33601 6
Luka_Danilovic 0:f44c89c33601 7 int day; // Current Day
Luka_Danilovic 0:f44c89c33601 8 int mnt; // Current Month
Luka_Danilovic 0:f44c89c33601 9 int yr; // Current Year
Luka_Danilovic 0:f44c89c33601 10
Luka_Danilovic 0:f44c89c33601 11 int sec; // Current Seconds
Luka_Danilovic 0:f44c89c33601 12 int min; // Current Minutes
Luka_Danilovic 0:f44c89c33601 13 int hr; // Current Hours
Luka_Danilovic 0:f44c89c33601 14
Luka_Danilovic 0:f44c89c33601 15 } TDS_DT; // Type Def Struct _ Date Time
Luka_Danilovic 0:f44c89c33601 16
Luka_Danilovic 0:f44c89c33601 17
Luka_Danilovic 0:f44c89c33601 18 class C_DT // Class _ Date Time
Luka_Danilovic 0:f44c89c33601 19 {
Luka_Danilovic 0:f44c89c33601 20
Luka_Danilovic 0:f44c89c33601 21 // Constructorless class - constructor not needed
Luka_Danilovic 0:f44c89c33601 22
Luka_Danilovic 0:f44c89c33601 23 private:
Luka_Danilovic 0:f44c89c33601 24 TDS_DT date_time; // TDS_DT format of storing Date & Time
Luka_Danilovic 0:f44c89c33601 25
Luka_Danilovic 0:f44c89c33601 26 public:
Luka_Danilovic 0:f44c89c33601 27 TDS_DT getDT(); // Get Date & Time
Luka_Danilovic 0:f44c89c33601 28 void setT(int, int, int); // set Date
Luka_Danilovic 0:f44c89c33601 29 void setD(int, int, int); // Set Time
Luka_Danilovic 0:f44c89c33601 30
Luka_Danilovic 0:f44c89c33601 31 };
Luka_Danilovic 0:f44c89c33601 32
Luka_Danilovic 0:f44c89c33601 33 #endif