1.\" $OpenBSD: gpiodcf.4,v 1.5 2015/06/07 20:13:13 claudio 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: June 7 2015 $ 18.Dt GPIODCF 4 19.Os 20.Sh NAME 21.Nm gpiodcf 22.Nd DCF77 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 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.El 63.Pp 64The quality of the timedelta is reported as the sensor status: 65.Bl -tag -width "CRITICALXX" -offset indent 66.It UNKNOWN 67No valid time information has been received yet. 68.It OK 69The time information is valid and the timedelta is safe to use for 70applications like 71.Xr ntpd 8 . 72.It WARN 73The time information is still valid, but no new time information has been 74decoded for at least 5 minutes due to a reception or parity error. 75The timedelta should be used with care. 76.It CRITICAL 77No valid time information has been received for more than 15 minutes since 78the sensor state degraded from OK to WARN. 79This is an indication that hardware should be checked 80to see if it is still functional. 81The timedelta will eventually degrade to a lie 82as all computer internal clocks have a drift. 83.El 84.Sh SEE ALSO 85.Xr gpio 4 , 86.Xr intro 4 , 87.Xr ntpd 8 , 88.Xr sysctl 8 89.Sh HISTORY 90The 91.Nm 92driver first appeared in 93.Ox 4.5 . 94.Sh AUTHORS 95.An -nosplit 96The 97.Nm 98driver was written by 99.An Marc Balmer Aq Mt mbalmer@openbsd.org . 100