Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FrontPanel

This is the class that encapsulates the functionality of the FPGA boards as well as the FrontPanel extensions such as wire and trigger endpoints.

Hierarchy

  • FrontPanel

Index

Constructors

constructor

  • Initializes the object with the remote server address.

    The only mandatory parameter is server which specifies the remote server, running FPoIP server, to connect to.

    Parameters

    Returns FrontPanel

Accessors

isConnected

  • get isConnected(): boolean
  • Returns true if the object is connected to the remote server.

    This value is initially false and becomes true once connect completes successfully.

    No other method of this class other than connect() can be used until this property becomes true.

    Returns boolean

Methods

activateTriggerIn

  • activateTriggerIn(epAddr: number, bit: number): Promise<void>
  • Activates a given trigger.

    Parameters

    • epAddr: number
    • bit: number

    Returns Promise<void>

clearFPGAConfiguration

  • clearFPGAConfiguration(): Promise<void>

closeDevice

  • closeDevice(): Promise<void>
  • Requests closing the currently opened device.

    openDevice can be called again, with the same or different device after calling this function.

    Returns Promise<void>

configureFPGA

  • configureFPGA(buf: Uint8Array): Promise<void>
  • Configures the device with the given firmware data.

    Parameters

    • buf: Uint8Array

      Contains firmware data.

    Returns Promise<void>

configureFPGAFromFlash

  • configureFPGAFromFlash(configIndex: number): Promise<void>
  • Configures the device with data stored in flash memory.

    Parameters

    • configIndex: number

      Reserved for future use.

    Returns Promise<void>

configureFPGAWithReset

  • configureFPGAWithReset(buf: Uint8Array, reset: FPGAResetProfile): Promise<void>
  • Configures the device with the given firmware data and reset profile.

    Parameters

    • buf: Uint8Array

      Contains firmware data.

    • reset: FPGAResetProfile

      Indicates which reset profile should be set.

    Returns Promise<void>

connect

  • connect(): Promise<void>
  • Initiates connection to the server.

    This async function will satisfy its promise when connecting succeeds or break it when it fails.

    See isConnected.

    Returns Promise<void>

destroyScriptEngine

  • destroyScriptEngine(engine: number): Promise<void>

disconnect

  • disconnect(code?: undefined | number): Promise<void>
  • Initiates disconnection from the server.

    Parameters

    • Optional code: undefined | number

      Optional standard WebSocket close code explaining why the connection is being closed.

    Returns Promise<void>

flashEraseSector

  • flashEraseSector(addr: number): Promise<void>
  • Erases a flash memory sector at the specified address.

    Parameters

    • addr: number

      Flash memory address.

    Returns Promise<void>

flashRead

  • flashRead(addr: number, length: number): Promise<Uint8Array>
  • Reads a string of bytes from the target Flash Memory address.

    Parameters

    • addr: number

      Flash memory address.

    • length: number

      Length of data (in bytes).

    Returns Promise<Uint8Array>

flashWrite

  • flashWrite(addr: number, buf: Uint8Array): Promise<void>
  • Writes a string of bytes to the target Flash memory address.

    Parameters

    • addr: number

      Flash memory address.

    • buf: Uint8Array

      Data to be written.

    Returns Promise<void>

getDeviceInfo

getDeviceSensors

getDeviceSettings

getEepromPLL22150Configuration

getFPGAResetProfile

getLastTransferLength

  • getLastTransferLength(): Promise<number>

getPLL22150Configuration

getTriggerOutVector

  • getTriggerOutVector(epAddr: number): number

getWireInValue

  • getWireInValue(epAddr: number): number
  • Gets the value of a particular Wire In from the internal wire data structure.

    Parameters

    • epAddr: number

    Returns number

getWireOutValue

  • getWireOutValue(epAddr: number): number
  • Gets the value of a particular Wire Out from the internal wire data structure.

    Parameters

    • epAddr: number

    Returns number

hasDeviceSensorsSupport

  • hasDeviceSensorsSupport(): boolean
  • Indicates whether Device Sensors are supported.

    Returns boolean

    true if Device Sensors are supported.

hasDeviceSettingsSupport

  • hasDeviceSettingsSupport(): boolean
  • Indicates whether Device Settings are supported.

    Returns boolean

    true if Device Settings are supported.

isFrontPanel3Supported

  • isFrontPanel3Supported(): Promise<boolean>

isFrontPanelEnabled

  • isFrontPanelEnabled(): Promise<boolean>
  • This method checks to see if the FrontPanel Host Interface has been instantiated in the FPGA design. If it is detected, FrontPanel support is enabled and endpoint functionality is available.

    Returns Promise<boolean>

isTriggered

  • isTriggered(epAddr: number, mask: number): boolean
  • Returns true if the trigger has been triggered.

    Parameters

    • epAddr: number
    • mask: number

    Returns boolean

loadDefaultPLLConfiguration

  • loadDefaultPLLConfiguration(): Promise<void>

loadScript

  • loadScript(engine: number, name: string, code: string): Promise<void>
  • Prepare a script for later execution.

    This method parses the given Lua code and makes it possible to execute functions defined in it later, see runScriptFunction.

    Parameters

    • engine: number
    • name: string
    • code: string

    Returns Promise<void>

login

  • login(username: string, password: string): Promise<string[]>
  • Initiates login to the server.

    As the provided credentials are transmitted unencrypted, connection itself must be secure, i.e. use TLS.

    After successfully logging in, call openDevice to start working with one of the devices from the list returned by the server.

    Parameters

    • username: string

      The username to use for authentication.

    • password: string

      The password to use for authentication.

    Returns Promise<string[]>

    List of available devices in case of successful login.

