View Source gpio (gpio v0.6.1)

Link to this section Summary

Link to this section Types

-opaque chip()
-type chip_info() :: #{name := string(), label := string(), lines := non_neg_integer()}.
-opaque line_events()
-opaque lines()

Link to this section Functions

-spec chip_info(chip()) -> {ok, chip_info()} | {error, term()}.
-spec close_chip(chip()) -> ok | {error, term()}.
-spec close_line_events(line_events()) -> ok | {error, term()}.
-spec close_lines(lines()) -> ok | {error, term()}.
-spec open_chip(Path) -> {ok, chip()} | {error, term()} when Path :: file:filename_all().
Link to this function

open_line_events(Chip, Offset, HandleFlags, EventFlags, ConsumerLabel)

View Source
-spec open_line_events(chip(), Offset, [Flag], [EventFlag], ConsumerLabel) ->
                    {ok, line_events()} | {error, term()}
                    when
                        Offset :: non_neg_integer(),
                        Flag :: active_low | open_drain | open_source,
                        EventFlag :: rising_edge | falling_edge,
                        ConsumerLabel :: string() | binary().
Link to this function

open_lines(Chip, Offsets, Flags, Defaults, ConsumerLabel)

View Source
-spec open_lines(chip(), [Offset], [Flag], [Default], ConsumerLabel) -> {ok, lines()} | {error, term()}
              when
                  Offset :: non_neg_integer(),
                  Flag :: input | output | active_low | open_drain | open_source,
                  Default :: 0 | 1,
                  ConsumerLabel :: string() | binary().
-spec read_lines(lines()) -> {ok, tuple()} | {error, term()}.
Link to this function

write_lines(Lines, Values)

View Source
-spec write_lines(lines(), tuple()) -> ok | {error, term()}.