This repository has been archived by the owner on Apr 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLine.php
139 lines (120 loc) · 2.67 KB
/
Line.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
namespace GPIO;
/**
* Represents a single GPIO line.
*/
final class Line {
/**
* Parent chip instance.
*
* @var \GPIO\Chip
*/
private Chip $chip;
/**
* @var int
*/
public const VALUE_HIGH = 1;
/**
* @var int
*/
public const VALUE_LOW = 0;
/**
* Get current bias of this line.
*
* @return int
*/
public function getBias(): int {}
/**
* Get the consumer of this line (if any).
*
* @return string
*/
public function getConsumer(): string {}
/**
* Get current direction of this line.
*
* @return int
*/
public function getDirection(): int {}
/**
* Get current drive setting of this line.
*
* @return int
*/
public function getDrive(): int {}
/**
* Get the parent chip.
*
* @return \GPIO\Chip
*/
public function getChip(): Chip {}
/**
* Read the line value.
*
* @return int
*/
public function getValue(): int {}
/**
* Check if this line's signal is inverted.
*
* @return bool
*/
public function isActiveLow(): bool {}
/**
* Check if this line is used by the kernel or other user space process.
*
* @return bool
*/
public function isUsed(): bool {}
/**
* Get the name of this line (if any).
*
* @return string
*/
public function getName(): string {}
/**
* Get the offset of this line.
*
* @return int
*/
public function getOffset(): int {}
/**
* Request this line.
*
* @param string $consumer Name of the consumer.
* @param int $type Request type.
* @param int $flags Configuration flags.
* @param int $value Default value (only matters for OUTPUT direction).
*/
public function request(string $consumer, int $type, int $flags, int $value = self::VALUE_LOW): void {}
/**
* Set configuration of this line.
*
* @param int $direction New direction.
* @param int $flags Replacement flags.
* @param int $value New value (0 or 1) - only matters for OUTPUT direction.
*/
public function setConfig(int $direction, int $flags, int $value = self::VALUE_LOW): void {}
/**
* Change the direction of this line to input.
*/
public function setDirectionInput(): void {}
/**
* Change the direction of this line to output.
*
* @param int $value New value (0 or 1).
*/
public function setDirectionOutput(int $value = self::VALUE_LOW): void {}
/**
* Set configuration flags of this line.
*
* @param int $flags Replacement flags.
*/
public function setFlags(int $flags): void {}
/**
* Set the value of this line.
*
* @param int $value New value (0 or 1).
*/
public function setValue(int $value): void {}
}