-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathhf.idol
159 lines (158 loc) · 4.17 KB
/
hf.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Gimlet Host Flash API
Interface(
name: "HostFlash",
ops: {
"read_id": (
args: {},
reply: Result(
ok: "[u8; 20]",
err: CLike("HfError"),
),
),
"capacity": (
doc: "Return the flash capacity in bytes.",
args: {},
reply: Result(
ok: "usize",
err: CLike("HfError"),
),
),
"read_status": (
args: {},
reply: Result(
ok: "u8",
err: CLike("HfError"),
),
),
"bulk_erase": (
args: {
"protect": (
type: "HfProtectMode",
recv: FromPrimitive("u8"),
),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"page_program": (
args: {
"address": "u32",
"protect": (
type: "HfProtectMode",
recv: FromPrimitive("u8"),
),
},
leases: {
"data": (type: "[u8]", read: true, max_len: Some(256)),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"read": (
args: {
"address": "u32",
},
leases: {
"data": (type: "[u8]", write: true, max_len: Some(256)),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"sector_erase": (
args: {
"address": "u32",
"protect": (
type: "HfProtectMode",
recv: FromPrimitive("u8"),
),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"get_mux": (
doc: "Return the state of the mux",
reply: Result(
ok: (
type: "HfMuxState",
recv: FromPrimitive("u8"),
),
err: CLike("HfError"),
),
),
"set_mux": (
doc: "Set the state of the mux",
args: {
"state": (
type: "HfMuxState",
recv: FromPrimitive("u8"),
)
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"get_dev": (
doc: "Returns the selected device",
reply: Result(
ok: (
type: "HfDevSelect",
recv: FromPrimitive("u8"),
),
err: CLike("HfError"),
),
),
"set_dev": (
doc: "Sets the selected device",
args: {
"dev": (
type: "HfDevSelect",
recv: FromPrimitive("u8"),
),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
"hash": (
args: {
"address": "u32",
"len": "u32",
},
reply: Result(
ok: "[u8; drv_hash_api::SHA256_SZ]",
err: CLike("HfError"),
),
),
"get_persistent_data": (
doc: "looks up persistent configuration data",
reply: Result(
ok: "HfPersistentData",
err: CLike("HfError"),
),
encoding: Hubpack,
),
"write_persistent_data": (
doc: "stores persistent configuration data to flash",
args: {
"dev_select": (
type: "HfDevSelect",
recv: FromPrimitive("u8"),
),
},
reply: Result(
ok: "()",
err: CLike("HfError"),
),
),
},
)