A simple WIP that logs data from a Grove sensor, and can send and receive information over USB and SMS.
Dependencies: DHT DS_1337 SDFileSystem USBDevice mbed
rtc.h
00001 #ifndef __RTC_H__ 00002 #define __RTC_H__ 00003 00004 #include "mbed.h" 00005 00006 //! The functions needed to configure time in the micro, used in \sa attach_rtc, using the on board DS_1337 00007 /*! 00008 As there is no on-chip RTC, connecting the time functionality to the DS_1337 enables more convenient use of time 00009 00010 The function which is called to configure is as such: 00011 void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void)) 00012 00013 read_rtc is assigned \sa my_rtc_read 00014 00015 write_rtc is assigned \sa my_rtc_write 00016 00017 init_rtc is assigned \sa my_rtc_init 00018 00019 isenabled_rtc is assigned \sa my_rtc_enabled 00020 */ 00021 00022 00023 /*! 00024 * \brief my_rtc_read Interfaces to the on board RTC DS1337 and converts read values to time_t 00025 * \return the value read from the on board RTC converted to system struct time_t 00026 */ 00027 time_t my_rtc_read(); 00028 00029 00030 /*! 00031 * \brief my_rtc_write Interfaces to the on board RTC DS1337 and converts and writes the time given as time_t 00032 * \param _time is the time in system time_t format which will be written to DS1337 00033 */ 00034 void my_rtc_write(time_t _time); 00035 00036 00037 /*! 00038 * \brief my_rtc_init Initialises the RTC DS1337 00039 */ 00040 void my_rtc_init(); 00041 00042 00043 /*! 00044 * \brief my_rtc_enabled Checks if RTC DS1337 is enabled 00045 * \return 1 if enabled, 0 if not enabled (i.e. \sa my_rtc_init never called) 00046 */ 00047 int my_rtc_enabled(); 00048 00049 00050 #endif // __RTC_H__
Generated on Tue Jul 12 2022 23:07:44 by 1.7.2