DS1307(4)
π DS1307 π
okay bestie, so this is from the Kernel Interfaces Manual section (iykyk) and it's literally all about the ds1307 β a 64 x 8, serial, i2c real-time clock. she's tiny, she keeps time, she's iconic. let's get into it πβ¨
β¨ NAME β¨
ds1307 β 64 x 8, serial, i2c real-time clock π
πΈ SYNOPSIS πΈ
so to even have her in your kernel you need these three lines, no cap:
device iic
device iicbus
device ds1307
π DESCRIPTION π
okay so the ds1307 serial real-time clock (RTC) is a low-power, full binary-coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. yes girl, clock AND storage. multitasking queen. π
she's also got a built-in power-sense circuit that detects power failures and automatically switches to the backup supply. and the timekeeping? doesn't even stop. she keeps ticking while she's running off the backup supply. main character energy fr fr. π¦
access to ds1307 settings is made with the sysctl(8) interface:
dev.ds1307.0.%desc: Maxim DS1307 RTC
dev.ds1307.0.%driver: ds1307
dev.ds1307.0.%location: addr=0xd0
dev.ds1307.0.%pnpinfo: name=rtc compat=maxim,ds1307
dev.ds1307.0.%parent: iicbus1
dev.ds1307.0.sqwe: 1
dev.ds1307.0.sqw_freq: 32768
dev.ds1307.0.sqw_out: 0
look at her. so organized. π
dev.ds1307.%d.sqweβ if you set this to1, the SQW pin drives a square-wave ofdev.ds1307.%d.sqw_freqfrequency. if you set it to0, then the output level of the SQW pin is controlled bydev.ds1307.%d.sqw_outinstead. pick your fighter bestie β‘dev.ds1307.%d.sqw_freqβ this one selects the frequency of the SQW pin when the square-wave output is enabled ondev.ds1307.%d.sqwe. it can be set to1,4096,8192and32768. that's the whole menu, don't try to be cute with other numbers πdev.ds1307.%d.sqw_outβ sets the output level of the SQW pin whendev.ds1307.%d.sqweis set to0. that's it, that's her job. π
please check the ds1307 datasheet for more details. (yes girl, read the datasheet, it's giving homework but it's worth it π)
π§ device.hints(5) vibes π§
on a device.hints(5) based system, such as MIPS, these values are configurable for ds1307:
hint.ds1307.%d.atβ theiicbus(4)that theds1307is connected to. πhint.ds1307.%d.addrβ the i2c address ofds1307. π
π FDT(4) vibes π
on a FDT(4) based system the following properties must be set:
compatibleβ must always be set to"dallas,ds1307"or"maxim,ds1307". no other options bestie, these are the only two she answers to. πregβ the i2c address ofds1307. the default address fords1307is0xd0. remember it, love it, use it. β¨
π₯ SEE ALSO π₯
fdt(4), iic(4), iicbus(4), sysctl(8)
go read them, they're all part of the friend group π«Ά
π HISTORY π
the ds1307 driver first appeared in FreeBSD 11.0. a legend since day one, periodt. π
π AUTHORS π
the ds1307 driver and this manual page were written by Luiz Otavio O Souza <loos@FreeBSD.org>. thank you for your service king π«‘π
and that's the whole page bestie!! this version came from Debian and it's dated March 7, 2015, filed under DS1307(4). slay, go forth and keep time β°β¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2015 Luiz Otavio O Souza <loos@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms