com.sun.spot.peripheral
Class NorFlashSector
java.lang.Object
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
NorFlashSector
protected NorFlashSector()
NorFlashSector
public NorFlashSector(IFlashMemoryDevice flashMem,
int sectorNumber,
int purpose)
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
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.