aboutsummaryrefslogtreecommitdiff
path: root/lib/libgpio
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2015-07-01 09:25:23 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2015-07-01 09:25:23 +0000
commitb28dfe657021ab64a246f27b37da85f2679e33b3 (patch)
treea754109694d80f626a0914e894177ae0e0da5e7a /lib/libgpio
parent4079836c5e531160cff0bf73ff8d0da7e7ead357 (diff)
downloadsrc-b28dfe657021ab64a246f27b37da85f2679e33b3.tar.gz
src-b28dfe657021ab64a246f27b37da85f2679e33b3.zip
Make the example code actually work.
PR: 199440 Submitted by: waitman@waitman.net Reviewed by: loos MFC after: 1 week
Notes
Notes: svn path=/head/; revision=284997
Diffstat (limited to 'lib/libgpio')
-rw-r--r--lib/libgpio/gpio.34
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libgpio/gpio.3 b/lib/libgpio/gpio.3
index 70f6b38c0622..27925f09108d 100644
--- a/lib/libgpio/gpio.3
+++ b/lib/libgpio/gpio.3
@@ -35,6 +35,7 @@
.Sh LIBRARY
.Lb libgpio
.Sh SYNOPSIS
+.In sys/types.h
.In libgpio.h
.Ft "gpio_handle_t"
.Fn gpio_open "unsigned int unit"
@@ -161,13 +162,14 @@ are wrappers around
The following example shows how to configure pin 16 as output and then
drive it high:
.Bd -literal
+#include <sys/types.h>
#include <err.h>
#include <libgpio.h>
gpio_handle_t handle;
handle = gpio_open(0);
-if (handle == GPIO_HANDLE_INVALID)
+if (handle == GPIO_INVALID_HANDLE)
err(1, "gpio_open failed");
gpio_pin_output(handle, 16);
gpio_pin_high(handle, 16);