@ikalogic/at1000 0.1.13 → 0.1.25
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-BWX7kovf.cjs +3 -0
- package/build/{at1000-DBnCRa4B.cjs.map → at1000-BWX7kovf.cjs.map} +1 -1
- package/build/{at1000-BLTMMFOe.d.cts → at1000-DIVuASWg.d.cts} +7 -7
- package/build/at1000-DIVuASWg.d.cts.map +1 -0
- package/build/at1000-TQqJHjwy.mjs +3 -0
- package/build/{at1000-DOi600n-.mjs.map → at1000-TQqJHjwy.mjs.map} +1 -1
- package/build/{at1000-tq5RRNjA.d.mts → at1000-TeP9-fyr.d.mts} +7 -7
- package/build/at1000-TeP9-fyr.d.mts.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.cts.map +1 -1
- package/build/browser.d.mts +2 -8
- package/build/browser.d.mts.map +1 -1
- package/build/browser.mjs +1 -1
- package/build/browser.mjs.map +1 -1
- package/build/com.cjs +2 -1
- package/build/com.cjs.map +1 -0
- package/build/com.d.cts +1155 -2
- package/build/com.d.cts.map +1 -0
- package/build/com.d.mts +1155 -2
- package/build/com.d.mts.map +1 -0
- package/build/com.mjs +2 -1
- package/build/com.mjs.map +1 -0
- package/build/{common-SFHWBeL2.cjs → common-Bbc8Sixu.cjs} +1 -1
- package/build/{common-SFHWBeL2.cjs.map → common-Bbc8Sixu.cjs.map} +1 -1
- package/build/{common-B_zag9Mq.mjs → common-D4tBd_j2.mjs} +1 -1
- package/build/{common-B_zag9Mq.mjs.map → common-D4tBd_j2.mjs.map} +1 -1
- package/build/{common-DAOxX-Zx.d.cts → common-DJ7WSo1p.d.mts} +1 -1
- package/build/common-DJ7WSo1p.d.mts.map +1 -0
- package/build/{common-SiysH9tt.d.mts → common-DWQyDOs5.d.cts} +1 -1
- package/build/common-DWQyDOs5.d.cts.map +1 -0
- package/build/gpio.cjs +2 -1
- package/build/gpio.cjs.map +1 -0
- package/build/gpio.d.cts +358 -3
- package/build/gpio.d.cts.map +1 -0
- package/build/gpio.d.mts +358 -4
- package/build/gpio.d.mts.map +1 -0
- package/build/gpio.mjs +2 -1
- package/build/gpio.mjs.map +1 -0
- package/build/hmi.cjs +2 -1
- package/build/hmi.cjs.map +1 -0
- package/build/hmi.d.cts +135 -2
- package/build/hmi.d.cts.map +1 -0
- package/build/hmi.d.mts +135 -2
- package/build/hmi.d.mts.map +1 -0
- package/build/hmi.mjs +2 -1
- package/build/hmi.mjs.map +1 -0
- package/build/management.cjs +2 -1
- package/build/management.cjs.map +1 -0
- package/build/management.d.cts +283 -2
- package/build/management.d.cts.map +1 -0
- package/build/management.d.mts +283 -2
- package/build/management.d.mts.map +1 -0
- package/build/management.mjs +2 -1
- package/build/management.mjs.map +1 -0
- package/build/node.cjs +1 -1
- package/build/node.cjs.map +1 -1
- package/build/node.d.cts +1 -1
- package/build/node.d.cts.map +1 -1
- package/build/node.d.mts +2 -8
- package/build/node.d.mts.map +1 -1
- package/build/node.mjs +1 -1
- package/build/node.mjs.map +1 -1
- package/build/power.cjs +2 -1
- package/build/power.cjs.map +1 -0
- package/build/power.d.cts +343 -3
- package/build/power.d.cts.map +1 -0
- package/build/power.d.mts +343 -4
- package/build/power.d.mts.map +1 -0
- package/build/power.mjs +2 -1
- package/build/power.mjs.map +1 -0
- package/build/relays.cjs +2 -1
- package/build/relays.cjs.map +1 -0
- package/build/relays.d.cts +80 -2
- package/build/relays.d.cts.map +1 -0
- package/build/relays.d.mts +80 -2
- package/build/relays.d.mts.map +1 -0
- package/build/relays.mjs +2 -1
- package/build/relays.mjs.map +1 -0
- package/package.json +11 -7
- package/build/at1000-BLTMMFOe.d.cts.map +0 -1
- package/build/at1000-DBnCRa4B.cjs +0 -3
- package/build/at1000-DOi600n-.mjs +0 -3
- package/build/at1000-tq5RRNjA.d.mts.map +0 -1
- package/build/com-9S4BYQCi.mjs +0 -2
- package/build/com-9S4BYQCi.mjs.map +0 -1
- package/build/com-C7d5yOIK.cjs +0 -2
- package/build/com-C7d5yOIK.cjs.map +0 -1
- package/build/com-C9-fdGPZ.d.mts +0 -1155
- package/build/com-C9-fdGPZ.d.mts.map +0 -1
- package/build/com-DFB9TPdI.d.cts +0 -1155
- package/build/com-DFB9TPdI.d.cts.map +0 -1
- package/build/common-DAOxX-Zx.d.cts.map +0 -1
- package/build/common-SiysH9tt.d.mts.map +0 -1
- package/build/gpio-BWNwiLs7.cjs +0 -2
- package/build/gpio-BWNwiLs7.cjs.map +0 -1
- package/build/gpio-DQwp2EAk.d.mts +0 -358
- package/build/gpio-DQwp2EAk.d.mts.map +0 -1
- package/build/gpio-DUqCYSA4.d.cts +0 -358
- package/build/gpio-DUqCYSA4.d.cts.map +0 -1
- package/build/gpio-lBesVV2E.mjs +0 -2
- package/build/gpio-lBesVV2E.mjs.map +0 -1
- package/build/hmi-BCMtWRQH.d.mts +0 -135
- package/build/hmi-BCMtWRQH.d.mts.map +0 -1
- package/build/hmi-CGDU48qM.d.cts +0 -135
- package/build/hmi-CGDU48qM.d.cts.map +0 -1
- package/build/hmi-CTx2jfxU.mjs +0 -2
- package/build/hmi-CTx2jfxU.mjs.map +0 -1
- package/build/hmi-CnTa8kMx.cjs +0 -2
- package/build/hmi-CnTa8kMx.cjs.map +0 -1
- package/build/management-BMEMu2Kx.mjs +0 -2
- package/build/management-BMEMu2Kx.mjs.map +0 -1
- package/build/management-CCwBNLm_.d.cts +0 -240
- package/build/management-CCwBNLm_.d.cts.map +0 -1
- package/build/management-Cw05hjbG.d.mts +0 -240
- package/build/management-Cw05hjbG.d.mts.map +0 -1
- package/build/management-Lna6AzGK.cjs +0 -2
- package/build/management-Lna6AzGK.cjs.map +0 -1
- package/build/power-BkJtVbiA.d.cts +0 -343
- package/build/power-BkJtVbiA.d.cts.map +0 -1
- package/build/power-Bz5S5GGr.mjs +0 -2
- package/build/power-Bz5S5GGr.mjs.map +0 -1
- package/build/power-C7KM2zvR.cjs +0 -2
- package/build/power-C7KM2zvR.cjs.map +0 -1
- package/build/power-nWlY0xFN.d.mts +0 -343
- package/build/power-nWlY0xFN.d.mts.map +0 -1
- package/build/relays-BK2uL5i_.cjs +0 -2
- package/build/relays-BK2uL5i_.cjs.map +0 -1
- package/build/relays-Bn8LBgWl.d.cts +0 -79
- package/build/relays-Bn8LBgWl.d.cts.map +0 -1
- package/build/relays-CkBk7SOg.d.mts +0 -79
- package/build/relays-CkBk7SOg.d.mts.map +0 -1
- package/build/relays-CqglfFwF.mjs +0 -2
- package/build/relays-CqglfFwF.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"com.d.mts","names":[],"sources":["../src/api/com.ts"],"mappings":";;;;cAGM,QAAA,EAAQ,CAAA,CAAA,YAAA;EAAA;;;KAIF,QAAA,GAAW,CAAA,CAAE,WAAA,QAAmB,QAAA;AAAA,cAEtC,UAAA,EAAU,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,WAAA,EAAA,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,eAAA,6BAAA,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,cAAA,wBAAA,CAAA,CAAA,cAAA,wCAAA,CAAA,CAAA,eAAA,4CAAA,CAAA,CAAA,eAAA;AAAA,KAkBJ,UAAA,GAAa,CAAA,CAAE,WAAA,QAAmB,UAAA;AAAA,KAClC,eAAA,GAAkB,CAAA,CAAE,UAAA,QAAkB,UAAA;AAAA,cAQ5C,kBAAA,EAAkB,CAAA,CAAA,eAAA,EAAA,IAAA,CAAA,CAAA,CAAA,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAInB,kBAAA,GAAqB,CAAA,CAAE,WAAA,QAAmB,kBAAA;AAAA,cACzC,mBAAA,E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 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import*as e from"valibot";const t=e.object({can_id:e.number(),data:e.pipe(e.array(e.number()),e.minLength(0),e.maxLength(8))}),n=e.pipe(e.union([e.pipe(e.string(),e.maxLength(1024)),e.pipe(e.array(e.pipe(e.number(),e.minValue(0),e.maxValue(255))),e.maxLength(1024))]),e.transform(e=>typeof e==`string`?e.split(``).map(e=>{let t=e.charCodeAt(0);return t>127?63:t}):e)),r=e.object({address:e.number(),start:e.boolean(),stop:e.boolean(),nack_last_byte:e.boolean()}),i=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({length:e.pipe(e.number(),e.minValue(1),e.maxValue(1024))})]),a=e.intersect([e.partial(r,[`start`,`stop`,`nack_last_byte`]),e.object({data:n})]),o=e.object({enabled:e.boolean(),baud_rate:e.picklist([5e3,1e4,2e4,31250,33e3,4e4,5e4,8e4,83300,95e3,1e5,125e3,2e5,25e4,5e5,1e6]),termination_resistors:e.boolean(),rx_filter:e.object({extended_id:e.boolean(),id:e.number(),mask:e.number()})}),s=e.partial(o);e.omit(s,[`enabled`]);const c=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(1e6))}),l=e.partial(c);e.omit(l,[`enabled`]);const u=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(2e7)),termination_resistors:e.boolean()}),d=e.partial(u);e.omit(d,[`enabled`]);const f=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(1e7)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5)),mode:e.pipe(e.number(),e.minValue(0),e.maxValue(3))}),p=e.partial(f);e.omit(p,[`enabled`]);const m=e.object({enabled:e.boolean(),baud_rate:e.picklist([1e5,4e5,1e6]),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5))}),h=e.partial(m);e.omit(h,[`enabled`]);const g=e.object({enabled:e.boolean(),baud_rate:e.pipe(e.number(),e.minValue(300),e.maxValue(12e6)),vcc:e.pipe(e.number(),e.minValue(1.6),e.maxValue(5))}),_=e.partial(g);e.omit(_,[`enabled`]);var v=class{constructor(e){this.fetch=e}reset(){return this.fetch(`/com/reset`,{method:`POST`,parseResponse:()=>{}})}can(e){return new y(this.fetch,e)}rs232(e){return new b(this.fetch,e)}rs485(e){return new x(this.fetch,e)}spi(e){return new S(this.fetch,e)}i2c(e){return new C(this.fetch,e)}uart(e){return new w(this.fetch,e)}},y=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/can/${this.id}/config`,{method:`PATCH`,body:e.parse(s,t),schema:o})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(n){return this.fetch(`/com/can/${this.id}/write`,{method:`POST`,body:e.parse(t,n),schema:t})}start_rx(){return this.fetch(`/com/can/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/can/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/can/${this.id}/read`,{schema:e.array(t)})}},b=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs232/${this.id}/config`,{method:`PATCH`,body:e.parse(l,t),schema:c})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs232/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs232/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs232/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs232/${this.id}/read`,{schema:n})}},x=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/rs485/${this.id}/config`,{method:`PATCH`,body:e.parse(d,t),schema:u})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/rs485/${this.id}/write`,{method:`POST`,body:e.parse(n,t),schema:n})}start_rx(){return this.fetch(`/com/rs485/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/rs485/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/rs485/${this.id}/read`,{schema:n})}},S=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/spi/${this.id}/config`,{method:`PATCH`,body:e.parse(p,t),schema:f})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}trx(t){return this.fetch(`/com/spi/${this.id}/write_read`,{method:`POST`,body:e.parse(n,t),schema:n})}},C=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/i2c/${this.id}/config`,{method:`PATCH`,body:e.parse(h,t),schema:m})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/i2c/${this.id}/write`,{method:`POST`,body:e.parse(a,t),parseResponse:async e=>{let t=await e.text();return parseInt(t,10)}})}rx(t){return this.fetch(`/com/i2c/${this.id}/read`,{method:`POST`,body:e.parse(i,t),schema:n})}},w=class{constructor(e,t){this.fetch=e,this.id=t}configure(t){return this.fetch(`/com/uart/${this.id}/config`,{method:`PATCH`,body:e.parse(_,t),schema:g})}enable(e={}){return this.configure({...e,enabled:!0})}disable(){return this.configure({enabled:!1})}tx(t){return this.fetch(`/com/uart/${this.id}/write`,{method:`POST`,body:e.parse(n,t)})}start_rx(){return this.fetch(`/com/uart/${this.id}/start_rx`,{method:`POST`,parseResponse:()=>{}})}stop_rx(){return this.fetch(`/com/uart/${this.id}/stop_rx`,{method:`POST`,parseResponse:()=>{}})}rx(){return this.fetch(`/com/uart/${this.id}/read`,{schema:n})}};export{y as Can,v as ComApi,C as I2c,b as Rs232,x as Rs485,S as Spi,w as Uart};
|
|
2
|
+
//# sourceMappingURL=com.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"com.mjs","names":[],"sources":["../src/api/com.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nconst canFrame = v.object({\n can_id: v.number(),\n data: v.pipe(v.array(v.number()), v.minLength(0), v.maxLength(8)),\n});\nexport type CanFrame = v.InferOutput<typeof canFrame>;\n\nconst serialData = v.pipe(\n // 1. Validate Input: String OR Array of Bytes (0-255), both max length 1024\n v.union([\n v.pipe(v.string(), v.maxLength(1024)),\n v.pipe(v.array(v.pipe(v.number(), v.minValue(0), v.maxValue(255))), v.maxLength(1024)),\n ]),\n // 2. Transform: Convert String to ASCII bytes or pass Array as is\n v.transform((input) => {\n if (typeof input === 'string') {\n return input.split('').map((char) => {\n const code = char.charCodeAt(0);\n // Replace UTF8/Non-ASCII (>127) with \"?\" (ASCII 63)\n return code > 127 ? 63 : code;\n });\n }\n return input;\n }),\n);\nexport type SerialData = v.InferOutput<typeof serialData>;\nexport type SerialDataInput = v.InferInput<typeof serialData>;\n\nconst i2cTransactionBase = v.object({\n address: v.number(),\n start: v.boolean(),\n stop: v.boolean(),\n nack_last_byte: v.boolean(),\n});\nconst i2cTransactionRead = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ length: v.pipe(v.number(), v.minValue(1), v.maxValue(1024)) }),\n]);\ntype I2cTransactionRead = v.InferOutput<typeof i2cTransactionRead>;\nconst i2cTransactionWrite = v.intersect([\n v.partial(i2cTransactionBase, ['start', 'stop', 'nack_last_byte']),\n v.object({ data: serialData }),\n]);\ntype I2cTransactionWrite = v.InferOutput<typeof i2cTransactionWrite>;\n\nconst canConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([5_000, 10_000, 20_000, 31_250, 33_000, 40_000, 50_000, 80_000, 83_300,\n 95_000, 100_000, 125_000, 200_000, 250_000, 500_000, 1_000_000]),\n termination_resistors: v.boolean(),\n rx_filter: v.object({ extended_id: v.boolean(), id: v.number(), mask: v.number() }),\n});\nexport type CanConfig = v.InferOutput<typeof canConfig>;\nconst canConfigPatch = v.partial(canConfig);\nexport type CanConfigPatch = v.InferOutput<typeof canConfigPatch>;\nconst canEnableConfig = v.omit(canConfigPatch, ['enabled']);\nexport type CanEnableConfig = v.InferOutput<typeof canEnableConfig>;\n\nconst rs232Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(1_000_000)),\n});\nexport type Rs232Config = v.InferOutput<typeof rs232Config>;\nconst rs232ConfigPatch = v.partial(rs232Config);\nexport type Rs232ConfigPatch = v.InferOutput<typeof rs232ConfigPatch>;\nconst rs232EnableConfig = v.omit(rs232ConfigPatch, ['enabled']);\nexport type Rs232EnableConfig = v.InferOutput<typeof rs232EnableConfig>;\n\nconst rs485Config = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(20_000_000)),\n termination_resistors: v.boolean(),\n});\nexport type Rs485Config = v.InferOutput<typeof rs485Config>;\nconst rs485ConfigPatch = v.partial(rs485Config);\nexport type Rs485ConfigPatch = v.InferOutput<typeof rs485ConfigPatch>;\nconst rs485EnableConfig = v.omit(rs485ConfigPatch, ['enabled']);\nexport type Rs485EnableConfig = v.InferOutput<typeof rs485EnableConfig>;\n\nconst spiConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(10_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n mode: v.pipe(v.number(), v.minValue(0), v.maxValue(3)),\n});\nexport type SpiConfig = v.InferOutput<typeof spiConfig>;\nconst spiConfigPatch = v.partial(spiConfig);\nexport type SpiConfigPatch = v.InferOutput<typeof spiConfigPatch>;\nconst spiEnableConfig = v.omit(spiConfigPatch, ['enabled']);\nexport type SpiEnableConfig = v.InferOutput<typeof spiEnableConfig>;\n\nconst i2cConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.picklist([100_000, 400_000, 1_000_000]),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n});\nexport type I2cConfig = v.InferOutput<typeof i2cConfig>;\nconst i2cConfigPatch = v.partial(i2cConfig);\nexport type I2cConfigPatch = v.InferOutput<typeof i2cConfigPatch>;\nconst i2cEnableConfig = v.omit(i2cConfigPatch, ['enabled']);\nexport type I2cEnableConfig = v.InferOutput<typeof i2cEnableConfig>;\n\nconst uartConfig = v.object({\n enabled: v.boolean(),\n baud_rate: v.pipe(v.number(), v.minValue(300), v.maxValue(12_000_000)),\n vcc: v.pipe(v.number(), v.minValue(1.6), v.maxValue(5)),\n});\nexport type UartConfig = v.InferOutput<typeof uartConfig>;\nconst uartConfigPatch = v.partial(uartConfig);\nexport type UartConfigPatch = v.InferOutput<typeof uartConfigPatch>;\nconst uartEnableConfig = v.omit(uartConfigPatch, ['enabled']);\nexport type UartEnableConfig = v.InferOutput<typeof uartEnableConfig>;\n\n/** @hideconstructor */\nexport class ComApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets the communication interfaces.\n */\n reset(): Promise<void> {\n return this.fetch('/com/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific CAN interface by id.\n * @param id The CAN interface id.\n * @returns The CAN instance.\n */\n can(id: number): Can {\n return new Can(this.fetch, id);\n }\n\n /**\n * Access a specific RS232 interface by id.\n * @param id The RS232 interface id.\n * @returns The RS232 instance.\n */\n rs232(id: number): Rs232 {\n return new Rs232(this.fetch, id);\n }\n\n /**\n * Access a specific RS485 interface by id.\n * @param id The RS485 interface id.\n * @returns The RS485 instance.\n */\n rs485(id: number): Rs485 {\n return new Rs485(this.fetch, id);\n }\n\n /**\n * Access a specific SPI interface by id.\n * @param id The SPI interface id.\n * @returns The SPI instance.\n */\n spi(id: number): Spi {\n return new Spi(this.fetch, id);\n }\n\n /**\n * Access a specific I2C interface by id.\n * @param id The I2C interface id.\n * @returns The I2C instance.\n */\n i2c(id: number): I2c {\n return new I2c(this.fetch, id);\n }\n\n /**\n * Access a specific UART interface by id.\n * @param id The UART interface id.\n * @returns The UART instance.\n */\n uart(id: number): Uart {\n return new Uart(this.fetch, id);\n }\n}\n\n/** @hideconstructor */\nexport class Can {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the CAN interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: CanConfigPatch): Promise<CanConfig> {\n return this.fetch(`/com/can/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(canConfigPatch, config),\n schema: canConfig,\n });\n }\n\n /**\n * Enables the CAN interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: CanEnableConfig = {}): Promise<CanConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the CAN interface.\n * @returns The updated configuration.\n */\n disable(): Promise<CanConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the CAN interface.\n * @param data The data to transmit.\n * @returns The transmitted data.\n */\n tx(data: CanFrame): Promise<CanFrame> {\n return this.fetch(`/com/can/${this.id}/write`, {\n method: 'POST',\n body: v.parse(canFrame, data),\n schema: canFrame,\n });\n }\n\n /**\n * Starts receiving data over the CAN interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the CAN interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/can/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the CAN interface.\n * @returns An array of can frames.\n */\n rx(): Promise<CanFrame[]> {\n return this.fetch(`/com/can/${this.id}/read`, { schema: v.array(canFrame) });\n }\n}\n\n/** @hideconstructor */\nexport class Rs232 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS232 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs232ConfigPatch): Promise<Rs232Config> {\n return this.fetch(`/com/rs232/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs232ConfigPatch, config),\n schema: rs232Config,\n });\n }\n\n /**\n * Enables the RS232 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs232EnableConfig = {}): Promise<Rs232Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS232 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs232Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS232 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS232 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS232 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs232/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS232 interface.\n * @returns An array containing the received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs232/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Rs485 {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the RS485 interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: Rs485ConfigPatch): Promise<Rs485Config> {\n return this.fetch(`/com/rs485/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(rs485ConfigPatch, config),\n schema: rs485Config,\n });\n }\n\n /**\n * Enables the RS485 interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: Rs485EnableConfig = {}): Promise<Rs485Config> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the RS485 interface.\n * @returns The updated configuration.\n */\n disable(): Promise<Rs485Config> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the RS485 interface.\n * @param data The data to transmit (byte array or string).\n * @returns The transmitted data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n\n /**\n * Starts receiving data over the RS485 interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/start_rx`, {\n method: 'POST',\n parseResponse: () => {},\n });\n }\n\n /**\n * Stops receiving data over the RS485 interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/rs485/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the RS485 interface.\n * @returns The received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/rs485/${this.id}/read`, { schema: serialData });\n }\n}\n\n/** @hideconstructor */\nexport class Spi {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the SPI interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: SpiConfigPatch): Promise<SpiConfig> {\n return this.fetch(`/com/spi/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(spiConfigPatch, config),\n schema: spiConfig,\n });\n }\n\n /**\n * Enables the SPI interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: SpiEnableConfig = {}): Promise<SpiConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the SPI interface.\n * @returns The updated configuration.\n */\n disable(): Promise<SpiConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the SPI interface and receives the response.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n trx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/spi/${this.id}/write_read`, {\n method: 'POST',\n body: v.parse(serialData, data),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class I2c {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the I2C interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: I2cConfigPatch): Promise<I2cConfig> {\n return this.fetch(`/com/i2c/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(i2cConfigPatch, config),\n schema: i2cConfig,\n });\n }\n\n /**\n * Enables the I2C interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: I2cEnableConfig = {}): Promise<I2cConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the I2C interface.\n * @returns The updated configuration.\n */\n disable(): Promise<I2cConfig> {\n return this.configure({ enabled: false });\n }\n\n tx(transaction: I2cTransactionWrite): Promise<number> {\n return this.fetch(`/com/i2c/${this.id}/write`, {\n method: 'POST',\n body: v.parse(i2cTransactionWrite, transaction),\n parseResponse: async (response) => {\n const text = await response.text();\n return parseInt(text, 10);\n },\n });\n }\n\n rx(transaction: I2cTransactionRead): Promise<SerialData> {\n return this.fetch(`/com/i2c/${this.id}/read`, {\n method: 'POST',\n body: v.parse(i2cTransactionRead, transaction),\n schema: serialData,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Uart {\n constructor(private readonly fetch: UpFetch, public readonly id: number) {}\n\n /**\n * Configures the UART interface.\n * @param config The configuration to apply.\n * @returns The updated configuration.\n */\n configure(config: UartConfigPatch): Promise<UartConfig> {\n return this.fetch(`/com/uart/${this.id}/config`, {\n method: 'PATCH',\n body: v.parse(uartConfigPatch, config),\n schema: uartConfig,\n });\n }\n\n /**\n * Enables the UART interface.\n * @param config Optional configuration to apply while enabling.\n * @returns The updated configuration.\n */\n enable(config: UartEnableConfig = {}): Promise<UartConfig> {\n return this.configure({ ...config, enabled: true });\n }\n\n /**\n * Disables the UART interface.\n * @returns The updated configuration.\n */\n disable(): Promise<UartConfig> {\n return this.configure({ enabled: false });\n }\n\n /**\n * Transmits data over the UART interface.\n * @param data The data to transmit (byte array or string).\n * @returns The received response data.\n */\n tx(data: SerialDataInput): Promise<SerialData> {\n return this.fetch(`/com/uart/${this.id}/write`, {\n method: 'POST',\n body: v.parse(serialData, data),\n });\n }\n\n /**\n * Starts receiving data over the UART interface.\n */\n start_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/start_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Stops receiving data over the UART interface.\n */\n stop_rx(): Promise<void> {\n return this.fetch(`/com/uart/${this.id}/stop_rx`, { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Reads data from the UART interface.\n * @returns The received data.\n */\n rx(): Promise<SerialData> {\n return this.fetch(`/com/uart/${this.id}/read`, { schema: serialData });\n }\n}\n"],"mappings":"0BAGA,MAAM,EAAW,EAAE,OAAO,CACxB,OAAQ,EAAE,QAAQ,CAClB,KAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAE,EAAE,UAAU,EAAE,CAAE,EAAE,UAAU,EAAE,CAAC,CAClE,CAAC,CAGI,EAAa,EAAE,KAEnB,EAAE,MAAM,CACN,EAAE,KAAK,EAAE,QAAQ,CAAE,EAAE,UAAU,KAAK,CAAC,CACrC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAE,EAAE,SAAS,EAAE,CAAE,EAAE,SAAS,IAAI,CAAC,CAAC,CAAE,EAAE,UAAU,KAAK,CAAC,CACvF,CAAC,CAEF,EAAE,UAAW,GACP,OAAO,GAAU,SACZ,EAAM,MAAM,GAAG,CAAC,IAAK,GAAS,CACnC,IAAM,EAAO,EAAK,WAAW,EAAE,CAE/B,OAAO,EAAO,IAAM,GAAK,GACzB,CAEG,EACP,CACH,CAIK,EAAqB,EAAE,OAAO,CAClC,QAAS,EAAE,QAAQ,CACnB,MAAO,EAAE,SAAS,CAClB,KAA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I,CAAC,CAOhG,IAA0B,CACxB,OAAO,KAAK,MAAM,aAAa,KAAK,GAAG,OAAQ,CAAE,OAAQ,EAAY,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`valibot`);t=e.t(t);const n=t.pipe(t.number(),t.minValue(-25),t.maxValue(25)),r=t.pipe(t.number(),t.minValue(0),t.maxValue(24)),i=t.pipe(t.union([t.boolean(),t.number()]),t.toBoolean());Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
2
|
-
//# sourceMappingURL=common-
|
|
2
|
+
//# sourceMappingURL=common-Bbc8Sixu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-
|
|
1
|
+
{"version":3,"file":"common-Bbc8Sixu.cjs","names":["v"],"sources":["../src/api/common.ts"],"sourcesContent":["import * as v from 'valibot';\n\nexport const analogLevel = v.pipe(v.number(), v.minValue(-25), v.maxValue(25));\nexport const analogOutputLevel = v.pipe(v.number(), v.minValue(0), v.maxValue(24));\nexport const digitalLevel = v.pipe(v.union([v.boolean(), v.number()]), v.toBoolean());\n\nexport type AnalogLevel = v.InferOutput<typeof analogLevel>;\nexport type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;\nexport type DigitalLevel = v.InferInput<typeof digitalLevel>;\n"],"mappings":"0EAEA,MAAa,EAAcA,EAAE,KAAKA,EAAE,QAAQ,CAAEA,EAAE,SAAS,IAAI,CAAEA,EAAE,SAAS,GAAG,CAAC,CACjE,EAAoBA,EAAE,KAAKA,EAAE,QAAQ,CAAEA,EAAE,SAAS,EAAE,CAAEA,EAAE,SAAS,GAAG,CAAC,CACrE,EAAeA,EAAE,KAAKA,EAAE,MAAM,CAACA,EAAE,SAAS,CAAEA,EAAE,QAAQ,CAAC,CAAC,CAAEA,EAAE,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import*as e from"valibot";const t=e.pipe(e.number(),e.minValue(-25),e.maxValue(25)),n=e.pipe(e.number(),e.minValue(0),e.maxValue(24)),r=e.pipe(e.union([e.boolean(),e.number()]),e.toBoolean());export{n,r,t};
|
|
2
|
-
//# sourceMappingURL=common-
|
|
2
|
+
//# sourceMappingURL=common-D4tBd_j2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-
|
|
1
|
+
{"version":3,"file":"common-D4tBd_j2.mjs","names":[],"sources":["../src/api/common.ts"],"sourcesContent":["import * as v from 'valibot';\n\nexport const analogLevel = v.pipe(v.number(), v.minValue(-25), v.maxValue(25));\nexport const analogOutputLevel = v.pipe(v.number(), v.minValue(0), v.maxValue(24));\nexport const digitalLevel = v.pipe(v.union([v.boolean(), v.number()]), v.toBoolean());\n\nexport type AnalogLevel = v.InferOutput<typeof analogLevel>;\nexport type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;\nexport type DigitalLevel = v.InferInput<typeof digitalLevel>;\n"],"mappings":"0BAEA,MAAa,EAAc,EAAE,KAAK,EAAE,QAAQ,CAAE,EAAE,SAAS,IAAI,CAAE,EAAE,SAAS,GAAG,CAAC,CACjE,EAAoB,EAAE,KAAK,EAAE,QAAQ,CAAE,EAAE,SAAS,EAAE,CAAE,EAAE,SAAS,GAAG,CAAC,CACrE,EAAe,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,SAAS,CAAE,EAAE,QAAQ,CAAC,CAAC,CAAE,EAAE,WAAW,CAAC"}
|
|
@@ -5,4 +5,4 @@ declare const analogOutputLevel: v.SchemaWithPipe<readonly [v.NumberSchema<undef
|
|
|
5
5
|
type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AnalogOutputLevel as t };
|
|
8
|
-
//# sourceMappingURL=common-
|
|
8
|
+
//# sourceMappingURL=common-DJ7WSo1p.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-DJ7WSo1p.d.mts","names":[],"sources":["../src/api/common.ts"],"mappings":";;;cAGa,iBAAA,EAAiB,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,cAAA,wBAAA,CAAA,CAAA,cAAA;AAAA,KAIlB,iBAAA,GAAoB,CAAA,CAAE,WAAA,QAAmB,iBAAA"}
|
|
@@ -5,4 +5,4 @@ declare const analogOutputLevel: v.SchemaWithPipe<readonly [v.NumberSchema<undef
|
|
|
5
5
|
type AnalogOutputLevel = v.InferOutput<typeof analogOutputLevel>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AnalogOutputLevel as t };
|
|
8
|
-
//# sourceMappingURL=common-
|
|
8
|
+
//# sourceMappingURL=common-DWQyDOs5.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-DWQyDOs5.d.cts","names":[],"sources":["../src/api/common.ts"],"mappings":";;;cAGa,iBAAA,EAAiB,CAAA,CAAA,cAAA,WAAA,CAAA,CAAA,YAAA,aAAA,CAAA,CAAA,cAAA,wBAAA,CAAA,CAAA,cAAA;AAAA,KAIlB,iBAAA,GAAoB,CAAA,CAAE,WAAA,QAAmB,iBAAA"}
|
package/build/gpio.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
require(`./common-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common-Bbc8Sixu.cjs`);let n=require(`valibot`);n=e.t(n);const r=n.picklist([`release`,`hold`],`Invalid sync action`),i=n.object({mode:n.literal(`analog`),direction:n.literal(`input`)}),a=n.object({mode:n.literal(`analog`),direction:n.literal(`output`),value:n.optional(t.n)}),o=n.object({mode:n.literal(`digital`),direction:n.literal(`input`),vil:t.t,vih:t.t}),s=n.object({mode:n.literal(`digital`),direction:n.literal(`output`),value:t.r,vol:t.n,voh:t.n,vil:t.t,vih:t.t}),c=n.object({mode:n.literal(`digital`),direction:n.literal(`open_drain`),value:t.r,vil:t.t,vih:t.t});n.omit(a,[`direction`,`mode`]),n.omit(o,[`direction`,`mode`]);const l=n.partial(n.omit(s,[`direction`,`mode`]),[`vih`,`vil`]);n.omit(c,[`direction`,`mode`]);const u=n.object({value:t.r}),d=n.object({value:t.t}),f=n.object({action:r});var p=class{count;constructor(e,t){this.fetch=e,this.count=t.capabilities.io.count}reset(){return this.fetch(`/gpio/reset`,{method:`POST`,parseResponse:()=>{}})}digital(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new m(this.fetch,e)}analog(e){if(e<0||e>=this.count)throw Error(`Invalid GPIO pin ${e} (RESOURCE_NOT_FOUND)\n Suggestion: Use a pin number between 0 and ${this.count-1}\n Path: /gpio/${e}`);return new h(this.fetch,e)}hold(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`hold`},schema:f})}release(){return this.fetch(`/gpio/sync`,{method:`POST`,body:{action:`release`},schema:f})}},m=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(o,{...e,mode:`digital`,direction:`input`}),schema:o})}configure_output(e){e=n.parse(l,e);let t={mode:`digital`,direction:`output`,value:e.value,vol:e.vol,voh:e.voh,vil:e.vil??e.vol+(e.voh-e.vol)/4,vih:e.vih??e.voh-(e.voh-e.vol)/4};return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(s,t),schema:s})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:u})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:u})).value}configure_open_drain(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(c,{...e,mode:`digital`,direction:`open_drain`}),schema:c})}},h=class{constructor(e,t){this.fetch=e,this.id=t}configure_input(){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:{mode:`analog`,direction:`input`},schema:i})}configure_output(e){return this.fetch(`/gpio/${this.id}/config`,{method:`PATCH`,body:n.parse(a,{value:e,mode:`analog`,direction:`output`}),schema:a})}async read(){return(await this.fetch(`/gpio/${this.id}/state`,{schema:d})).value}async write(e){return(await this.fetch(`/gpio/${this.id}/state`,{method:`PUT`,body:{value:e},schema:d})).value}};exports.AnalogIO=h,exports.DigitalIO=m,exports.GpioApi=p;
|
|
2
|
+
//# sourceMappingURL=gpio.cjs.map
|
|
@@ -0,0 +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');\nconst analogInputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('input'),\n});\nconst analogOutputConfiguration = v.object({\n mode: v.literal('analog'),\n direction: v.literal('output'),\n value: v.optional(analogOutputLevel),\n});\nconst digitalInputConfiguration = v.object({\n mode: v.literal('digital'),\n direction: v.literal('input'),\n vil: analogLevel,\n vih: analogLevel,\n});\nconst 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});\nconst 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\nconst digitalState = v.object({ value: digitalLevel });\nconst analogState = v.object({ value: analogLevel });\n\nconst syncConfiguration = v.object({ action: syncAction });\nexport type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;\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/** @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: { 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":"gLAQA,MAAM,EAAaA,EAAE,SAAS,CAAC,UAAW,OAAO,CAAE,sBAAsB,CACnE,EAA2BA,EAAE,OAAO,CACxC,KAAMA,EAAE,QAAQ,SAAS,CACzB,UAAWA,EAAE,QAAQ,QAAQ,CAC9B,CAAC,CACI,EAA4BA,EAAE,OAAO,CACzC,KAAMA,EAAE,QAAQ,SAAS,CACzB,UAAWA,EAAE,QAAQ,SAAS,CAC9B,MAAOA,EAAE,SAASC,EAAAA,EAAkB,CACrC,CAAC,CACI,EAA4BD,EAAE,OAAO,CACzC,KAAMA,EAAE,QAAQ,UAAU,CAC1B,UAAWA,EAAE,QAAQ,QAAQ,CAC7B,IAAKE,EAAAA,EACL,IAAKA,EAAAA,EACN,CAAC,CACI,EAA6BF,EAAE,OAAO,CAC1C,KAAMA,EAAE,QAAQ,UAAU,CAC1B,UAAWA,EAAE,QAAQ,SAAS,CAC9B,MAAOG,EAAAA,EACP,IAAKF,EAAAA,EACL,IAAKA,EAAAA,EACL,IAAKC,EAAAA,EACL,IAAKA,EAAAA,EACN,CAAC,CACI,EAAyBF,EAAE,OAAO,CACtC,KAAMA,EAAE,QAAQ,UAAU,CAC1B,UAAWA,EAAE,QAAQ,aAAa,CAClC,MAAOG,EAAAA,EACP,IAAKD,EAAAA,EACL,IAAKA,EAAAA,EACN,CAAC,CAOuCF,EAAE,KAAK,EAA2B,CAAC,YAAa,OAAO,CAAC,CAIxDA,EAAE,KAAK,EAA2B,CAAC,YAAa,OAAO,CAAC,CAIjG,MAAM,EAAoCA,EAAE,QAC1CA,EAAE,KAAK,EAA4B,CAAC,YAAa,OAAO,CAAC,CACzD,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AMA,EAAE,MACN,EACA,CAAE,QAAO,KAAM,SAAU,UAAW,SAAU,CAC/C,CACD,OAAQ,EACT,CAAC,CAOJ,MAAM,MAAwB,CAC5B,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CAAE,OAAQ,EAAa,CAAC,EAAE,MAQ/E,MAAM,MAAM,EAAgC,CAC1C,OAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,GAAG,QAAS,CACjD,OAAQ,MACR,KAAM,CAAE,QAAO,CACf,OAAQ,EACT,CAAC,EACC"}
|
package/build/gpio.d.cts
CHANGED
|
@@ -1,3 +1,358 @@
|
|
|
1
|
-
import { t as AnalogOutputLevel } from "./common-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { t as AnalogOutputLevel } from "./common-DWQyDOs5.cjs";
|
|
2
|
+
import { Information } from "./management.cjs";
|
|
3
|
+
import { UpFetch } from "up-fetch";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
|
|
6
|
+
//#region src/api/gpio.d.ts
|
|
7
|
+
declare const analogInputConfiguration: v.ObjectSchema<{
|
|
8
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
9
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
10
|
+
}, undefined>;
|
|
11
|
+
declare const analogOutputConfiguration: v.ObjectSchema<{
|
|
12
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
13
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
14
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
declare const digitalInputConfiguration: v.ObjectSchema<{
|
|
17
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
18
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
19
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
20
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
21
|
+
}, undefined>;
|
|
22
|
+
declare const digitalOutputConfiguration: v.ObjectSchema<{
|
|
23
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
24
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
25
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
26
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
27
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
28
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
29
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
declare const openDrainConfiguration: v.ObjectSchema<{
|
|
32
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
33
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
34
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
35
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
36
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
37
|
+
}, undefined>;
|
|
38
|
+
type AnalogInputConfiguration = v.InferOutput<typeof analogInputConfiguration>;
|
|
39
|
+
type AnalogOutputConfiguration = v.InferOutput<typeof analogOutputConfiguration>;
|
|
40
|
+
type DigitalInputConfiguration = v.InferOutput<typeof digitalInputConfiguration>;
|
|
41
|
+
type DigitalOutputConfiguration = v.InferOutput<typeof digitalOutputConfiguration>;
|
|
42
|
+
type OpenDrainConfiguration = v.InferOutput<typeof openDrainConfiguration>;
|
|
43
|
+
declare const partialAnalogOutputConfiguration: Omit<v.ObjectSchema<{
|
|
44
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
45
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
46
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
47
|
+
}, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
|
|
48
|
+
readonly entries: Omit<{
|
|
49
|
+
readonly mode: v.LiteralSchema<"analog", undefined>;
|
|
50
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
51
|
+
readonly value: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>, undefined>;
|
|
52
|
+
}, "mode" | "direction">;
|
|
53
|
+
readonly "~standard": v.StandardProps<{
|
|
54
|
+
value?: number | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
value?: number | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
59
|
+
value?: number | undefined;
|
|
60
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>>;
|
|
61
|
+
readonly "~types"?: {
|
|
62
|
+
readonly input: {
|
|
63
|
+
value?: number | undefined;
|
|
64
|
+
};
|
|
65
|
+
readonly output: {
|
|
66
|
+
value?: number | undefined;
|
|
67
|
+
};
|
|
68
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.ObjectIssue | v.MaxValueIssue<number, 24>;
|
|
69
|
+
} | undefined;
|
|
70
|
+
};
|
|
71
|
+
type PartialAnalogOutputConfiguration = v.InferOutput<typeof partialAnalogOutputConfiguration>;
|
|
72
|
+
declare const partialDigitalInputConfiguration: Omit<v.ObjectSchema<{
|
|
73
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
74
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
75
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
76
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
77
|
+
}, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
|
|
78
|
+
readonly entries: Omit<{
|
|
79
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
80
|
+
readonly direction: v.LiteralSchema<"input", undefined>;
|
|
81
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
82
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
83
|
+
}, "mode" | "direction">;
|
|
84
|
+
readonly "~standard": v.StandardProps<{
|
|
85
|
+
vil: number;
|
|
86
|
+
vih: number;
|
|
87
|
+
}, {
|
|
88
|
+
vil: number;
|
|
89
|
+
vih: number;
|
|
90
|
+
}>;
|
|
91
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
92
|
+
vil: number;
|
|
93
|
+
vih: number;
|
|
94
|
+
}, v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
95
|
+
readonly "~types"?: {
|
|
96
|
+
readonly input: {
|
|
97
|
+
vil: number;
|
|
98
|
+
vih: number;
|
|
99
|
+
};
|
|
100
|
+
readonly output: {
|
|
101
|
+
vil: number;
|
|
102
|
+
vih: number;
|
|
103
|
+
};
|
|
104
|
+
readonly issue: v.NumberIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>;
|
|
105
|
+
} | undefined;
|
|
106
|
+
};
|
|
107
|
+
type PartialDigitalInputConfiguration = v.InferOutput<typeof partialDigitalInputConfiguration>;
|
|
108
|
+
declare const partialDigitalOutputConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
109
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
110
|
+
readonly direction: v.LiteralSchema<"output", undefined>;
|
|
111
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
112
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
113
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
114
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
115
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
116
|
+
}, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
|
|
117
|
+
readonly entries: Omit<{
|
|
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
|
+
}, "mode" | "direction">;
|
|
126
|
+
readonly "~standard": v.StandardProps<{
|
|
127
|
+
value: number | boolean;
|
|
128
|
+
vil: number;
|
|
129
|
+
vih: number;
|
|
130
|
+
vol: number;
|
|
131
|
+
voh: number;
|
|
132
|
+
}, {
|
|
133
|
+
value: boolean;
|
|
134
|
+
vil: number;
|
|
135
|
+
vih: number;
|
|
136
|
+
vol: number;
|
|
137
|
+
voh: number;
|
|
138
|
+
}>;
|
|
139
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
140
|
+
value: boolean;
|
|
141
|
+
vil: number;
|
|
142
|
+
vih: number;
|
|
143
|
+
vol: number;
|
|
144
|
+
voh: number;
|
|
145
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
|
|
146
|
+
readonly "~types"?: {
|
|
147
|
+
readonly input: {
|
|
148
|
+
value: number | boolean;
|
|
149
|
+
vil: number;
|
|
150
|
+
vih: number;
|
|
151
|
+
vol: number;
|
|
152
|
+
voh: number;
|
|
153
|
+
};
|
|
154
|
+
readonly output: {
|
|
155
|
+
value: boolean;
|
|
156
|
+
vil: number;
|
|
157
|
+
vih: number;
|
|
158
|
+
vol: number;
|
|
159
|
+
voh: number;
|
|
160
|
+
};
|
|
161
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
|
|
162
|
+
} | undefined;
|
|
163
|
+
}, "~standard" | "~run" | "~types" | "entries"> & {
|
|
164
|
+
readonly entries: {
|
|
165
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
166
|
+
readonly vil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
167
|
+
readonly vih: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
168
|
+
readonly vol: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
169
|
+
readonly voh: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 24, undefined>]>;
|
|
170
|
+
};
|
|
171
|
+
readonly "~standard": v.StandardProps<{
|
|
172
|
+
value: number | boolean;
|
|
173
|
+
vil?: number | undefined;
|
|
174
|
+
vih?: number | undefined;
|
|
175
|
+
vol: number;
|
|
176
|
+
voh: number;
|
|
177
|
+
}, {
|
|
178
|
+
value: boolean;
|
|
179
|
+
vil?: number | undefined;
|
|
180
|
+
vih?: number | undefined;
|
|
181
|
+
vol: number;
|
|
182
|
+
voh: number;
|
|
183
|
+
}>;
|
|
184
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
185
|
+
value: boolean;
|
|
186
|
+
vil?: number | undefined;
|
|
187
|
+
vih?: number | undefined;
|
|
188
|
+
vol: number;
|
|
189
|
+
voh: number;
|
|
190
|
+
}, v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
|
|
191
|
+
readonly "~types"?: {
|
|
192
|
+
readonly input: {
|
|
193
|
+
value: number | boolean;
|
|
194
|
+
vil?: number | undefined;
|
|
195
|
+
vih?: number | undefined;
|
|
196
|
+
vol: number;
|
|
197
|
+
voh: number;
|
|
198
|
+
};
|
|
199
|
+
readonly output: {
|
|
200
|
+
value: boolean;
|
|
201
|
+
vil?: number | undefined;
|
|
202
|
+
vih?: number | undefined;
|
|
203
|
+
vol: number;
|
|
204
|
+
voh: number;
|
|
205
|
+
};
|
|
206
|
+
readonly issue: v.NumberIssue | v.MinValueIssue<number, 0> | v.BooleanIssue | v.ObjectIssue | v.MaxValueIssue<number, 24> | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
|
|
207
|
+
} | undefined;
|
|
208
|
+
};
|
|
209
|
+
type PartialDigitalOutputConfiguration = v.InferInput<typeof partialDigitalOutputConfiguration>;
|
|
210
|
+
declare const partialOpenDrainConfiguration: Omit<v.ObjectSchema<{
|
|
211
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
212
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
213
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
214
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
215
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
216
|
+
}, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
|
|
217
|
+
readonly entries: Omit<{
|
|
218
|
+
readonly mode: v.LiteralSchema<"digital", undefined>;
|
|
219
|
+
readonly direction: v.LiteralSchema<"open_drain", undefined>;
|
|
220
|
+
readonly value: v.SchemaWithPipe<readonly [v.UnionSchema<[v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.ToBooleanAction<number | boolean>]>;
|
|
221
|
+
readonly vil: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
222
|
+
readonly vih: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
223
|
+
}, "mode" | "direction">;
|
|
224
|
+
readonly "~standard": v.StandardProps<{
|
|
225
|
+
value: number | boolean;
|
|
226
|
+
vil: number;
|
|
227
|
+
vih: number;
|
|
228
|
+
}, {
|
|
229
|
+
value: boolean;
|
|
230
|
+
vil: number;
|
|
231
|
+
vih: number;
|
|
232
|
+
}>;
|
|
233
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
234
|
+
value: boolean;
|
|
235
|
+
vil: number;
|
|
236
|
+
vih: number;
|
|
237
|
+
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>>;
|
|
238
|
+
readonly "~types"?: {
|
|
239
|
+
readonly input: {
|
|
240
|
+
value: number | boolean;
|
|
241
|
+
vil: number;
|
|
242
|
+
vih: number;
|
|
243
|
+
};
|
|
244
|
+
readonly output: {
|
|
245
|
+
value: boolean;
|
|
246
|
+
vil: number;
|
|
247
|
+
vih: number;
|
|
248
|
+
};
|
|
249
|
+
readonly issue: v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25> | v.UnionIssue<v.NumberIssue | v.BooleanIssue>;
|
|
250
|
+
} | undefined;
|
|
251
|
+
};
|
|
252
|
+
type PartialOpenDrainConfiguration = v.InferOutput<typeof partialOpenDrainConfiguration>;
|
|
253
|
+
declare const syncConfiguration: v.ObjectSchema<{
|
|
254
|
+
readonly action: v.PicklistSchema<["release", "hold"], "Invalid sync action">;
|
|
255
|
+
}, undefined>;
|
|
256
|
+
type SyncConfiguration = v.InferOutput<typeof syncConfiguration>;
|
|
257
|
+
/** @hideconstructor */
|
|
258
|
+
declare class GpioApi {
|
|
259
|
+
private readonly fetch;
|
|
260
|
+
private count;
|
|
261
|
+
constructor(fetch: UpFetch, info: Information);
|
|
262
|
+
/**
|
|
263
|
+
* Resets all IO configurations to default.
|
|
264
|
+
*/
|
|
265
|
+
reset(): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Access a specific digital IO pin by id.
|
|
268
|
+
* @param io The IO pin id.
|
|
269
|
+
* @returns The digital IO instance.
|
|
270
|
+
*/
|
|
271
|
+
digital(io: number): DigitalIO;
|
|
272
|
+
/**
|
|
273
|
+
* Access a specific analog IO pin by id.
|
|
274
|
+
* @param io The IO pin id.
|
|
275
|
+
* @returns The analog IO instance.
|
|
276
|
+
*/
|
|
277
|
+
analog(io: number): AnalogIO;
|
|
278
|
+
/**
|
|
279
|
+
* Holds the current state of all GPIO pins.
|
|
280
|
+
* @returns The applied sync state.
|
|
281
|
+
*/
|
|
282
|
+
hold(): Promise<SyncConfiguration>;
|
|
283
|
+
/**
|
|
284
|
+
* Releases control of the IO pins, allowing external control.
|
|
285
|
+
*
|
|
286
|
+
* This also sets the device as a slave.
|
|
287
|
+
*
|
|
288
|
+
* @returns The applied sync state.
|
|
289
|
+
*/
|
|
290
|
+
release(): Promise<SyncConfiguration>;
|
|
291
|
+
}
|
|
292
|
+
/** @hideconstructor */
|
|
293
|
+
declare class DigitalIO {
|
|
294
|
+
private readonly fetch;
|
|
295
|
+
readonly id: number;
|
|
296
|
+
constructor(fetch: UpFetch, id: number);
|
|
297
|
+
/**
|
|
298
|
+
* Configure the pin as a digital input.
|
|
299
|
+
* @param config The digital input configuration.
|
|
300
|
+
* @returns The applied configuration.
|
|
301
|
+
*/
|
|
302
|
+
configure_input(config: PartialDigitalInputConfiguration): Promise<DigitalInputConfiguration>;
|
|
303
|
+
/**
|
|
304
|
+
* Configures the pin as a digital output.
|
|
305
|
+
* @param config The digital output configuration.
|
|
306
|
+
* @returns The applied configuration.
|
|
307
|
+
*/
|
|
308
|
+
configure_output(config: PartialDigitalOutputConfiguration): Promise<DigitalOutputConfiguration>;
|
|
309
|
+
/**
|
|
310
|
+
* Reads the current state of the pin.
|
|
311
|
+
* @returns The current state of the pin.
|
|
312
|
+
*/
|
|
313
|
+
read(): Promise<boolean>;
|
|
314
|
+
/**
|
|
315
|
+
* Writes a value to the pin.
|
|
316
|
+
* @param value The value to write.
|
|
317
|
+
* @returns The written value.
|
|
318
|
+
*/
|
|
319
|
+
write(value: boolean | number): Promise<boolean>;
|
|
320
|
+
/**
|
|
321
|
+
* Configure the pin as an open drain output.
|
|
322
|
+
* @param config The open drain configuration.
|
|
323
|
+
* @returns The applied configuration.
|
|
324
|
+
*/
|
|
325
|
+
configure_open_drain(config: PartialOpenDrainConfiguration): Promise<OpenDrainConfiguration>;
|
|
326
|
+
}
|
|
327
|
+
/** @hideconstructor */
|
|
328
|
+
declare class AnalogIO {
|
|
329
|
+
private readonly fetch;
|
|
330
|
+
readonly id: number;
|
|
331
|
+
constructor(fetch: UpFetch, id: number);
|
|
332
|
+
/**
|
|
333
|
+
* Configures the pin as an analog input.
|
|
334
|
+
* @returns The applied configuration.
|
|
335
|
+
* @returns The applied configuration.
|
|
336
|
+
*/
|
|
337
|
+
configure_input(): Promise<AnalogInputConfiguration>;
|
|
338
|
+
/**
|
|
339
|
+
* Configures the pin as an analog output.
|
|
340
|
+
* @param config The analog output configuration.
|
|
341
|
+
* @returns The applied configuration.
|
|
342
|
+
*/
|
|
343
|
+
configure_output(value: AnalogOutputLevel): Promise<AnalogOutputConfiguration>;
|
|
344
|
+
/**
|
|
345
|
+
* Reads the current state of the pin.
|
|
346
|
+
* @returns The current state of the pin.
|
|
347
|
+
*/
|
|
348
|
+
read(): Promise<number>;
|
|
349
|
+
/**
|
|
350
|
+
* Writes a value to the pin.
|
|
351
|
+
* @param value The value to write.
|
|
352
|
+
* @returns The written value.
|
|
353
|
+
*/
|
|
354
|
+
write(value: number): Promise<number>;
|
|
355
|
+
}
|
|
356
|
+
//#endregion
|
|
357
|
+
export { AnalogIO, AnalogInputConfiguration, AnalogOutputConfiguration, type AnalogOutputLevel, DigitalIO, DigitalInputConfiguration, DigitalOutputConfiguration, GpioApi, OpenDrainConfiguration, PartialAnalogOutputConfiguration, PartialDigitalInputConfiguration, PartialDigitalOutputConfiguration, PartialOpenDrainConfiguration, SyncConfiguration };
|
|
358
|
+
//# sourceMappingURL=gpio.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpio.d.cts","names":[],"sources":["../src/api/gpio.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