12345678910111213141516171819202122232425 |
- #include "esp_err.h"
- #include <time.h>
- enum alrm1_mode {
- each_second = 0x0F,
- seconds_match = 0x0E,
- minutes_seconds_match = 0x0C,
- hours_minutes_seconds_match = 0x08,
- all_match = 0x00,
- day_time_match = 0x10
- };
- esp_err_t ds3231_init(int sda_pin, int scl_pin);
- esp_err_t ds3231_read_date_time(struct tm *date_time);
- esp_err_t ds3231_write_date_time(struct tm date_time);
- esp_err_t ds3231_set_alrm1(struct tm date_time, uint16_t mode);
- esp_err_t ds3231_enable_arlm1_interrupt(void);
- esp_err_t ds3231_acknowledge_alrm1(void);
- esp_err_t ds3231_disable_32khz_output(void);
|