-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathspi.idol
70 lines (68 loc) · 2.08 KB
/
spi.idol
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
// SPI server IPC interface
Interface(
name: "Spi",
ops: {
"read": (
doc: "Read bytes from device `device_index` into `sink`, shifting out 1s.",
args: {
"device_index": "u8",
},
leases: {
"sink": (type: "[u8]", write: true, max_len: Some(65535)),
},
reply: Result(
ok: "()",
err: CLike("drv_spi_api::SpiError"),
),
),
"write": (
doc: "Write bytes from `source` and to device `device_index`, ignoring whatever's sent back.",
args: {
"device_index": "u8",
},
leases: {
"source": (type: "[u8]", read: true, max_len: Some(65535)),
},
reply: Result(
ok: "()",
err: CLike("drv_spi_api::SpiError"),
),
),
"exchange": (
doc: "Simultaneously write bytes from `source` and read bytes into `sink` using device `device_index`.",
args: {
"device_index": "u8",
},
leases: {
"source": (type: "[u8]", read: true, max_len: Some(65535)),
"sink": (type: "[u8]", write: true, max_len: Some(65535)),
},
reply: Result(
ok: "()",
err: CLike("drv_spi_api::SpiError"),
),
),
"lock": (
doc: "Take exclusive control of this SPI controller for talking to device `device_index`.",
args: {
"device_index": "u8",
"cs_state": (
type: "CsState",
recv: FromPrimitive("u8"),
),
},
reply: Result(
ok: "()",
err: ServerDeath,
),
),
"release": (
doc: "Release a previously acquired lock.",
args: {},
reply: Result(
ok: "()",
err: ServerDeath,
),
),
},
)