Interface Flash

interface Flash {
    isFlashSupported(): boolean;
    listSupportedOperations(): string;
    multiLoadEnd(): void;
    multiLoadStart(): void;
    performOperation(operation: string): void;
}

Methods

  • Determines if flash is supported for the current device.

    Returns boolean

    true if flash is supported on the current device, false otherwise.

    if (session.flash.isFlashSupported()) {
    // perform flash operations...
    }
  • Queries the list of flash operations supported for the current device.

    Returns string

    A string containing a list of all the supported operations.

    Will throw if flash is not supported for the current device.

    // Print the list of supported operations
    console.log(session.flash.listSupportedOperations());
  • Called to finish a multi-load operation. The flash manager will return to default mode (erasing flash based on user settings).

    Returns void

    session.flash.multiLoadStart();

    // multiple program loads...

    session.flash.multiLoadEnd();
  • Should be called to start a multi-load operation. The flash manager will only erase the flash on the first program load. Once the Flash Manger receives this call, users will be free to call Memory.loadProgram and Memory.loadBinaryProgram as many times as needed to write to the Flash

    Returns void

    session.flash.multiLoadStart();

    // multiple program loads...

    session.flash.multiLoadEnd();
  • Performs the specified flash operation. A list of all available operations for the current device can be obtained by calling Flash.listSupportedOperations.

    Parameters

    • operation: string

      The operation to be performed

    Returns void

    Will throw if the operation is not valid or if flash is not supported for the current device.

    // Erases the flash (assuming the operation is supported and named "Erase")
    session.flash.performOperation("Erase");