PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

41 行
848B

  1. /*
  2. * DS1307RTC.h - library for DS1307 RTC
  3. * This library is intended to be uses with Arduino Time library functions
  4. */
  5. #ifndef DS1307RTC_h
  6. #define DS1307RTC_h
  7. #include <TimeLib.h>
  8. // library interface description
  9. class DS1307RTC
  10. {
  11. // user-accessible "public" interface
  12. public:
  13. DS1307RTC();
  14. static time_t get();
  15. static bool set(time_t t);
  16. static bool read(tmElements_t &tm);
  17. static bool write(tmElements_t &tm);
  18. static bool chipPresent() { return exists; }
  19. static unsigned char isRunning();
  20. static void setCalibration(char calValue);
  21. static char getCalibration();
  22. private:
  23. static bool exists;
  24. static uint8_t dec2bcd(uint8_t num);
  25. static uint8_t bcd2dec(uint8_t num);
  26. };
  27. #ifdef RTC
  28. #undef RTC // workaround for Arduino Due, which defines "RTC"...
  29. #endif
  30. extern DS1307RTC RTC;
  31. #endif