xref: /openbsd/share/man/man4/gpiodcf.4 (revision 404b540a)
1.\"	$OpenBSD: gpiodcf.4,v 1.3 2008/11/29 01:44:20 mbalmer Exp $
2.\"
3.\" Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 29 2008 $
18.Dt GPIODCF 4
19.Os
20.Sh NAME
21.Nm gpiodcf
22.Nd DCF77/HBG timedelta sensor through GPIO pin
23.Sh SYNOPSIS
24.Cd "gpiodcf* at gpio? offset 0 mask 0x1"
25.Cd "gpiodcf* at gpio?"
26.Sh DESCRIPTION
27The
28.Nm
29driver decodes the DCF77 or HBG time signal code using one GPIO pin.
30The pin is used as a data signal.
31The GPIO pin must be able to read an input.
32.Pp
33The pin number can be specified in the kernel configuration with the
34.Ar offset
35locator.
36The
37.Ar mask
38locator should always be 0x1 in this case.
39The
40.Ar offset
41and
42.Ar mask
43can also be specified when
44.Nm
45is attached at runtime using the
46.Dv GPIOATTACH
47.Xr ioctl 2
48on the
49.Xr gpio 4
50device.
51.Pp
52.Nm
53implements a timedelta sensor and the delta (in nanoseconds) between the
54received time information and the local time can be accessed through the
55.Xr sysctl 8
56interface.
57The clock type is indicated in the sensor description:
58.Bl -tag -width "CRITICALXX" -offset indent
59.It DCF77
60German DCF77 time signal station
61(77.5 kHz longwave transmitter located in Mainflingen near Frankfurt).
62.It HBG
63Swiss HBG time signal station
64(75 kHz longwave transmitter located in Prangins near Geneva).
65.It Unknown
66The clock type has not been determined.
67.El
68.Pp
69The quality of the timedelta is reported as the sensor status:
70.Bl -tag -width "CRITICALXX" -offset indent
71.It UNKNOWN
72No valid time information has been received yet.
73.It OK
74The time information is valid and the timedelta is safe to use for
75applications like
76.Xr ntpd 8 .
77.It WARN
78The time information is still valid, but no new time information has been
79decoded for at least 5 minutes due to a reception or parity error.
80The timedelta should be used with care.
81.It CRITICAL
82No valid time information has been received for more than 15 minutes since
83the sensor state degraded from OK to WARN.
84This is an indication that hardware should be checked
85to see if it is still functional.
86The timedelta will eventually degrade to a lie
87as all computer internal clocks have a drift.
88.El
89.Sh SEE ALSO
90.Xr gpio 4 ,
91.Xr intro 4 ,
92.Xr ntpd 8 ,
93.Xr sysctl 8
94.Sh HISTORY
95The
96.Nm
97driver first appeared in
98.Ox 4.5 .
99.Sh AUTHORS
100.An -nosplit
101The
102.Nm
103driver was written by
104.An Marc Balmer Aq mbalmer@openbsd.org .
105