For coursework of group 3 in SOFT564Z

Dependencies:   Motordriver ros_lib_kinetic

dateTime.hpp

Committer:
Jonathan738
Date:
2020-01-05
Revision:
12:82b8fe254222
Parent:
5:207e0cd8b9de

File content as of revision 12:82b8fe254222:

/*------------------------------------------------------------------------------
Creator : Ben Gordon
Date : 08/01/2019
Module : ELEC351
Note : Code Ripped from coursework of Group A for ELEC351
------------------------------------------------------------------------------*/
#ifndef _dateTime_HPP
#define _dateTime_HPP
    #include "mbed.h"
    #include "General.hpp"
    #include "Pins.h"
    //dateTime(PinName GREEN, PinName YELLOW, PinName RED);
    
    //TEMPORARY FOR DEBUGGING//
    //void errorReport(char* message);
    
    BYTE updateSystemTime();
    
    BYTE setTime(S_BYTE hours   = 0,
                 S_BYTE minutes = 0,
                 S_BYTE seconds = 0);
     
    //Setting the date and time
    BYTE setDate(S_BYTE days    = 1,
                 S_BYTE months  = 1,
                 INT_32 years   = 1970);
    
    void addYear (INT_32 years  = 1);
    
    void addMonth(S_BYTE months =1);
    void addDay  (S_BYTE days   =1);
    void addHour (S_BYTE hours  =1);
    void addMin  (S_BYTE minutes=1);
    void addSec  (S_BYTE seconds=1);
    
    BYTE confirmDate();
    char* getSetDate();
    char* getSetTime();
    
    char* startEditDate();
    char* startEditTime();
    void   endEdit();
    
    char* getSystemDateTime();
    //-----------------------------------
    BYTE checkStruct(struct tm check);
    
    char* printDate(struct tm _time_struct);
    
    char* printTime(struct tm _time_struct);
    struct tm getRawTime();
    
    signed INT_32 getYear(struct tm _time_struct);
    BYTE          getMonth(struct tm _time_struct);
    BYTE          getDay(struct tm _time_struct);
    BYTE          getHour(struct tm _time_struct);
    BYTE          getMin(struct tm _time_struct);
    BYTE          getSec(struct tm _time_struct);
#endif