DS3231(4)
π DS3231(4) π
ok so this is a kernel interfaces manual page, and it's literally about the ds3231 β an extremely accurate i2c-integrated real-time clock (RTC)/TCXO/Crystal. yes that's the whole name, she's got a long government name and she slays π
β¨ NAME β¨
ds3231 β Extremely Accurate i2c-integrated real-time clock (RTC)/TCXO/Crystal π
πΈ SYNOPSIS πΈ
device iic
device iicbus
device ds3231
like, that's it. three lines. add these to your kernel config and you're so back bestie π
π¦ DESCRIPTION π¦
The ds3231 is a low-cost, extremely accurate I2C realtime clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. low-cost AND extremely accurate?? it's giving overachiever, and honestly? we love that for her π
The device incorporates a battery input and maintains accurate timekeeping when main power to the device is interrupted. so when the power dips, she's still keeping time. main character energy fr fr π«Ά
Access to ds3231 data is made with the sysctl(8) interface:
dev.ds3231.0.%desc: Maxim DS3231 RTC
dev.ds3231.0.%driver: ds3231
dev.ds3231.0.%location: addr=0xd0
dev.ds3231.0.%pnpinfo: name=rtc compat=maxim,ds3231
dev.ds3231.0.%parent: iicbus1
dev.ds3231.0.temperature: 23.2C
dev.ds3231.0.temp_conv: 0
dev.ds3231.0.bbsqw: 0
dev.ds3231.0.sqw_freq: 8192
dev.ds3231.0.sqw_mode: interrupt
dev.ds3231.0.32khz_enable: 1
look at all those knobs, she's got OPTIONS πβ¨
dev.ds3231.%d.temperatureβ The read-only value of the current temperature read by the RTC. read-only bestie, you can look but you cannot touch πdev.ds3231.%d.temp_convβ Start a new temperature conversion. When read as 1, a temperature conversion is in progress. When read as 0 and then set to 1, a temperature conversion is started. The temperature conversion runs automatically on power up and once every 64 seconds afterward. she's doing conversions in the background without even being asked, iconic behaviour honestly π§dev.ds3231.%d.bbsqwβ If set to 1 anddev.ds3231.%d.sqw_modeis set to square-wave, battery-backed square-wave output is enabled. If set to 0, the SQW pin will be set to high impendance when the RTC is being powered by battery. (yes, "impendance" β I'm quoting her, don't come for me π)dev.ds3231.%d.sqw_freqβ Select the frequency of the SQW pin when the square-wave output is enabled ondev.ds3231.%d.sqw_mode. It can be set to 1, 1024, 4096, and 8192. pick your vibe, bestie βdev.ds3231.%d.sqw_modeβ Set the operation mode for the SQW pin. It can be set to'interrupt'(default) or'square-wave'. In interrupt mode, the SQW pin is used to generate interrupts for the RTC alarms. In square-wave mode, the SQW pin drives a square-wave ofdev.ds3231.%d.sqw_freqfrequency. two modes, both valid, both slaying πdev.ds3231.%d.32khz_enableβ Enable the 32kHz output. turn it on and let her sing π΅
Please check the ds3231 datasheet for more details. (she's got lore, go read it π)
π On a device.hints(5) based system π
On a device.hints(5) based system, such as MIPS, these values are configurable for ds3231:
hint.ds3231.%d.atβ Theiicbus(4)that theds3231is connected to. where does she live? right here, on this bus πhint.ds3231.%d.addrβ The 8-bit i2c address ofds3231. The default 8-bit address fords3231is0xd0. that's her 8-bit government address, no cap π
π On a FDT(4) based system π
On a FDT(4) based system the following properties must be set:
compatibleβ Must always be set to"maxim,ds3231". always. no negotiating. periodt β¨regβ The 7-bit i2c address ofds3231. The default 7-bit address fords3231is0x68. different system, different address, same queen π
π₯ SEE ALSO π₯
fdt(4), iic(4), iicbus(4), sysctl(8)
go read those too, bestie, they're all connected iykyk π¦
π HISTORY π
The ds3231 driver first appeared in FreeBSD 11.0. she's been here since 11.0 and she's still accurate af β°
π AUTHORS π
The ds3231 driver and this manual page were written by Luiz Otavio O Souza <loos@FreeBSD.org>. thank you king, the timekeeping would NOT be this accurate without you π«Άπ
okay that's the whole page!! and for the little sign-off: this beauty came out of Debian, dated December 10, 2024, and it's the DS3231(4) page β remember her name, she's accurate forever β±οΈβ¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms