xref: /netbsd-src/share/man/man5/gpio.conf.5 (revision 84213c7105cbf0d9881d2995b5f025e657685380)
1*84213c71Sbrad.\"        $NetBSD: gpio.conf.5,v 1.3 2022/04/30 13:48:09 brad Exp $
270d654f7Smbalmer.\"
370d654f7Smbalmer.\" Copyright (c) 2009 Marc Balmer <marc@msys.ch>
470d654f7Smbalmer.\" All rights reserved.
570d654f7Smbalmer.\"
670d654f7Smbalmer.\" Redistribution and use in source and binary forms, with or without
770d654f7Smbalmer.\" modification, are permitted provided that the following conditions
870d654f7Smbalmer.\" are met:
970d654f7Smbalmer.\" 1. Redistributions of source code must retain the above copyright
1070d654f7Smbalmer.\"    notice, this list of conditions and the following disclaimer.
1170d654f7Smbalmer.\" 2. Redistributions in binary form must reproduce the above copyright
1270d654f7Smbalmer.\"    notice, this list of conditions and the following disclaimer in the
1370d654f7Smbalmer.\"    documentation and/or other materials provided with the distribution.
1470d654f7Smbalmer.\"
1570d654f7Smbalmer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1670d654f7Smbalmer.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1770d654f7Smbalmer.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1870d654f7Smbalmer.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1970d654f7Smbalmer.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2070d654f7Smbalmer.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2170d654f7Smbalmer.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2270d654f7Smbalmer.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2370d654f7Smbalmer.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2470d654f7Smbalmer.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2570d654f7Smbalmer.\"
26b0979f18Smbalmer.Dd August 1, 2009
2770d654f7Smbalmer.Dt GPIO.CONF 5
2870d654f7Smbalmer.Os
2970d654f7Smbalmer.Sh NAME
3070d654f7Smbalmer.Nm gpio.conf
3170d654f7Smbalmer.Nd GPIO config file
3270d654f7Smbalmer.Sh DESCRIPTION
3370d654f7SmbalmerThe
3470d654f7Smbalmer.Nm
3570d654f7Smbalmerfile is read by the
3670d654f7Smbalmer.Pa gpio
3770d654f7Smbalmerrc.d script during system start-up and shutdown,
3870d654f7Smbalmerand is intended for configuring GPIO pins.
3970d654f7Smbalmer.Ss FILE FORMAT
4070d654f7SmbalmerLines starting with a hash
4170d654f7Smbalmer.Pq Sq #
4270d654f7Smbalmerand empty lines are ignored.
43*84213c71SbradIf a line starts with
44*84213c71Sbrad.Sq \&! ,
45*84213c71Sbradthe rest of line will get evaluated as shell script fragment.
4670d654f7SmbalmerAll other lines are passed to
4770d654f7Smbalmer.Xr gpioctl 8 .
4870d654f7Smbalmer.Sh FILES
4970d654f7Smbalmer.Bl -tag -width XXetcXgpioXconfXX
5070d654f7Smbalmer.It Pa /etc/gpio.conf
5170d654f7SmbalmerThe
5270d654f7Smbalmer.Nm
5370d654f7Smbalmerconfiguration file resides in
5470d654f7Smbalmer.Pa /etc .
5570d654f7Smbalmer.It Pa /etc/rc.d/gpio
5670d654f7Smbalmer.Xr rc.d 8
5770d654f7Smbalmerscript that parses
5870d654f7Smbalmer.Nm .
5970d654f7Smbalmer.El
6070d654f7Smbalmer.Sh EXAMPLES
6170d654f7SmbalmerIn this example, if the
6270d654f7Smbalmer.Pa /etc/gpio.conf
6370d654f7Smbalmerconfig file is present pin 1 of
6470d654f7Smbalmer.Pa /dev/gpio0
6570d654f7Smbalmeris set as output and named "error_led".
6670d654f7Smbalmer.Bd -literal -offset indent
6770d654f7Smbalmer# Program pin 1 of /dev/gpio0 as output and name it "error_led"
68b0979f18Smbalmergpio0 1 set out error_led
6970d654f7Smbalmer.Ed
7070d654f7Smbalmer.Sh SEE ALSO
7170d654f7Smbalmer.Xr gpioctl 8 ,
7270d654f7Smbalmer.Xr rc 8
73