All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V7 0/8] libgpiod: Add Rust bindings
@ 2022-10-14 10:47 Viresh Kumar
  2022-10-14 10:47 ` [PATCH V7 1/8] libgpiod: Add libgpiod-sys rust crate Viresh Kumar
                   ` (8 more replies)
  0 siblings, 9 replies; 50+ messages in thread
From: Viresh Kumar @ 2022-10-14 10:47 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: Viresh Kumar, Vincent Guittot, linux-gpio, Kent Gibson,
	Miguel Ojeda, Wedson Almeida Filho, Alex Bennée,
	stratos-dev, Gerard Ryan

Hello,

Here is another version of rust bindings for libgpiod v2.0, based of the
next/libgpiod-2.0.

Pushed here:

https://github.com/vireshk/libgpiod v7

[I have pushed v6 and v5 there too, in case someone wants to look at the
changes].

V6->V7:
- Don't let buffer read new events if the earlier events are still referenced.
- BufferIntenal is gone now, to make the above work.
- Update example and tests too for the same.

V5->V6:
- Updates according to the new line-settings interface.
- New file, line_settings.rs.
- Renamed 'enum Setting' as 'SettingVal' to avoid conflicting names, as we also
  have 'struct Settings' now.
- Support for HTE clock type.
- Implement 'Eq' for public structure/enums (reported by build).
- Remove 'SettingKindMap' and 'SettingMap' as they aren't required anymore.
- Updated tests based on new interface.

V4->V5:
- Arrange as workspace with crates for libgpiod-sys, libgpiod, gpiosim.
- Use static libgpiod and libgpiosim libraries instead of rebuilding again.
- Arrange in modules instead of flattened approach.
- New enums like Setting and SettingKind and new types based on them SettingMap
  and SettingKindMap.
- New property independent helpers for line_config, like set_prop_default().
- Improved tests/examples, new example for gpiowatch.
- Add pre-built bindings for gpiosim too.
- Many other changes.

V3->V4:
- Rebased on top of new changes, and made changes accordingly.
- Added rust integration tests with gpiosim.
- Found a kernel bug with tests, sent a patch for that to LKML.

V2->V3:
- Remove naming redundancy, users just need to do this now
  use libgpiod:{Chip, Direction, LineConfig} now (Bartosz);
- Fix lifetime issues between event-buffer and edge-event modules, the event
  buffer is released after the last edge-event reference is dropped (Bartosz).
- Allow edge-event to be copied, and freed later (Bartosz).
- Add two separate rust crates, sys and wrapper (Gerard).
- Null-terminate the strings passed to libgpiod (Wedson).
- Drop unnecessary checks to validate string returned from chip:name/label/path.
- Fix SAFETY comments (Wedson).
- Drop unnecessary clone() instances (Bartosz).

V1->V2:
- Added examples (I tested everything except gpiomon.rs, didn't have right
  hardware/mock device to test).
- Build rust bindings as part of Make, update documentation.

Thanks.

--
Viresh

