Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/pita_api/mod.ts>IO

API for Pita projects, simpliest way to develop secure and powerful webapps for redpitaya.
Latest
class IO
import { IO } from "https://deno.land/x/pita_api@0.9.1/mod.ts";

Interface for Redpitaya digital and slow analog IOs.

Examples

Example 1

const dio6p = new IO({
	mode: IOMode.RW,
	type: IOType.Digital,
	connection: redpitaya.connection('parameters', Pin.digital.io6p),
})

Constructors

new
IO(unnamed 0: { mode: Mode; type: Type; bitness?: Bitness<12>; connection: RPConnection<Type extends IOType.Digital ? "parameters" : "signals", IoId>; })

Type Parameters

Mode extends IOMode
Type extends IOType

Methods

getActive(): boolean

Get the state of the IO. Only for Analog IOs.

Get the bitness of the IO. Only for Analog IOs.

read(): Promise<Mode extends IOMode.WO ? never : Type extends IOType.Digital ? boolean : number>

Reads a value from IO.

Continuously read a value from IO.

setActive(active: boolean)

Set the state of the IO. Only for Analog IOs.

setBitness(bitness: Bitness<12>)

Set the bitness of the IO. Only for Analog IOs.

write(value: Mode extends IOMode.RO ? never : Type extends IOType.Digital ? boolean : number): Promise<void>

Writes a value from IO.

Continuously write a value to IO.