00001 /*! \file WaspRTC.h 00002 \brief Library for managing the RTC 00003 00004 Copyright (C) 2009 Libelium Comunicaciones Distribuidas S.L. 00005 http://www.libelium.com 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation, either version 2.1 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 Version: 0.6 00021 00022 Design: David Gascón 00023 00024 Implementation: Alberto Bielsa, David Cuartielles, Marcos Yarza 00025 00026 */ 00027 00028 /*! \def WaspRTC_h 00029 \brief The library flag 00030 00031 */ 00032 #ifndef WaspRTC_h 00033 #define WaspRTC_h 00034 00035 /****************************************************************************** 00036 * Includes 00037 ******************************************************************************/ 00038 00039 #include <inttypes.h> 00040 00041 /****************************************************************************** 00042 * Definitions & Declarations 00043 ******************************************************************************/ 00044 00045 // RTC ADDRESSES CONSTANTS 00046 /*! \def RTC_SECONDS_ADDRESS 00047 \brief RTC Addresses constants. Seconds register in this case 00048 */ 00049 /*! \def RTC_MINUTES_ADDRESS 00050 \brief RTC Addresses constants. Minutes register in this case 00051 */ 00052 /*! \def RTC_HOURS_ADDRESS 00053 \brief RTC Addresses constants. Hours register in this case 00054 */ 00055 /*! \def RTC_DAYS_ADDRESS 00056 \brief RTC Addresses constants. Days register in this case 00057 */ 00058 /*! \def RTC_DATE_ADDRESS 00059 \brief RTC Addresses constants. Date register in this case 00060 */ 00061 /*! \def RTC_MONTH_ADDRESS 00062 \brief RTC Addresses constants. Month register in this case 00063 */ 00064 /*! \def RTC_YEAR_ADDRESS 00065 \brief RTC Addresses constants. Year register in this case 00066 */ 00067 /*! \def RTC_ALM1_START_ADDRESS 00068 \brief RTC Addresses constants. Alarm1 start address in this case 00069 */ 00070 /*! \def RTC_ALM1_SECONDS_ADDRESS 00071 \brief RTC Addresses constants. Alarm1 seconds register in this case 00072 */ 00073 /*! \def RTC_ALM1_MINUTES_ADDRESS 00074 \brief RTC Addresses constants. Alarm1 minutes register in this case 00075 */ 00076 /*! \def RTC_ALM1_HOURS_ADDRESS 00077 \brief RTC Addresses constants. Alarm1 hours register in this case 00078 */ 00079 /*! \def RTC_ALM1_DAYS_ADDRESS 00080 \brief RTC Addresses constants. Alarm1 days register in this case 00081 */ 00082 /*! \def RTC_ALM2_START_ADDRESS 00083 \brief RTC Addresses constants. Alarm2 start address in this case 00084 */ 00085 /*! \def RTC_ALM2_MINUTES_ADDRESS 00086 \brief RTC Addresses constants. Alarm2 minutes register in this case 00087 */ 00088 /*! \def RTC_ALM2_HOURS_ADDRESS 00089 \brief RTC Addresses constants. Alarm2 hours register in this case 00090 */ 00091 /*! \def RTC_ALM2_DAYS_ADDRESS 00092 \brief RTC Addresses constants. Alarm2 days register in this case 00093 */ 00094 /*! \def RTC_CONTROL_ADDRESS 00095 \brief RTC Addresses constants. Control register in this case 00096 */ 00097 /*! \def RTC_STATUS_ADDRESS 00098 \brief RTC Addresses constants. Status register in this case 00099 */ 00100 /*! \def RTC_MSB_TEMP_ADDRESS 00101 \brief RTC Addresses constants. MSB Temperature register in this case 00102 */ 00103 /*! \def RTC_LSB_TEMP_ADDRESS 00104 \brief RTC Addresses constants. LSB Temperature register in this case 00105 */ 00106 #define RTC_SECONDS_ADDRESS 0x00 00107 #define RTC_MINUTES_ADDRESS 0x01 00108 #define RTC_HOURS_ADDRESS 0x02 00109 #define RTC_DAYS_ADDRESS 0x03 00110 #define RTC_DATE_ADDRESS 0x04 00111 #define RTC_MONTH_ADDRESS 0x05 00112 #define RTC_YEAR_ADDRESS 0x06 00113 #define RTC_ALM1_START_ADDRESS 0x07 00114 #define RTC_ALM1_SECONDS_ADDRESS 0x07 00115 #define RTC_ALM1_MINUTES_ADDRESS 0x08 00116 #define RTC_ALM1_HOURS_ADDRESS 0x09 00117 #define RTC_ALM1_DAYS_ADDRESS 0x0A 00118 #define RTC_ALM2_START_ADDRESS 0x0B 00119 #define RTC_ALM2_MINUTES_ADDRESS 0x0B 00120 #define RTC_ALM2_HOURS_ADDRESS 0x0C 00121 #define RTC_ALM2_DAYS_ADDRESS 0x0D 00122 #define RTC_CONTROL_ADDRESS 0x0E 00123 #define RTC_STATUS_ADDRESS 0x0F 00124 #define RTC_MSB_TEMP_ADDRESS 0x11 00125 #define RTC_LSB_TEMP_ADDRESS 0x12 00126 00127 00128 /*! \def RTC_START_ADDRESS 00129 \brief RTC Addresses constants. Start address 00130 */ 00131 /*! \def RTC_ADDRESS 00132 \brief RTC Addresses constants. I2C RTC Address 00133 */ 00134 /*! \def RTC_DATA_SIZE 00135 \brief RTC Addresses constants. RTC Data size 00136 */ 00137 #define RTC_START_ADDRESS 0x00 00138 #define RTC_ADDRESS 0x68 00139 #define RTC_DATA_SIZE 0x12 00140 00141 00142 /*! \def RTC_DATE_ADDRESS_2 00143 \brief RTC Addresses constants to use in function 'readRTC'. Use when only time and date wants to be read from the RTC 00144 */ 00145 /*! \def RTC_ALARM1_ADDRESS 00146 \brief RTC Addresses constants to use in function 'readRTC'. Use when time, date and alarm1 wants to be read from the RTC 00147 */ 00148 /*! \def RTC_ALARM2_ADDRESS 00149 \brief RTC Addresses constants to use in function 'readRTC'. Use when time, date, alarm1 and alarm2 wants to be read from the RTC 00150 */ 00151 #define RTC_DATE_ADDRESS_2 6 00152 #define RTC_ALARM1_ADDRESS 10 00153 #define RTC_ALARM2_ADDRESS 13 00154 00155 /*! \def RTC_ALM1_MODE1 00156 \brief RTC Alarm Modes. Day of the week,hours,minutes and seconds match 00157 */ 00158 /*! \def RTC_ALM1_MODE2 00159 \brief RTC Alarm Modes. Date,hours,minutes and seconds match 00160 */ 00161 /*! \def RTC_ALM1_MODE3 00162 \brief RTC Alarm Modes. Hours,minutes and seconds match 00163 */ 00164 /*! \def RTC_ALM1_MODE4 00165 \brief RTC Alarm Modes. Minutes and seconds match 00166 */ 00167 /*! \def RTC_ALM1_MODE5 00168 \brief RTC Alarm Modes. Seconds match 00169 */ 00170 /*! \def RTC_ALM1_MODE6 00171 \brief RTC Alarm Modes. Once per second 00172 */ 00173 /*! \def RTC_ALM2_MODE1 00174 \brief RTC Alarm Modes. Day of the week,hours and minutes match 00175 */ 00176 /*! \def RTC_ALM2_MODE2 00177 \brief RTC Alarm Modes. Date,hours and minutes match 00178 */ 00179 /*! \def RTC_ALM2_MODE3 00180 \brief RTC Alarm Modes. Hours and minutes 00181 */ 00182 /*! \def RTC_ALM2_MODE4 00183 \brief RTC Alarm Modes. Minutes match 00184 */ 00185 /*! \def RTC_ALM2_MODE5 00186 \brief RTC Alarm Modes. Once per minute 00187 */ 00188 #define RTC_ALM1_MODE1 0 00189 #define RTC_ALM1_MODE2 1 00190 #define RTC_ALM1_MODE3 2 00191 #define RTC_ALM1_MODE4 3 00192 #define RTC_ALM1_MODE5 4 00193 #define RTC_ALM1_MODE6 5 00194 00195 #define RTC_ALM2_MODE1 0 00196 #define RTC_ALM2_MODE2 1 00197 #define RTC_ALM2_MODE3 2 00198 #define RTC_ALM2_MODE4 3 00199 #define RTC_ALM2_MODE5 4 00200 00201 00202 /*! \def RTC_OFFSET 00203 \brief RTC Alarm Values. This option adds the time specified by the user to the actual time 00204 */ 00205 /*! \def RTC_ABSOLUTE 00206 \brief RTC Alarm Values. This option establishes the time specified by the user as the alarm time 00207 */ 00208 /*! \def RTC_ALM1 00209 \brief RTC Alarm Values. Specifies Alarm1 00210 */ 00211 /*! \def RTC_ALM2 00212 \brief RTC Alarm Values. Specifies Alarm2 00213 */ 00214 #define RTC_OFFSET 0 00215 #define RTC_ABSOLUTE 1 00216 #define RTC_ALM1 1 00217 #define RTC_ALM2 2 00218 00219 00220 /*! \def DAY_1 00221 \brief Days of the Week. Sunday in this case 00222 */ 00223 /*! \def DAY_2 00224 \brief Days of the Week. Monday in this case 00225 */ 00226 /*! \def DAY_3 00227 \brief Days of the Week. Tuesday in this case 00228 */ 00229 /*! \def DAY_4 00230 \brief Days of the Week. Wednesday in this case 00231 */ 00232 /*! \def DAY_5 00233 \brief Days of the Week. Thursday in this case 00234 */ 00235 /*! \def DAY_6 00236 \brief Days of the Week. Friday in this case 00237 */ 00238 /*! \def DAY_7 00239 \brief Days of the Week. Saturday in this case 00240 */ 00241 #define DAY_1 "Sunday" 00242 #define DAY_2 "Monday" 00243 #define DAY_3 "Tuesday" 00244 #define DAY_4 "Wednesday" 00245 #define DAY_5 "Thursday" 00246 #define DAY_6 "Friday" 00247 #define DAY_7 "Saturday" 00248 00249 /*! \def RTC_ON 00250 \brief RTC Power Modes. ON in this case 00251 */ 00252 /*! \def RTC_OFF 00253 \brief RTC Power Modes. OFF in this case 00254 */ 00255 #define RTC_ON 1 00256 #define RTC_OFF 2 00257 00258 /****************************************************************************** 00259 * Class 00260 ******************************************************************************/ 00261 00262 //! WaspRTC Class 00263 /*! 00264 WaspRTC Class defines all the variables and functions used for managing the RTC 00265 */ 00266 class WaspRTC 00267 { 00268 private: 00269 public: 00270 //! class constructor 00271 /*! 00272 It does nothing 00273 \param void 00274 \return void 00275 */ 00276 WaspRTC(); 00277 00278 //! It converts a number from BCD to byte 00279 /*! 00280 \param uint8_t number : number to convert 00281 \return the number converted 00282 \sa BCD2byte(uint8_t high, uint8_t low), byte2BCD(uint8_t theNumber) 00283 */ 00284 uint8_t BCD2byte(uint8_t number); 00285 00286 //! It converts a number from BCD to byte 00287 /*! 00288 \param uint8_t high : higher part of the number to convert 00289 \param uint8_t low : lower part of the number to convert 00290 \return the number converted 00291 \sa BCD2byte(uint8_t number), byte2BCD(uint8_t theNumber) 00292 */ 00293 uint8_t BCD2byte(uint8_t high, uint8_t low); 00294 00295 //! It converts a number from int to BCD 00296 /*! 00297 \param uint8_t theNumber : number to convert 00298 \return the number converted 00299 \sa BCD2byte(uint8_t number), BCD2byte(uint8_t high, uint8_t low) 00300 */ 00301 uint8_t byte2BCD(uint8_t theNumber); 00302 00303 //! Variable : Array for storing the value of the different RTC registers 00304 /*! 00305 Its size is defined by 'RTC_DATA_SIZE' constant 00306 */ 00307 uint8_t registersRTC[RTC_DATA_SIZE]; 00308 00309 //! Variable : It stores the value of the year 00310 /*! 00311 */ 00312 uint8_t year; 00313 00314 //! Variable : It stores the value of the month 00315 /*! 00316 */ 00317 uint8_t month; 00318 00319 //! Variable : It stores the value of the day of the week 00320 /*! 00321 */ 00322 uint8_t day; 00323 00324 //! Variable : It stores the value of the hours 00325 /*! 00326 */ 00327 uint8_t hour; 00328 00329 //! Variable : It stores the value of the minutes 00330 /*! 00331 */ 00332 uint8_t minute; 00333 00334 //! Variable : It stores the value of the seconds 00335 /*! 00336 */ 00337 uint8_t second; 00338 00339 //! Variable : It stores the value of the date(day of the week) 00340 /*! 00341 */ 00342 uint8_t date; 00343 00344 //! Variable : It stores the value of the seconds for Alarm1 00345 /*! 00346 */ 00347 uint8_t second_alarm1; 00348 00349 //! Variable : It stores the value of the minutes for Alarm1 00350 /*! 00351 */ 00352 uint8_t minute_alarm1; 00353 00354 //! Variable : It stores the value of the hours for Alarm1 00355 /*! 00356 */ 00357 uint8_t hour_alarm1; 00358 00359 //! Variable : It stores the value of the day of the week/date for Alarm1 00360 /*! 00361 */ 00362 uint8_t day_alarm1; 00363 00364 //! Variable : It stores the value of the minutes for Alarm2 00365 /*! 00366 */ 00367 uint8_t minute_alarm2; 00368 00369 //! Variable : It stores the value of the hours for Alarm2 00370 /*! 00371 */ 00372 uint8_t hour_alarm2; 00373 00374 //! Variable : It stores the value of the day of the week/date for Alarm2 00375 /*! 00376 */ 00377 uint8_t day_alarm2; 00378 00379 //! Variable : It stores the alarm mode for the Alarm 1 00380 /*! 00381 */ 00382 uint8_t alarm1Mode; 00383 00384 //! Variable : It stores the alarm mode for the Alarm 2 00385 /*! 00386 */ 00387 uint8_t alarm2Mode; 00388 00389 //! Variable : It stores the value of the temperature 00390 /*! 00391 */ 00392 uint8_t temp; 00393 00394 //! Variable : It stores if the temperature is negative or possitive 00395 /*! 00396 */ 00397 bool tempNegative; 00398 00399 //! Variable : It stores the RTC power mode 00400 /*! 00401 */ 00402 uint8_t _pwrMode; 00403 00404 // RTC Internal Functions 00405 //! It resets the variables used through the library 00406 /*! 00407 \param void 00408 \return void 00409 */ 00410 void resetVars(); 00411 00412 //! It gets 'registerRTC' variable 00413 /*! 00414 \param void 00415 \return 'registerRTC' variable 00416 */ 00417 char* getRTCarray(); 00418 00419 //! It gets date and time 00420 /*! 00421 \param void 00422 \return a string containing date and time. These values are got from the library variables 00423 */ 00424 char* getTimestamp(); 00425 00426 //! It writes the date and time set in the corresponding variables to the RTC 00427 /*! 00428 \param void 00429 \return void 00430 \sa readRTC(uint8_t endAddress) 00431 */ 00432 void writeRTC(); 00433 00434 //! It reads from the RTC the date,time and optionally alarm1 and alarm2, setting the corresponding variables 00435 /*! 00436 \param uint8_t endAddress : specifies the last RTC register we want to read 00437 \return void 00438 \sa writeRTC() 00439 */ 00440 void readRTC(uint8_t endAddress); 00441 00442 //! It writes to the RTC the selected registers stored in 'registersRTC' 00443 /*! 00444 \param uint8_t theAddress : specifies the RTC register address where we want to start writing 00445 \return void 00446 \sa readRTCregister(uint8_t theAddress) 00447 */ 00448 void writeRTCregister(uint8_t theAddress); 00449 00450 //! It reads from the RTC the selected register, and stores it in 'registersRTC' variable 00451 /*! 00452 \param uint8_t theAddress : specifies the RTC register address where we want to read from 00453 \return void 00454 \sa writeRTCregister(uint8_t theAddress) 00455 */ 00456 void readRTCregister(uint8_t theAddress); 00457 00458 //! It configures the alarm mode and attaches the interruption 00459 /*! 00460 \param uint8_t alarmNum : specifies the alarm we want to use 00461 \param uint8_t alarmMode : specifies the alarm mode we want to use 00462 \return void 00463 */ 00464 void configureAlarmMode (uint8_t alarmNum, uint8_t alarmMode); 00465 00466 //! It writes Alarm1 to the RTC 00467 /*! 00468 \param void 00469 \return void 00470 \sa writeRTCalarm2() 00471 */ 00472 void writeRTCalarm1(); 00473 00474 //! It writes Alarm2 to the RTC 00475 /*! 00476 \param void 00477 \return void 00478 \sa writeRTCalarm1() 00479 */ 00480 void writeRTCalarm2(); 00481 00482 //! It attaches the interruption to the defined pin 00483 /*! 00484 \param void 00485 \return void 00486 \sa detachInt() 00487 */ 00488 void attachInt(void); 00489 00490 //! It detaches the interruption from the defined pin 00491 /*! 00492 \param void 00493 \return void 00494 \sa attachInt() 00495 */ 00496 void detachInt(void); 00497 00498 // RTC User Functions 00499 00500 //! It opens I2C bus and powers the RTC 00501 /*! 00502 \param void 00503 \return void 00504 \sa close(), begin() 00505 */ 00506 void ON(); 00507 00508 //! It closes I2C and powers off the RTC module 00509 /*! 00510 \param void 00511 \return void 00512 \sa close(), begin() 00513 */ 00514 void OFF(); 00515 00516 //! It inits the I2C bus and the variables reading them from the RTC 00517 /*! 00518 \param void 00519 \return void 00520 */ 00521 void begin(); 00522 00523 //! It closes I2C bus 00524 /*! 00525 \param void 00526 \return void 00527 */ 00528 void close(); 00529 00530 //! It sets Power Mode 00531 /*! 00532 \param uint8_t mode : RTC_ON or RTC_OFF 00533 \return void 00534 \sa getMode() 00535 */ 00536 void setMode(uint8_t mode); 00537 00538 //! It gets Power Mode 00539 /*! 00540 \param void 00541 \return the variable '_pwrMode' that contains the RTC power mode 00542 \sa setMode(uint8_t mode) 00543 */ 00544 uint8_t getMode(); 00545 00546 //! It sets in the RTC the specified date and time 00547 /*! 00548 \param const char* time : the time and date to set in the RTC. It looks like "YY:MM:DD:dow:hh:mm:ss" 00549 \return void 00550 \sa setTime(uint8_t year, uint8_t month, uint8_t date, uint8_t day_week, uint8_t hour, uint8_t minute, uint8_t second), getTime() 00551 */ 00552 void setTime(const char* time); 00553 00554 //! It sets in the RTC the specified date and time 00555 /*! 00556 \param uint8_t year : the year to set in the RTC 00557 \param uint8_t month : the month to set in the RTC 00558 \param uint8_t date : the date to set in the RTC 00559 \param uint8_t day_week : the day of the week to set in the RTC 00560 \param uint8_t hour : the hours to set in the RTC 00561 \param uint8_t minute : the minutes to set in the RTC 00562 \param uint8_t second : the seconds to set in the RTC 00563 \return void 00564 \sa setTime(const char* time), getTime() 00565 */ 00566 void setTime(uint8_t year, uint8_t month, uint8_t date, uint8_t day_week, uint8_t hour, uint8_t minute, uint8_t second); 00567 00568 //! It gets from the RTC the date and time, storing them in the corresponding variables 00569 /*! 00570 \param void 00571 \return a string containing the date and the time 00572 \sa setTime(const char* time), setTime(uint8_t year, uint8_t month, uint8_t date, uint8_t day_week, uint8_t hour, uint8_t minute, uint8_t second) 00573 */ 00574 char* getTime(); 00575 00576 //! It sets time and date from the GPS to the RTC. GPS has to be initialized first and got the time/date 00577 /*! 00578 \param void 00579 \return void 00580 \sa setTime(const char* time), setTime(uint8_t year, uint8_t month, uint8_t date, uint8_t day_week, uint8_t hour, uint8_t minute, uint8_t second) 00581 */ 00582 void setTimeFromGPS(); 00583 00584 //! It sets Alarm1 to the specified time. It also enables the corresponding RTC interruption 00585 /*! 00586 \param const char* time : the time to set for the Alarm 1. It looks like "DD:hh:mm:ss" 00587 \param uint8_t offset : RTC_OFFSET or RTC_ABSOLUTE 00588 \param uint8_t mode : RTC_ALM1_MODE1, RTC_ALM1_MODE2, RTC_ALM1_MODE3, RTC_ALM1_MODE4, RTC_ALM1_MODE5, RTC_ALM1_MODE6 00589 \return void 00590 \sa setAlarm1(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t second, uint8_t offset, uint8_t mode), getAlarm1() 00591 */ 00592 void setAlarm1(const char* time, uint8_t offset, uint8_t mode); 00593 00594 //! It sets Alarm1 to the specified time. It also enables the corresponding RTC interruption 00595 /*! 00596 \param uint8_t day_date : specifies the date or the day of the week to set the Alarm1 to 00597 \param uint8_t hour : specifies the hour to set the Alarm1 to 00598 \param uint8_t minute : specifies the minute to set the Alarm1 to 00599 \param uint8_t second : specifies the second to set the Alarm1 to 00600 \param uint8_t offset : RTC_OFFSET or RTC_ABSOLUTE 00601 \param uint8_t mode : RTC_ALM1_MODE1, RTC_ALM1_MODE2, RTC_ALM1_MODE3, RTC_ALM1_MODE4, RTC_ALM1_MODE5, RTC_ALM1_MODE6 00602 \return void 00603 \sa setAlarm1(const char* time, uint8_t offset, uint8_t mode), getAlarm1() 00604 */ 00605 void setAlarm1(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t second, uint8_t offset, uint8_t mode); 00606 00607 //! It gets Alarm1 date and time from the RTC, storing them in the corresponding variables 00608 /*! 00609 \param void 00610 \return a string containing the Alarm1 date and the time 00611 \sa setAlarm1(const char* time, uint8_t offset, uint8_t mode), setAlarm1(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t second, uint8_t offset, uint8_t mode) 00612 */ 00613 char* getAlarm1(); 00614 00615 //! It sets Alarm2 to the specified time. It also enables the corresponding RTC interruption 00616 /*! 00617 \param const char* time : the time to set for the Alarm 1. It looks like "DD:hh:mm" 00618 \param uint8_t offset : RTC_OFFSET or RTC_ABSOLUTE 00619 \param uint8_t mode : RTC_ALM2_MODE1, RTC_ALM2_MODE2, RTC_ALM2_MODE3, RTC_ALM2_MODE4, RTC_ALM2_MODE5 00620 \return void 00621 \sa setAlarm2(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t offset, uint8_t mode), getAlarm2() 00622 */ 00623 void setAlarm2(const char* time, uint8_t offset, uint8_t mode); 00624 00625 //! It sets Alarm2 to the specified time. It also enables the corresponding RTC interruption 00626 /*! 00627 \param uint8_t day_date : specifies the date or the day of the week to set the Alarm2 to 00628 \param uint8_t hour : specifies the hour to set the Alarm2 to 00629 \param uint8_t minute : specifies the minute to set the Alarm2 to 00630 \param uint8_t offset : RTC_OFFSET or RTC_ABSOLUTE 00631 \param uint8_t mode : RTC_ALM2_MODE1, RTC_ALM2_MODE2, RTC_ALM2_MODE3, RTC_ALM2_MODE4, RTC_ALM2_MODE5 00632 \return void 00633 \sa setAlarm2(const char* time, uint8_t offset, uint8_t mode), getAlarm2() 00634 */ 00635 void setAlarm2(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t offset, uint8_t mode); 00636 00637 //! It gets Alarm2 date and time from the RTC, storing them in the corresponding variables 00638 /*! 00639 \param void 00640 \return a string containing the Alarm2 date and the time 00641 \sa setAlarm2(const char* time, uint8_t offset, uint8_t mode), setAlarm2(uint8_t day_date, uint8_t hour, uint8_t minute, uint8_t offset, uint8_t mode) 00642 */ 00643 char* getAlarm2(); 00644 00645 //! It clears bits A1F and A2F, necessary to be able to catch interrupts after previous interrupts 00646 /*! 00647 \param void 00648 \return void 00649 */ 00650 void clearAlarmFlag(); 00651 00652 //! It gets the temperature from the RTC temperature sensor 00653 /*! 00654 \param void 00655 \return temperature 00656 */ 00657 uint8_t getTemperature(); 00658 }; 00659 00660 extern WaspRTC RTC; 00661 00662 #endif 00663
1.5.6