Make headers in extras more cpp friendly
This commit is contained in:
parent
2994a566a6
commit
57cb9b925c
12 changed files with 130 additions and 29 deletions
|
@ -13,40 +13,44 @@
|
|||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DS3231_ADDR 0x68
|
||||
|
||||
#define DS3231_STAT_OSCILLATOR 0x80
|
||||
#define DS3231_STAT_32KHZ 0x08
|
||||
#define DS3231_STAT_BUSY 0x04
|
||||
#define DS3231_STAT_ALARM_2 0x02
|
||||
#define DS3231_STAT_ALARM_1 0x01
|
||||
#define DS3231_STAT_OSCILLATOR 0x80
|
||||
#define DS3231_STAT_32KHZ 0x08
|
||||
#define DS3231_STAT_BUSY 0x04
|
||||
#define DS3231_STAT_ALARM_2 0x02
|
||||
#define DS3231_STAT_ALARM_1 0x01
|
||||
|
||||
#define DS3231_CTRL_OSCILLATOR 0x80
|
||||
#define DS3231_CTRL_SQUAREWAVE_BB 0x40
|
||||
#define DS3231_CTRL_TEMPCONV 0x20
|
||||
#define DS3231_CTRL_SQWAVE_4096HZ 0x10
|
||||
#define DS3231_CTRL_SQWAVE_1024HZ 0x08
|
||||
#define DS3231_CTRL_SQWAVE_8192HZ 0x18
|
||||
#define DS3231_CTRL_SQWAVE_1HZ 0x00
|
||||
#define DS3231_CTRL_ALARM_INTS 0x04
|
||||
#define DS3231_CTRL_ALARM2_INT 0x02
|
||||
#define DS3231_CTRL_ALARM1_INT 0x01
|
||||
#define DS3231_CTRL_OSCILLATOR 0x80
|
||||
#define DS3231_CTRL_SQUAREWAVE_BB 0x40
|
||||
#define DS3231_CTRL_TEMPCONV 0x20
|
||||
#define DS3231_CTRL_SQWAVE_4096HZ 0x10
|
||||
#define DS3231_CTRL_SQWAVE_1024HZ 0x08
|
||||
#define DS3231_CTRL_SQWAVE_8192HZ 0x18
|
||||
#define DS3231_CTRL_SQWAVE_1HZ 0x00
|
||||
#define DS3231_CTRL_ALARM_INTS 0x04
|
||||
#define DS3231_CTRL_ALARM2_INT 0x02
|
||||
#define DS3231_CTRL_ALARM1_INT 0x01
|
||||
|
||||
#define DS3231_ALARM_WDAY 0x40
|
||||
#define DS3231_ALARM_NOTSET 0x80
|
||||
#define DS3231_ALARM_WDAY 0x40
|
||||
#define DS3231_ALARM_NOTSET 0x80
|
||||
|
||||
#define DS3231_ADDR_TIME 0x00
|
||||
#define DS3231_ADDR_ALARM1 0x07
|
||||
#define DS3231_ADDR_ALARM2 0x0b
|
||||
#define DS3231_ADDR_CONTROL 0x0e
|
||||
#define DS3231_ADDR_STATUS 0x0f
|
||||
#define DS3231_ADDR_AGING 0x10
|
||||
#define DS3231_ADDR_TEMP 0x11
|
||||
#define DS3231_ADDR_TIME 0x00
|
||||
#define DS3231_ADDR_ALARM1 0x07
|
||||
#define DS3231_ADDR_ALARM2 0x0b
|
||||
#define DS3231_ADDR_CONTROL 0x0e
|
||||
#define DS3231_ADDR_STATUS 0x0f
|
||||
#define DS3231_ADDR_AGING 0x10
|
||||
#define DS3231_ADDR_TEMP 0x11
|
||||
|
||||
#define DS3231_12HOUR_FLAG 0x40
|
||||
#define DS3231_12HOUR_MASK 0x1f
|
||||
#define DS3231_PM_FLAG 0x20
|
||||
#define DS3231_MONTH_MASK 0x1f
|
||||
#define DS3231_12HOUR_FLAG 0x40
|
||||
#define DS3231_12HOUR_MASK 0x1f
|
||||
#define DS3231_PM_FLAG 0x20
|
||||
#define DS3231_MONTH_MASK 0x1f
|
||||
|
||||
enum {
|
||||
DS3231_SET = 0,
|
||||
|
@ -184,4 +188,8 @@ bool ds3231_getTempFloat(float *temp);
|
|||
bool ds3231_getTime(struct tm *time);
|
||||
void ds3231_Init(uint8_t scl, uint8_t sda);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __DS3231_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue