All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	linux-gpio@vger.kernel.org, "Kent Gibson" <warthog618@gmail.com>,
	"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@google.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	"Gerard Ryan" <g.m0n3y.2503@gmail.com>
Subject: [PATCH V3 0/4] libgpiod: Add Rust bindings
Date: Mon, 20 Dec 2021 16:41:34 +0530	[thread overview]
Message-ID: <cover.1639997241.git.viresh.kumar@linaro.org> (raw)

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

I will be adding testing infrastructure later on, once other bindings are
converted to use gpiosim.

All the examples, including gpiomon, are tested now and work just fine.

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 (4):
  libgpiod: Add libgpiod-sys rust crate
  libgpiod: Add rust wrapper crate
  libgpiod: Add rust examples
  libgpiod: Integrate building of rust bindings with make

 .gitignore                            |   5 +
 README                                |   8 +-
 TODO                                  |   8 -
 bindings/Makefile.am                  |   6 +
 bindings/rust/Cargo.toml              |  11 +
 bindings/rust/Makefile.am             |  27 ++
 bindings/rust/examples/gpiodetect.rs  |  37 +++
 bindings/rust/examples/gpiofind.rs    |  42 +++
 bindings/rust/examples/gpioget.rs     |  42 +++
 bindings/rust/examples/gpioinfo.rs    |  89 ++++++
 bindings/rust/examples/gpiomon.rs     |  68 +++++
 bindings/rust/examples/gpioset.rs     |  52 ++++
 bindings/rust/libgpiod-sys/Cargo.toml |  12 +
 bindings/rust/libgpiod-sys/build.rs   |  60 ++++
 bindings/rust/libgpiod-sys/src/lib.rs |  16 ++
 bindings/rust/libgpiod-sys/wrapper.h  |   2 +
 bindings/rust/src/chip.rs             | 183 ++++++++++++
 bindings/rust/src/edge_event.rs       | 103 +++++++
 bindings/rust/src/event_buffer.rs     |  87 ++++++
 bindings/rust/src/info_event.rs       |  68 +++++
 bindings/rust/src/lib.rs              | 280 ++++++++++++++++++
 bindings/rust/src/line_config.rs      | 391 ++++++++++++++++++++++++++
 bindings/rust/src/line_info.rs        | 182 ++++++++++++
 bindings/rust/src/line_request.rs     | 214 ++++++++++++++
 bindings/rust/src/request_config.rs   | 119 ++++++++
 configure.ac                          |  16 ++
 26 files changed, 2117 insertions(+), 11 deletions(-)
 create mode 100644 bindings/rust/Cargo.toml
 create mode 100644 bindings/rust/Makefile.am
 create mode 100644 bindings/rust/examples/gpiodetect.rs
 create mode 100644 bindings/rust/examples/gpiofind.rs
 create mode 100644 bindings/rust/examples/gpioget.rs
 create mode 100644 bindings/rust/examples/gpioinfo.rs
 create mode 100644 bindings/rust/examples/gpiomon.rs
 create mode 100644 bindings/rust/examples/gpioset.rs
 create mode 100644 bindings/rust/libgpiod-sys/Cargo.toml
 create mode 100644 bindings/rust/libgpiod-sys/build.rs
 create mode 100644 bindings/rust/libgpiod-sys/src/lib.rs
 create mode 100644 bindings/rust/libgpiod-sys/wrapper.h
 create mode 100644 bindings/rust/src/chip.rs
 create mode 100644 bindings/rust/src/edge_event.rs
 create mode 100644 bindings/rust/src/event_buffer.rs
 create mode 100644 bindings/rust/src/info_event.rs
 create mode 100644 bindings/rust/src/lib.rs
 create mode 100644 bindings/rust/src/line_config.rs
 create mode 100644 bindings/rust/src/line_info.rs
 create mode 100644 bindings/rust/src/line_request.rs
 create mode 100644 bindings/rust/src/request_config.rs

-- 
2.31.1.272.g89b43f80a514


             reply	other threads:[~2021-12-20 11:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 11:11 Viresh Kumar [this message]
2021-12-20 11:11 ` [PATCH V3 1/4] libgpiod: Add libgpiod-sys rust crate Viresh Kumar
2021-12-20 11:11 ` [PATCH V3 2/4] libgpiod: Add rust wrapper crate Viresh Kumar
2021-12-20 11:11 ` [PATCH V3 3/4] libgpiod: Add rust examples Viresh Kumar
2021-12-20 11:11 ` [PATCH V3 4/4] libgpiod: Integrate building of rust bindings with make Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1639997241.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=g.m0n3y.2503@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=warthog618@gmail.com \
    --cc=wedsonaf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.