Interface Board

Represents a physical general purpose compute board that contains various components such as analog readers, and digital interrupts.

interface Board {
    doCommand: ((command) => Promise<StructType>);
    getDigitalInterruptValue(digitalInterruptName, extra?): Promise<number>;
    getGPIO(pin, extra?): Promise<boolean>;
    getPWM(pin, extra?): Promise<number>;
    getPWMFrequency(pin, extra?): Promise<number>;
    getStatus(extra?): Promise<Status>;
    readAnalogReader(analogReader, extra?): Promise<number>;
    setGPIO(pin, high, extra?): Promise<void>;
    setPWM(pin, dutyCyclePct, extra?): Promise<void>;
    setPWMFrequency(pin, frequencyHz, extra?): Promise<void>;
    setPowerMode(name, powerMode, duration, extra?): Promise<void>;
    streamTicks(interrupts, queue, extra?): Promise<void>;
    writeAnalog(pin, value, extra?): Promise<void>;
}

Hierarchy (view full)

Implemented by

Properties

doCommand: ((command) => Promise<StructType>)

Send/Receive arbitrary commands to the resource.

Type declaration

Methods

  • Return the current value of the interrupt which is based on the type of interrupt.

    Parameters

    • digitalInterruptName: string

      The name of the digital interrupt.

    • Optional extra: StructType

    Returns Promise<number>

  • Get the high/low state of the given pin of a board.

    Parameters

    Returns Promise<boolean>

  • Get the duty cycle of the given pin of a board.

    Parameters

    Returns Promise<number>

    The duty cycle, which is a value from 0 to 1.

  • Get the PWM frequency of the given pin of a board.

    Parameters

    Returns Promise<number>

  • Get the status of the board.

    Parameters

    Returns Promise<Status>

  • Read the current value of an analog reader of a board.

    Parameters

    • analogReader: string

      The name of the analog reader.

    • Optional extra: StructType

    Returns Promise<number>

  • Set the high/low state of the given pin of a board.

    Parameters

    • pin: string

      The pin.

    • high: boolean

      When true, set the given pin to high. When false, set the given pin to low.

    • Optional extra: StructType

    Returns Promise<void>

  • Set the duty cycle of the given pin of a board.

    Parameters

    • pin: string

      The pin.

    • dutyCyclePct: number

      A value from 0 to 1.

    • Optional extra: StructType

    Returns Promise<void>

  • Set the PWM frequency of the given pin of a board.

    Parameters

    • pin: string

      The pin.

    • frequencyHz: number

      The PWM frequency, in hertz. 0 will use the board's default PWM frequency.

    • Optional extra: StructType

    Returns Promise<void>

  • Set power mode of the board.

    Parameters

    • name: string

      The name of the board.

    • powerMode: PowerMode

      The requested power mode.

    • duration: AsObject

      The requested duration to stay in power mode.

    • Optional extra: StructType

    Returns Promise<void>

  • Stream digital interrupt ticks on the board.

    Parameters

    • interrupts: string[]

      Names of the interrupts to stream.

    • queue: Tick[]

      Array to put the ticks in.

    • Optional extra: StructType

    Returns Promise<void>

  • Write an analog value to a pin on the board.

    Parameters

    • pin: string

      The pin name.

    • value: number

      An integer value to write.

    • Optional extra: StructType

    Returns Promise<void>

Generated using TypeDoc