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

#include <AmdFlash.hh>

Inheritance diagram for openmsx::AmdFlash:
Inheritance graph
[legend]
Collaboration diagram for openmsx::AmdFlash:
Collaboration graph
[legend]

Classes

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 18 of file AmdFlash.hh.

Member Enumeration Documentation

Enumerator
ST_IDLE 
ST_IDENT 

Definition at line 73 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.

Parameters
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 AmdFlash.cc.

openmsx::AmdFlash::~AmdFlash ( )

Definition at line 105 of file AmdFlash.cc.

Member Function Documentation

const byte * openmsx::AmdFlash::getReadCacheLine ( unsigned  address) const

Definition at line 181 of file AmdFlash.cc.

References ST_IDLE, and openmsx::MSXDevice::unmappedRead.

unsigned openmsx::AmdFlash::getSize ( ) const
inline

Definition at line 55 of file AmdFlash.hh.

byte openmsx::AmdFlash::peek ( unsigned  address) const

Definition at line 138 of file AmdFlash.cc.

References ST_IDLE.

Referenced by read().

byte openmsx::AmdFlash::read ( unsigned  address)

Definition at line 175 of file AmdFlash.cc.

References peek().

void openmsx::AmdFlash::reset ( )

Definition at line 125 of file AmdFlash.cc.

References ST_IDLE.

Referenced by write().

template<typename Archive >
void openmsx::AmdFlash::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 328 of file AmdFlash.cc.

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

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 53 of file AmdFlash.hh.

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

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