Viresh Kumar (8):
  libgpiod: Add libgpiod-sys rust crate
  libgpiod-sys: Add pre generated rust bindings
  libgpiod: Add rust wrapper crate
  libgpiod: Add rust examples
  libgpiod: Add gpiosim rust crate
  gpiosim: Add pre generated rust bindings
  libgpiod: Add rust tests
  libgpiod: Integrate building of rust bindings with make

 .gitignore                                    |    5 +
 README                                        |    8 +-
 TODO                                          |    8 -
 bindings/Makefile.am                          |    6 +
 bindings/rust/Cargo.toml                      |    7 +
 bindings/rust/Makefile.am                     |   18 +
 bindings/rust/gpiosim/Cargo.toml              |   18 +
 bindings/rust/gpiosim/README.md               |   11 +
 bindings/rust/gpiosim/build.rs                |   43 +
 bindings/rust/gpiosim/src/bindings.rs         |  180 +++
 bindings/rust/gpiosim/src/lib.rs              |   25 +
 bindings/rust/gpiosim/src/sim.rs              |  323 +++++
 bindings/rust/libgpiod-sys/Cargo.toml         |   15 +
 bindings/rust/libgpiod-sys/README.md          |   11 +
 bindings/rust/libgpiod-sys/build.rs           |   41 +
 bindings/rust/libgpiod-sys/src/bindings.rs    | 1173 +++++++++++++++++
 bindings/rust/libgpiod-sys/src/lib.rs         |   13 +
 bindings/rust/libgpiod/Cargo.toml             |   16 +
 bindings/rust/libgpiod/examples/gpiodetect.rs |   30 +
 bindings/rust/libgpiod/examples/gpiofind.rs   |   35 +
 bindings/rust/libgpiod/examples/gpioget.rs    |   42 +
 bindings/rust/libgpiod/examples/gpioinfo.rs   |   95 ++
 bindings/rust/libgpiod/examples/gpiomon.rs    |   73 +
 bindings/rust/libgpiod/examples/gpioset.rs    |   60 +
 bindings/rust/libgpiod/examples/gpiowatch.rs  |   54 +
 bindings/rust/libgpiod/src/chip.rs            |  253 ++++
 bindings/rust/libgpiod/src/edge_event.rs      |  101 ++
 bindings/rust/libgpiod/src/event_buffer.rs    |   66 +
 bindings/rust/libgpiod/src/info_event.rs      |   68 +
 bindings/rust/libgpiod/src/lib.rs             |  471 +++++++
 bindings/rust/libgpiod/src/line_config.rs     |  118 ++
 bindings/rust/libgpiod/src/line_info.rs       |  180 +++
 bindings/rust/libgpiod/src/line_request.rs    |  246 ++++
 bindings/rust/libgpiod/src/line_settings.rs   |  277 ++++
 bindings/rust/libgpiod/src/request_config.rs  |   96 ++
 bindings/rust/libgpiod/tests/chip.rs          |   97 ++
 bindings/rust/libgpiod/tests/common/config.rs |  134 ++
 bindings/rust/libgpiod/tests/common/mod.rs    |   10 +
 bindings/rust/libgpiod/tests/edge_event.rs    |  296 +++++
 bindings/rust/libgpiod/tests/info_event.rs    |  125 ++
 bindings/rust/libgpiod/tests/line_config.rs   |  105 ++
 bindings/rust/libgpiod/tests/line_info.rs     |  279 ++++
 bindings/rust/libgpiod/tests/line_request.rs  |  519 ++++++++
 bindings/rust/libgpiod/tests/line_settings.rs |  226 ++++
 .../rust/libgpiod/tests/request_config.rs     |   38 +
 configure.ac                                  |   16 +
 46 files changed, 6020 insertions(+), 11 deletions(-)
 create mode 100644 bindings/rust/Cargo.toml
 create mode 100644 bindings/rust/Makefile.am
 create mode 100644 bindings/rust/gpiosim/Cargo.toml
 create mode 100644 bindings/rust/gpiosim/README.md
 create mode 100644 bindings/rust/gpiosim/build.rs
 create mode 100644 bindings/rust/gpiosim/src/bindings.rs
 create mode 100644 bindings/rust/gpiosim/src/lib.rs
 create mode 100644 bindings/rust/gpiosim/src/sim.rs
 create mode 100644 bindings/rust/libgpiod-sys/Cargo.toml
 create mode 100644 bindings/rust/libgpiod-sys/README.md
 create mode 100644 bindings/rust/libgpiod-sys/build.rs
 create mode 100644 bindings/rust/libgpiod-sys/src/bindings.rs
 create mode 100644 bindings/rust/libgpiod-sys/src/lib.rs
 create mode 100644 bindings/rust/libgpiod/Cargo.toml
 create mode 100644 bindings/rust/libgpiod/examples/gpiodetect.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpiofind.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpioget.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpioinfo.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpiomon.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpioset.rs
 create mode 100644 bindings/rust/libgpiod/examples/gpiowatch.rs
 create mode 100644 bindings/rust/libgpiod/src/chip.rs
 create mode 100644 bindings/rust/libgpiod/src/edge_event.rs
 create mode 100644 bindings/rust/libgpiod/src/event_buffer.rs
 create mode 100644 bindings/rust/libgpiod/src/info_event.rs
 create mode 100644 bindings/rust/libgpiod/src/lib.rs
 create mode 100644 bindings/rust/libgpiod/src/line_config.rs
 create mode 100644 bindings/rust/libgpiod/src/line_info.rs
 create mode 100644 bindings/rust/libgpiod/src/line_request.rs
 create mode 100644 bindings/rust/libgpiod/src/line_settings.rs
 create mode 100644 bindings/rust/libgpiod/src/request_config.rs
 create mode 100644 bindings/rust/libgpiod/tests/chip.rs
 create mode 100644 bindings/rust/libgpiod/tests/common/config.rs
 create mode 100644 bindings/rust/libgpiod/tests/common/mod.rs
 create mode 100644 bindings/rust/libgpiod/tests/edge_event.rs
 create mode 100644 bindings/rust/libgpiod/tests/info_event.rs
 create mode 100644 bindings/rust/libgpiod/tests/line_config.rs
 create mode 100644 bindings/rust/libgpiod/tests/line_info.rs
 create mode 100644 bindings/rust/libgpiod/tests/line_request.rs
 create mode 100644 bindings/rust/libgpiod/tests/line_settings.rs
 create mode 100644 bindings/rust/libgpiod/tests/request_config.rs

