Skip to content

Commit e2f07de

Browse files
committed
* Update to libgpiod 1.4.
1 parent a641b33 commit e2f07de

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

asyncgpio/libgpiod.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
ffi.cdef(
3737
"""
3838
enum {
39-
GPIOD_CTXLESS_EVENT_CB_TIMEOUT,
39+
GPIOD_CTXLESS_EVENT_CB_TIMEOUT = 1,
4040
GPIOD_CTXLESS_EVENT_CB_RISING_EDGE,
4141
GPIOD_CTXLESS_EVENT_CB_FALLING_EDGE,
4242
};
@@ -54,17 +54,17 @@
5454
};
5555
5656
enum {
57-
GPIOD_LINE_DIRECTION_INPUT,
57+
GPIOD_LINE_DIRECTION_INPUT = 1,
5858
GPIOD_LINE_DIRECTION_OUTPUT,
5959
};
6060
6161
enum {
62-
GPIOD_LINE_ACTIVE_STATE_HIGH,
62+
GPIOD_LINE_ACTIVE_STATE_HIGH = 1,
6363
GPIOD_LINE_ACTIVE_STATE_LOW,
6464
};
6565
6666
enum {
67-
GPIOD_LINE_REQUEST_DIRECTION_AS_IS,
67+
GPIOD_LINE_REQUEST_DIRECTION_AS_IS = 1,
6868
GPIOD_LINE_REQUEST_DIRECTION_INPUT,
6969
GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
7070
GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE,
@@ -79,7 +79,7 @@
7979
};
8080
8181
enum {
82-
GPIOD_LINE_EVENT_RISING_EDGE,
82+
GPIOD_LINE_EVENT_RISING_EDGE = 1,
8383
GPIOD_LINE_EVENT_FALLING_EDGE,
8484
};
8585
@@ -137,6 +137,8 @@
137137
138138
struct gpiod_line_iter;
139139
140+
struct gpiod_line_bulk;
141+
140142
typedef void (*gpiod_ctxless_set_value_cb)(void *);
141143
142144
typedef int (*gpiod_ctxless_event_handle_cb)(int, unsigned int,
@@ -162,6 +164,9 @@
162164
size_t chipname_size,
163165
unsigned int *offset);
164166
167+
int gpiod_chip_find_lines(struct gpiod_chip *chip, const char **names,
168+
struct gpiod_line_bulk *bulk) GPIOD_API;
169+
165170
struct gpiod_chip *gpiod_chip_open(const char *path);
166171
167172
struct gpiod_chip *gpiod_chip_open_by_name(const char *name);
@@ -183,6 +188,13 @@
183188
struct gpiod_line *
184189
gpiod_chip_get_line(struct gpiod_chip *chip, unsigned int offset);
185190
191+
int gpiod_chip_get_lines(struct gpiod_chip *chip,
192+
unsigned int *offsets, unsigned int num_offsets,
193+
struct gpiod_line_bulk *bulk);
194+
195+
int gpiod_chip_get_all_lines(struct gpiod_chip *chip,
196+
struct gpiod_line_bulk *bulk);
197+
186198
struct gpiod_line *
187199
gpiod_chip_find_line(struct gpiod_chip *chip, const char *name);
188200
@@ -254,6 +266,9 @@
254266
255267
int gpiod_line_set_value(struct gpiod_line *line, int value);
256268
269+
int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk,
270+
const int *values);
271+
257272
int gpiod_line_event_wait(struct gpiod_line *line,
258273
const struct timespec *timeout);
259274
@@ -298,7 +313,7 @@
298313
)
299314

300315
try:
301-
lib = ffi.dlopen("libgpiod.so.1")
316+
lib = ffi.dlopen("libgpiod.so.2")
302317
except OSError:
303318
lib = ffi.dlopen("c") # workaround if we're only building docs
304319

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
asyncgpio (0.4.0-1) unstable; urgency=medium
2+
3+
* Update to libgpiod 1.4.
4+
5+
-- Matthias Urlichs <[email protected]> Fri, 22 May 2020 21:10:25 +0200
6+
17
asyncgpio (0.3.0-1) unstable; urgency=medium
28

39
* Renamed.

debian/control

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Maintainer: Matthias Urlichs <[email protected]>
33
Section: python
44
Priority: optional
55
Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9),
6-
libgpiod-dev,
6+
libgpiod-dev (>= 1.4),
77
python3-cffi,
88
Standards-Version: 3.9.6
99
Homepage: https://github.com/M-o-a-T/asyncgpio
1010

1111
Package: python3-asyncgpio
1212
Architecture: all
1313
Depends: ${misc:Depends}, ${python3:Depends},
14-
libgpiod1,
14+
libgpiod2 (>= 1.4),
1515
python3-cffi,
1616
python3-trio,
1717
Standards-Version: 3.9.6
@@ -22,4 +22,5 @@ Description: GPIO access via Trio and libgpiod
2222
It is based on libgpiod and its CFFI adapter by Steven P. Goldsmith
2323
<[email protected]>, as downloaded from
2424
`https://github.com/sgjava/userspaceio.git`__.
25-
25+
.
26+
This version has been updated to libgpiod 1.4.

0 commit comments

Comments
 (0)