SunSPOT API V3.0


com.sun.spot.peripheral
Class NorFlashSector

java.lang.Object
  extended by com.sun.spot.peripheral.NorFlashSector
All Implemented Interfaces:
IAddressableNorFlashSector, INorFlashSector

public class NorFlashSector
extends Object
implements IAddressableNorFlashSector

Define a segment of memory which is defined as being of type NOR Flash. The read-only mode of NOR memories is similar to reading from a common memory, provided address and data bus is mapped correctly, so NOR flash memory is much like any address-mapped memory. NOR flash memories can be used as execute-in-place memory (XIP), meaning it behaves as a ROM memory mapped to a certain address. A NOR flash sector can be completely erased, setting all bits to 1s. Writing simply sets some bits from 1 to 0. Setting a bit from 0 to 1, requires the complete sector to be erased.

Author:
Eric Arseneau

Field Summary
 
Fields inherited from interface com.sun.squawk.peripheral.INorFlashSector
RMS_PURPOSED, SYSTEM_PURPOSED, USER_PURPOSED
 
Constructor Summary
protected NorFlashSector()
           
  NorFlashSector(IFlashMemoryDevice flashMem, int sectorNumber, int purpose)
           
 
Method Summary
 void erase()
           
 void getBytes(int memoryOffset, byte[] buffer, int bufferOffset, int length)
           
 byte getErasedValue()
           
 int getPurpose()
           
 int getSectorNumber()
           
 int getSize()
           
 Address getStartAddress()
           
 int getStartAddressAsInt()
           
 int getVirtualStartAddressAsInt()
           
 void setBytes(int memoryOffset, byte[] buffer, int bufferOffset, int length)
           
 void setVirtualAddress(int virtualAddress)
          Set the virtual memory address associated with this sector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NorFlashSector

protected NorFlashSector()

NorFlashSector

public NorFlashSector(IFlashMemoryDevice flashMem,
                      int sectorNumber,
                      int purpose)
Method Detail

erase

public void erase()
Specified by:
erase in interface INorFlashSector

getBytes

public void getBytes(int memoryOffset,
                     byte[] buffer,
                     int bufferOffset,
                     int length)
Specified by:
getBytes in interface INorFlashSector

getErasedValue

public byte getErasedValue()
Specified by:
getErasedValue in interface INorFlashSector

getPurpose

public int getPurpose()
Specified by:
getPurpose in interface INorFlashSector

getSize

public int getSize()
Specified by:
getSize in interface INorFlashSector

getStartAddress

public Address getStartAddress()
Specified by:
getStartAddress in interface INorFlashSector

getStartAddressAsInt

public int getStartAddressAsInt()
Specified by:
getStartAddressAsInt in interface IAddressableNorFlashSector
Returns:
The physical memory address of the start of this sector.

getVirtualStartAddressAsInt

public int getVirtualStartAddressAsInt()
Specified by:
getVirtualStartAddressAsInt in interface IAddressableNorFlashSector
Returns:
The virtual address associated with this sector.

setBytes

public void setBytes(int memoryOffset,
                     byte[] buffer,
                     int bufferOffset,
                     int length)
Specified by:
setBytes in interface INorFlashSector

getSectorNumber

public int getSectorNumber()
Specified by:
getSectorNumber in interface IAddressableNorFlashSector
Returns:
The unique sector number associated with this sector.

setVirtualAddress

public void setVirtualAddress(int virtualAddress)
Description copied from interface: IAddressableNorFlashSector
Set the virtual memory address associated with this sector.

Specified by:
setVirtualAddress in interface IAddressableNorFlashSector
Parameters:
virtualAddress - The new virtual memory address

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.