Skip to content

Commit aa0f0df

Browse files
authored
Merge pull request #19 from jepler/calibration-registers
PCF8523: Add additional registers
2 parents 25c1e8b + 31e6648 commit aa0f0df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

adafruit_pcf8523.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ class PCF8523:
101101
battery_low = i2c_bit.ROBit(0x02, 2)
102102
"""True if the battery is low and should be replaced."""
103103

104+
high_capacitance = i2c_bit.RWBit(0x00, 7)
105+
"""True for high oscillator capacitance (12.5pF), otherwise lower (7pF)"""
106+
107+
calibration_schedule_per_minute = i2c_bit.RWBit(0x0E, 7)
108+
"""False to apply the calibration offset every 2 hours (1 LSB = 4.340ppm);
109+
True to offset every minute (1 LSB = 4.069ppm). The default, False,
110+
consumes less power. See datasheet figures 28-31 for details."""
111+
112+
calibration = i2c_bits.RWBits(7, 0xE, 0, signed=True)
113+
"""Calibration offset to apply, from -64 to +63. See the PCF8523 datasheet
114+
figure 18 for the offset calibration calculation workflow."""
115+
104116
def __init__(self, i2c_bus):
105117
self.i2c_device = I2CDevice(i2c_bus, 0x68)
106118

0 commit comments

Comments
 (0)