-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2022-11-04 15:51 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 10:47 [PATCH V7 0/8] libgpiod: Add Rust bindings Viresh Kumar
2022-10-14 10:47 ` [PATCH V7 1/8] libgpiod: Add libgpiod-sys rust crate Viresh Kumar
2022-10-17 12:59   ` Kent Gibson
2022-10-18 11:22     ` Viresh Kumar
2022-10-18 11:42       ` Miguel Ojeda
2022-10-18 11:49       ` Kent Gibson
2022-10-19  6:46         ` Viresh Kumar
2022-10-19  7:21           ` Kent Gibson
2022-10-19 11:22             ` Viresh Kumar
2022-10-19 12:01               ` Kent Gibson
2022-10-20  5:34                 ` Viresh Kumar
2022-10-27 12:18                 ` Bartosz Golaszewski
2022-10-14 10:47 ` [PATCH V7 2/8] libgpiod-sys: Add pre generated rust bindings Viresh Kumar
2022-10-14 10:47 ` [PATCH V7 3/8] libgpiod: Add rust wrapper crate Viresh Kumar
2022-10-17 12:59   ` Kent Gibson
2022-10-21 11:22     ` Viresh Kumar
2022-10-21 12:39       ` Kent Gibson
2022-10-27 12:09         ` Bartosz Golaszewski
2022-10-31 12:33           ` Kent Gibson
2022-10-31 12:45             ` Bartosz Golaszewski
2022-11-02  4:00             ` Viresh Kumar
2022-11-02 12:47               ` Bartosz Golaszewski
2022-11-02 13:08                 ` Kent Gibson
2022-11-02 16:34                   ` Bartosz Golaszewski
2022-11-03  0:38                     ` Kent Gibson
2022-11-03  8:35                       ` Bartosz Golaszewski
2022-11-03 12:29                         ` Kent Gibson
2022-11-04 15:51                           ` Bartosz Golaszewski
2022-10-18  3:27   ` Kent Gibson
2022-10-21 11:25     ` Viresh Kumar
2022-10-14 10:47 ` [PATCH V7 4/8] libgpiod: Add rust examples Viresh Kumar
2022-10-17 13:00   ` Kent Gibson
2022-10-14 10:47 ` [PATCH V7 5/8] libgpiod: Add gpiosim rust crate Viresh Kumar
2022-10-17 13:00   ` Kent Gibson
2022-10-21  9:56     ` Viresh Kumar
2022-10-14 10:47 ` [PATCH V7 6/8] gpiosim: Add pre generated rust bindings Viresh Kumar
2022-10-14 10:47 ` [PATCH V7 7/8] libgpiod: Add rust tests Viresh Kumar
2022-10-17 13:00   ` Kent Gibson
2022-10-17 14:30     ` Kent Gibson
2022-10-20 10:37     ` Viresh Kumar
2022-10-20 11:02       ` Kent Gibson
2022-10-20 12:40         ` Bartosz Golaszewski
2022-10-20 15:16           ` Miguel Ojeda
2022-10-14 10:47 ` [PATCH V7 8/8] libgpiod: Integrate building of rust bindings with make Viresh Kumar
2022-10-14 17:03 ` [PATCH V7 0/8] libgpiod: Add Rust bindings Miguel Ojeda
2022-10-20 13:29   ` Björn Roy Baron
2022-10-21  9:39     ` Viresh Kumar
2022-10-21 14:34       ` Björn Roy Baron
2022-10-25  6:42         ` Viresh Kumar
2022-10-29 17:46           ` Björn Roy Baron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.