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

#include <AmdFlash.hh>

Classes

struct  AmdCmd
 
struct  SectorInfo
 

Public Types

enum class  Addressing { BITS_11 , BITS_12 }
 
enum class  Load { NORMAL , DONT }
 
enum  State { ST_IDLE , ST_IDENT }
 

Public Member Functions

 AmdFlash (const Rom &rom, span< const SectorInfo > sectorInfo, word ID, Addressing addressing, const DeviceConfig &config, Load load=Load::NORMAL)
 Create AmdFlash with given configuration. More...
 
 AmdFlash (const std::string &name, span< const SectorInfo > sectorInfo, word ID, Addressing addressing, const DeviceConfig &config)
 
 ~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) const
 
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

◆ Addressing

Enumerator
BITS_11 
BITS_12 

Definition at line 24 of file AmdFlash.hh.

◆ Load

Enumerator
NORMAL 
DONT 

Definition at line 28 of file AmdFlash.hh.

◆ State

Enumerator
ST_IDLE 
ST_IDENT 

Definition at line 83 of file AmdFlash.hh.

Constructor & Destructor Documentation

◆ AmdFlash() [1/2]

openmsx::AmdFlash::AmdFlash ( const Rom rom,
span< const SectorInfo sectorInfo,
word  ID,
Addressing  addressing,
const DeviceConfig config,
Load  load = Load::NORMAL 
)

Create AmdFlash with given configuration.

Parameters
romThe initial content for this flash
sectorInfoA span 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.
addressingSpecify addressing mode (11-bit or 12-bit)
configThe motherboard this flash belongs to
loadLoad initial content (hack for 'Matra INK')

Definition at line 25 of file AmdFlash.cc.

◆ AmdFlash() [2/2]

openmsx::AmdFlash::AmdFlash ( const std::string &  name,
span< const SectorInfo sectorInfo,
word  ID,
Addressing  addressing,
const DeviceConfig config 
)

Definition at line 37 of file AmdFlash.cc.

◆ ~AmdFlash()

openmsx::AmdFlash::~AmdFlash ( )
default

Member Function Documentation

◆ getReadCacheLine()

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

◆ getSize()

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

Definition at line 65 of file AmdFlash.hh.

◆ peek()

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

◆ read()

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

◆ reset()

void openmsx::AmdFlash::reset ( )

◆ serialize()

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

Definition at line 407 of file AmdFlash.cc.

◆ setVppWpPinLow()

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

◆ write()

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

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