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, std::span< const SectorInfo > sectorInfo, uint16_t ID, Addressing addressing, const DeviceConfig &config, Load load=Load::NORMAL)
 Create AmdFlash with given configuration.
 
 AmdFlash (const std::string &name, std::span< const SectorInfo > sectorInfo, uint16_t 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.
 
size_t size () const
 
uint8_t read (size_t address) const
 
uint8_t peek (size_t address) const
 
void write (size_t address, uint8_t value)
 
const uint8_t * getReadCacheLine (size_t address) const
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Detailed Description

Definition at line 19 of file AmdFlash.hh.

Member Enumeration Documentation

◆ Addressing

enum class openmsx::AmdFlash::Addressing
strong
Enumerator
BITS_11 
BITS_12 

Definition at line 26 of file AmdFlash.hh.

◆ Load

enum class openmsx::AmdFlash::Load
strong
Enumerator
NORMAL 
DONT 

Definition at line 30 of file AmdFlash.hh.

◆ State

Enumerator
ST_IDLE 
ST_IDENT 

Definition at line 85 of file AmdFlash.hh.

Constructor & Destructor Documentation

◆ AmdFlash() [1/2]

openmsx::AmdFlash::AmdFlash ( const Rom rom,
std::span< const SectorInfo sectorInfo,
uint16_t  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 22 of file AmdFlash.cc.

References openmsx::Rom::getName().

◆ AmdFlash() [2/2]

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

Definition at line 34 of file AmdFlash.cc.

References NORMAL.

◆ ~AmdFlash()

openmsx::AmdFlash::~AmdFlash ( )
default

Member Function Documentation

◆ getReadCacheLine()

const uint8_t * openmsx::AmdFlash::getReadCacheLine ( size_t  address) const

◆ peek()

uint8_t openmsx::AmdFlash::peek ( size_t  address) const

◆ read()

uint8_t openmsx::AmdFlash::read ( size_t  address) const

◆ reset()

void openmsx::AmdFlash::reset ( )

◆ serialize()

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

Definition at line 404 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 65 of file AmdFlash.hh.

◆ size()

size_t openmsx::AmdFlash::size ( ) const
inline

Definition at line 67 of file AmdFlash.hh.

◆ write()

void openmsx::AmdFlash::write ( size_t  address,
uint8_t  value 
)

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