@ikalogic/at1000 0.5.2 → 0.6.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-BGZGhgco.mjs +3 -0
- package/build/at1000-BGZGhgco.mjs.map +1 -0
- package/build/at1000-D9r6GCs0.cjs +3 -0
- package/build/at1000-D9r6GCs0.cjs.map +1 -0
- package/build/browser.cjs +1 -1
- package/build/browser.cjs.map +1 -1
- package/build/browser.d.cts +1 -1
- package/build/browser.d.mts +1 -1
- package/build/browser.mjs +1 -1
- package/build/browser.mjs.map +1 -1
- package/build/{com-DN1l6xqC.d.cts → com-XQjoTBdU.d.cts} +25 -25
- package/build/{com-DN1l6xqC.d.cts.map → com-XQjoTBdU.d.cts.map} +1 -1
- package/build/{com-DN1l6xqC.d.mts → com-XQjoTBdU.d.mts} +25 -25
- package/build/{com-DN1l6xqC.d.mts.map → com-XQjoTBdU.d.mts.map} +1 -1
- package/build/com.d.cts +1 -1
- package/build/com.d.mts +1 -1
- package/build/events.cjs +1 -1
- package/build/events.mjs +1 -1
- package/build/{gpio-CsxbjhA_.d.cts → gpio-Bk1VEKYF.d.cts} +19 -9
- package/build/gpio-Bk1VEKYF.d.cts.map +1 -0
- package/build/{gpio-Dk-s_yMc.d.mts → gpio-bFe112uI.d.mts} +19 -9
- package/build/gpio-bFe112uI.d.mts.map +1 -0
- package/build/gpio.cjs.map +1 -1
- package/build/gpio.d.cts +1 -1
- package/build/gpio.d.mts +1 -1
- package/build/gpio.mjs.map +1 -1
- package/build/{at1000-tUTVczQa.d.cts → host-BCOEcUog.d.cts} +15 -13
- package/build/host-BCOEcUog.d.cts.map +1 -0
- package/build/{at1000-gm586Tc9.d.mts → host-DJ8SAGMC.d.mts} +15 -13
- package/build/host-DJ8SAGMC.d.mts.map +1 -0
- package/build/management-BGrPAG5k.cjs +7 -0
- package/build/management-BGrPAG5k.cjs.map +1 -0
- package/build/management-CuI4cenF.mjs +7 -0
- package/build/management-CuI4cenF.mjs.map +1 -0
- package/build/management.cjs +1 -1
- package/build/management.d.cts +27 -21
- package/build/management.d.cts.map +1 -1
- package/build/management.d.mts +27 -21
- 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 +1 -1
- package/build/node.d.mts +1 -1
- package/build/node.mjs +1 -1
- package/build/node.mjs.map +1 -1
- package/build/package-CXtuh0C5.mjs +2 -0
- package/build/package-CXtuh0C5.mjs.map +1 -0
- package/build/{package-0hAwYBa1.cjs → package-DDLRsahz.cjs} +2 -2
- package/build/package-DDLRsahz.cjs.map +1 -0
- package/build/power.cjs.map +1 -1
- package/build/power.mjs.map +1 -1
- package/build/session.cjs +1 -1
- package/build/session.mjs +1 -1
- package/package.json +1 -1
- 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/gpio-CsxbjhA_.d.cts.map +0 -1
- package/build/gpio-Dk-s_yMc.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
|
@@ -374,7 +374,7 @@ declare const rs232ConfigPatch: Omit<v.ObjectSchema<{
|
|
|
374
374
|
data_bits?: number | undefined;
|
|
375
375
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
376
376
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
377
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
377
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>>;
|
|
378
378
|
readonly "~types"?: {
|
|
379
379
|
readonly input: {
|
|
380
380
|
enabled?: boolean | undefined;
|
|
@@ -390,7 +390,7 @@ declare const rs232ConfigPatch: Omit<v.ObjectSchema<{
|
|
|
390
390
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
391
391
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
392
392
|
};
|
|
393
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
393
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>;
|
|
394
394
|
} | undefined;
|
|
395
395
|
};
|
|
396
396
|
type Rs232ConfigPatch = v.InferOutput<typeof rs232ConfigPatch>;
|
|
@@ -427,7 +427,7 @@ declare const rs232EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
427
427
|
data_bits?: number | undefined;
|
|
428
428
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
429
429
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
430
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
430
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>>;
|
|
431
431
|
readonly "~types"?: {
|
|
432
432
|
readonly input: {
|
|
433
433
|
enabled?: boolean | undefined;
|
|
@@ -443,7 +443,7 @@ declare const rs232EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
443
443
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
444
444
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
445
445
|
};
|
|
446
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
446
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>;
|
|
447
447
|
} | undefined;
|
|
448
448
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
449
449
|
readonly entries: Omit<{
|
|
@@ -469,7 +469,7 @@ declare const rs232EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
469
469
|
data_bits?: number | undefined;
|
|
470
470
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
471
471
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
472
|
-
}, v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
472
|
+
}, v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>>;
|
|
473
473
|
readonly "~types"?: {
|
|
474
474
|
readonly input: {
|
|
475
475
|
baud_rate?: number | undefined;
|
|
@@ -483,7 +483,7 @@ declare const rs232EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
483
483
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
484
484
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
485
485
|
};
|
|
486
|
-
readonly issue: v.PicklistIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7
|
|
486
|
+
readonly issue: v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 50> | v.MaxValueIssue<number, 1000000> | v.MinValueIssue<number, 7>;
|
|
487
487
|
} | undefined;
|
|
488
488
|
};
|
|
489
489
|
type Rs232EnableConfig = v.InferOutput<typeof rs232EnableConfig>;
|
|
@@ -534,7 +534,7 @@ declare const rs485ConfigPatch: Omit<v.ObjectSchema<{
|
|
|
534
534
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
535
535
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
536
536
|
termination_resistors?: boolean | undefined;
|
|
537
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
537
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>>;
|
|
538
538
|
readonly "~types"?: {
|
|
539
539
|
readonly input: {
|
|
540
540
|
enabled?: boolean | undefined;
|
|
@@ -552,7 +552,7 @@ declare const rs485ConfigPatch: Omit<v.ObjectSchema<{
|
|
|
552
552
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
553
553
|
termination_resistors?: boolean | undefined;
|
|
554
554
|
};
|
|
555
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
555
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>;
|
|
556
556
|
} | undefined;
|
|
557
557
|
};
|
|
558
558
|
type Rs485ConfigPatch = v.InferOutput<typeof rs485ConfigPatch>;
|
|
@@ -594,7 +594,7 @@ declare const rs485EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
594
594
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
595
595
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
596
596
|
termination_resistors?: boolean | undefined;
|
|
597
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
597
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>>;
|
|
598
598
|
readonly "~types"?: {
|
|
599
599
|
readonly input: {
|
|
600
600
|
enabled?: boolean | undefined;
|
|
@@ -612,7 +612,7 @@ declare const rs485EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
612
612
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
613
613
|
termination_resistors?: boolean | undefined;
|
|
614
614
|
};
|
|
615
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
615
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>;
|
|
616
616
|
} | undefined;
|
|
617
617
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
618
618
|
readonly entries: Omit<{
|
|
@@ -642,7 +642,7 @@ declare const rs485EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
642
642
|
data_bits?: number | undefined;
|
|
643
643
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
644
644
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
645
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
645
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>>;
|
|
646
646
|
readonly "~types"?: {
|
|
647
647
|
readonly input: {
|
|
648
648
|
baud_rate?: number | undefined;
|
|
@@ -658,7 +658,7 @@ declare const rs485EnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
658
658
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
659
659
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
660
660
|
};
|
|
661
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
661
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 20000000>;
|
|
662
662
|
} | undefined;
|
|
663
663
|
};
|
|
664
664
|
type Rs485EnableConfig = v.InferOutput<typeof rs485EnableConfig>;
|
|
@@ -697,7 +697,7 @@ declare const spiConfigPatch: Omit<v.ObjectSchema<{
|
|
|
697
697
|
baud_rate?: number | undefined;
|
|
698
698
|
vcc?: number | undefined;
|
|
699
699
|
mode?: number | undefined;
|
|
700
|
-
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
700
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>>;
|
|
701
701
|
readonly "~types"?: {
|
|
702
702
|
readonly input: {
|
|
703
703
|
enabled?: boolean | undefined;
|
|
@@ -711,7 +711,7 @@ declare const spiConfigPatch: Omit<v.ObjectSchema<{
|
|
|
711
711
|
vcc?: number | undefined;
|
|
712
712
|
mode?: number | undefined;
|
|
713
713
|
};
|
|
714
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
714
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>;
|
|
715
715
|
} | undefined;
|
|
716
716
|
};
|
|
717
717
|
type SpiConfigPatch = v.InferOutput<typeof spiConfigPatch>;
|
|
@@ -743,7 +743,7 @@ declare const spiEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
743
743
|
baud_rate?: number | undefined;
|
|
744
744
|
vcc?: number | undefined;
|
|
745
745
|
mode?: number | undefined;
|
|
746
|
-
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
746
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>>;
|
|
747
747
|
readonly "~types"?: {
|
|
748
748
|
readonly input: {
|
|
749
749
|
enabled?: boolean | undefined;
|
|
@@ -757,7 +757,7 @@ declare const spiEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
757
757
|
vcc?: number | undefined;
|
|
758
758
|
mode?: number | undefined;
|
|
759
759
|
};
|
|
760
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
760
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>;
|
|
761
761
|
} | undefined;
|
|
762
762
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
763
763
|
readonly entries: Omit<{
|
|
@@ -779,7 +779,7 @@ declare const spiEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
779
779
|
baud_rate?: number | undefined;
|
|
780
780
|
vcc?: number | undefined;
|
|
781
781
|
mode?: number | undefined;
|
|
782
|
-
}, v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
782
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>>;
|
|
783
783
|
readonly "~types"?: {
|
|
784
784
|
readonly input: {
|
|
785
785
|
baud_rate?: number | undefined;
|
|
@@ -791,7 +791,7 @@ declare const spiEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
791
791
|
vcc?: number | undefined;
|
|
792
792
|
mode?: number | undefined;
|
|
793
793
|
};
|
|
794
|
-
readonly issue: v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.
|
|
794
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, 300> | v.MaxValueIssue<number, 10000000> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 3>;
|
|
795
795
|
} | undefined;
|
|
796
796
|
};
|
|
797
797
|
type SpiEnableConfig = v.InferOutput<typeof spiEnableConfig>;
|
|
@@ -954,7 +954,7 @@ declare const uartConfigPatch: Omit<v.ObjectSchema<{
|
|
|
954
954
|
data_bits?: number | undefined;
|
|
955
955
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
956
956
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
957
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
957
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>>;
|
|
958
958
|
readonly "~types"?: {
|
|
959
959
|
readonly input: {
|
|
960
960
|
enabled?: boolean | undefined;
|
|
@@ -972,7 +972,7 @@ declare const uartConfigPatch: Omit<v.ObjectSchema<{
|
|
|
972
972
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
973
973
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
974
974
|
};
|
|
975
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
975
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>;
|
|
976
976
|
} | undefined;
|
|
977
977
|
};
|
|
978
978
|
type UartConfigPatch = v.InferOutput<typeof uartConfigPatch>;
|
|
@@ -1014,7 +1014,7 @@ declare const uartEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
1014
1014
|
data_bits?: number | undefined;
|
|
1015
1015
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
1016
1016
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
1017
|
-
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
1017
|
+
}, v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>>;
|
|
1018
1018
|
readonly "~types"?: {
|
|
1019
1019
|
readonly input: {
|
|
1020
1020
|
enabled?: boolean | undefined;
|
|
@@ -1032,7 +1032,7 @@ declare const uartEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
1032
1032
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
1033
1033
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
1034
1034
|
};
|
|
1035
|
-
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.
|
|
1035
|
+
readonly issue: v.BooleanIssue | v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>;
|
|
1036
1036
|
} | undefined;
|
|
1037
1037
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
1038
1038
|
readonly entries: Omit<{
|
|
@@ -1062,7 +1062,7 @@ declare const uartEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
1062
1062
|
stop_bits?: "1" | "2" | "1.5" | undefined;
|
|
1063
1063
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
1064
1064
|
vcc?: number | undefined;
|
|
1065
|
-
}, v.PicklistIssue | v.NumberIssue | v.
|
|
1065
|
+
}, v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>>;
|
|
1066
1066
|
readonly "~types"?: {
|
|
1067
1067
|
readonly input: {
|
|
1068
1068
|
baud_rate?: number | undefined;
|
|
@@ -1078,7 +1078,7 @@ declare const uartEnableConfig: Omit<Omit<v.ObjectSchema<{
|
|
|
1078
1078
|
parity?: "none" | "odd" | "even" | "mark" | "space" | undefined;
|
|
1079
1079
|
vcc?: number | undefined;
|
|
1080
1080
|
};
|
|
1081
|
-
readonly issue: v.PicklistIssue | v.NumberIssue | v.
|
|
1081
|
+
readonly issue: v.PicklistIssue | v.NumberIssue | v.MaxValueIssue<number, 8> | v.ObjectIssue | v.MinValueIssue<number, 7> | v.MinValueIssue<number, 300> | v.MinValueIssue<number, 1.6> | v.MaxValueIssue<number, 5> | v.MaxValueIssue<number, 12000000>;
|
|
1082
1082
|
} | undefined;
|
|
1083
1083
|
};
|
|
1084
1084
|
type UartEnableConfig = v.InferOutput<typeof uartEnableConfig>;
|
|
@@ -1433,4 +1433,4 @@ declare class Uart {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
//#endregion
|
|
1435
1435
|
export { UartConfig as A, rs485Config as B, SerialParity as C, SpiConfigPatch as D, SpiConfig as E, UsbState as F, uartConfig as H, canConfig as I, canFrame as L, UartEnableConfig as M, UsbDevice as N, SpiEnableConfig as O, UsbInterface as P, i2cConfig as R, SerialDataInput as S, Spi as T, spiConfig as V, Rs485 as _, CanFrame as a, Rs485EnableConfig as b, ComUsb as c, I2cConfigPatch as d, I2cEnableConfig as f, Rs232EnableConfig as g, Rs232ConfigPatch as h, CanEnableConfig as i, UartConfigPatch as j, Uart as k, I2c as l, Rs232Config as m, CanConfig as n, CanFrameInput as o, Rs232 as p, CanConfigPatch as r, ComApi as s, Can as t, I2cConfig as u, Rs485Config as v, SerialStopBits as w, SerialData as x, Rs485ConfigPatch as y, rs232Config as z };
|
|
1436
|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/com.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UartConfig, B as rs485Config, C as SerialParity, D as SpiConfigPatch, E as SpiConfig, F as UsbState, H as uartConfig, I as canConfig, L as canFrame, M as UartEnableConfig, N as UsbDevice, O as SpiEnableConfig, P as UsbInterface, R as i2cConfig, S as SerialDataInput, T as Spi, V as spiConfig, _ as Rs485, a as CanFrame, b as Rs485EnableConfig, c as ComUsb, d as I2cConfigPatch, f as I2cEnableConfig, g as Rs232EnableConfig, h as Rs232ConfigPatch, i as CanEnableConfig, j as UartConfigPatch, k as Uart, l as I2c, m as Rs232Config, n as CanConfig, o as CanFrameInput, p as Rs232, r as CanConfigPatch, s as ComApi, t as Can, u as I2cConfig, v as Rs485Config, w as SerialStopBits, x as SerialData, y as Rs485ConfigPatch, z as rs232Config } from "./com-
|
|
1
|
+
import { A as UartConfig, B as rs485Config, C as SerialParity, D as SpiConfigPatch, E as SpiConfig, F as UsbState, H as uartConfig, I as canConfig, L as canFrame, M as UartEnableConfig, N as UsbDevice, O as SpiEnableConfig, P as UsbInterface, R as i2cConfig, S as SerialDataInput, T as Spi, V as spiConfig, _ as Rs485, a as CanFrame, b as Rs485EnableConfig, c as ComUsb, d as I2cConfigPatch, f as I2cEnableConfig, g as Rs232EnableConfig, h as Rs232ConfigPatch, i as CanEnableConfig, j as UartConfigPatch, k as Uart, l as I2c, m as Rs232Config, n as CanConfig, o as CanFrameInput, p as Rs232, r as CanConfigPatch, s as ComApi, t as Can, u as I2cConfig, v as Rs485Config, w as SerialStopBits, x as SerialData, y as Rs485ConfigPatch, z as rs232Config } from "./com-XQjoTBdU.cjs";
|
|
2
2
|
export { Can, CanConfig, CanConfigPatch, CanEnableConfig, CanFrame, CanFrameInput, ComApi, ComUsb, I2c, I2cConfig, I2cConfigPatch, I2cEnableConfig, Rs232, Rs232Config, Rs232ConfigPatch, Rs232EnableConfig, Rs485, Rs485Config, Rs485ConfigPatch, Rs485EnableConfig, SerialData, SerialDataInput, SerialParity, SerialStopBits, Spi, SpiConfig, SpiConfigPatch, SpiEnableConfig, Uart, UartConfig, UartConfigPatch, UartEnableConfig, UsbDevice, UsbInterface, UsbState, canConfig, canFrame, i2cConfig, rs232Config, rs485Config, spiConfig, uartConfig };
|
package/build/com.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UartConfig, B as rs485Config, C as SerialParity, D as SpiConfigPatch, E as SpiConfig, F as UsbState, H as uartConfig, I as canConfig, L as canFrame, M as UartEnableConfig, N as UsbDevice, O as SpiEnableConfig, P as UsbInterface, R as i2cConfig, S as SerialDataInput, T as Spi, V as spiConfig, _ as Rs485, a as CanFrame, b as Rs485EnableConfig, c as ComUsb, d as I2cConfigPatch, f as I2cEnableConfig, g as Rs232EnableConfig, h as Rs232ConfigPatch, i as CanEnableConfig, j as UartConfigPatch, k as Uart, l as I2c, m as Rs232Config, n as CanConfig, o as CanFrameInput, p as Rs232, r as CanConfigPatch, s as ComApi, t as Can, u as I2cConfig, v as Rs485Config, w as SerialStopBits, x as SerialData, y as Rs485ConfigPatch, z as rs232Config } from "./com-
|
|
1
|
+
import { A as UartConfig, B as rs485Config, C as SerialParity, D as SpiConfigPatch, E as SpiConfig, F as UsbState, H as uartConfig, I as canConfig, L as canFrame, M as UartEnableConfig, N as UsbDevice, O as SpiEnableConfig, P as UsbInterface, R as i2cConfig, S as SerialDataInput, T as Spi, V as spiConfig, _ as Rs485, a as CanFrame, b as Rs485EnableConfig, c as ComUsb, d as I2cConfigPatch, f as I2cEnableConfig, g as Rs232EnableConfig, h as Rs232ConfigPatch, i as CanEnableConfig, j as UartConfigPatch, k as Uart, l as I2c, m as Rs232Config, n as CanConfig, o as CanFrameInput, p as Rs232, r as CanConfigPatch, s as ComApi, t as Can, u as I2cConfig, v as Rs485Config, w as SerialStopBits, x as SerialData, y as Rs485ConfigPatch, z as rs232Config } from "./com-XQjoTBdU.mjs";
|
|
2
2
|
export { Can, CanConfig, CanConfigPatch, CanEnableConfig, CanFrame, CanFrameInput, ComApi, ComUsb, I2c, I2cConfig, I2cConfigPatch, I2cEnableConfig, Rs232, Rs232Config, Rs232ConfigPatch, Rs232EnableConfig, Rs485, Rs485Config, Rs485ConfigPatch, Rs485EnableConfig, SerialData, SerialDataInput, SerialParity, SerialStopBits, Spi, SpiConfig, SpiConfigPatch, SpiEnableConfig, Uart, UartConfig, UartConfigPatch, UartEnableConfig, UsbDevice, UsbInterface, UsbState, canConfig, canFrame, i2cConfig, rs232Config, rs485Config, spiConfig, uartConfig };
|
package/build/events.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./at1000-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./at1000-D9r6GCs0.cjs");exports.EventsApi=e.i;
|
package/build/events.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as e}from"./at1000-BGZGhgco.mjs";export{e as EventsApi};
|
|
@@ -12,12 +12,19 @@ declare const analogOutputConfiguration: v.ObjectSchema<{
|
|
|
12
12
|
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
13
13
|
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
14
14
|
}, undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Input thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
17
|
+
*/
|
|
15
18
|
declare const digitalInputConfiguration: v.ObjectSchema<{
|
|
16
19
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
17
20
|
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
18
21
|
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
19
22
|
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
20
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
|
+
*/
|
|
21
28
|
declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
22
29
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
23
30
|
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
@@ -27,6 +34,9 @@ declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
|
27
34
|
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
28
35
|
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
29
36
|
}, undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
39
|
+
*/
|
|
30
40
|
declare const openDrainConfiguration: v.ObjectSchema<{
|
|
31
41
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
32
42
|
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
@@ -56,7 +66,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
|
56
66
|
}>;
|
|
57
67
|
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
58
68
|
value?: number | undefined;
|
|
59
|
-
}, v.NumberIssue | v.
|
|
69
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
|
|
60
70
|
readonly "~types"?: {
|
|
61
71
|
readonly input: {
|
|
62
72
|
value?: number | undefined;
|
|
@@ -64,7 +74,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
|
64
74
|
readonly output: {
|
|
65
75
|
value?: number | undefined;
|
|
66
76
|
};
|
|
67
|
-
readonly issue: v.NumberIssue | v.
|
|
77
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
|
|
68
78
|
} | undefined;
|
|
69
79
|
};
|
|
70
80
|
type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
|
|
@@ -141,7 +151,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
141
151
|
vih: number;
|
|
142
152
|
vol: number;
|
|
143
153
|
voh: number;
|
|
144
|
-
}, v.BooleanIssue | v.NumberIssue | v.
|
|
154
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
145
155
|
readonly "~types"?: {
|
|
146
156
|
readonly input: {
|
|
147
157
|
value: number | boolean;
|
|
@@ -157,7 +167,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
157
167
|
vol: number;
|
|
158
168
|
voh: number;
|
|
159
169
|
};
|
|
160
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.
|
|
170
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
161
171
|
} | undefined;
|
|
162
172
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
163
173
|
readonly entries: {
|
|
@@ -186,7 +196,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
186
196
|
vih?: number | undefined;
|
|
187
197
|
vol: number;
|
|
188
198
|
voh: number;
|
|
189
|
-
}, v.BooleanIssue | v.NumberIssue | v.
|
|
199
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
190
200
|
readonly "~types"?: {
|
|
191
201
|
readonly input: {
|
|
192
202
|
value: number | boolean;
|
|
@@ -202,7 +212,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
202
212
|
vol: number;
|
|
203
213
|
voh: number;
|
|
204
214
|
};
|
|
205
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.
|
|
215
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
206
216
|
} | undefined;
|
|
207
217
|
};
|
|
208
218
|
type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
|
|
@@ -233,7 +243,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
|
233
243
|
value: boolean;
|
|
234
244
|
vil: number;
|
|
235
245
|
vih: number;
|
|
236
|
-
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.
|
|
246
|
+
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
237
247
|
readonly "~types"?: {
|
|
238
248
|
readonly input: {
|
|
239
249
|
value: number | boolean;
|
|
@@ -245,7 +255,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
|
245
255
|
vil: number;
|
|
246
256
|
vih: number;
|
|
247
257
|
};
|
|
248
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.
|
|
258
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
249
259
|
} | undefined;
|
|
250
260
|
};
|
|
251
261
|
type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
|
|
@@ -403,4 +413,4 @@ declare class AnalogIO {
|
|
|
403
413
|
}
|
|
404
414
|
//#endregion
|
|
405
415
|
export { openDrainConfiguration as C, gpioConfiguration as S, analogOutputConfiguration as _, DigitalInputConfiguration as a, digitalOutputConfiguration as b, GpioConfiguration as c, PartialDigitalInputConfiguration as d, PartialDigitalOutputConfiguration as f, analogInputConfiguration as g, SyncState as h, DigitalIO as i, OpenDrainConfiguration as l, SyncConfiguration as m, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, PartialOpenDrainConfiguration as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, PartialAnalogOutputConfiguration as u, analogState as v, syncState as w, digitalState as x, digitalInputConfiguration as y };
|
|
406
|
-
//# sourceMappingURL=gpio-
|
|
416
|
+
//# sourceMappingURL=gpio-Bk1VEKYF.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpio-Bk1VEKYF.d.cts","names":[],"sources":["../src/api/gpio.ts"],"mappings":";;;;;cASa,0BAAwB,EAAA;;;;cAIxB,2BAAyB,EAAA;;;;;;;;cAQzB,2BAAyB,EAAA;;;;;;;;;;cAUzB,4BAA0B,EAAA;;;;;;;;;;;;cAY1B,wBAAsB,EAAA;;;;;;;KAOvB,2BAA2B,EAAE,mBAAmB;KAChD,4BAA4B,EAAE,mBAAmB;KACjD,4BAA4B,EAAE,mBAAmB;KACjD,6BAA6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QAAQ;;;cAa1D;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,mBAAmB,QAAQ;;;;;;EAa3B,iBAAiB,OAAO,oBAAoB,QAAQ;;;;;EAe9C,QAAQ;;;;;;EASR,MAAM,gBAAgB"}
|
|
@@ -12,12 +12,19 @@ declare const analogOutputConfiguration: v.ObjectSchema<{
|
|
|
12
12
|
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
13
13
|
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
14
14
|
}, undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Input thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
17
|
+
*/
|
|
15
18
|
declare const digitalInputConfiguration: v.ObjectSchema<{
|
|
16
19
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
17
20
|
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
18
21
|
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
19
22
|
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
20
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
|
+
*/
|
|
21
28
|
declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
22
29
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
23
30
|
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
@@ -27,6 +34,9 @@ declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
|
27
34
|
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
28
35
|
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
29
36
|
}, undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.
|
|
39
|
+
*/
|
|
30
40
|
declare const openDrainConfiguration: v.ObjectSchema<{
|
|
31
41
|
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
32
42
|
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
@@ -56,7 +66,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
|
56
66
|
}>;
|
|
57
67
|
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
58
68
|
value?: number | undefined;
|
|
59
|
-
}, v.NumberIssue | v.
|
|
69
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
|
|
60
70
|
readonly "~types"?: {
|
|
61
71
|
readonly input: {
|
|
62
72
|
value?: number | undefined;
|
|
@@ -64,7 +74,7 @@ declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
|
64
74
|
readonly output: {
|
|
65
75
|
value?: number | undefined;
|
|
66
76
|
};
|
|
67
|
-
readonly issue: v.NumberIssue | v.
|
|
77
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
|
|
68
78
|
} | undefined;
|
|
69
79
|
};
|
|
70
80
|
type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
|
|
@@ -141,7 +151,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
141
151
|
vih: number;
|
|
142
152
|
vol: number;
|
|
143
153
|
voh: number;
|
|
144
|
-
}, v.BooleanIssue | v.NumberIssue | v.
|
|
154
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
145
155
|
readonly "~types"?: {
|
|
146
156
|
readonly input: {
|
|
147
157
|
value: number | boolean;
|
|
@@ -157,7 +167,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
157
167
|
vol: number;
|
|
158
168
|
voh: number;
|
|
159
169
|
};
|
|
160
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.
|
|
170
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
161
171
|
} | undefined;
|
|
162
172
|
}, "~types" | "~run" | "~standard" | "entries"> & {
|
|
163
173
|
readonly entries: {
|
|
@@ -186,7 +196,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
186
196
|
vih?: number | undefined;
|
|
187
197
|
vol: number;
|
|
188
198
|
voh: number;
|
|
189
|
-
}, v.BooleanIssue | v.NumberIssue | v.
|
|
199
|
+
}, v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
190
200
|
readonly "~types"?: {
|
|
191
201
|
readonly input: {
|
|
192
202
|
value: number | boolean;
|
|
@@ -202,7 +212,7 @@ declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
202
212
|
vol: number;
|
|
203
213
|
voh: number;
|
|
204
214
|
};
|
|
205
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.
|
|
215
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.MaxValueIssue<number, 24> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
206
216
|
} | undefined;
|
|
207
217
|
};
|
|
208
218
|
type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
|
|
@@ -233,7 +243,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
|
233
243
|
value: boolean;
|
|
234
244
|
vil: number;
|
|
235
245
|
vih: number;
|
|
236
|
-
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.
|
|
246
|
+
}, v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>>;
|
|
237
247
|
readonly "~types"?: {
|
|
238
248
|
readonly input: {
|
|
239
249
|
value: number | boolean;
|
|
@@ -245,7 +255,7 @@ declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
|
245
255
|
vil: number;
|
|
246
256
|
vih: number;
|
|
247
257
|
};
|
|
248
|
-
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.
|
|
258
|
+
readonly issue: v.BooleanIssue | v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.BooleanIssue | v.NumberIssue>;
|
|
249
259
|
} | undefined;
|
|
250
260
|
};
|
|
251
261
|
type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
|
|
@@ -403,4 +413,4 @@ declare class AnalogIO {
|
|
|
403
413
|
}
|
|
404
414
|
//#endregion
|
|
405
415
|
export { openDrainConfiguration as C, gpioConfiguration as S, analogOutputConfiguration as _, DigitalInputConfiguration as a, digitalOutputConfiguration as b, GpioConfiguration as c, PartialDigitalInputConfiguration as d, PartialDigitalOutputConfiguration as f, analogInputConfiguration as g, SyncState as h, DigitalIO as i, OpenDrainConfiguration as l, SyncConfiguration as m, AnalogInputConfiguration as n, DigitalOutputConfiguration as o, PartialOpenDrainConfiguration as p, AnalogOutputConfiguration as r, GpioApi as s, AnalogIO as t, PartialAnalogOutputConfiguration as u, analogState as v, syncState as w, digitalState as x, digitalInputConfiguration as y };
|
|
406
|
-
//# sourceMappingURL=gpio-
|
|
416
|
+
//# sourceMappingURL=gpio-bFe112uI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpio-bFe112uI.d.mts","names":[],"sources":["../src/api/gpio.ts"],"mappings":";;;;;cASa,0BAAwB,EAAA;;;;cAIxB,2BAAyB,EAAA;;;;;;;;cAQzB,2BAAyB,EAAA;;;;;;;;;;cAUzB,4BAA0B,EAAA;;;;;;;;;;;;cAY1B,wBAAsB,EAAA;;;;;;;KAOvB,2BAA2B,EAAE,mBAAmB;KAChD,4BAA4B,EAAE,mBAAmB;KACjD,4BAA4B,EAAE,mBAAmB;KACjD,6BAA6B,EAAE,mBAAmB;KAClD,yBAAyB,EAAE,mBAAmB;cAEpD,kCAAgC,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAC1B,mCAAmC,EAAE,mBACxC;cAEH,kCAAgC,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAC1B,mCAAmC,EAAE,mBACxC;cAEH,mCAAiC,KAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAI3B,oCAAoC,EAAE,kBACzC;cAEH,+BAA6B,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACvB,gCAAgC,EAAE,mBAAmB;cAEpD,cAAY,EAAA;;;cACZ,aAAW,EAAA;;;cAElB,mBAAiB,EAAA;mBAAjB,EAAA;;KACM,oBAAoB,EAAE,mBAAmB;cAExC,WAAS,EAAA;uBAAT,EAAA;;KACD,YAAY,EAAE,mBAAmB;cAEhC,mBAAiB,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOlB,oBAAoB,EAAE,mBAAmB;;cAGxC;mBAGkB;UAFrB;EAEqB,YAAA,OAAO,SAAS,MAAM;;;;EAOnD,SAAS;;;;;;EAST,QAAQ,aAAa;;;;;;EAiBrB,OAAO,aAAa;;;;;EAgBpB,QAAQ,QAAQ;;;;;;;;EAehB,WAAW,QAAQ;;;;;;EAanB,YAAY,aAAa,QAAQ;;;;;EAgBjC,aAAa,QAAQ;;;cAMV;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,gBAAgB,QAAQ,mCAAmC,QAAQ;;;;;;EAgBnE,iBAAiB,QAAQ,oCAAoC,QAAQ;;;;;EAwB/D,QAAQ;;;;;;EASR,MAAM,0BAA0B;;;;;;EActC,qBAAqB,QAAQ,gCAAgC,QAAQ;;;cAa1D;mBACkB;WAAgC;EAAhC,YAAA,OAAO,SAAyB;;;;;;EAO7D,mBAAmB,QAAQ;;;;;;EAa3B,iBAAiB,OAAO,oBAAoB,QAAQ;;;;;EAe9C,QAAQ;;;;;;EASR,MAAM,gBAAgB"}
|
package/build/gpio.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpio.cjs","names":["v","analogOutputLevel","analogLevel","digitalLevel"],"sources":["../src/api/gpio.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nimport { analogLevel, type AnalogOutputLevel, analogOutputLevel, digitalLevel } from './common';\nimport type { Information } from './management';\n\nexport type { AnalogOutputLevel };\n\nconst syncAction = v.picklist(['release', 'hold'], 'Invalid sync action');\nexport const analogInputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('input'),\n});\nexport const analogOutputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('output'),\n value: v.optional(analogOutputLevel),\n});\nexport const digitalInputConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('input'),\n vil: analogLevel,\n vih: analogLevel,\n});\nexport const digitalOutputConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('output'),\n value: digitalLevel,\n vol: analogOutputLevel,\n voh: analogOutputLevel,\n vil: analogLevel,\n vih: analogLevel,\n});\nexport const openDrainConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('open_drain'),\n value: digitalLevel,\n vil: analogLevel,\n vih: analogLevel,\n});\nexport type AnalogInputConfiguration = v.InferOutput<typeof analogInputConfiguration>;\nexport type AnalogOutputConfiguration = v.InferOutput<typeof analogOutputConfiguration>;\nexport type DigitalInputConfiguration = v.InferOutput<typeof digitalInputConfiguration>;\nexport type DigitalOutputConfiguration = v.InferOutput<typeof digitalOutputConfiguration>;\nexport type OpenDrainConfiguration = v.InferOutput<typeof openDrainConfiguration>;\n\nconst partialAnalogOutputConfiguration = v.omit(analogOutputConfiguration, ['direction', 'mode']);\nexport type PartialAnalogOutputConfiguration = v.InferOutput<\n typeof partialAnalogOutputConfiguration\n>;\nconst partialDigitalInputConfiguration = v.omit(digitalInputConfiguration, ['direction', 'mode']);\nexport type PartialDigitalInputConfiguration = v.InferOutput<\n typeof partialDigitalInputConfiguration\n>;\nconst partialDigitalOutputConfiguration = v.partial(\n v.omit(digitalOutputConfiguration, ['direction', 'mode']),\n ['vih', 'vil'],\n);\nexport type PartialDigitalOutputConfiguration = v.InferInput<\n typeof partialDigitalOutputConfiguration\n>;\nconst partialOpenDrainConfiguration = v.omit(openDrainConfiguration, ['direction', 'mode']);\nexport type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;\n\nexport const digitalState = v.object({ value: digitalLevel });\nexport const analogState = v.object({ value: analogLevel });\n\nconst syncConfiguration = v.object({ action: syncAction });\nexport type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;\n\nexport const syncState = v.object({ hold_state: v.picklist(['held', 'released']) });\nexport type SyncState = v.InferOutput<typeof syncState>;\n\nexport const gpioConfiguration = v.union([\n digitalOutputConfiguration,\n openDrainConfiguration,\n digitalInputConfiguration,\n analogOutputConfiguration,\n analogInputConfiguration,\n]);\nexport type GpioConfiguration = v.InferOutput<typeof gpioConfiguration>;\n\n/** @hideconstructor */\nexport class GpioApi {\n private count: number;\n\n constructor(private readonly fetch: UpFetch, info: Information) {\n this.count = info.capabilities.io.count;\n }\n\n /**\n * Resets all IO configurations to default.\n */\n reset(): Promise<void> {\n return this.fetch('/gpio/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific digital IO pin by id.\n * @param io The IO pin id.\n * @returns The digital IO instance.\n */\n digital(io: number): DigitalIO {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}`,\n );\n }\n\n return new DigitalIO(this.fetch, io);\n }\n\n /**\n * Access a specific analog IO pin by id.\n * @param io The IO pin id.\n * @returns The analog IO instance.\n */\n analog(io: number): AnalogIO {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}`,\n );\n }\n\n return new AnalogIO(this.fetch, io);\n }\n\n /**\n * Holds the current state of all GPIO pins.\n * @returns The applied sync state.\n */\n hold(): Promise<SyncConfiguration> {\n return this.fetch('/gpio/sync', {\n method: 'POST',\n body: { action: 'hold' } satisfies SyncConfiguration,\n schema: syncConfiguration,\n });\n }\n\n /**\n * Releases control of the IO pins, allowing external control.\n *\n * This also sets the device as a slave.\n *\n * @returns The applied sync state.\n */\n release(): Promise<SyncConfiguration> {\n return this.fetch('/gpio/sync', {\n method: 'POST',\n body: { action: 'release' } satisfies SyncConfiguration,\n schema: syncConfiguration,\n });\n }\n\n /**\n * Reads back the current configuration of a specific IO pin.\n * @param io The IO pin id.\n * @returns The pin's current configuration.\n */\n read_config(io: number): Promise<GpioConfiguration> {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}/config`,\n );\n }\n\n return this.fetch(`/gpio/${io}/config`, { schema: gpioConfiguration });\n }\n\n /**\n * Reads the current hold state of all GPIO pins.\n * @returns The current sync state.\n */\n read_sync(): Promise<SyncState> {\n return this.fetch('/gpio/sync', { schema: syncState });\n }\n}\n\n/** @hideconstructor */\nexport class DigitalIO {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configure the pin as a digital input.\n * @param config The digital input configuration.\n * @returns The applied configuration.\n */\n configure_input(config: PartialDigitalInputConfiguration): Promise<DigitalInputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n digitalInputConfiguration,\n { ...config, mode: 'digital', direction: 'input' } satisfies DigitalInputConfiguration,\n ),\n schema: digitalInputConfiguration,\n });\n }\n\n /**\n * Configures the pin as a digital output.\n * @param config The digital output configuration.\n * @returns The applied configuration.\n */\n configure_output(config: PartialDigitalOutputConfiguration): Promise<DigitalOutputConfiguration> {\n config = v.parse(partialDigitalOutputConfiguration, config);\n\n const fullConfig = {\n mode: 'digital' as const,\n direction: 'output' as const,\n value: config.value,\n vol: config.vol,\n voh: config.voh,\n vil: config.vil ?? config.vol + (config.voh - config.vol) / 4,\n vih: config.vih ?? config.voh - (config.voh - config.vol) / 4,\n };\n\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(digitalOutputConfiguration, fullConfig),\n schema: digitalOutputConfiguration,\n });\n }\n\n /**\n * Reads the current state of the pin.\n * @returns The current state of the pin.\n */\n async read(): Promise<boolean> {\n return (await this.fetch(`/gpio/${this.id}/state`, { schema: digitalState })).value;\n }\n\n /**\n * Writes a value to the pin.\n * @param value The value to write.\n * @returns The written value.\n */\n async write(value: boolean | number): Promise<boolean> {\n return (await this.fetch(`/gpio/${this.id}/state`, {\n method: 'PUT',\n body: v.parse(digitalState, { value }),\n schema: digitalState,\n }))\n .value;\n }\n\n /**\n * Configure the pin as an open drain output.\n * @param config The open drain configuration.\n * @returns The applied configuration.\n */\n configure_open_drain(config: PartialOpenDrainConfiguration): Promise<OpenDrainConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n openDrainConfiguration,\n { ...config, mode: 'digital', direction: 'open_drain' } satisfies OpenDrainConfiguration,\n ),\n schema: openDrainConfiguration,\n });\n }\n}\n\n/** @hideconstructor */\nexport class AnalogIO {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the pin as an analog input.\n * @returns The applied configuration.\n * @returns The applied configuration.\n */\n configure_input(): Promise<AnalogInputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: { mode: 'analog', direction: 'input' } satisfies AnalogInputConfiguration,\n schema: analogInputConfiguration,\n });\n }\n\n /**\n * Configures the pin as an analog output.\n * @param config The analog output configuration.\n * @returns The applied configuration.\n */\n configure_output(value: AnalogOutputLevel): Promise<AnalogOutputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n analogOutputConfiguration,\n { value, mode: 'analog', direction: 'output' } satisfies AnalogOutputConfiguration,\n ),\n schema: analogOutputConfiguration,\n });\n }\n\n /**\n * Reads the current state of the pin.\n * @returns The current state of the pin.\n */\n async read(): Promise<number> {\n return (await this.fetch(`/gpio/${this.id}/state`, { schema: analogState })).value;\n }\n\n /**\n * Writes a value to the pin.\n * @param value The value to write.\n * @returns The written value.\n */\n async write(value: number): Promise<number> {\n return (await this.fetch(`/gpio/${this.id}/state`, {\n method: 'PUT',\n body: { value },\n schema: analogState,\n }))\n .value;\n }\n}\n"],"mappings":"6LAQA,MAAM,EAAaA,EAAE,SAAS,CAAC,UAAW,MAAM,EAAG,qBAAqB,EAC3D,EAA2BA,EAAE,OAAO,CAC/C,KAAMA,EAAE,QAAQ,QAAQ,EACxB,UAAWA,EAAE,QAAQ,OAAO,CAC9B,CAAC,EACY,EAA4BA,EAAE,OAAO,CAChD,KAAMA,EAAE,QAAQ,QAAQ,EACxB,UAAWA,EAAE,QAAQ,QAAQ,EAC7B,MAAOA,EAAE,SAASC,EAAAA,CAAiB,CACrC,CAAC,EACY,EAA4BD,EAAE,OAAO,CAChD,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,OAAO,EAC5B,IAAKE,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EACY,EAA6BF,EAAE,OAAO,CACjD,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,QAAQ,EAC7B,MAAOG,EAAAA,EACP,IAAKF,EAAAA,EACL,IAAKA,EAAAA,EACL,IAAKC,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EACY,EAAyBF,EAAE,OAAO,CAC7C,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,YAAY,EACjC,MAAOG,EAAAA,EACP,IAAKD,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EAOwCF,EAAE,KAAK,EAA2B,CAAC,YAAa,MAAM,CAAC,EAIvDA,EAAE,KAAK,EAA2B,CAAC,YAAa,MAAM,CAAC,EAIhG,MAAM,EAAoCA,EAAE,QAC1CA,EAAE,KAAK,EAA4B,CAAC,YAAa,MAAM,CAAC,EACxD,CAAC,MAAO,KAAK,CACf,EAIsCA,EAAE,KAAK,EAAwB,CAAC,YAAa,MAAM,CAAC,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3F,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAMA,EAAE,MACN,EACA,CAAE,GAAG,EAAQ,KAAM,UAAW,UAAW,YAAa,CACxD,EACA,OAAQ,CACV,CAAC,CACH,CACF,EAGa,EAAb,KAAsB,CACS,MAAgC,GAA7D,YAAY,EAAiC,EAA4B,CAA5C,KAAA,MAAA,EAAgC,KAAA,GAAA,CAAa,CAO1E,iBAAqD,CACnD,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAM,CAAE,KAAM,SAAU,UAAW,OAAQ,EAC3C,OAAQ,CACV,CAAC,CACH,CAOA,iBAAiB,EAA8D,CAC7E,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAMA,EAAE,MACN,EACA,CAAE,QAAO,KAAM,SAAU,UAAW,QAAS,CAC/C,EACA,OAAQ,CACV,CAAC,CACH,CAMA,MAAM,MAAwB,CAC5B,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CAAE,OAAQ,CAAY,CAAC,EAAA,CAAG,KAC/E,CAOA,MAAM,MAAM,EAAgC,CAC1C,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CACjD,OAAQ,MACR,KAAM,CAAE,OAAM,EACd,OAAQ,CACV,CAAC,EAAA,CACE,KACL,CACF"}
|
|
1
|
+
{"version":3,"file":"gpio.cjs","names":["v","analogOutputLevel","analogLevel","digitalLevel"],"sources":["../src/api/gpio.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nimport { type AnalogOutputLevel, analogLevel, analogOutputLevel, digitalLevel } from './common';\nimport type { Information } from './management';\n\nexport type { AnalogOutputLevel };\n\nconst syncAction = v.picklist(['release', 'hold'], 'Invalid sync action');\nexport const analogInputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('input'),\n});\nexport const analogOutputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('output'),\n value: v.optional(analogOutputLevel),\n});\n/**\n * Input thresholds `vil` and `vih` are in [-25, 25] V, inclusive.\n */\nexport const digitalInputConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('input'),\n vil: analogLevel,\n vih: analogLevel,\n});\n/**\n * Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.\n * Output levels `vol` and `voh` are in [0, 24] V, inclusive.\n */\nexport const digitalOutputConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('output'),\n value: digitalLevel,\n vol: analogOutputLevel,\n voh: analogOutputLevel,\n vil: analogLevel,\n vih: analogLevel,\n});\n/**\n * Readback thresholds `vil` and `vih` are in [-25, 25] V, inclusive.\n */\nexport const openDrainConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('open_drain'),\n value: digitalLevel,\n vil: analogLevel,\n vih: analogLevel,\n});\nexport type AnalogInputConfiguration = v.InferOutput<typeof analogInputConfiguration>;\nexport type AnalogOutputConfiguration = v.InferOutput<typeof analogOutputConfiguration>;\nexport type DigitalInputConfiguration = v.InferOutput<typeof digitalInputConfiguration>;\nexport type DigitalOutputConfiguration = v.InferOutput<typeof digitalOutputConfiguration>;\nexport type OpenDrainConfiguration = v.InferOutput<typeof openDrainConfiguration>;\n\nconst partialAnalogOutputConfiguration = v.omit(analogOutputConfiguration, ['direction', 'mode']);\nexport type PartialAnalogOutputConfiguration = v.InferOutput<\n typeof partialAnalogOutputConfiguration\n>;\nconst partialDigitalInputConfiguration = v.omit(digitalInputConfiguration, ['direction', 'mode']);\nexport type PartialDigitalInputConfiguration = v.InferOutput<\n typeof partialDigitalInputConfiguration\n>;\nconst partialDigitalOutputConfiguration = v.partial(\n v.omit(digitalOutputConfiguration, ['direction', 'mode']),\n ['vih', 'vil'],\n);\nexport type PartialDigitalOutputConfiguration = v.InferInput<\n typeof partialDigitalOutputConfiguration\n>;\nconst partialOpenDrainConfiguration = v.omit(openDrainConfiguration, ['direction', 'mode']);\nexport type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;\n\nexport const digitalState = v.object({ value: digitalLevel });\nexport const analogState = v.object({ value: analogLevel });\n\nconst syncConfiguration = v.object({ action: syncAction });\nexport type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;\n\nexport const syncState = v.object({ hold_state: v.picklist(['held', 'released']) });\nexport type SyncState = v.InferOutput<typeof syncState>;\n\nexport const gpioConfiguration = v.union([\n digitalOutputConfiguration,\n openDrainConfiguration,\n digitalInputConfiguration,\n analogOutputConfiguration,\n analogInputConfiguration,\n]);\nexport type GpioConfiguration = v.InferOutput<typeof gpioConfiguration>;\n\n/** @hideconstructor */\nexport class GpioApi {\n private count: number;\n\n constructor(private readonly fetch: UpFetch, info: Information) {\n this.count = info.capabilities.io.count;\n }\n\n /**\n * Resets all IO configurations to default.\n */\n reset(): Promise<void> {\n return this.fetch('/gpio/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific digital IO pin by id.\n * @param io The IO pin id.\n * @returns The digital IO instance.\n */\n digital(io: number): DigitalIO {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}`,\n );\n }\n\n return new DigitalIO(this.fetch, io);\n }\n\n /**\n * Access a specific analog IO pin by id.\n * @param io The IO pin id.\n * @returns The analog IO instance.\n */\n analog(io: number): AnalogIO {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}`,\n );\n }\n\n return new AnalogIO(this.fetch, io);\n }\n\n /**\n * Holds the current state of all GPIO pins.\n * @returns The applied sync state.\n */\n hold(): Promise<SyncConfiguration> {\n return this.fetch('/gpio/sync', {\n method: 'POST',\n body: { action: 'hold' } satisfies SyncConfiguration,\n schema: syncConfiguration,\n });\n }\n\n /**\n * Releases control of the IO pins, allowing external control.\n *\n * This also sets the device as a slave.\n *\n * @returns The applied sync state.\n */\n release(): Promise<SyncConfiguration> {\n return this.fetch('/gpio/sync', {\n method: 'POST',\n body: { action: 'release' } satisfies SyncConfiguration,\n schema: syncConfiguration,\n });\n }\n\n /**\n * Reads back the current configuration of a specific IO pin.\n * @param io The IO pin id.\n * @returns The pin's current configuration.\n */\n read_config(io: number): Promise<GpioConfiguration> {\n if (io < 0 || io >= this.count) {\n throw new Error(\n `Invalid GPIO pin ${io} (RESOURCE_NOT_FOUND)\\n Suggestion: Use a pin number between 0 and ${\n this.count - 1\n }\\n Path: /gpio/${io}/config`,\n );\n }\n\n return this.fetch(`/gpio/${io}/config`, { schema: gpioConfiguration });\n }\n\n /**\n * Reads the current hold state of all GPIO pins.\n * @returns The current sync state.\n */\n read_sync(): Promise<SyncState> {\n return this.fetch('/gpio/sync', { schema: syncState });\n }\n}\n\n/** @hideconstructor */\nexport class DigitalIO {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configure the pin as a digital input.\n * @param config The digital input configuration.\n * @returns The applied configuration.\n */\n configure_input(config: PartialDigitalInputConfiguration): Promise<DigitalInputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n digitalInputConfiguration,\n { ...config, mode: 'digital', direction: 'input' } satisfies DigitalInputConfiguration,\n ),\n schema: digitalInputConfiguration,\n });\n }\n\n /**\n * Configures the pin as a digital output.\n * @param config The digital output configuration.\n * @returns The applied configuration.\n */\n configure_output(config: PartialDigitalOutputConfiguration): Promise<DigitalOutputConfiguration> {\n config = v.parse(partialDigitalOutputConfiguration, config);\n\n const fullConfig = {\n mode: 'digital' as const,\n direction: 'output' as const,\n value: config.value,\n vol: config.vol,\n voh: config.voh,\n vil: config.vil ?? config.vol + (config.voh - config.vol) / 4,\n vih: config.vih ?? config.voh - (config.voh - config.vol) / 4,\n };\n\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(digitalOutputConfiguration, fullConfig),\n schema: digitalOutputConfiguration,\n });\n }\n\n /**\n * Reads the current state of the pin.\n * @returns The current state of the pin.\n */\n async read(): Promise<boolean> {\n return (await this.fetch(`/gpio/${this.id}/state`, { schema: digitalState })).value;\n }\n\n /**\n * Writes a value to the pin.\n * @param value The value to write.\n * @returns The written value.\n */\n async write(value: boolean | number): Promise<boolean> {\n return (await this.fetch(`/gpio/${this.id}/state`, {\n method: 'PUT',\n body: v.parse(digitalState, { value }),\n schema: digitalState,\n }))\n .value;\n }\n\n /**\n * Configure the pin as an open drain output.\n * @param config The open drain configuration.\n * @returns The applied configuration.\n */\n configure_open_drain(config: PartialOpenDrainConfiguration): Promise<OpenDrainConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n openDrainConfiguration,\n { ...config, mode: 'digital', direction: 'open_drain' } satisfies OpenDrainConfiguration,\n ),\n schema: openDrainConfiguration,\n });\n }\n}\n\n/** @hideconstructor */\nexport class AnalogIO {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the pin as an analog input.\n * @returns The applied configuration.\n * @returns The applied configuration.\n */\n configure_input(): Promise<AnalogInputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: { mode: 'analog', direction: 'input' } satisfies AnalogInputConfiguration,\n schema: analogInputConfiguration,\n });\n }\n\n /**\n * Configures the pin as an analog output.\n * @param config The analog output configuration.\n * @returns The applied configuration.\n */\n configure_output(value: AnalogOutputLevel): Promise<AnalogOutputConfiguration> {\n return this.fetch(`/gpio/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(\n analogOutputConfiguration,\n { value, mode: 'analog', direction: 'output' } satisfies AnalogOutputConfiguration,\n ),\n schema: analogOutputConfiguration,\n });\n }\n\n /**\n * Reads the current state of the pin.\n * @returns The current state of the pin.\n */\n async read(): Promise<number> {\n return (await this.fetch(`/gpio/${this.id}/state`, { schema: analogState })).value;\n }\n\n /**\n * Writes a value to the pin.\n * @param value The value to write.\n * @returns The written value.\n */\n async write(value: number): Promise<number> {\n return (await this.fetch(`/gpio/${this.id}/state`, {\n method: 'PUT',\n body: { value },\n schema: analogState,\n }))\n .value;\n }\n}\n"],"mappings":"6LAQA,MAAM,EAAaA,EAAE,SAAS,CAAC,UAAW,MAAM,EAAG,qBAAqB,EAC3D,EAA2BA,EAAE,OAAO,CAC/C,KAAMA,EAAE,QAAQ,QAAQ,EACxB,UAAWA,EAAE,QAAQ,OAAO,CAC9B,CAAC,EACY,EAA4BA,EAAE,OAAO,CAChD,KAAMA,EAAE,QAAQ,QAAQ,EACxB,UAAWA,EAAE,QAAQ,QAAQ,EAC7B,MAAOA,EAAE,SAASC,EAAAA,CAAiB,CACrC,CAAC,EAIY,EAA4BD,EAAE,OAAO,CAChD,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,OAAO,EAC5B,IAAKE,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EAKY,EAA6BF,EAAE,OAAO,CACjD,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,QAAQ,EAC7B,MAAOG,EAAAA,EACP,IAAKF,EAAAA,EACL,IAAKA,EAAAA,EACL,IAAKC,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EAIY,EAAyBF,EAAE,OAAO,CAC7C,KAAMA,EAAE,QAAQ,SAAS,EACzB,UAAWA,EAAE,QAAQ,YAAY,EACjC,MAAOG,EAAAA,EACP,IAAKD,EAAAA,EACL,IAAKA,EAAAA,CACP,CAAC,EAOwCF,EAAE,KAAK,EAA2B,CAAC,YAAa,MAAM,CAAC,EAIvDA,EAAE,KAAK,EAA2B,CAAC,YAAa,MAAM,CAAC,EAIhG,MAAM,EAAoCA,EAAE,QAC1CA,EAAE,KAAK,EAA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KAAMA,EAAE,MAAM,EAAc,CAAE,OAAM,CAAC,EACrC,OAAQ,CACV,CAAC,EAAA,CACE,KACL,CAOA,qBAAqB,EAAwE,CAC3F,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAMA,EAAE,MACN,EACA,CAAE,GAAG,EAAQ,KAAM,UAAW,UAAW,YAAa,CACxD,EACA,OAAQ,CACV,CAAC,CACH,CACF,EAGa,EAAb,KAAsB,CACS,MAAgC,GAA7D,YAAY,EAAiC,EAA4B,CAA5C,KAAA,MAAA,EAAgC,KAAA,GAAA,CAAa,CAO1E,iBAAqD,CACnD,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAM,CAAE,KAAM,SAAU,UAAW,OAAQ,EAC3C,OAAQ,CACV,CAAC,CACH,CAOA,iBAAiB,EAA8D,CAC7E,OAAO,KAAK,MAAM,SAAS,KAAK,GAAG,SAAU,CAC3C,OAAQ,QACR,KAAMA,EAAE,MACN,EACA,CAAE,QAAO,KAAM,SAAU,UAAW,QAAS,CAC/C,EACA,OAAQ,CACV,CAAC,CACH,CAMA,MAAM,MAAwB,CAC5B,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CAAE,OAAQ,CAAY,CAAC,EAAA,CAAG,KAC/E,CAOA,MAAM,MAAM,EAAgC,CAC1C,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CACjD,OAAQ,MACR,KAAM,CAAE,OAAM,EACd,OAAQ,CACV,CAAC,EAAA,CACE,KACL,CACF"}
|
package/build/gpio.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-Cv6nZZS9.cjs";
|
|
2
|
-
import { C as openDrainConfiguration, S as gpioConfiguration, _ as analogOutputConfiguration, a as DigitalInputConfiguration, b as digitalOutputConfiguration, c as GpioConfiguration, d as PartialDigitalInputConfiguration, f as PartialDigitalOutputConfiguration, g as analogInputConfiguration, h as SyncState, i as DigitalIO, l as OpenDrainConfiguration, m as SyncConfiguration, n as AnalogInputConfiguration, o as DigitalOutputConfiguration, p as PartialOpenDrainConfiguration, r as AnalogOutputConfiguration, s as GpioApi, t as AnalogIO, u as PartialAnalogOutputConfiguration, v as analogState, w as syncState, x as digitalState, y as digitalInputConfiguration } from "./gpio-
|
|
2
|
+
import { C as openDrainConfiguration, S as gpioConfiguration, _ as analogOutputConfiguration, a as DigitalInputConfiguration, b as digitalOutputConfiguration, c as GpioConfiguration, d as PartialDigitalInputConfiguration, f as PartialDigitalOutputConfiguration, g as analogInputConfiguration, h as SyncState, i as DigitalIO, l as OpenDrainConfiguration, m as SyncConfiguration, n as AnalogInputConfiguration, o as DigitalOutputConfiguration, p as PartialOpenDrainConfiguration, r as AnalogOutputConfiguration, s as GpioApi, t as AnalogIO, u as PartialAnalogOutputConfiguration, v as analogState, w as syncState, x as digitalState, y as digitalInputConfiguration } from "./gpio-Bk1VEKYF.cjs";
|
|
3
3
|
export { AnalogIO, AnalogInputConfiguration, AnalogOutputConfiguration, type AnalogOutputLevel, DigitalIO, DigitalInputConfiguration, DigitalOutputConfiguration, GpioApi, GpioConfiguration, OpenDrainConfiguration, PartialAnalogOutputConfiguration, PartialDigitalInputConfiguration, PartialDigitalOutputConfiguration, PartialOpenDrainConfiguration, SyncConfiguration, SyncState, analogInputConfiguration, analogOutputConfiguration, analogState, digitalInputConfiguration, digitalOutputConfiguration, digitalState, gpioConfiguration, openDrainConfiguration, syncState };
|
package/build/gpio.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-Cv6nZZS9.mjs";
|
|
2
|
-
import { C as openDrainConfiguration, S as gpioConfiguration, _ as analogOutputConfiguration, a as DigitalInputConfiguration, b as digitalOutputConfiguration, c as GpioConfiguration, d as PartialDigitalInputConfiguration, f as PartialDigitalOutputConfiguration, g as analogInputConfiguration, h as SyncState, i as DigitalIO, l as OpenDrainConfiguration, m as SyncConfiguration, n as AnalogInputConfiguration, o as DigitalOutputConfiguration, p as PartialOpenDrainConfiguration, r as AnalogOutputConfiguration, s as GpioApi, t as AnalogIO, u as PartialAnalogOutputConfiguration, v as analogState, w as syncState, x as digitalState, y as digitalInputConfiguration } from "./gpio-
|
|
2
|
+
import { C as openDrainConfiguration, S as gpioConfiguration, _ as analogOutputConfiguration, a as DigitalInputConfiguration, b as digitalOutputConfiguration, c as GpioConfiguration, d as PartialDigitalInputConfiguration, f as PartialDigitalOutputConfiguration, g as analogInputConfiguration, h as SyncState, i as DigitalIO, l as OpenDrainConfiguration, m as SyncConfiguration, n as AnalogInputConfiguration, o as DigitalOutputConfiguration, p as PartialOpenDrainConfiguration, r as AnalogOutputConfiguration, s as GpioApi, t as AnalogIO, u as PartialAnalogOutputConfiguration, v as analogState, w as syncState, x as digitalState, y as digitalInputConfiguration } from "./gpio-bFe112uI.mjs";
|
|
3
3
|
export { AnalogIO, AnalogInputConfiguration, AnalogOutputConfiguration, type AnalogOutputLevel, DigitalIO, DigitalInputConfiguration, DigitalOutputConfiguration, GpioApi, GpioConfiguration, OpenDrainConfiguration, PartialAnalogOutputConfiguration, PartialDigitalInputConfiguration, PartialDigitalOutputConfiguration, PartialOpenDrainConfiguration, SyncConfiguration, SyncState, analogInputConfiguration, analogOutputConfiguration, analogState, digitalInputConfiguration, digitalOutputConfiguration, digitalState, gpioConfiguration, openDrainConfiguration, syncState };
|