Loading...
Searching...
No Matches
ds1307_internal.h File Reference

Register definitions for DS1307 RTC. More...

Detailed Description

Register definitions for DS1307 RTC.

Author
Martine Lenders m.len.nosp@m.ders.nosp@m.@fu-b.nosp@m.erli.nosp@m.n.de

Definition in file ds1307_internal.h.

Go to the source code of this file.

Registers

#define DS1307_REG_SEC   (0x00)
 seconds
 
#define DS1307_REG_MIN   (0x01)
 minutes
 
#define DS1307_REG_HOUR   (0x02)
 hours
 
#define DS1307_REG_DOW   (0x03)
 day of week (1-7, 1 == sunday)
 
#define DS1307_REG_DOM   (0x04)
 day of month
 
#define DS1307_REG_MON   (0x05)
 month
 
#define DS1307_REG_YEAR   (0x06)
 year
 
#define DS1307_REG_SQW_CTL   (0x07)
 SQW control.
 
#define DS1307_REG_RAM_FIRST   (0x08)
 NVRAM start.
 
#define DS1307_REG_RAM_LAST   (0x3F)
 NVRAM end.
 

Register bits

#define DS1307_REG_SEC_CH   (0x80)
 clock halt bit
 
#define DS1307_REG_SEC_MASK   (0x7f)
 seconds mask
 
#define DS1307_REG_MIN_MASK   (0x7f)
 minutes mask
 
#define DS1307_REG_HOUR_12H   (0x40)
 12-hour (0) / 24-hour (1) mode
 
#define DS1307_REG_HOUR_PM   (0x20)
 AM (0) / PM (1) in 12-hour mode.
 
#define DS1307_REG_HOUR_12H_MASK   (0x2f)
 hour (12-hour mode)
 
#define DS1307_REG_HOUR_24H_MASK   (0x3f)
 hour (24-hour mode)
 
#define DS1307_REG_DOW_MASK   (0x07)
 day of week mask
 
#define DS1307_REG_DOM_MASK   (0x3f)
 day of month mask
 
#define DS1307_REG_MON_MASK   (0x1f)
 month mask
 

Custom offsets (to DS1307 registers to struct tm)

#define DS1307_DOW_OFFSET   (1)
 offset in days from sunday
 
#define DS1307_MON_OFFSET   (1)
 offset in month from January
 
#define DS1307_YEAR_OFFSET   (-100)
 offset in years from 1900
 

Macro Definition Documentation

◆ DS1307_DOW_OFFSET

#define DS1307_DOW_OFFSET   (1)

offset in days from sunday

Definition at line 62 of file ds1307_internal.h.

◆ DS1307_MON_OFFSET

#define DS1307_MON_OFFSET   (1)

offset in month from January

Definition at line 63 of file ds1307_internal.h.

◆ DS1307_REG_DOM

#define DS1307_REG_DOM   (0x04)

day of month

Definition at line 34 of file ds1307_internal.h.

◆ DS1307_REG_DOM_MASK

#define DS1307_REG_DOM_MASK   (0x3f)

day of month mask

Definition at line 54 of file ds1307_internal.h.

◆ DS1307_REG_DOW

#define DS1307_REG_DOW   (0x03)

day of week (1-7, 1 == sunday)

Definition at line 33 of file ds1307_internal.h.

◆ DS1307_REG_DOW_MASK

#define DS1307_REG_DOW_MASK   (0x07)

day of week mask

Definition at line 53 of file ds1307_internal.h.

◆ DS1307_REG_HOUR

#define DS1307_REG_HOUR   (0x02)

hours

Definition at line 32 of file ds1307_internal.h.

◆ DS1307_REG_HOUR_12H

#define DS1307_REG_HOUR_12H   (0x40)

12-hour (0) / 24-hour (1) mode

Definition at line 49 of file ds1307_internal.h.

◆ DS1307_REG_HOUR_12H_MASK

#define DS1307_REG_HOUR_12H_MASK   (0x2f)

hour (12-hour mode)

Definition at line 51 of file ds1307_internal.h.

◆ DS1307_REG_HOUR_24H_MASK

#define DS1307_REG_HOUR_24H_MASK   (0x3f)

hour (24-hour mode)

Definition at line 52 of file ds1307_internal.h.

◆ DS1307_REG_HOUR_PM

#define DS1307_REG_HOUR_PM   (0x20)

AM (0) / PM (1) in 12-hour mode.

Definition at line 50 of file ds1307_internal.h.

◆ DS1307_REG_MIN

#define DS1307_REG_MIN   (0x01)

minutes

Definition at line 31 of file ds1307_internal.h.

◆ DS1307_REG_MIN_MASK

#define DS1307_REG_MIN_MASK   (0x7f)

minutes mask

Definition at line 48 of file ds1307_internal.h.

◆ DS1307_REG_MON

#define DS1307_REG_MON   (0x05)

month

Definition at line 35 of file ds1307_internal.h.

◆ DS1307_REG_MON_MASK

#define DS1307_REG_MON_MASK   (0x1f)

month mask

Definition at line 55 of file ds1307_internal.h.

◆ DS1307_REG_RAM_FIRST

#define DS1307_REG_RAM_FIRST   (0x08)

NVRAM start.

Definition at line 38 of file ds1307_internal.h.

◆ DS1307_REG_RAM_LAST

#define DS1307_REG_RAM_LAST   (0x3F)

NVRAM end.

Definition at line 39 of file ds1307_internal.h.

◆ DS1307_REG_SEC

#define DS1307_REG_SEC   (0x00)

seconds

Definition at line 30 of file ds1307_internal.h.

◆ DS1307_REG_SEC_CH

#define DS1307_REG_SEC_CH   (0x80)

clock halt bit

Definition at line 46 of file ds1307_internal.h.

◆ DS1307_REG_SEC_MASK

#define DS1307_REG_SEC_MASK   (0x7f)

seconds mask

Definition at line 47 of file ds1307_internal.h.

◆ DS1307_REG_SQW_CTL

#define DS1307_REG_SQW_CTL   (0x07)

SQW control.

Definition at line 37 of file ds1307_internal.h.

◆ DS1307_REG_YEAR

#define DS1307_REG_YEAR   (0x06)

year

Definition at line 36 of file ds1307_internal.h.

◆ DS1307_YEAR_OFFSET

#define DS1307_YEAR_OFFSET   (-100)

offset in years from 1900

Definition at line 64 of file ds1307_internal.h.