fhunleth

fhunleth

Co-author of Nerves

Circuits.GPIO v2.0

Circuits.GPIO lets you read and write to I/O pins on embedded hardware like that used by Nerves. The new v2.0 version makes it possible to support other platforms as well. This is a big update to v1.0 that is mostly backwards compatible but has many improvements that make it worth a look.

Here’s part of the ChangeLog to highlight other v2.0 updates:

  • Nerves and embedded Linux platforms now use the Linux GPIO character device API (cdev) which offers better performance, more functionality and fixes race conditions seen with the previous sysfs implementation

  • Circuits.GPIO.open/3 is much more flexible in how GPIOs are identified. Specifying GPIOs by number still works, but it’s now possible to specify GPIOs by string labels and by tuples that contain the GPIO controller name and index.

  • List out available GPIOs with Circuits.GPIO.enumerate/0. Other helper
    functions are available for getting more information about each GPIO too.

  • Specify pull modes on all hardware that supports them and not just Raspberry Pis

  • Easily do one-off reads and writes with Circuits.GPIO.read_one/2 and
    Circuits.GPIO.write_one/3

  • Must better timestamping of GPIO input events since the timestamps get applied when the kernel processes the event

  • Runtime diagnostics to help debug low level issues. See Circuits.GPIO.Diagnostics

Much more documentation and porting information is available in the hex docs.

Happy hardware hacking!

Where Next?

Popular in News & Updates Top

jjcarstens
Testing code destined for hardware can be tricky, but it just got one tiny bit easier! :tty0tty was just released which is an Elixir por...
New
josevalim
Hi everyone, We have just released Mime v2.0.4 with a potential security fix. Before this version, Mime.extensions("foo/bar+baz") would ...
New
fhunleth
It looks like it’s finally safe to announce that Nerves supports Erlang/OTP 26 and Elixir 1.15! We’ve updated dozens of Nerves and close...
New
zachdaniel
What if you had full stack types for SPAs built with tech like React, Inertia, Vue, Svelte… but all of the power Ash Framework and Elixir...
New
bartblast
Great news for Hologram: the Erlang Ecosystem Foundation has awarded a stipend to support key development milestones! I’m deeply gratefu...
New
bartblast
Hologram v0.8.0 is out! This release brings JavaScript interoperability - the most requested feature since the project’s inception. You c...
New
bartblast
Hologram v0.9 is out! The headline is a realtime layer - your server can now push updates to connected clients with no polling: broadcast...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New

We're in Beta

About us Mission Statement