-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
i2c.stub.php
77 lines (66 loc) · 1.33 KB
/
i2c.stub.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
<?php
/** @generate-function-entries */
namespace I2C;
final class Bus {
/**
* Opens the I2C Bus.
*
* @param string $path Path to the I2C bus
* @param int $deviceId I2C device id
*
* @return void
*/
public function __construct(string $path, int $deviceId) {}
/**
* Read from I2C bus.
*
* @return int
*/
public function read(): int {}
/**
* Read a byte from a register.
*
* @param int $register Register address
*
* @return int
*/
public function readByte(int $register): int {}
/**
* Read a word from a register.
*
* @param int $register Register address
*
* @return int
*/
public function readWord(int $register): int {}
/**
* Write to I2C bus.
*
* @param int $data Data to be written
*
* @return int
*/
public function write(int $data): int {}
/**
* Write a byte to a register.
*
* @param int $register Register address
* @param int $value Byte value
*
* @return int
*/
public function writeByte(int $register, int $value): int {}
/**
* Write a word to a register.
*
* @param int $register Register address
* @param int $value Word value
*
* @return int
*/
public function writeWord(int $register, int $value): int {}
}
/**
* Base exception
*/
class Exception extends \Exception {}