FrontPanel Platform API - v6.0.0
    Preparing search index...

    Interface IFlashMemory

    Interface that provides the methods that may be used to interact with flash memory.

    interface IFlashMemory {
        eraseSector(address: number): Promise<void>;
        getLayout(): Promise<IFlashMemoryLayout>;
        read(address: number, buffer: DataBuffer): Promise<number>;
        write(address: number, data: DataBuffer): Promise<number>;
    }
    Index

    Methods

    • Erases a single sector in System Flash memory. The sector to erase is determined based on the provided address. Any address within the sector will specify that the entire sector be erased. The sector specified must be in the acceptable range for the user area of Flash memory for the device. See the device User's Manual for Flash memory layout details.

      Parameters

      • address: number

        Byte address within the sector to erase.

      Returns Promise<void>

      • A promise that resolves when the sector has been erased.
    • Reads data from System Flash memory starting at the specified address. The address and length must both be integer multiples of the System Flash page size.

      Parameters

      • address: number

        Byte address to begin read operation.

      • buffer: DataBuffer

        The buffer to store the data that is read. The transfer length is determined by the buffer's byte length. The buffer must not be modified or detached until the returned Promise settles.

      Returns Promise<number>

      • A promise that resolves when the data has been read indicating the number of bytes that were successfully read.
    • Writes data to System Flash memory starting at the specified address. The address and length must both be integer multiples of the System Flash page size. This method will not erase the sector prior to writing. You must use eraseSector to erase a sector prior to writing.

      Parameters

      • address: number

        Byte address to begin write operation.

      • data: DataBuffer

        The data to write. The transfer length is determined by the buffer's byte length. The buffer must not be modified or detached until the returned Promise settles.

      Returns Promise<number>

      • A promise that resolves when the data has been written indicating the number of bytes that were successfully written.