openDevice

  • openDevice(device: string): Promise<void>
  • Requests opening the specified device.

    Opening the device is required before using any functions other than connect, login and disconnect.

    Parameters

    • device: string

      One of the devices returned from login.

    Returns Promise<void>

readFromBlockPipeOut

  • readFromBlockPipeOut(epAddr: number, blockSize: number, length: number): Promise<Uint8Array>
  • Reads data from a BlockPipeOut endpoint.

    Parameters

    • epAddr: number
    • blockSize: number
    • length: number

    Returns Promise<Uint8Array>

readFromPipeOut

  • readFromPipeOut(epAddr: number, length: number): Promise<Uint8Array>
  • Reads a block from a Pipe Out endpoint.

    Parameters

    • epAddr: number
    • length: number

    Returns Promise<Uint8Array>

readI2C

  • readI2C(addr: number, length: number): Promise<Uint8Array>
  • This method reads a string of bytes from the target I2C address. This transfer does not utilize the FPGA and can be done prior to configuration.

    The following errors can be thrown:

    • DeviceNotOpen - Communication with a XEM is not established.
    • CommunicationError - Communication error with the firmware.
    • I2CRestrictedAddress - Read from a restricted I2C address.
    • I2CBitError - I2C bit error occurred.
    • I2CNack - I2C device responded with NACK.
    • I2CUnknownStatus - Unknown result status.

    Parameters

    • addr: number

      I2C address of the target device.

    • length: number

      Length of data (in bytes).

    Returns Promise<Uint8Array>

readRegisters

resetFPGA

  • resetFPGA(): Promise<void>
  • Performs a RESET of the FPGA internals. This requires that FrontPanel support be present in the FPGA design because the RESET signal actually comes from the FrontPanel Host Interface.

    Returns Promise<void>

runScriptFunction

  • runScriptFunction(engine: number, name: string, ...args: any): Promise<any[]>
  • Runs a function defined in a previously loaded script, see loadScript.

    Parameters

    • engine: number
    • name: string
    • Rest ...args: any

    Returns Promise<any[]>

setBTPipePollingInterval

  • setBTPipePollingInterval(interval: number): Promise<void>
  • At the completion of a BTPipeIn transfer, the host polls the hardware to confirm that all of the data has been consumed by the FPGA before returning from the function. The polling interval is set by this method.

    The valid range for this interval is 1 to 100 milliseconds. Values outside this range throws the error Failed. The default is 25 milliseconds.

    Parameters

    • interval: number

      Polling interval (in milliseconds).

    Returns Promise<void>

setDeviceID

  • setDeviceID(str: string): Promise<void>
  • This method modifies the XEM Device ID string with the new string. The Device ID string is a user-programmable string of up to 32 characters that can be used to uniquely identify a particular XEM. The string will be truncated if it exceeds 32 characters.

    Parameters

    • str: string

      A string containing the new Device ID.

    Returns Promise<void>

setEepromPLL22150Configuration

setFPGAResetProfile

setPLL22150Configuration

setTimeout

  • setTimeout(timeout: number): Promise<void>
  • This method sets the timeout value used by USB transactions when communicating with the target device. Note that this is not necessarily the timeout for a particular API call. By default, the timeout is set to 10 seconds).

    Note that a timeout is not always provided by the underlying calls nor by the operating system. Most generally, the timeout will apply to pipe transfers and FPGA configuration transfers.

    Parameters

    • timeout: number

      Timeout duration specified in milliseconds.

    Returns Promise<void>

setWireInValue

  • setWireInValue(epAddr: number, val: number, mask?: undefined | number): void
  • Sets a wire value in the internal wire data structure.

    Parameters

    • epAddr: number
    • val: number
    • Optional mask: undefined | number

    Returns void

updateAllOuts

  • updateAllOuts(): Promise<void>

updateTriggerOuts

  • updateTriggerOuts(): Promise<void>

updateWireIns

  • updateWireIns(): Promise<void>

updateWireOuts

  • updateWireOuts(): Promise<void>

waitForServer

  • waitForServer(): Promise<IReply>
  • Asynchronously waits for any unsolicited server reply.

    Unsolicited replies are sent by the server not in reply to a client request but due to an event on the server-side, e.g. new device connection.

    Returns Promise<IReply>

writeI2C

  • writeI2C(addr: number, buf: Uint8Array): Promise<void>
  • This method writes a string of bytes to the target I2C address. This transfer does not utilize the FPGA and can be done prior to configuration.

    The following errors can be thrown:

    • DeviceNotOpen - Communication with a XEM is not established.
    • CommunicationError - Communication error with the firmware.
    • I2CRestrictedAddress - Write to a restricted I2C address.
    • I2CBitError - I2C bit error occurred.
    • I2CNack - I2C device responded with NACK.
    • I2CUnknownStatus - Unknown result status.

    Parameters

    • addr: number

      I2C address of the target device.

    • buf: Uint8Array

      Data to be written.

    Returns Promise<void>

writeRegisters

writeToBlockPipeIn

  • writeToBlockPipeIn(epAddr: number, blockSize: number, buf: Uint8Array): Promise<number>
  • Writes data to a BlockPipeIn endpoint.

    Parameters

    • epAddr: number
    • blockSize: number
    • buf: Uint8Array

    Returns Promise<number>

writeToPipeIn

  • writeToPipeIn(epAddr: number, buf: Uint8Array): Promise<number>
  • Writes a block to a Pipe In endpoint.

    Parameters

    • epAddr: number
    • buf: Uint8Array

    Returns Promise<number>

Generated using TypeDoc