Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
rtc_ds3231.h File Reference

Go to the source code of this file.

Macros

#define DS3231_REG_TIME_SECONDS   0x00
 
#define DS3231_REG_TIME_MINUTES   0x01
 
#define DS3231_REG_TIME_HOURS   0x02
 
#define DS3231_REG_TIME_DAY_OF_WEEK   0x03
 
#define DS3231_REG_TIME_DATE   0x04
 
#define DS3231_REG_TIME_MONTH   0x05
 
#define DS3231_REG_TIME_YEAR   0x06
 
#define DS3231_REG_ALARM_1_SECONDS   0x07
 
#define DS3231_REG_ALARM_1_MINUTES   0x08
 
#define DS3231_REG_ALARM_1_HOURS   0x09
 
#define DS3231_REG_ALARM_1_DATE   0x0A
 
#define DS3231_REG_ALARM_2_MINUTES   0x0B
 
#define DS3231_REG_ALARM_2_HOURS   0x0C
 
#define DS3231_REG_ALARM_2_DATE   0x0D
 
#define DS3231_REG_CTRL   0x0E
 
#define DS3231_REG_CTRL_STS   0x0F
 
#define DS3231_REG_AGING_OFFSET   0x10
 
#define DS3231_BITS_TIME_SECONDS   GENMASK(6, 0)
 
#define DS3231_BITS_TIME_MINUTES   GENMASK(6, 0)
 
#define DS3231_BITS_TIME_HOURS   GENMASK(5, 0)
 
#define DS3231_BITS_TIME_PM   BIT(5)
 
#define DS3231_BITS_TIME_12HR   BIT(6)
 
#define DS3231_BITS_TIME_DAY_OF_WEEK   GENMASK(2, 0)
 
#define DS3231_BITS_TIME_DATE   GENMASK(5, 0)
 
#define DS3231_BITS_TIME_MONTH   GENMASK(4, 0)
 
#define DS3231_BITS_TIME_CENTURY   BIT(7)
 
#define DS3231_BITS_TIME_YEAR   GENMASK(7, 0)
 
#define DS3231_BITS_ALARM_RATE   BIT(7)
 
#define DS3231_BITS_ALARM_DATE_W_OR_M   BIT(6)
 
#define DS3231_BITS_SIGN   BIT(7)
 
#define DS3231_BITS_CTRL_EOSC   BIT(7) /* enable oscillator, active low */
 
#define DS3231_BITS_CTRL_BBSQW   BIT(6) /* enable battery-backed square-wave */
 
#define DS3231_BITS_CTRL_CONV   BIT(6)
 
#define DS3231_BITS_CTRL_RS2   BIT(4)
 
#define DS3231_BITS_CTRL_RS1   BIT(3)
 
#define DS3231_BITS_CTRL_INTCTRL   BIT(2)
 
#define DS3231_BITS_CTRL_ALARM_2_EN   BIT(1)
 
#define DS3231_BITS_CTRL_ALARM_1_EN   BIT(0)
 
#define DS3231_BITS_CTRL_STS_OSF   BIT(7) /* oscillator stop flag */ /* read only */
 
#define DS3231_BITS_CTRL_STS_32_EN   BIT(3) /* 32kHz square-wave */
 
#define DS3231_BITS_CTRL_STS_BSY   BIT(2)
 
#define DS3231_BITS_CTRL_STS_ALARM_2_FLAG   BIT(1) /* can only be set to 0 */
 
#define DS3231_BITS_CTRL_STS_ALARM_1_FLAG   BIT(0) /* can only be set to 0 */
 
#define DS3231_BITS_DATA   BIT(6, 0)
 
#define DS3231_BITS_STS_OSC   BIT(0)
 
#define DS3231_BITS_STS_INTCTRL   BIT(1)
 
#define DS3231_BITS_STS_SQW   BIT(2)
 
#define DS3231_BITS_STS_32KHZ   BIT(3)
 
#define DS3231_BITS_STS_ALARM_1   BIT(4)
 
#define DS3231_BITS_STS_ALARM_2   BIT(5)
 

Macro Definition Documentation

◆ DS3231_BITS_ALARM_DATE_W_OR_M

#define DS3231_BITS_ALARM_DATE_W_OR_M   BIT(6)

◆ DS3231_BITS_ALARM_RATE

#define DS3231_BITS_ALARM_RATE   BIT(7)

◆ DS3231_BITS_CTRL_ALARM_1_EN

#define DS3231_BITS_CTRL_ALARM_1_EN   BIT(0)

◆ DS3231_BITS_CTRL_ALARM_2_EN

#define DS3231_BITS_CTRL_ALARM_2_EN   BIT(1)

◆ DS3231_BITS_CTRL_BBSQW

#define DS3231_BITS_CTRL_BBSQW   BIT(6) /* enable battery-backed square-wave */

◆ DS3231_BITS_CTRL_CONV

#define DS3231_BITS_CTRL_CONV   BIT(6)

◆ DS3231_BITS_CTRL_EOSC

#define DS3231_BITS_CTRL_EOSC   BIT(7) /* enable oscillator, active low */

◆ DS3231_BITS_CTRL_INTCTRL

#define DS3231_BITS_CTRL_INTCTRL   BIT(2)

◆ DS3231_BITS_CTRL_RS1

