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

x/pita_api/mod.ts>Channel

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

Interface for Redpitaya fast analog IOs.

Examples

Example 1

const adc1 = new Channel({
	 mode: IOMode.RO,
	 bitness: 16n,
	 frequency: Frequency.SMP_125M,
	 connection: redpitaya.connection('signals', ChannelPin.adc1),
})

Constructors

new
Channel(unnamed 0: { mode: Mode; frequency: Frequency; bitness: Bitness<16>; connection: RPConnection<"signals", ChannelId>; })

Methods

Get the bitness of the Channel.

Get the clock frequency of the Channel.

Get the trigger of the Channel.

readIter<Size extends number>(bufferSize: Size): AsyncGenerator<Mode extends IOMode.WO ? never : Tuple<number, Size>, void, void>

Continuously read a buffered slice from adc input.

readSlice<Size extends number>(bufferSize: Size): Promise<Mode extends IOMode.WO ? never : Tuple<number, Size>>

Reads a buffered slice from adc input.

setBitness(bitness: Bitness<16>)

Set the bitness of the Channel.

Set the clock frequency of the Channel.

Set the trigger of the Channel.

writeIter<Size extends number>(bufferSize: Size): AsyncGenerator<(data: SignalDatas) => Promise<void>, void, void>

Continously write a slice of points to dac.

writeSlice(buffer: number[]): Promise<Mode extends IOMode.RO ? never : void>

Writes a slice of points to dac.