@ikalogic/at1000 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/at1000-Bav5xUM1.mjs +3 -0
- package/build/at1000-Bav5xUM1.mjs.map +1 -0
- package/build/at1000-DjoKZEha.cjs +3 -0
- package/build/at1000-DjoKZEha.cjs.map +1 -0
- package/build/browser.cjs +1 -1
- package/build/browser.cjs.map +1 -1
- package/build/browser.d.cts +3 -3
- package/build/browser.d.cts.map +1 -1
- package/build/browser.d.mts +3 -3
- package/build/browser.d.mts.map +1 -1
- package/build/browser.mjs +1 -1
- package/build/browser.mjs.map +1 -1
- package/build/{com-DN1l6xqC.d.cts → com-Bkkgrsep.d.cts} +177 -177
- package/build/{com-DN1l6xqC.d.cts.map → com-Bkkgrsep.d.cts.map} +1 -1
- package/build/{com-DN1l6xqC.d.mts → com-Bkkgrsep.d.mts} +177 -177
- package/build/{com-DN1l6xqC.d.mts.map → com-Bkkgrsep.d.mts.map} +1 -1
- package/build/com.cjs +1 -1
- package/build/com.d.cts +1 -1
- package/build/com.d.mts +1 -1
- package/build/{common-BSrNhbq_.cjs → common-BUohXSqz.cjs} +2 -2
- package/build/{common-BSrNhbq_.cjs.map → common-BUohXSqz.cjs.map} +1 -1
- package/build/{events-Cf7iAMZP.d.cts → events-8aTmwMUi.d.cts} +6 -6
- package/build/events-8aTmwMUi.d.cts.map +1 -0
- package/build/{events-Cf7iAMZP.d.mts → events-8aTmwMUi.d.mts} +6 -6
- package/build/events-8aTmwMUi.d.mts.map +1 -0
- package/build/events.cjs +1 -1
- package/build/events.d.cts +1 -1
- package/build/events.d.mts +1 -1
- package/build/events.mjs +1 -1
- package/build/gpio-5-tRkdTW.d.mts +712 -0
- package/build/gpio-5-tRkdTW.d.mts.map +1 -0
- package/build/gpio-D3QEeLKh.d.cts +712 -0
- package/build/gpio-D3QEeLKh.d.cts.map +1 -0
- package/build/gpio.cjs +1 -1
- package/build/gpio.cjs.map +1 -1
- package/build/gpio.d.cts +2 -2
- package/build/gpio.d.mts +2 -2
- package/build/gpio.mjs +1 -1
- package/build/gpio.mjs.map +1 -1
- package/build/{hmi-B-potLdl.d.cts → hmi-BEMiVKDF.d.cts} +2 -2
- package/build/hmi-BEMiVKDF.d.cts.map +1 -0
- package/build/{hmi-B-potLdl.d.mts → hmi-BEMiVKDF.d.mts} +2 -2
- package/build/hmi-BEMiVKDF.d.mts.map +1 -0
- package/build/hmi.cjs +1 -1
- package/build/hmi.d.cts +1 -1
- package/build/hmi.d.mts +1 -1
- package/build/{at1000-gm586Tc9.d.mts → host-BBjSKRqs.d.mts} +18 -16
- package/build/host-BBjSKRqs.d.mts.map +1 -0
- package/build/{at1000-tUTVczQa.d.cts → host-DlP73amZ.d.cts} +18 -16
- package/build/host-DlP73amZ.d.cts.map +1 -0
- package/build/management-DqBsC1HB.cjs +7 -0
- package/build/management-DqBsC1HB.cjs.map +1 -0
- package/build/management-StKcAkgo.mjs +7 -0
- package/build/management-StKcAkgo.mjs.map +1 -0
- package/build/management.cjs +1 -1
- package/build/management.d.cts +75 -70
- package/build/management.d.cts.map +1 -1
- package/build/management.d.mts +75 -70
- package/build/management.d.mts.map +1 -1
- package/build/management.mjs +1 -1
- package/build/node.cjs +1 -1
- package/build/node.cjs.map +1 -1
- package/build/node.d.cts +3 -3
- package/build/node.d.cts.map +1 -1
- package/build/node.d.mts +3 -3
- package/build/node.d.mts.map +1 -1
- package/build/node.mjs +1 -1
- package/build/node.mjs.map +1 -1
- package/build/package-DNfLRnEC.mjs +2 -0
- package/build/package-DNfLRnEC.mjs.map +1 -0
- package/build/{package-0hAwYBa1.cjs → package-iERj9NJ6.cjs} +2 -2
- package/build/package-iERj9NJ6.cjs.map +1 -0
- package/build/{power-B8QFbKdP.d.cts → power-B3oUS0wU.d.cts} +18 -18
- package/build/power-B3oUS0wU.d.cts.map +1 -0
- package/build/{power-BZmXOJyK.d.mts → power-D08VFff6.d.mts} +18 -18
- package/build/power-D08VFff6.d.mts.map +1 -0
- package/build/power.cjs +1 -1
- package/build/power.cjs.map +1 -1
- package/build/power.d.cts +1 -1
- package/build/power.d.mts +1 -1
- package/build/power.mjs.map +1 -1
- package/build/relays-TADiLsPk.d.cts.map +1 -1
- package/build/relays-TADiLsPk.d.mts.map +1 -1
- package/build/relays.cjs +1 -1
- package/build/{rolldown-runtime-CMqjfN_6.cjs → rolldown-runtime-BocRIvOZ.cjs} +1 -1
- package/build/session-qWW9mqWH.d.cts.map +1 -1
- package/build/session-qWW9mqWH.d.mts.map +1 -1
- package/build/session.cjs +1 -1
- package/build/session.mjs +1 -1
- package/package.json +12 -22
- package/build/at1000-DbIvMQUc.cjs +0 -8
- package/build/at1000-DbIvMQUc.cjs.map +0 -1
- package/build/at1000-Zs18VzlP.mjs +0 -8
- package/build/at1000-Zs18VzlP.mjs.map +0 -1
- package/build/at1000-gm586Tc9.d.mts.map +0 -1
- package/build/at1000-tUTVczQa.d.cts.map +0 -1
- package/build/events-Cf7iAMZP.d.cts.map +0 -1
- package/build/events-Cf7iAMZP.d.mts.map +0 -1
- package/build/gpio-CsxbjhA_.d.cts +0 -406
- package/build/gpio-CsxbjhA_.d.cts.map +0 -1
- package/build/gpio-Dk-s_yMc.d.mts +0 -406
- package/build/gpio-Dk-s_yMc.d.mts.map +0 -1
- package/build/hmi-B-potLdl.d.cts.map +0 -1
- package/build/hmi-B-potLdl.d.mts.map +0 -1
- package/build/package-0hAwYBa1.cjs.map +0 -1
- package/build/package-CU5MagIg.mjs +0 -2
- package/build/package-CU5MagIg.mjs.map +0 -1
- package/build/power-B8QFbKdP.d.cts.map +0 -1
- package/build/power-BZmXOJyK.d.mts.map +0 -1
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
import { t as AnalogOutputLevel } from "./common-Cv6nZZS9.mjs";
|
|
2
|
+
import { Information } from "./management.mjs";
|
|
3
|
+
import { UpFetch } from "up-fetch";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
//#region src/api/gpio.d.ts
|
|
6
|
+
declare const analogInputConfiguration: v.ObjectSchema<{
|
|
7
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
8
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
9
|
+
}, undefined>;
|
|
10
|
+
declare const analogOutputConfiguration: v.ObjectSchema<{
|
|
11
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
12
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
13
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Input thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
17
|
+
*/
|
|
18
|
+
declare const digitalInputConfiguration: v.ObjectSchema<{
|
|
19
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
20
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
21
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
22
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
26
|
+
* Output levels `vol` and `voh` are in [0, 24] V, inclusive.
|
|
27
|
+
*/
|
|
28
|
+
declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
29
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
30
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
31
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
32
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
33
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
34
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
35
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
36
|
+
}, undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
39
|
+
*/
|
|
40
|
+
declare const openDrainConfiguration: v.ObjectSchema<{
|
|
41
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
42
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
43
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
44
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
45
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
46
|
+
}, undefined>;
|
|
47
|
+
type AnalogInputConfiguration = v.InferOutput<typeof analogInputConfiguration>;
|
|
48
|
+
type AnalogOutputConfiguration = v.InferOutput<typeof analogOutputConfiguration>;
|
|
49
|
+
type DigitalInputConfiguration = v.InferOutput<typeof digitalInputConfiguration>;
|
|
50
|
+
type DigitalOutputConfiguration = v.InferOutput<typeof digitalOutputConfiguration>;
|
|
51
|
+
type OpenDrainConfiguration = v.InferOutput<typeof openDrainConfiguration>;
|
|
52
|
+
declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
53
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
54
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
55
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
56
|
+
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
57
|
+
readonly entries: Omit<{
|
|
58
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
59
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
60
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
61
|
+
}, "direction" | "mode">;
|
|
62
|
+
readonly "~standard": v.StandardProps<{
|
|
63
|
+
value?: number | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
value?: number | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
68
|
+
value?: number | undefined;
|
|
69
|
+
}, v.MaxValueIssue<number, 24> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue>;
|
|
70
|
+
readonly "~types"?: {
|
|
71
|
+
readonly input: {
|
|
72
|
+
value?: number | undefined;
|
|
73
|
+
};
|
|
74
|
+
readonly output: {
|
|
75
|
+
value?: number | undefined;
|
|
76
|
+
};
|
|
77
|
+
readonly issue: v.MaxValueIssue<number, 24> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue;
|
|
78
|
+
} | undefined;
|
|
79
|
+
};
|
|
80
|
+
type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
|
|
81
|
+
declare const partialDigitalInputConfiguration: Omit<v.ObjectSchema<{
|
|
82
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
83
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
84
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
85
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
86
|
+
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
87
|
+
readonly entries: Omit<{
|
|
88
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
89
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
90
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
91
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
92
|
+
}, "direction" | "mode">;
|
|
93
|
+
readonly "~standard": v.StandardProps<{
|
|
94
|
+
vil: number;
|
|
95
|
+
vih: number;
|
|
96
|
+
}, {
|
|
97
|
+
vil: number;
|
|
98
|
+
vih: number;
|
|
99
|
+
}>;
|
|
100
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
101
|
+
vil: number;
|
|
102
|
+
vih: number;
|
|
103
|
+
}, v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.NumberIssue | v.ObjectIssue>;
|
|
104
|
+
readonly "~types"?: {
|
|
105
|
+
readonly input: {
|
|
106
|
+
vil: number;
|
|
107
|
+
vih: number;
|
|
108
|
+
};
|
|
109
|
+
readonly output: {
|
|
110
|
+
vil: number;
|
|
111
|
+
vih: number;
|
|
112
|
+
};
|
|
113
|
+
readonly issue: v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.NumberIssue | v.ObjectIssue;
|
|
114
|
+
} | undefined;
|
|
115
|
+
};
|
|
116
|
+
type PartialDigitalInputConfiguration = v.InferOutput<typeof partialDigitalInputConfiguration>;
|
|
117
|
+
declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
118
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
119
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
120
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
121
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
122
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
123
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
124
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
125
|
+
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
126
|
+
readonly entries: Omit<{
|
|
127
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
128
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
129
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
130
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
131
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
132
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
133
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
134
|
+
}, "direction" | "mode">;
|
|
135
|
+
readonly "~standard": v.StandardProps<{
|
|
136
|
+
value: number | boolean;
|
|
137
|
+
vol: number;
|
|
138
|
+
voh: number;
|
|
139
|
+
vil: number;
|
|
140
|
+
vih: number;
|
|
141
|
+
}, {
|
|
142
|
+
value: boolean;
|
|
143
|
+
vol: number;
|
|
144
|
+
voh: number;
|
|
145
|
+
vil: number;
|
|
146
|
+
vih: number;
|
|
147
|
+
}>;
|
|
148
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
149
|
+
value: boolean;
|
|
150
|
+
vol: number;
|
|
151
|
+
voh: number;
|
|
152
|
+
vil: number;
|
|
153
|
+
vih: number;
|
|
154
|
+
}, v.BooleanIssue | v.MaxValueIssue<number, 24> | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
155
|
+
readonly "~types"?: {
|
|
156
|
+
readonly input: {
|
|
157
|
+
value: number | boolean;
|
|
158
|
+
vol: number;
|
|
159
|
+
voh: number;
|
|
160
|
+
vil: number;
|
|
161
|
+
vih: number;
|
|
162
|
+
};
|
|
163
|
+
readonly output: {
|
|
164
|
+
value: boolean;
|
|
165
|
+
vol: number;
|
|
166
|
+
voh: number;
|
|
167
|
+
vil: number;
|
|
168
|
+
vih: number;
|
|
169
|
+
};
|
|
170
|
+
readonly issue: v.BooleanIssue | v.MaxValueIssue<number, 24> | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
171
|
+
} | undefined;
|
|
172
|
+
}, "entries" | "~run" | "~standard" | "~types"> & {
|
|
173
|
+
readonly entries: {
|
|
174
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
175
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
176
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
177
|
+
readonly vil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
178
|
+
readonly vih: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
179
|
+
};
|
|
180
|
+
readonly "~standard": v.StandardProps<{
|
|
181
|
+
value: number | boolean;
|
|
182
|
+
vol: number;
|
|
183
|
+
voh: number;
|
|
184
|
+
vil?: number | undefined;
|
|
185
|
+
vih?: number | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
value: boolean;
|
|
188
|
+
vol: number;
|
|
189
|
+
voh: number;
|
|
190
|
+
vil?: number | undefined;
|
|
191
|
+
vih?: number | undefined;
|
|
192
|
+
}>;
|
|
193
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
194
|
+
value: boolean;
|
|
195
|
+
vol: number;
|
|
196
|
+
voh: number;
|
|
197
|
+
vil?: number | undefined;
|
|
198
|
+
vih?: number | undefined;
|
|
199
|
+
}, v.BooleanIssue | v.MaxValueIssue<number, 24> | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
200
|
+
readonly "~types"?: {
|
|
201
|
+
readonly input: {
|
|
202
|
+
value: number | boolean;
|
|
203
|
+
vol: number;
|
|
204
|
+
voh: number;
|
|
205
|
+
vil?: number | undefined;
|
|
206
|
+
vih?: number | undefined;
|
|
207
|
+
};
|
|
208
|
+
readonly output: {
|
|
209
|
+
value: boolean;
|
|
210
|
+
vol: number;
|
|
211
|
+
voh: number;
|
|
212
|
+
vil?: number | undefined;
|
|
213
|
+
vih?: number | undefined;
|
|
214
|
+
};
|
|
215
|
+
readonly issue: v.BooleanIssue | v.MaxValueIssue<number, 24> | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.MinValueIssue<number, 0> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
216
|
+
} | undefined;
|
|
217
|
+
};
|
|
218
|
+
type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
|
|
219
|
+
declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
220
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
221
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
222
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
223
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
224
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
225
|
+
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
226
|
+
readonly entries: Omit<{
|
|
227
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
228
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
229
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
230
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
231
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
232
|
+
}, "direction" | "mode">;
|
|
233
|
+
readonly "~standard": v.StandardProps<{
|
|
234
|
+
value: number | boolean;
|
|
235
|
+
vil: number;
|
|
236
|
+
vih: number;
|
|
237
|
+
}, {
|
|
238
|
+
value: boolean;
|
|
239
|
+
vil: number;
|
|
240
|
+
vih: number;
|
|
241
|
+
}>;
|
|
242
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
243
|
+
value: boolean;
|
|
244
|
+
vil: number;
|
|
245
|
+
vih: number;
|
|
246
|
+
}, v.BooleanIssue | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
247
|
+
readonly "~types"?: {
|
|
248
|
+
readonly input: {
|
|
249
|
+
value: number | boolean;
|
|
250
|
+
vil: number;
|
|
251
|
+
vih: number;
|
|
252
|
+
};
|
|
253
|
+
readonly output: {
|
|
254
|
+
value: boolean;
|
|
255
|
+
vil: number;
|
|
256
|
+
vih: number;
|
|
257
|
+
};
|
|
258
|
+
readonly issue: v.BooleanIssue | v.MaxValueIssue<number, 25> | v.MinValueIssue<number, -25> | v.NumberIssue | v.ObjectIssue | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
259
|
+
} | undefined;
|
|
260
|
+
};
|
|
261
|
+
type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
|
|
262
|
+
declare const digitalState: v.ObjectSchema<{
|
|
263
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
264
|
+
}, undefined>;
|
|
265
|
+
declare const analogState: v.ObjectSchema<{
|
|
266
|
+
readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
267
|
+
}, undefined>;
|
|
268
|
+
declare const syncConfiguration: v.ObjectSchema<{
|
|
269
|
+
readonly action: v.PicklistSchema<["release", "hold"], "Invalid sync action">;
|
|
270
|
+
}, undefined>;
|
|
271
|
+
type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;
|
|
272
|
+
declare const syncState: v.ObjectSchema<{
|
|
273
|
+
readonly hold_state: v.PicklistSchema<["held", "released"], undefined>;
|
|
274
|
+
}, undefined>;
|
|
275
|
+
type SyncState = v.InferOutput<typeof syncState>;
|
|
276
|
+
declare const sequenceValue: v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>], undefined>;
|
|
277
|
+
declare const sequenceExpect: v.UnionSchema<[v.BooleanSchema<undefined>, v.ObjectSchema<{
|
|
278
|
+
readonly min: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
279
|
+
readonly max: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
280
|
+
}, undefined>], undefined>;
|
|
281
|
+
declare const sequenceCommand: v.VariantSchema<"op", [v.ObjectSchema<{
|
|
282
|
+
readonly op: v.LiteralSchema<"read", undefined>;
|
|
283
|
+
readonly io: v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>, undefined>, v.MinLengthAction<number[], 1, undefined>]>], undefined>;
|
|
284
|
+
readonly repeat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
285
|
+
readonly delay: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>, undefined>;
|
|
286
|
+
readonly expect: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.ObjectSchema<{
|
|
287
|
+
readonly min: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
288
|
+
readonly max: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
289
|
+
}, undefined>], undefined>, undefined>;
|
|
290
|
+
}, undefined>, v.ObjectSchema<{
|
|
291
|
+
readonly op: v.LiteralSchema<"write", undefined>;
|
|
292
|
+
readonly io: v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>, undefined>, v.MinLengthAction<number[], 1, undefined>]>], undefined>;
|
|
293
|
+
readonly value: v.UnionSchema<[v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>], undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>], undefined>, undefined>, v.MinLengthAction<(number | boolean)[], 1, undefined>]>], undefined>;
|
|
294
|
+
}, undefined>, v.ObjectSchema<{
|
|
295
|
+
readonly op: v.LiteralSchema<"wait_voltage", undefined>;
|
|
296
|
+
readonly io: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>;
|
|
297
|
+
readonly min: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
298
|
+
readonly max: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
299
|
+
readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>, undefined>;
|
|
300
|
+
readonly stable_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>, undefined>;
|
|
301
|
+
}, undefined>, v.ObjectSchema<{
|
|
302
|
+
readonly op: v.LiteralSchema<"wait_level", undefined>;
|
|
303
|
+
readonly io: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 31, undefined>]>;
|
|
304
|
+
readonly level: v.PicklistSchema<["low", "high"], "Invalid level">;
|
|
305
|
+
readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>, undefined>;
|
|
306
|
+
readonly stable_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>, undefined>;
|
|
307
|
+
}, undefined>, v.ObjectSchema<{
|
|
308
|
+
readonly op: v.LiteralSchema<"delay", undefined>;
|
|
309
|
+
readonly duration: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
|
|
310
|
+
}, undefined>, v.ObjectSchema<{
|
|
311
|
+
readonly op: v.LiteralSchema<"hold", undefined>;
|
|
312
|
+
}, undefined>, v.ObjectSchema<{
|
|
313
|
+
readonly op: v.LiteralSchema<"release", undefined>;
|
|
314
|
+
}, undefined>], undefined>;
|
|
315
|
+
declare const sequenceSample: v.ObjectSchema<{
|
|
316
|
+
readonly io: v.NumberSchema<undefined>;
|
|
317
|
+
readonly value: v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
318
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
319
|
+
}, undefined>;
|
|
320
|
+
declare const sequenceStep: v.ObjectSchema<{
|
|
321
|
+
readonly op: v.PicklistSchema<["read", "write", "wait_voltage", "wait_level", "delay", "hold", "release"], undefined>;
|
|
322
|
+
readonly io: v.OptionalSchema<v.UnionSchema<[v.NumberSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>], undefined>, undefined>;
|
|
323
|
+
readonly value: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
324
|
+
readonly samples: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
325
|
+
readonly io: v.NumberSchema<undefined>;
|
|
326
|
+
readonly value: v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
327
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
328
|
+
}, undefined>, undefined>, undefined>;
|
|
329
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
330
|
+
}, undefined>;
|
|
331
|
+
declare const sequenceReport: v.ObjectSchema<{
|
|
332
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
333
|
+
readonly results: v.ArraySchema<v.ObjectSchema<{
|
|
334
|
+
readonly op: v.PicklistSchema<["read", "write", "wait_voltage", "wait_level", "delay", "hold", "release"], undefined>;
|
|
335
|
+
readonly io: v.OptionalSchema<v.UnionSchema<[v.NumberSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>], undefined>, undefined>;
|
|
336
|
+
readonly value: v.OptionalSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
337
|
+
readonly samples: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
338
|
+
readonly io: v.NumberSchema<undefined>;
|
|
339
|
+
readonly value: v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
340
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
341
|
+
}, undefined>, undefined>, undefined>;
|
|
342
|
+
readonly elapsed: v.NumberSchema<undefined>;
|
|
343
|
+
}, undefined>, undefined>;
|
|
344
|
+
}, undefined>;
|
|
345
|
+
type GpioSequenceCommand = v.InferOutput<typeof sequenceCommand>;
|
|
346
|
+
type GpioSequenceSample = v.InferOutput<typeof sequenceSample>;
|
|
347
|
+
/**
|
|
348
|
+
* Result of one command.
|
|
349
|
+
*
|
|
350
|
+
* `value` carries a single-valued step — an ordinary read of one pin with no repeat, or
|
|
351
|
+
* a write of one pin — while `samples` carries a step that covered several pins or
|
|
352
|
+
* repeated: the readings of a `read`, or the values a `write` applied.
|
|
353
|
+
*/
|
|
354
|
+
type GpioSequenceStep = v.InferOutput<typeof sequenceStep>;
|
|
355
|
+
type SequenceWireReport = v.InferOutput<typeof sequenceReport>;
|
|
356
|
+
type SequenceKind = 'scalar' | 'collection' | 'control';
|
|
357
|
+
type SequenceDescriptor<Op extends GpioSequenceCommand['op'] = GpioSequenceCommand['op'], Kind extends SequenceKind = SequenceKind> = {
|
|
358
|
+
op: Op;
|
|
359
|
+
kind: Kind;
|
|
360
|
+
};
|
|
361
|
+
type SequenceMetadata<Op> = {
|
|
362
|
+
name: string;
|
|
363
|
+
index: number;
|
|
364
|
+
op: Op;
|
|
365
|
+
};
|
|
366
|
+
type SequenceAttempt<Op> = SequenceMetadata<Op> & {
|
|
367
|
+
elapsed: number;
|
|
368
|
+
};
|
|
369
|
+
type SequenceScalar<Op> = SequenceAttempt<Op> & {
|
|
370
|
+
kind: 'scalar';
|
|
371
|
+
io: number | number[];
|
|
372
|
+
value: boolean | number;
|
|
373
|
+
};
|
|
374
|
+
type SequenceCollection<Op> = SequenceAttempt<Op> & {
|
|
375
|
+
kind: 'collection';
|
|
376
|
+
io: number | number[];
|
|
377
|
+
samples: GpioSequenceSample[];
|
|
378
|
+
};
|
|
379
|
+
type SequenceControl<Op> = SequenceAttempt<Op> & {
|
|
380
|
+
kind: 'control';
|
|
381
|
+
};
|
|
382
|
+
type SequenceResultForKind<Op, Kind> = Kind extends 'scalar' ? SequenceScalar<Op> : Kind extends 'collection' ? SequenceCollection<Op> : SequenceControl<Op>;
|
|
383
|
+
type SequenceResult<Descriptor> = Descriptor extends SequenceDescriptor<infer Op, infer Kind> ? SequenceResultForKind<Op, Kind> : never;
|
|
384
|
+
type SequenceDescriptors = SequenceDescriptor<'read' | 'write', 'scalar' | 'collection'> | SequenceDescriptor<'wait_voltage' | 'wait_level', 'scalar'> | SequenceDescriptor<'hold' | 'release' | 'delay', 'control'>;
|
|
385
|
+
type GpioSequenceNamedResult = SequenceResult<SequenceDescriptors>;
|
|
386
|
+
type SequenceNamed<Names> = { readonly [Name in keyof Names]: SequenceResult<Names[Name]>; };
|
|
387
|
+
type SequenceAssociation = {
|
|
388
|
+
name: string;
|
|
389
|
+
index: number;
|
|
390
|
+
command: GpioSequenceCommand;
|
|
391
|
+
};
|
|
392
|
+
/** Raw results remain in command order. Names are local to this run. */
|
|
393
|
+
declare class GpioSequenceReport<Names = {}> {
|
|
394
|
+
#private;
|
|
395
|
+
readonly elapsed: number;
|
|
396
|
+
readonly results: GpioSequenceStep[];
|
|
397
|
+
readonly named: SequenceNamed<Names>;
|
|
398
|
+
/** Constructing a bare wire report does not restore command names. */
|
|
399
|
+
constructor(wire: SequenceWireReport, associations?: readonly SequenceAssociation[]);
|
|
400
|
+
get(name: string): GpioSequenceNamedResult | undefined;
|
|
401
|
+
toJSON(): SequenceWireReport;
|
|
402
|
+
}
|
|
403
|
+
type SequenceReadRepeat<Options> = Options extends GpioSequenceReadOptions ? 'repeat' extends keyof Options ? Options['repeat'] : undefined : undefined;
|
|
404
|
+
type SequenceReadKind<Pins, Repeat> = Pins extends readonly number[] ? 'collection' : Repeat extends undefined | 1 ? 'scalar' : number extends Repeat ? 'scalar' | 'collection' : 'collection';
|
|
405
|
+
type SequenceWriteKind<Pins> = Pins extends readonly number[] ? number extends Pins['length'] ? 'scalar' | 'collection' : Pins['length'] extends 1 ? 'scalar' : 'collection' : 'scalar';
|
|
406
|
+
type SequenceWithName<Names, Name extends string, Last> = string extends Name ? Names : Name extends string ? Names & { [Key in Name]: Last; } : never;
|
|
407
|
+
type SequenceNode = {
|
|
408
|
+
readonly command: GpioSequenceCommand;
|
|
409
|
+
readonly name?: string;
|
|
410
|
+
readonly previous?: SequenceNode;
|
|
411
|
+
readonly length: number;
|
|
412
|
+
};
|
|
413
|
+
/** A digital level, or inclusive voltage bounds for an analog pin. */
|
|
414
|
+
type GpioSequenceExpectation = v.InferOutput<typeof sequenceExpect>;
|
|
415
|
+
/** A digital level, or a voltage for an analog pin. */
|
|
416
|
+
type GpioSequenceValue = v.InferOutput<typeof sequenceValue>;
|
|
417
|
+
type GpioSequenceReadOptions = {
|
|
418
|
+
repeat?: number;
|
|
419
|
+
delay?: number;
|
|
420
|
+
expect?: GpioSequenceExpectation;
|
|
421
|
+
};
|
|
422
|
+
/** A digital level: the strings the wire uses, or a boolean (`true` is high). */
|
|
423
|
+
type GpioSequenceLevel = 'low' | 'high' | boolean;
|
|
424
|
+
type GpioSequenceWaitOptions = {
|
|
425
|
+
timeout?: number;
|
|
426
|
+
stable_for?: number;
|
|
427
|
+
};
|
|
428
|
+
/** At least one edge is required; both together are an inclusive band. */
|
|
429
|
+
type GpioSequenceWaitVoltageOptions = ({
|
|
430
|
+
min: number;
|
|
431
|
+
max?: number;
|
|
432
|
+
} | {
|
|
433
|
+
max: number;
|
|
434
|
+
min?: number;
|
|
435
|
+
}) & GpioSequenceWaitOptions;
|
|
436
|
+
declare const gpioConfiguration: v.UnionSchema<[v.ObjectSchema<{
|
|
437
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
438
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
439
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
440
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
441
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
442
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
443
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
444
|
+
}, undefined>, v.ObjectSchema<{
|
|
445
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
446
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
447
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
448
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
449
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
450
|
+
}, undefined>, v.ObjectSchema<{
|
|
451
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
452
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
453
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
454
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
455
|
+
}, undefined>, v.ObjectSchema<{
|
|
456
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
457
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
458
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
459
|
+
}, undefined>, v.ObjectSchema<{
|
|
460
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
461
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
462
|
+
}, undefined>], undefined>;
|
|
463
|
+
type GpioConfiguration = v.InferOutput<typeof gpioConfiguration>;
|
|
464
|
+
/** @hideconstructor */
|
|
465
|
+
declare class GpioApi {
|
|
466
|
+
private readonly fetch;
|
|
467
|
+
private count;
|
|
468
|
+
constructor(fetch: UpFetch, info: Information);
|
|
469
|
+
/**
|
|
470
|
+
* Resets all IO configurations to default.
|
|
471
|
+
*/
|
|
472
|
+
reset(): Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
* Access a specific digital IO pin by id.
|
|
475
|
+
* @param io The IO pin id.
|
|
476
|
+
* @returns The digital IO instance.
|
|
477
|
+
*/
|
|
478
|
+
digital(io: number): DigitalIO;
|
|
479
|
+
/**
|
|
480
|
+
* Access a specific analog IO pin by id.
|
|
481
|
+
* @param io The IO pin id.
|
|
482
|
+
* @returns The analog IO instance.
|
|
483
|
+
*/
|
|
484
|
+
analog(io: number): AnalogIO;
|
|
485
|
+
/**
|
|
486
|
+
* Holds the current state of all GPIO pins.
|
|
487
|
+
* @returns The applied sync state.
|
|
488
|
+
*/
|
|
489
|
+
hold(): Promise<SyncConfiguration>;
|
|
490
|
+
/**
|
|
491
|
+
* Releases control of the IO pins, allowing external control.
|
|
492
|
+
*
|
|
493
|
+
* This also sets the device as a slave.
|
|
494
|
+
*
|
|
495
|
+
* @returns The applied sync state.
|
|
496
|
+
*/
|
|
497
|
+
release(): Promise<SyncConfiguration>;
|
|
498
|
+
/**
|
|
499
|
+
* Reads back the current configuration of a specific IO pin.
|
|
500
|
+
* @param io The IO pin id.
|
|
501
|
+
* @returns The pin's current configuration.
|
|
502
|
+
*/
|
|
503
|
+
read_config(io: number): Promise<GpioConfiguration>;
|
|
504
|
+
/**
|
|
505
|
+
* Reads the current hold state of all GPIO pins.
|
|
506
|
+
* @returns The current sync state.
|
|
507
|
+
*/
|
|
508
|
+
read_sync(): Promise<SyncState>;
|
|
509
|
+
/**
|
|
510
|
+
* Starts a command sequence.
|
|
511
|
+
*
|
|
512
|
+
* The device runs every appended command back to back, holding the IO subsystem for
|
|
513
|
+
* the whole run, so no other IO request interleaves. Every pin used must be
|
|
514
|
+
* configured before `run()`.
|
|
515
|
+
*
|
|
516
|
+
* @returns An empty sequence builder.
|
|
517
|
+
*/
|
|
518
|
+
sequence(): GpioSequence;
|
|
519
|
+
}
|
|
520
|
+
/** @hideconstructor */
|
|
521
|
+
declare class DigitalIO {
|
|
522
|
+
private readonly fetch;
|
|
523
|
+
readonly id: number;
|
|
524
|
+
constructor(fetch: UpFetch, id: number);
|
|
525
|
+
/**
|
|
526
|
+
* Configure the pin as a digital input.
|
|
527
|
+
* @param config The digital input configuration.
|
|
528
|
+
* @returns The applied configuration.
|
|
529
|
+
*/
|
|
530
|
+
configure_input(config: PartialDigitalInputConfiguration): Promise<DigitalInputConfiguration>;
|
|
531
|
+
/**
|
|
532
|
+
* Configures the pin as a digital output.
|
|
533
|
+
* @param config The digital output configuration.
|
|
534
|
+
* @returns The applied configuration.
|
|
535
|
+
*/
|
|
536
|
+
configure_output(config: PartialDigitalOutputConfiguration): Promise<DigitalOutputConfiguration>;
|
|
537
|
+
/**
|
|
538
|
+
* Reads the current state of the pin.
|
|
539
|
+
* @returns The current state of the pin.
|
|
540
|
+
*/
|
|
541
|
+
read(): Promise<boolean>;
|
|
542
|
+
/**
|
|
543
|
+
* Writes a value to the pin.
|
|
544
|
+
* @param value The value to write.
|
|
545
|
+
* @returns The written value.
|
|
546
|
+
*/
|
|
547
|
+
write(value: boolean | number): Promise<boolean>;
|
|
548
|
+
/**
|
|
549
|
+
* Configure the pin as an open drain output.
|
|
550
|
+
* @param config The open drain configuration.
|
|
551
|
+
* @returns The applied configuration.
|
|
552
|
+
*/
|
|
553
|
+
configure_open_drain(config: PartialOpenDrainConfiguration): Promise<OpenDrainConfiguration>;
|
|
554
|
+
}
|
|
555
|
+
/** @hideconstructor */
|
|
556
|
+
declare class AnalogIO {
|
|
557
|
+
private readonly fetch;
|
|
558
|
+
readonly id: number;
|
|
559
|
+
constructor(fetch: UpFetch, id: number);
|
|
560
|
+
/**
|
|
561
|
+
* Configures the pin as an analog input.
|
|
562
|
+
* @returns The applied configuration.
|
|
563
|
+
* @returns The applied configuration.
|
|
564
|
+
*/
|
|
565
|
+
configure_input(): Promise<AnalogInputConfiguration>;
|
|
566
|
+
/**
|
|
567
|
+
* Configures the pin as an analog output.
|
|
568
|
+
* @param config The analog output configuration.
|
|
569
|
+
* @returns The applied configuration.
|
|
570
|
+
*/
|
|
571
|
+
configure_output(value: AnalogOutputLevel): Promise<AnalogOutputConfiguration>;
|
|
572
|
+
/**
|
|
573
|
+
* Reads the current state of the pin.
|
|
574
|
+
* @returns The current state of the pin.
|
|
575
|
+
*/
|
|
576
|
+
read(): Promise<number>;
|
|
577
|
+
/**
|
|
578
|
+
* Writes a value to the pin.
|
|
579
|
+
* @param value The value to write.
|
|
580
|
+
* @returns The written value.
|
|
581
|
+
*/
|
|
582
|
+
write(value: number): Promise<number>;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* A list of IO commands the device runs back to back.
|
|
586
|
+
*
|
|
587
|
+
* Nothing is sent until `run()`. `repeat`, `delay`, `expect` and `stable_for` are
|
|
588
|
+
* device-side parameters: the builder never expands one appended command into several,
|
|
589
|
+
* and never loops client-side. A builder is reusable — `run()` keeps the commands, so
|
|
590
|
+
* the same sequence can be run again.
|
|
591
|
+
*
|
|
592
|
+
* @hideconstructor
|
|
593
|
+
*/
|
|
594
|
+
declare class GpioSequence<Names = {}, Last = never> {
|
|
595
|
+
private readonly fetch;
|
|
596
|
+
private readonly count;
|
|
597
|
+
private readonly tail?;
|
|
598
|
+
constructor(fetch: UpFetch, count: number, tail?: SequenceNode | undefined);
|
|
599
|
+
/**
|
|
600
|
+
* Reads one pin, or several pins in the order given.
|
|
601
|
+
*
|
|
602
|
+
* `repeat` is the total number of readings of the whole pin list (1 when omitted) and
|
|
603
|
+
* `delay` is the gap in seconds between passes: the first pass runs immediately, every
|
|
604
|
+
* later pass waits `delay`, nothing waits after the last one, and nothing waits
|
|
605
|
+
* between the pins of one pass. It is an end-to-start gap, not a sampling interval,
|
|
606
|
+
* so the effective period is `delay` plus however long a pass takes. `expect` is
|
|
607
|
+
* asserted on every reading: a boolean needs digital pins, inclusive `{ min, max }`
|
|
608
|
+
* volts needs analog pins. A failed assertion fails the whole run with
|
|
609
|
+
* `SEQUENCE_ASSERTION_FAILED`.
|
|
610
|
+
*
|
|
611
|
+
* @param io The pin, or the distinct pins to read in order.
|
|
612
|
+
* @param options Repetition, inter-pass gap and assertion.
|
|
613
|
+
* @returns An independent builder with this command appended.
|
|
614
|
+
*/
|
|
615
|
+
read<const Pins extends number | readonly number[], const Options extends GpioSequenceReadOptions | undefined = undefined>(io: Pins, options?: Options): GpioSequence<Names, SequenceDescriptor<'read', SequenceReadKind<Pins, SequenceReadRepeat<Options>>>>;
|
|
616
|
+
/**
|
|
617
|
+
* Writes one pin, or several pins in the order given.
|
|
618
|
+
*
|
|
619
|
+
* A single `value` is applied to every listed pin; an array pairs one value per pin,
|
|
620
|
+
* in the order of `io`, and must be exactly as long as the pin list. Each pin's
|
|
621
|
+
* configured mode decides what its value means, exactly like the per-pin API: on a
|
|
622
|
+
* digital pin a number is a level (`0` low, anything else high), on an analog pin a
|
|
623
|
+
* number is volts, and a boolean written to an analog pin is rejected by the device.
|
|
624
|
+
* The pins are independent, so one command may mix a digital level and an analog
|
|
625
|
+
* voltage. Closed-loop output correction still runs per pin, so a multi-pin analog
|
|
626
|
+
* write costs one correction per pin. Writing a pin several times, or spacing writes
|
|
627
|
+
* out, means appending more `write` commands with `delay()` between them.
|
|
628
|
+
*
|
|
629
|
+
* A write of one pin reports the applied `value`; a write of several reports
|
|
630
|
+
* `samples`, one entry per pin in the order they were driven.
|
|
631
|
+
*
|
|
632
|
+
* @param io The pin, or the distinct pins to write in order.
|
|
633
|
+
* @param value The value applied to every pin, or one value per pin.
|
|
634
|
+
* @returns An independent builder with this command appended.
|
|
635
|
+
*/
|
|
636
|
+
write<const Pins extends number | readonly number[]>(io: Pins, value: GpioSequenceValue | readonly GpioSequenceValue[]): GpioSequence<Names, SequenceDescriptor<'write', SequenceWriteKind<Pins>>>;
|
|
637
|
+
/**
|
|
638
|
+
* Waits for an analog pin to read inside a voltage bound.
|
|
639
|
+
*
|
|
640
|
+
* The pin must be in `analog` mode; the device rejects a digital one, which
|
|
641
|
+
* {@link GpioSequence.wait_level} handles instead. `min` alone waits for the pin to
|
|
642
|
+
* read at or above it, `max` alone for at or below it, and the two together for the
|
|
643
|
+
* inclusive band they describe; at least one is required and `min` must not be above
|
|
644
|
+
* `max`. The semantics are on the sample, not the edge, so a pin already inside the
|
|
645
|
+
* bound completes immediately. `stable_for` (seconds) requires the bound to hold
|
|
646
|
+
* across samples spanning that long; any sample outside it restarts the window.
|
|
647
|
+
* Voltages come from polled ADC samples, so an excursion shorter than the interval
|
|
648
|
+
* between two samples is invisible. A wait that exceeds its `timeout` fails the whole
|
|
649
|
+
* run with `SEQUENCE_TIMED_OUT`.
|
|
650
|
+
*
|
|
651
|
+
* @param io The pin to watch.
|
|
652
|
+
* @param options The bound edges in volts, time budget and stability window.
|
|
653
|
+
* @returns An independent builder with this command appended.
|
|
654
|
+
*/
|
|
655
|
+
wait_voltage(io: number, options: GpioSequenceWaitVoltageOptions): GpioSequence<Names, SequenceDescriptor<'wait_voltage', 'scalar'>>;
|
|
656
|
+
/**
|
|
657
|
+
* Waits for a digital pin to read a level.
|
|
658
|
+
*
|
|
659
|
+
* The pin must be in `digital` mode; the device rejects an analog one, which
|
|
660
|
+
* {@link GpioSequence.wait_voltage} handles instead. The level is resolved from the
|
|
661
|
+
* pin's configured `vil`/`vih`. The semantics are on the level, not the edge, so a pin
|
|
662
|
+
* that already reads the level completes immediately. `stable_for` (seconds) requires
|
|
663
|
+
* the level to hold across samples spanning that long; any sample that fails the
|
|
664
|
+
* condition restarts the window. Levels come from polled ADC samples, so a transition
|
|
665
|
+
* shorter than the interval between two samples is invisible. A wait that exceeds its
|
|
666
|
+
* `timeout` fails the whole run with `SEQUENCE_TIMED_OUT`.
|
|
667
|
+
*
|
|
668
|
+
* @param io The pin to watch.
|
|
669
|
+
* @param level The level to wait for, as `'low'`/`'high'` or a boolean.
|
|
670
|
+
* @param options Time budget and stability window.
|
|
671
|
+
* @returns An independent builder with this command appended.
|
|
672
|
+
*/
|
|
673
|
+
wait_level(io: number, level: GpioSequenceLevel, options?: GpioSequenceWaitOptions): GpioSequence<Names, SequenceDescriptor<'wait_level', 'scalar'>>;
|
|
674
|
+
/**
|
|
675
|
+
* Sleeps, holding the IO subsystem.
|
|
676
|
+
* @param duration Seconds to sleep.
|
|
677
|
+
* @returns An independent builder with this command appended.
|
|
678
|
+
*/
|
|
679
|
+
delay(duration: number): GpioSequence<Names, SequenceDescriptor<'delay', 'control'>>;
|
|
680
|
+
/**
|
|
681
|
+
* Holds synchronization, freezing the analog outputs for the rest of the sequence.
|
|
682
|
+
* @returns An independent builder with this command appended.
|
|
683
|
+
*/
|
|
684
|
+
hold(): GpioSequence<Names, SequenceDescriptor<'hold', 'control'>>;
|
|
685
|
+
/**
|
|
686
|
+
* Releases synchronization, applying every output staged while it was held.
|
|
687
|
+
* @returns An independent builder with this command appended.
|
|
688
|
+
*/
|
|
689
|
+
release(): GpioSequence<Names, SequenceDescriptor<'release', 'control'>>;
|
|
690
|
+
/** Names the preceding command without changing this builder or the wire request. */
|
|
691
|
+
as<const Name extends string>(name: Name & ([Last] extends [never] ? never : Name extends keyof Names ? never : unknown)): GpioSequence<SequenceWithName<Names, Name, Last>, never>;
|
|
692
|
+
/**
|
|
693
|
+
* Runs the sequence on the device.
|
|
694
|
+
*
|
|
695
|
+
* A wait that times out, a sequence that exceeds its budget and a failed read
|
|
696
|
+
* assertion reject with an `ApiError` whose `code` is `SEQUENCE_TIMED_OUT` or
|
|
697
|
+
* `SEQUENCE_ASSERTION_FAILED`; nothing after the stopping command runs, and no
|
|
698
|
+
* partial report is produced.
|
|
699
|
+
*
|
|
700
|
+
* @param options Total time budget in seconds, 30 when omitted.
|
|
701
|
+
* @returns One result per appended command.
|
|
702
|
+
*/
|
|
703
|
+
run(options?: {
|
|
704
|
+
timeout?: number;
|
|
705
|
+
}): Promise<GpioSequenceReport<Names>>;
|
|
706
|
+
private pinList;
|
|
707
|
+
private check;
|
|
708
|
+
private append;
|
|
709
|
+
}
|
|
710
|
+
//#endregion
|
|
711
|
+
export { analogState as A, PartialDigitalInputConfiguration as C, SyncState as D, SyncConfiguration as E, openDrainConfiguration as F, syncState as I, digitalOutputConfiguration as M, digitalState as N, analogInputConfiguration as O, gpioConfiguration as P, PartialAnalogOutputConfiguration as S, PartialOpenDrainConfiguration as T, GpioSequenceStep as _, DigitalInputConfiguration as a, GpioSequenceWaitVoltageOptions as b, GpioConfiguration as c, GpioSequenceExpectation as d, GpioSequenceLevel as f, GpioSequenceSample as g, GpioSequenceReport as h, DigitalIO as i, digitalInputConfiguration as j, analogOutputConfiguration as k, GpioSequence as l, GpioSequenceReadOptions as m, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, GpioSequenceNamedResult as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, GpioSequenceCommand as u, GpioSequenceValue as v, PartialDigitalOutputConfiguration as w, OpenDrainConfiguration as x, GpioSequenceWaitOptions as y };
|
|
712
|
+
//# sourceMappingURL=gpio-5-tRkdTW.d.mts.map
|