ds3231.h 596 B

12345678910111213141516171819202122232425
  1. #include "esp_err.h"
  2. #include <time.h>
  3. enum alrm1_mode {
  4. each_second = 0x0F,
  5. seconds_match = 0x0E,
  6. minutes_seconds_match = 0x0C,
  7. hours_minutes_seconds_match = 0x08,
  8. all_match = 0x00,
  9. day_time_match = 0x10
  10. };
  11. esp_err_t ds3231_init(int sda_pin, int scl_pin);
  12. esp_err_t ds3231_read_date_time(struct tm *date_time);
  13. esp_err_t ds3231_write_date_time(struct tm date_time);
  14. esp_err_t ds3231_set_alrm1(struct tm date_time, uint16_t mode);
  15. esp_err_t ds3231_enable_arlm1_interrupt(void);
  16. esp_err_t ds3231_acknowledge_alrm1(void);
  17. esp_err_t ds3231_disable_32khz_output(void);