gpio_utils/
options.rs

1// Copyright (c) 2016, The gpio-utils Authors.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/license/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option.  This file may not be copied, modified, or distributed
7// except according to those terms.
8
9#[derive(Debug)]
10pub struct GpioOptions {
11    pub configs: Vec<String>,
12}
13
14#[derive(Debug)]
15pub struct GpioReadOptions<'a> {
16    pub gpio_opts: GpioOptions,
17    pub pin: &'a str,
18}
19
20#[derive(Debug)]
21pub struct GpioWriteOptions<'a> {
22    pub gpio_opts: GpioOptions,
23    pub pin: &'a str,
24    pub value: u8,
25}
26
27#[derive(Debug)]
28pub struct GpioPollOptions<'a> {
29    pub gpio_opts: GpioOptions,
30    pub timeout: Option<isize>,
31    pub edge: &'a str,
32    pub pin: &'a str,
33}
34
35#[derive(Debug)]
36pub struct GpioExportOptions<'a> {
37    pub gpio_opts: GpioOptions,
38    pub symlink_root: Option<&'a str>,
39    pub pin: &'a str,
40}
41
42#[derive(Debug)]
43pub struct GpioExportAllOptions<'a> {
44    pub gpio_opts: GpioOptions,
45    pub symlink_root: Option<&'a str>,
46}
47
48#[derive(Debug)]
49pub struct GpioUnexportOptions<'a> {
50    pub gpio_opts: GpioOptions,
51    pub symlink_root: Option<&'a str>,
52    pub pin: &'a str,
53}
54
55#[derive(Debug)]
56pub struct GpioUnexportAllOptions<'a> {
57    pub gpio_opts: GpioOptions,
58    pub symlink_root: Option<&'a str>,
59}
60
61#[derive(Debug)]
62pub struct GpioStatusOptions<'a> {
63    pub gpio_opts: GpioOptions,
64    pub pin: Option<&'a str>,
65}