Classes | Public Types | Public Member Functions | List of all members
openmsx::AmdFlash Class Reference

#include <AmdFlash.hh>


struct  AmdCmd
struct  SectorInfo

Public Types

enum  State { ST_IDLE, ST_IDENT }

Public Member Functions

 AmdFlash (const Rom &rom, const std::vector< SectorInfo > &sectorInfo, word ID, bool use12bitAddressing, const DeviceConfig &config, bool load=true)
 Create AmdFlash with given configuration. More...
 ~AmdFlash ()
void reset ()
void setVppWpPinLow (bool value)
 Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors. More...
unsigned getSize () const
byte read (unsigned address)
byte peek (unsigned address) const
void write (unsigned address, byte value)
const bytegetReadCacheLine (unsigned address) const
template<typename Archive >
void serialize (Archive &ar, unsigned version)

Detailed Description

Definition at line 17 of file AmdFlash.hh.

Member Enumeration Documentation


Definition at line 72 of file AmdFlash.hh.

Constructor & Destructor Documentation

openmsx::AmdFlash::AmdFlash ( const Rom rom,
const std::vector< SectorInfo > &  sectorInfo,
word  ID,
bool  use12bitAddressing,
const DeviceConfig config,
bool  load = true 

Create AmdFlash with given configuration.

romThe initial content for this flash
sectorInfoA vector containing the size and write protected status of each sector in the flash. This implicitly also communicates the number of sectors (a sector is a region in the flash that can be erased individually). There exist flash roms were the different sectors are not all equally large, that's why it's required to enumerate the size of each sector (instead of simply specifying the size and the number of sectors).
IDContains manufacturer and device ID for this flash.
use12bitAddressingset to true for 12-bit command addresses, false for 11-bit command addresses
configThe motherboard this flash belongs to
loadLoad initial content (hack for 'Matra INK')

Definition at line 21 of file

References openmsx::SRAM::DONT_LOAD, openmsx::Rom::getName(), openmsx::Rom::getSize(), getSize(), Math::isPowerOfTwo(), openmsx::XMLLoader::load(), reset(), openmsx::MemBuffer< T, ALIGNMENT >::resize(), ST_IDLE, and xrange().

openmsx::AmdFlash::~AmdFlash ( )

Definition at line 105 of file

References begin(), end(), and getSize().

Member Function Documentation

const byte * openmsx::AmdFlash::getReadCacheLine ( unsigned  address) const
unsigned openmsx::AmdFlash::getSize ( ) const
byte openmsx::AmdFlash::peek ( unsigned  address) const
byte openmsx::AmdFlash::read ( unsigned  address)
void openmsx::AmdFlash::reset ( )
template<typename Archive >
void openmsx::AmdFlash::serialize ( Archive &  ar,
unsigned  version 

Definition at line 328 of file

Referenced by getSize().

void openmsx::AmdFlash::setVppWpPinLow ( bool  value)

Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors.

Currently it is implemented that it will enable protection of the first two sectors. (As for example in Numonix/Micron M29W640FB/M29W640GB.)

Definition at line 52 of file AmdFlash.hh.

Referenced by openmsx::MegaFlashRomSCCPlusSD::getWriteCacheLine().

void openmsx::AmdFlash::write ( unsigned  address,
byte  value 

The documentation for this class was generated from the following files: