1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-28 13:55:08 +03:00
Commit Graph

169 Commits

Author SHA1 Message Date
Bartosz Golaszewski
d1b9b66dee 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>
2017-02-24 11:56:22 +01:00
Bartosz Golaszewski
f92b2d0936 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>
2017-02-23 17:00:54 +01:00
Bartosz Golaszewski
8087808b64 core: extend gpiod_chip_open_lookup()
Make gpiod_chip_open_lookup() also check the chip label.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-02-22 12:01:41 +01:00
Bartosz Golaszewski
6d33670b95 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>
2017-02-22 11:47:52 +01:00
Clemens Gruber
4110ea2804 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>
2017-02-01 11:51:58 +01:00
Bartosz Golaszewski
f3f6982d1f 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>
2017-01-29 21:37:22 +01:00
Bartosz Golaszewski
339760773b doc: documentation updates
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-24 10:53:35 +01:00
Thomas Petazzoni
53a4cefdbe 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>
2017-01-23 11:06:24 +01:00
Bartosz Golaszewski
79faab2fac core: constify function arguments that will not be modified
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 17:34:03 +01:00
Bartosz Golaszewski
577820aa05 core: name the iterator functions consistently
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 17:06:53 +01:00
Bartosz Golaszewski
6c0b5dd40d core: allow to specify the consumer in the simple event loop
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 15:57:37 +01:00
Bartosz Golaszewski
1d2b82be5b core: allow to specify the consumer in simple set value routines
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 15:54:24 +01:00
Bartosz Golaszewski
fe496e0457 core: allow to specify the consumer in simple get value routines
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 15:54:05 +01:00
Bartosz Golaszewski
a834dd5571 core: add a typedef for the set value callback
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 09:54:36 +01:00
Bartosz Golaszewski
17970104b5 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>
2017-01-17 09:42:55 +01:00
Bartosz Golaszewski
542b908ce5 core: new set/get value helpers
Implement simple set/get value routines for multiple lines.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-17 09:15:47 +01:00
Bartosz Golaszewski
2f2ef7bf4f 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>
2017-01-16 11:51:09 +01:00
Bartosz Golaszewski
3e0ab165eb event: new event request helpers
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-16 11:42:03 +01:00
Bartosz Golaszewski
06cb40722a build: create an organized directory structure
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-15 18:48:18 +01:00