Bartosz Golaszewski [Mon, 27 Feb 2017 11:46:52 +0000 (12:46 +0100)]
tests: remove unnecessary goto
Check all loop conditions in a single if in test_prepare() and remove
the 'cont' label.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 11:20:07 +0000 (12:20 +0100)]
tests: test case for gpiod_foreach_chip_noclose()
Add a test for the noclose variants of the chip iterator routines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 11:18:54 +0000 (12:18 +0100)]
tests: add new cleanup helper
Add gu_free_chip_iter_noclose() which calls
gpiod_chip_iter_free_noclose() internally to free the chip iterator
without closing the most recent chip handle.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 11:05:02 +0000 (12:05 +0100)]
tests: add a test for gpiod_chip_open_by_name()
We forgot to test this one before.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 11:02:07 +0000 (12:02 +0100)]
core: tweak argument names
Rename line_bulk to bulk for brevity.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 10:56:22 +0000 (11:56 +0100)]
gpiod.h: documentation updates
Clarify that all functions dealing with sets of lines expect at least
a single line in order to work correctly and that the behavior is
undefined for zero lines. This applies both to bulk objects as well
as the high-level API.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 10:40:37 +0000 (11:40 +0100)]
tests: add test cases for the high-level API
For now we only test the get and set operations. We'll add event tests
once the support for that is merged in the kernel.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 24 Feb 2017 10:39:39 +0000 (11:39 +0100)]
tests: add new assertion helper
Add GU_ASSERT_NOTEQ() for testing if two numbers are not equal.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 16:00:54 +0000 (17:00 +0100)]
core: don't use double underscores
Symbols starting with a double underscore are reserved for the
compiler. Private symbols in libgpiod should start with a single
underscore.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 15:54:59 +0000 (16:54 +0100)]
core: use uint8_t instead of __u8
User space should use types defined in <stdint.h>, not the
linux-specific ones.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 15:03:12 +0000 (16:03 +0100)]
tests: fix potential memory corruption
Valgrind is complaining about invalid reads and writes from the two
line test cases. The culprit is the order in which the cleanup
functions are called.
Declare the chip pointers above the line handles so that we don't
free the resources associated with the chip before releasing the
lines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 14:27:21 +0000 (15:27 +0100)]
tests: move exported functions below main()
Group all functions that are used exclusively by tests together and
below main() for better readability.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 14:25:15 +0000 (15:25 +0100)]
tests: remove xcasprintf()
There's only one user and we already removed xasprintf() which was no
longer used after introducing udev polling. Remove it for simplicity.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 14:17:29 +0000 (15:17 +0100)]
tests: wait for gpiochips before running tests
We're currently using an ugly hack to check if gpiochip files are
actually mockup chips. Remove it and use libudev instead to poll for
uevents until all mockup GPIO devices appear in /dev.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 10:51:00 +0000 (11:51 +0100)]
tests: move the closedir() call
Close the directory immediately after the loop iterating over
its entries ends.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 23 Feb 2017 10:47:57 +0000 (11:47 +0100)]
tests: fix a potential segfault
We should only sort the mockup chip pointers after determining that
all gpiochip device files have actually been created. Otherwise we
might sort invalid memory since we don't create the mockup_chip
structures for nonexistent devices.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 15:18:30 +0000 (16:18 +0100)]
tests: implement xcasprintf()
Add another flavor of xasprintf() which can also return the number of
bytes written to the created string.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 15:10:43 +0000 (16:10 +0100)]
tests: introduce x-funcs
Add a couple helper functions that check for unrecoverable errors
internally and die() if they occur.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 14:57:09 +0000 (15:57 +0100)]
tests: don't sort entire structures
Instead of moving around whole mockup_chip structures, keep an array
of pointers in the test context structure and pass it to qsort().
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 11:01:41 +0000 (12:01 +0100)]
core: extend gpiod_chip_open_lookup()
Make gpiod_chip_open_lookup() also check the chip label.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 10:47:52 +0000 (11:47 +0100)]
core: new gpiod_chip_open() flavor
Implement gpiod_chip_open_by_label() which allows to find and open
a GPIO chip by its in-kernel label.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 09:57:23 +0000 (10:57 +0100)]
tests: add a couple line test cases
Add first test cases for GPIO lines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 09:55:24 +0000 (10:55 +0100)]
tests: new cleanup helper
Add a new cleanup helper which releases a previously requested GPIO
line when a gpiod_line pointer used with GU_CLEANUP() goes out of
scope.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 22 Feb 2017 09:44:33 +0000 (10:44 +0100)]
tests: new assertion helper
Add the GU_ASSERT_RET_OK() macro which checks if an integer (normally
returned from a function call) equals 0 - indicating a correct result.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 20 Feb 2017 15:16:17 +0000 (16:16 +0100)]
tests: fix a comment
This file contains iterator test cases, not GPIO chip tests.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 20 Feb 2017 14:57:24 +0000 (15:57 +0100)]
tests: add a chip iterator test case
Add a test case checking the chip iterators and the accompanying
gpiod_foreach_chip() macro.
Since we're adding a new file: make the cleanup helpers reusable from
all test files.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 9 Feb 2017 10:02:13 +0000 (11:02 +0100)]
tests: add a simple unit testing framework and a couple tests
Implement a simple unit testing framework working together with the
gpio-mockup module present in the mainline linux kernel.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 15 Feb 2017 11:43:49 +0000 (12:43 +0100)]
core: coding style fixes
Make struct definitions consistent.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 9 Feb 2017 13:51:53 +0000 (14:51 +0100)]
make: simplify Makefile.am in src/
Drop the redundant variable and use SUBDIRS directly.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 8 Feb 2017 13:35:04 +0000 (14:35 +0100)]
make: use LDADD instead of AM_LDFLAGS when linking against libgpiod
Libtool tends to have problems (especially with C++) when the
variables are used incorrectly. When building tools, specify the
library we want to link against using LDADD.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 8 Feb 2017 11:11:54 +0000 (12:11 +0100)]
configure: use quotation marks consistently
Always use quotation marks when testing variables.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 8 Feb 2017 11:02:11 +0000 (12:02 +0100)]
configure: fix variable assignment
We must not use spaces in assignment.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 8 Feb 2017 10:21:41 +0000 (11:21 +0100)]
core: code shrink
Use the ternary operator instead of an if-else.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 7 Feb 2017 10:03:57 +0000 (11:03 +0100)]
core: drop a redundant call to gpiod_line_name()
We're storing the name in line_name, so reuse it.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 6 Feb 2017 11:34:34 +0000 (12:34 +0100)]
core: really fix event requests
The previous commit addressing the issue when requesting both types
of line events was braindead. Actually fix the bug this time: check
the event_type, not the eventflags.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 6 Feb 2017 09:59:00 +0000 (10:59 +0100)]
core: close GPIO chip device files on exec
Pass the O_CLOEXEC flag to open() so that we don't leak open GPIO
chip descriptors to any processes spawned by users of the library.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 5 Feb 2017 16:25:30 +0000 (17:25 +0100)]
gpioset: fix helptext
Add 'signal' to the list of available modes.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Clemens Gruber [Tue, 31 Jan 2017 21:08:02 +0000 (22:08 +0100)]
core: add non-closing gpiochip iterator function and foreach macro
Allows users to iterate over the gpiochips without closing them
automatically. The lines can then be used during the runtime of the
program. The user is responsible for closing the chips after they are
no longer needed.
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 30 Jan 2017 11:02:07 +0000 (12:02 +0100)]
core: fix requesting events
There was a bitwise OR and assignment operator in an 'if else' instead
of an equality operator when requesting 'both edges' events.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 29 Jan 2017 12:06:15 +0000 (13:06 +0100)]
libgpiod: relicense under LGPLv2.1
The library is much less useful under GPLv3 - change the license
to the more permissive LGPLv2.1 for the entire project.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Bartosz Golaszewski [Sat, 28 Jan 2017 16:49:10 +0000 (17:49 +0100)]
core: simplify verify_line_bulk()
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sat, 28 Jan 2017 16:36:35 +0000 (17:36 +0100)]
core: rename line_update() to line_maybe_update()
This routine can silently fail, so reflect that in the name.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sat, 28 Jan 2017 16:32:23 +0000 (17:32 +0100)]
core: simplify gpiod_chip_close()
Use a temporary pointer for GPIO lines and helpers for reading the
line state.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sat, 28 Jan 2017 16:00:46 +0000 (17:00 +0100)]
gpioinfo: increase the width of the line offset
Increase the width of the line offset to 3 - that way we can display
999 lines before the formatting will be shifted.
This should be generally enough, but we should still implement
a correct, generic solution for gpioinfo display.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 25 Jan 2017 10:55:31 +0000 (11:55 +0100)]
gpioset: include <poll.h> instead of <sys/poll.h>
Just like we did in core.c: don't include <sys/poll.h> directly.
Follow the manual and include <poll.h>.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 24 Jan 2017 10:45:36 +0000 (11:45 +0100)]
build: use AC_FUNC_STRERROR_R to check the version of strerror_r()
Define _GNU_SOURCE globally in configure.ac and use the
AC_FUNC_STRERROR_R macro to figure out what version of strerror_r() is
provided. Some libraries (e.g. musl) only provide the POSIX version
even if we explicitly request GNU extensions.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 24 Jan 2017 09:53:35 +0000 (10:53 +0100)]
doc: documentation updates
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 23 Jan 2017 15:01:28 +0000 (16:01 +0100)]
core: allow to read values of lines configured for events
The kernel allows us to read values of lines on which we're listening
for events, but libgpiod bails out if the user tries to do it.
Modify gpiod_line_get_value_bulk() to select the correct file
descriptor, depending on how the line object is configured and
allow reading values for both normally exported and monitored lines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Thomas Petazzoni [Mon, 23 Jan 2017 08:18:32 +0000 (21:18 +1300)]
core: include <poll.h> instead of <sys/poll.h>
<sys/poll.h> is an internal C library header, which shouldn't be
included directly. <poll.h> should be included instead, as advertised
in poll(2).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Thomas Petazzoni [Mon, 23 Jan 2017 08:17:15 +0000 (21:17 +1300)]
gpiod.h: include missing <time.h> include
gpiod.h uses "struct timespec", but forgets to include the <time.h>
header which defines "struct timespec". This causes a build error with
the musl C library:
In file included from core.c:11:0:
../../include/gpiod.h:232:49: warning: ‘struct timespec’ declared inside parameter list
typedef int (*gpiod_event_cb)(int, const struct timespec *, void *);
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 17:11:20 +0000 (18:11 +0100)]
configure: add helpers for printing common errors
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 16:29:42 +0000 (17:29 +0100)]
configure: tweak error messages
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 16:23:40 +0000 (17:23 +0100)]
configure: don't check stdint.h
We probably have it if AC_HEADER_STDC succeeded.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 16:22:20 +0000 (17:22 +0100)]
configure: don't check headers/functions unnecessarily
Only check functions & headers required by tools if we're actually
building them.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 14:57:54 +0000 (15:57 +0100)]
configure: check sys/poll.h availability
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Fri, 20 Jan 2017 14:41:46 +0000 (15:41 +0100)]
configure: check ppoll() availability
We're using ppoll() for events - not poll(). Check the right syscall.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 19 Jan 2017 14:53:25 +0000 (15:53 +0100)]
README: fix the required version of kernel headers
The project actually needs kernel headers >= v4.8 to compile.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Thu, 19 Jan 2017 14:10:10 +0000 (15:10 +0100)]
gpiomon: fix shortops
The short option for --silent is missing in gpiomon. Add it.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 14:14:36 +0000 (15:14 +0100)]
build: don't try to process docs if doxygen is not installed
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 13:59:37 +0000 (14:59 +0100)]
libgpiod: start 0.2 development cycle
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 13:30:28 +0000 (14:30 +0100)]
libgpiod v0.1
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 10:57:35 +0000 (11:57 +0100)]
README: add examples
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 10:30:25 +0000 (11:30 +0100)]
README: add the autoconf version needed to compile the project
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 10:26:49 +0000 (11:26 +0100)]
README: add bullet points to the tool list
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 10:10:36 +0000 (11:10 +0100)]
README: the introduction is not a code block
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Wed, 18 Jan 2017 10:09:42 +0000 (11:09 +0100)]
README: rename to README.md for nice github cover
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 18:53:37 +0000 (19:53 +0100)]
README: update
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 16:34:03 +0000 (17:34 +0100)]
core: constify function arguments that will not be modified
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 16:25:00 +0000 (17:25 +0100)]
gpiomon: modify the output format
Drop unnecessary strings. Add offset info (if we ever wanted to allow
monitoring multiple lines at once while staying backwards compatible).
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 16:21:28 +0000 (17:21 +0100)]
gpiomon: check if offset is not negative
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 16:06:53 +0000 (17:06 +0100)]
core: name the iterator functions consistently
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 16:04:46 +0000 (17:04 +0100)]
core: skip chips and lines on error in gpiod_line_find_by_name()
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 15:51:11 +0000 (16:51 +0100)]
gpiomon: new options
Add new options to gpiomon:
- allow to specify the number of events after which the program
should exit
- allow to silence the output
- allow to only monitor certain types of events
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 15:21:28 +0000 (16:21 +0100)]
gpioset: arrange local arguments for better readability
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 15:02:52 +0000 (16:02 +0100)]
configure: check for daemon() and signalfd() functions
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:57:37 +0000 (15:57 +0100)]
core: allow to specify the consumer in the simple event loop
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:54:24 +0000 (15:54 +0100)]
core: allow to specify the consumer in simple set value routines
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:50:03 +0000 (15:50 +0100)]
core: allow to specify the consumer in simple get value routines
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:45:39 +0000 (15:45 +0100)]
gpioset: tweak error messages
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:44:23 +0000 (15:44 +0100)]
gpioset: fix help text
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:43:13 +0000 (15:43 +0100)]
gpioset: new option
Add an option allowing the program to detach from the controlling
terminal after setting values. This is useful for pulled-down/up pins
that we want to keep exported.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:29:43 +0000 (15:29 +0100)]
gpioset: new mode of operation
Add a new mode: 'signal', which makes the program set GPIO values and
then wait until it receives SIGTERM or SIGINT.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:11:16 +0000 (15:11 +0100)]
gpioset: major rework
Allow setting multiple lines at once and add different modes
of operation.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 14:10:21 +0000 (15:10 +0100)]
tools-common: make ARRAY_SIZE() a common macro
Move ARRAY_SIZE() out of gpioinfo.c and place it in tools-common.h.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 08:54:36 +0000 (09:54 +0100)]
core: add a typedef for the set value callback
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 08:42:55 +0000 (09:42 +0100)]
core: new error number
Introduce an error number indicating that the caller tried to request
too many lines at once. This is only relevant for the 'simple' API, as
the bulk operations are limited by the bulk buffer size.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 08:37:37 +0000 (09:37 +0100)]
gpioget: allow reading multiple lines at once
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Tue, 17 Jan 2017 08:15:47 +0000 (09:15 +0100)]
core: new set/get value helpers
Implement simple set/get value routines for multiple lines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 17:06:52 +0000 (18:06 +0100)]
gpioinfo: readability tweaks
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 15:56:40 +0000 (16:56 +0100)]
tools: tweak help text
Also: stop processing the command line after a first non-option is
encountered in all tools.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 10:53:22 +0000 (11:53 +0100)]
doc: don't generate class diagrams
This is only useful for C++. Maybe we'll restore it once we have C++
bindings done.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 10:51:09 +0000 (11:51 +0100)]
doc: document static inline functions
Configure doxygen to document static inline functions from gpiod.h
as well. While we're at it: add a PREDEFINED option to mark functions
in the header that are not part of the API.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 10:43:18 +0000 (11:43 +0100)]
doc: pass the EXTRA_VERSION to doxygen as well
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 10:42:37 +0000 (11:42 +0100)]
doc: fix Doxyfile
The header path was not updated in the Doxyfile after recent directory
structure changes.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 16 Jan 2017 10:42:03 +0000 (11:42 +0100)]
event: new event request helpers
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 15 Jan 2017 18:28:58 +0000 (19:28 +0100)]
libgpiod: start 0.1 development cycle
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 15 Jan 2017 18:26:06 +0000 (19:26 +0100)]
build: add EXTRA_VERSION to the version string
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 15 Jan 2017 17:58:08 +0000 (18:58 +0100)]
configure: don't use the m4 directory
This fixes the buildroot build.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sun, 15 Jan 2017 17:24:24 +0000 (18:24 +0100)]
build: create an organized directory structure
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Sat, 14 Jan 2017 17:53:01 +0000 (18:53 +0100)]
doc: doxygen: set the project version from Makefile
Drop the PROJECT_NUMBER option from the Doxyfile and pass the version
to doxygen via command-line when invoking it from Makefile.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>