|
36 | 36 | ffi.cdef(
|
37 | 37 | """
|
38 | 38 | enum {
|
39 |
| - GPIOD_CTXLESS_EVENT_CB_TIMEOUT, |
| 39 | + GPIOD_CTXLESS_EVENT_CB_TIMEOUT = 1, |
40 | 40 | GPIOD_CTXLESS_EVENT_CB_RISING_EDGE,
|
41 | 41 | GPIOD_CTXLESS_EVENT_CB_FALLING_EDGE,
|
42 | 42 | };
|
|
54 | 54 | };
|
55 | 55 |
|
56 | 56 | enum {
|
57 |
| - GPIOD_LINE_DIRECTION_INPUT, |
| 57 | + GPIOD_LINE_DIRECTION_INPUT = 1, |
58 | 58 | GPIOD_LINE_DIRECTION_OUTPUT,
|
59 | 59 | };
|
60 | 60 |
|
61 | 61 | enum {
|
62 |
| - GPIOD_LINE_ACTIVE_STATE_HIGH, |
| 62 | + GPIOD_LINE_ACTIVE_STATE_HIGH = 1, |
63 | 63 | GPIOD_LINE_ACTIVE_STATE_LOW,
|
64 | 64 | };
|
65 | 65 |
|
66 | 66 | enum {
|
67 |
| - GPIOD_LINE_REQUEST_DIRECTION_AS_IS, |
| 67 | + GPIOD_LINE_REQUEST_DIRECTION_AS_IS = 1, |
68 | 68 | GPIOD_LINE_REQUEST_DIRECTION_INPUT,
|
69 | 69 | GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
|
70 | 70 | GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE,
|
|
79 | 79 | };
|
80 | 80 |
|
81 | 81 | enum {
|
82 |
| - GPIOD_LINE_EVENT_RISING_EDGE, |
| 82 | + GPIOD_LINE_EVENT_RISING_EDGE = 1, |
83 | 83 | GPIOD_LINE_EVENT_FALLING_EDGE,
|
84 | 84 | };
|
85 | 85 |
|
|
137 | 137 |
|
138 | 138 | struct gpiod_line_iter;
|
139 | 139 |
|
| 140 | +struct gpiod_line_bulk; |
| 141 | +
|
140 | 142 | typedef void (*gpiod_ctxless_set_value_cb)(void *);
|
141 | 143 |
|
142 | 144 | typedef int (*gpiod_ctxless_event_handle_cb)(int, unsigned int,
|
|
162 | 164 | size_t chipname_size,
|
163 | 165 | unsigned int *offset);
|
164 | 166 |
|
| 167 | +int gpiod_chip_find_lines(struct gpiod_chip *chip, const char **names, |
| 168 | + struct gpiod_line_bulk *bulk) GPIOD_API; |
| 169 | +
|
165 | 170 | struct gpiod_chip *gpiod_chip_open(const char *path);
|
166 | 171 |
|
167 | 172 | struct gpiod_chip *gpiod_chip_open_by_name(const char *name);
|
|
183 | 188 | struct gpiod_line *
|
184 | 189 | gpiod_chip_get_line(struct gpiod_chip *chip, unsigned int offset);
|
185 | 190 |
|
| 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 | +
|
186 | 198 | struct gpiod_line *
|
187 | 199 | gpiod_chip_find_line(struct gpiod_chip *chip, const char *name);
|
188 | 200 |
|
|
254 | 266 |
|
255 | 267 | int gpiod_line_set_value(struct gpiod_line *line, int value);
|
256 | 268 |
|
| 269 | +int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk, |
| 270 | + const int *values); |
| 271 | +
|
257 | 272 | int gpiod_line_event_wait(struct gpiod_line *line,
|
258 | 273 | const struct timespec *timeout);
|
259 | 274 |
|
|
298 | 313 | )
|
299 | 314 |
|
300 | 315 | try:
|
301 |
| - lib = ffi.dlopen("libgpiod.so.1") |
| 316 | + lib = ffi.dlopen("libgpiod.so.2") |
302 | 317 | except OSError:
|
303 | 318 | lib = ffi.dlopen("c") # workaround if we're only building docs
|
304 | 319 |
|
|
0 commit comments