xref: /netbsd-src/share/man/man4/gpiosim.4 (revision 2b390b836b1b32e0f581df39db6493bcc2bbf85f)
1.\" $NetBSD: gpiosim.4,v 1.8 2023/11/24 15:13:35 brad Exp $
2.\"
3.\" Copyright (c) 2009, 2013 Marc Balmer <marc@msys.ch>
4.\" All rights reserved.
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd November 8, 2013
19.Dt GPIOSIM 4
20.Os
21.Sh NAME
22.Nm gpiosim
23.Nd General Purpose Input/Output Simulator
24.Sh SYNOPSIS
25.Cd "pseudo-device gpiosim"
26.Sh DESCRIPTION
27The
28.Nm
29pseudo-device simulates a 64-bit wide
30.Xr gpio 4
31device.
32The state of the simulated device can be manipulated through the
33.Xr sysctl 8
34interface.
35For this purpose, access the "hw.gpiosim<N>.value"
36.Xr sysctl 8
37variable, where "<N>" denotes the number of the
38.Nm
39instance.
40.Pp
41Both edge and level interrupts are simulated.
42The "hw.gpiosim<N>.ms"
43.Xr sysctl 8
44variable will change the amount of time between
45.Xr callout 9
46ticks for simulated level interrupts.
47.Sh SEE ALSO
48.Xr gpio 4 ,
49.Xr gpioirq 4 ,
50.Xr sysctl 8
51.Sh AUTHORS
52.An -nosplit
53The
54.Nm
55driver was written by
56.An Marc Balmer Aq Mt marc@msys.ch
57Simulated interrupts added by
58.An Brad Spencer Aq Mt brad@anduin.eldar.org .
59