]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/ds1307.4
disk(9): Fix a few mandoc related errors
[FreeBSD/FreeBSD.git] / share / man / man4 / ds1307.4
1 .\"
2 .\" Copyright (c) 2015 Luiz Otavio O Souza <loos@freebsd.org>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd March 7, 2015
28 .Dt DS1307 4
29 .Os
30 .Sh NAME
31 .Nm ds1307
32 .Nd 64 x 8, serial, i2c real-time clock
33 .Sh SYNOPSIS
34 .Cd "device iic"
35 .Cd "device iicbus"
36 .Cd "device ds1307"
37 .Sh DESCRIPTION
38 The
39 .Nm
40 serial real-time clock (RTC) is a low-power, full binary-coded decimal (BCD)
41 clock/calendar plus 56 bytes of NV SRAM.
42 .Pp
43 The
44 .Nm
45 has a built-in power-sense circuit that detects power failures and
46 automatically switches to the backup supply.
47 Timekeeping operation continues while the part operates from the backup supply.
48 .Pp
49 Access to
50 .Nm
51 settings is made with the
52 .Xr sysctl 8
53 interface:
54 .Bd -literal
55 dev.ds1307.0.%desc: Maxim DS1307 RTC
56 dev.ds1307.0.%driver: ds1307
57 dev.ds1307.0.%location: addr=0xd0
58 dev.ds1307.0.%pnpinfo: name=rtc compat=maxim,ds1307
59 dev.ds1307.0.%parent: iicbus1
60 dev.ds1307.0.sqwe: 1
61 dev.ds1307.0.sqw_freq: 32768
62 dev.ds1307.0.sqw_out: 0
63 .Ed
64 .Bl -tag -width ".Va dev.ds1307.%d.sqw_freq"
65 .It Va dev.ds1307.%d.sqwe
66 If set to 1, the SQW pin drives a square-wave of
67 .Va dev.ds1307.%d.sqw_freq
68 frequency.
69 If set to 0, the output level of SQW pin is controlled by
70 .Va dev.ds1307.%d.sqw_out .
71 .It Va dev.ds1307.%d.sqw_freq
72 Select the frequency of the SQW pin when the square-wave output is enabled on
73 .Va dev.ds1307.%d.sqwe .
74 It can be set to 1, 4096, 8192 and 32768.
75 .It Va dev.ds1307.%d.sqw_out
76 Set the output level of the SQW pin when
77 .Va dev.ds1307.%d.sqwe
78 is set to 0.
79 .El
80 .Pp
81 Please check the
82 .Nm
83 datasheet for more details.
84 .Pp
85 On a
86 .Xr device.hints 5
87 based system, such as
88 .Li MIPS ,
89 these values are configurable for
90 .Nm :
91 .Bl -tag -width ".Va hint.ds1307.%d.addr"
92 .It Va hint.ds1307.%d.at
93 The
94 .Xr iicbus 4
95 that the
96 .Nm
97 is connected to.
98 .It Va hint.ds1307.%d.addr
99 The i2c address of
100 .Nm .
101 .El
102 .Pp
103 On a
104 .Xr FDT 4
105 based system the following properties must be set:
106 .Bl -tag -width ".Va compatible"
107 .It Va compatible
108 Must always be set to "dallas,ds1307" or "maxim,ds1307".
109 .It Va reg
110 The i2c address of
111 .Nm .
112 The default address for
113 .Nm
114 is 0xd0.
115 .El
116 .Sh SEE ALSO
117 .Xr fdt 4 ,
118 .Xr iic 4 ,
119 .Xr iicbus 4 ,
120 .Xr sysctl 8
121 .Sh HISTORY
122 The
123 .Nm
124 driver first appeared in
125 .Fx 11.0 .
126 .Sh AUTHORS
127 .An -nosplit
128 The
129 .Nm
130 driver and this manual page were written by
131 .An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org .