summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Bartosz Golaszewski [Mon, 2 Jan 2017 15:05:59 +0000 (16:05 +0100)]
core: add libgpiod-specific error numbers
In order to better report error conditions to users, we need a set
of libgpiod-specific errnos. Extend the previous API to be able to
use both regular errno and GPIO-related error numbers together.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 14:55:30 +0000 (15:55 +0100)]
core: clamp GPIO values to either 1 or 0
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 14:50:28 +0000 (15:50 +0100)]
gpioset: drop the call to gpiod_line_set_value()
This is not needed as we already pass the default value to
gpiod_line_request_dout();
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 14:49:31 +0000 (15:49 +0100)]
core: fix a default value bug when requesting a GPIO line
The direction is stored in the 'direction' argument, not in flags.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 14:02:50 +0000 (15:02 +0100)]
gpiod.h: remove GPIOD_ARRAY_SIZE()
This macro is only used by gpioinfo and is not relevant for the GPIO
API. Remove it from gpiod.h and define it directly in gpioinfo.c.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:56:46 +0000 (14:56 +0100)]
core: don't set the error number if zalloc() fails
zalloc() is implemented locally and already sets the error number on
failure.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:55:25 +0000 (14:55 +0100)]
core: release all lines in gpiod_chip_close()
This fixes a memory leak if the user forgets to explicitly release
requested lines.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:51:01 +0000 (14:51 +0100)]
core: dynamically allocate memory for GPIO line request data
For bulk requests, the lines will share the struct gpiohandle_request
object. Instead of it being a part of struct gpiod_line, allocate its
memory dynamically and only store the pointer in the line context
structure.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:27:35 +0000 (14:27 +0100)]
core: rename two fields of struct gpiod_line
Drop the 'l' prefix - it's clear the fields are part of a GPIO line
structure.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:06:03 +0000 (14:06 +0100)]
core: ioctl() code shrink
Wrap GPIO ioctl() calls in a routine setting the libgpiod errno in
case of an error.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 13:01:13 +0000 (14:01 +0100)]
error: add internal wrappers for setting libgpiod errno
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 11:41:52 +0000 (12:41 +0100)]
documentation: add Doxyfile
Add doxygen configuration and a new target to Makefile.am to generate
documentation. Also: update gitignore.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 12:31:58 +0000 (13:31 +0100)]
libgpiod: use a per-thread variable for storing errors
The kernel-like trick with embedding error numbers in pointers can't
be guaranteed to work on all architectures. Use a per-thread variable
instead and add corresponding routines to access it.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 12:30:58 +0000 (13:30 +0100)]
build: define _GNU_SOURCE for .c files
This is needed for asprintf().
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 10:44:35 +0000 (11:44 +0100)]
libgpiod: add a simple README
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 10:25:52 +0000 (11:25 +0100)]
gitignore: ignore files generated by autotools
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 2 Jan 2017 10:23:20 +0000 (11:23 +0100)]
build: add autotools configuration
This allows to build the library and programs using autotools.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Bartosz Golaszewski [Mon, 26 Dec 2016 21:54:01 +0000 (22:54 +0100)]
libgpiod: initial commit
This adds four basic tools and implements core functionalities.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>