#define DS3231_BITS_CTRL_RS1   BIT(3)

◆ DS3231_BITS_CTRL_RS2

#define DS3231_BITS_CTRL_RS2   BIT(4)

◆ DS3231_BITS_CTRL_STS_32_EN

#define DS3231_BITS_CTRL_STS_32_EN   BIT(3) /* 32kHz square-wave */

◆ DS3231_BITS_CTRL_STS_ALARM_1_FLAG

#define DS3231_BITS_CTRL_STS_ALARM_1_FLAG   BIT(0) /* can only be set to 0 */

◆ DS3231_BITS_CTRL_STS_ALARM_2_FLAG

#define DS3231_BITS_CTRL_STS_ALARM_2_FLAG   BIT(1) /* can only be set to 0 */

◆ DS3231_BITS_CTRL_STS_BSY

#define DS3231_BITS_CTRL_STS_BSY   BIT(2)

◆ DS3231_BITS_CTRL_STS_OSF

#define DS3231_BITS_CTRL_STS_OSF   BIT(7) /* oscillator stop flag */ /* read only */

◆ DS3231_BITS_DATA

#define DS3231_BITS_DATA   BIT(6, 0)

◆ DS3231_BITS_SIGN

#define DS3231_BITS_SIGN   BIT(7)

◆ DS3231_BITS_STS_32KHZ

#define DS3231_BITS_STS_32KHZ   BIT(3)

◆ DS3231_BITS_STS_ALARM_1

#define DS3231_BITS_STS_ALARM_1   BIT(4)

◆ DS3231_BITS_STS_ALARM_2

#define DS3231_BITS_STS_ALARM_2   BIT(5)

◆ DS3231_BITS_STS_INTCTRL

#define DS3231_BITS_STS_INTCTRL   BIT(1)

◆ DS3231_BITS_STS_OSC

#define DS3231_BITS_STS_OSC   BIT(0)

◆ DS3231_BITS_STS_SQW

#define DS3231_BITS_STS_SQW   BIT(2)

◆ DS3231_BITS_TIME_12HR

#define DS3231_BITS_TIME_12HR   BIT(6)

◆ DS3231_BITS_TIME_CENTURY

#define DS3231_BITS_TIME_CENTURY   BIT(7)

◆ DS3231_BITS_TIME_DATE

#define DS3231_BITS_TIME_DATE   GENMASK(5, 0)

◆ DS3231_BITS_TIME_DAY_OF_WEEK

#define DS3231_BITS_TIME_DAY_OF_WEEK   GENMASK(2, 0)

◆ DS3231_BITS_TIME_HOURS

#define DS3231_BITS_TIME_HOURS   GENMASK(5, 0)

◆ DS3231_BITS_TIME_MINUTES

#define DS3231_BITS_TIME_MINUTES   GENMASK(6, 0)

◆ DS3231_BITS_TIME_MONTH

#define DS3231_BITS_TIME_MONTH   GENMASK(4, 0)

◆ DS3231_BITS_TIME_PM

#define DS3231_BITS_TIME_PM   BIT(5)

◆ DS3231_BITS_TIME_SECONDS

#define DS3231_BITS_TIME_SECONDS   GENMASK(6, 0)

◆ DS3231_BITS_TIME_YEAR

#define DS3231_BITS_TIME_YEAR   GENMASK(7, 0)

◆ DS3231_REG_AGING_OFFSET

#define DS3231_REG_AGING_OFFSET   0x10

◆ DS3231_REG_ALARM_1_DATE

#define DS3231_REG_ALARM_1_DATE   0x0A

◆ DS3231_REG_ALARM_1_HOURS

#define DS3231_REG_ALARM_1_HOURS   0x09

◆ DS3231_REG_ALARM_1_MINUTES

#define DS3231_REG_ALARM_1_MINUTES   0x08

◆ DS3231_REG_ALARM_1_SECONDS

#define DS3231_REG_ALARM_1_SECONDS   0x07

◆ DS3231_REG_ALARM_2_DATE

#define DS3231_REG_ALARM_2_DATE   0x0D

◆ DS3231_REG_ALARM_2_HOURS

#define DS3231_REG_ALARM_2_HOURS   0x0C

◆ DS3231_REG_ALARM_2_MINUTES

#define DS3231_REG_ALARM_2_MINUTES   0x0B

◆ DS3231_REG_CTRL

#define DS3231_REG_CTRL   0x0E

◆ DS3231_REG_CTRL_STS

#define DS3231_REG_CTRL_STS   0x0F

◆ DS3231_REG_TIME_DATE

#define DS3231_REG_TIME_DATE   0x04

◆ DS3231_REG_TIME_DAY_OF_WEEK

#define DS3231_REG_TIME_DAY_OF_WEEK   0x03

◆ DS3231_REG_TIME_HOURS

#define DS3231_REG_TIME_HOURS   0x02

◆ DS3231_REG_TIME_MINUTES

#define DS3231_REG_TIME_MINUTES   0x01

◆ DS3231_REG_TIME_MONTH

#define DS3231_REG_TIME_MONTH   0x05

◆ DS3231_REG_TIME_SECONDS

#define DS3231_REG_TIME_SECONDS   0x00

◆ DS3231_REG_TIME_YEAR

#define DS3231_REG_TIME_YEAR   0x06