Add documentation for gpiopwm(4).

This commit is contained in:
mbalmer 2011-11-13 12:35:40 +00:00
parent d4bc0f70c1
commit c70f5944c6
3 changed files with 86 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1353 2011/11/05 22:55:23 christos Exp $ # $NetBSD: mi,v 1.1354 2011/11/13 12:35:40 mbalmer Exp $
# #
# Note: don't delete entries from here - mark them as "obsolete" instead. # Note: don't delete entries from here - mark them as "obsolete" instead.
# #
@ -1019,6 +1019,7 @@
./usr/share/man/cat4/gpioiic.0 man-sys-catman .cat ./usr/share/man/cat4/gpioiic.0 man-sys-catman .cat
./usr/share/man/cat4/gpiolock.0 man-sys-catman .cat ./usr/share/man/cat4/gpiolock.0 man-sys-catman .cat
./usr/share/man/cat4/gpioow.0 man-sys-catman .cat ./usr/share/man/cat4/gpioow.0 man-sys-catman .cat
./usr/share/man/cat4/gpiopwm.0 man-sys-catman .cat
./usr/share/man/cat4/gpiosim.0 man-sys-catman .cat ./usr/share/man/cat4/gpiosim.0 man-sys-catman .cat
./usr/share/man/cat4/gre.0 man-sys-catman .cat ./usr/share/man/cat4/gre.0 man-sys-catman .cat
./usr/share/man/cat4/gsip.0 man-sys-catman .cat ./usr/share/man/cat4/gsip.0 man-sys-catman .cat
@ -3858,6 +3859,7 @@
./usr/share/man/html4/gpioiic.html man-sys-htmlman html ./usr/share/man/html4/gpioiic.html man-sys-htmlman html
./usr/share/man/html4/gpiolock.html man-sys-htmlman html ./usr/share/man/html4/gpiolock.html man-sys-htmlman html
./usr/share/man/html4/gpioow.html man-sys-htmlman html ./usr/share/man/html4/gpioow.html man-sys-htmlman html
./usr/share/man/html4/gpiopwm.html man-sys-htmlman html
./usr/share/man/html4/gpiosim.html man-sys-htmlman html ./usr/share/man/html4/gpiosim.html man-sys-htmlman html
./usr/share/man/html4/gre.html man-sys-htmlman html ./usr/share/man/html4/gre.html man-sys-htmlman html
./usr/share/man/html4/gsip.html man-sys-htmlman html ./usr/share/man/html4/gsip.html man-sys-htmlman html
@ -6474,6 +6476,7 @@
./usr/share/man/man4/gpioiic.4 man-sys-man .man ./usr/share/man/man4/gpioiic.4 man-sys-man .man
./usr/share/man/man4/gpiolock.4 man-sys-man .man ./usr/share/man/man4/gpiolock.4 man-sys-man .man
./usr/share/man/man4/gpioow.4 man-sys-man .man ./usr/share/man/man4/gpioow.4 man-sys-man .man
./usr/share/man/man4/gpiopwm.4 man-sys-man .man
./usr/share/man/man4/gpiosim.4 man-sys-man .man ./usr/share/man/man4/gpiosim.4 man-sys-man .man
./usr/share/man/man4/gre.4 man-sys-man .man ./usr/share/man/man4/gre.4 man-sys-man .man
./usr/share/man/man4/gsip.4 man-sys-man .man ./usr/share/man/man4/gsip.4 man-sys-man .man

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.573 2011/11/05 09:22:44 hannken Exp $ # $NetBSD: Makefile,v 1.574 2011/11/13 12:35:40 mbalmer Exp $
# @(#)Makefile 8.1 (Berkeley) 6/18/93 # @(#)Makefile 8.1 (Berkeley) 6/18/93
MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \ MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@ -26,7 +26,8 @@ MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
esa.4 esiop.4 esm.4 eso.4 et.4 etherip.4 etphy.4 exphy.4 \ esa.4 esiop.4 esm.4 eso.4 et.4 etherip.4 etphy.4 exphy.4 \
fast_ipsec.4 fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 fujbp.4 fxp.4 \ fast_ipsec.4 fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 fujbp.4 fxp.4 \
gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \ gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiosim.4 gre.4 gphyter.4 gsip.4 \ glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiopwm.4 gpiosim.4 gre.4 \
gphyter.4 gsip.4 \
hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 \ hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 \
ibmhawk.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 ieee80211.4 \ ibmhawk.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 ieee80211.4 \
ifmedia.4 igphy.4 igsfb.4 iha.4 ihphy.4 iic.4 inet.4 ikphy.4 inphy.4 \ ifmedia.4 igphy.4 igsfb.4 iha.4 ihphy.4 iic.4 inet.4 ikphy.4 inphy.4 \

79
share/man/man4/gpiopwm.4 Normal file
View File

@ -0,0 +1,79 @@
.\" $NetBSD: gpiopwm.4,v 1.1 2011/11/13 12:35:40 mbalmer Exp $
.\"
.\" Copyright (c) 2011 Marc Balmer <marc@msys.ch>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd Novemner 13, 2011
.Dt GPIOPWM 4
.Os
.Sh NAME
.Nm gpiopwm
.Nd support for pulsing GPIO pins in software
.Sh SYNOPSIS
.Cd "gpiopwm* at gpio? offset ? mask 1"
.Cd "gpiopwm* at gpio?"
.Sh DESCRIPTION
The
.Nm
driver allows for pulsing GPIO pins in software using the
.Xr callout 9
facility.
The pulse frequency and duty cycle are specified indirectly by setting an 'on'
and 'off' period, in ticks.
Both values are accessible as
.Xr sysctl 2
variables.
.Sh SYSCTL VARIABLES
The following
.Xr sysctl 2
variables are used to define the pulsing:
.Bl -tag width
.It hw.gpiopwmN.off
Define the 'off' period in ticks.
.It hw.gpiopwmN.on
Define the 'on' period in ticks.
.El
.Pp
Only when both the 'on' and the 'off' period are set to values higher than
zero pulsing will start.
To stop the pulsing, set either value to zero.
.Sh EXAMPLES
To pulse a pin on a machine with 100 ticks/second with a frequency of 1Hz and a
duty cycle of 20%, the 'on' period must be set to 20 and the 'off' perdiod
must be set to 80.
The following example will pulse the error LED of a Soekris net4801
with a frequency of 1 Hz and a duty cycle of 20%:
.Bd -literal
# gpioctl gpio0 20 set pp
# gpioctl gpio0 attach gpiopwm 20 1
# sysctl -w hw.gpiopwm0.off=80
# sysctl -w hw.gpiopwm0.on=20
.Ed
.Sh SEE ALSO
.Xr gpio 4 ,
.Xr gpioattach 4 ,
.Xr gpioctl 8 ,
.Xr sysctl 8 ,
.Xr intro 4
.Sh HISTORY
The
.Nm
driver first appeared in
.Nx 6.0 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was written by
.An Marc Balmer Aq marc@msys.ch .