Class FFS

  • All Implemented Interfaces:
    Impc555, IntbMpc555HB, Ippc32

    public class FFS
    extends Object
    implements IntbMpc555HB
    Flash File System
    Works if code runs out of RAM or flash Sets aside part of the onboard flash for a file system
    • Constructor Detail

      • FFS

        public FFS()
    • Method Detail

      • eraseSector

        public static void eraseSector​(int sector)
        erases a sector in the flash
        Parameters:
        sector - sector to be deleted
      • getSectorAddr

        public static int getSectorAddr​(int sector)
        Returns address of sector.
        Parameters:
        sector - Sector, of which address is returned.
        Returns:
        Address of sector.
      • programInt

        public static void programInt​(int sector,
                                      int offset,
                                      int val)
        Programs an integer value.
        Parameters:
        sector - address of sector.
        offset - offset.
        val - value to be programmed.
      • programShort

        public static void programShort​(int sector,
                                        int offset,
                                        short val)
        programs an short value
        Parameters:
        sector - address of sector
        offset - offset
        val - value to be programmed
      • readByte

        public static byte readByte​(int sector,
                                    int offset)
        reads a byte from flash file system
        Parameters:
        sector - sector
        offset - offset
        Returns:
        Byte read.
      • readShort

        public static short readShort​(int sector,
                                      int offset)
        reads a short from flash file system
        Parameters:
        sector - sector
        offset - offset
        Returns:
        Short read.
      • readInt

        public static int readInt​(int sector,
                                  int offset)
        reads an integer from flash file system
        Parameters:
        sector - sector
        offset - offset
        Returns:
        Integer read.
      • writeDir

        static void writeDir()
        writes directory to flash
      • old

        public static File old​(String filename)
        Returns file with filename, null if file does not exist.
        Parameters:
        filename - Name of file to be opened.
        Returns:
        Opened file.
      • directory

        public static boolean directory​(int index)
        Returns true if directory at index has a valid entry.
        Parameters:
        index - Index into file directory.
        Returns:
        true if directory contains valid entry at this index.
      • formatAll

        public static void formatAll()
        erases flash, initializes file system
      • init

        public static void init()
        reads directory from flash
      • showFreeBlocks

        public static void showFreeBlocks()
      • showUsedBlocks

        public static void showUsedBlocks()
      • outDir

        public static void outDir()