39 #ifndef __DS3231_SENSOR__
40 #define __DS3231_SENSOR__
42 #include <lib/sensors.h>
49 #define EARLIEST_EPOCH 946684800
54 #define DS3231_SENSOR_TEMP 0
55 #define DS3231_SENSOR_GET_EPOCH_SECONDS_MSB 1
56 #define DS3231_SENSOR_GET_EPOCH_SECONDS_LSB 2
57 #define DS3231_CONFIG_SET_TIME 55
58 #define DS3231_CONFIG_SET_ALARM 56
59 #define DS3231_CONFIG_CLEAR_ALARM 57
61 #define DS3231_MASTER 0x00
62 #define DS3231_ADDR 0x68 //0xd0 with shift
63 #define DS3231_CONTROL_A1IE_SET_MASK 0x05
64 #define DS3231_CONTROL_A1IE_CLEAR_MASK 0xfe
65 #define DS3231_STATUS_A1F_CLEAR_MASK 0xfe
int ds3231_get_temperature(int *temp)
ds3231_temperature
int ds3231_clear_alarm(void)
ds3231_clear_alarm
int ds3231_get_time(struct tm *t)
ds3231_get_time
int ds3231_set_time(struct tm *t)
ds3231_set_time
int configure(int type, int c)
configure
int ds3231_set_alarm(struct tm *t)
ds3231_set_alarm
const struct sensors_sensor ds3231_sensor
Export the DS3231 sensor object.
int status(int type)
status