USB EPROM/Flash Programmer
Signals | Public Member Functions | Protected Types | Protected Member Functions | List of all members
EPROM Class Reference

Parallel EPROM Class. More...

#include <eprom.hpp>

Inheritance diagram for EPROM:
Inheritance graph

Signals

void onProgress (uint32_t current=0, uint32_t total=0, bool done=false, bool success=true, bool canceled=false)
 Triggered when progress is changed, or operation is done or canceled. More...
 

Public Member Functions

 EPROM (QObject *parent=nullptr)
 Constructor. More...
 
virtual ~EPROM ()
 Destructor. More...
 
virtual void setSize (uint32_t value)
 Sets the device size. More...
 
virtual bool read (QByteArray &buffer)
 Read the Device. More...
 
virtual bool program (const QByteArray &buffer, bool verify=false)
 Program the Device. More...
 
virtual bool verify (const QByteArray &buffer)
 Verifies the Device. More...
 
virtual bool erase (bool check=false)
 Erases the Device. More...
 
virtual bool blankCheck ()
 Verifies if the Device is blank. More...
 
virtual bool getId (TDeviceID &result)
 Gets the Device ID. More...
 
virtual bool unprotect ()
 Unprotects the Device. More...
 
virtual bool protect ()
 Protects the Device. More...
 
virtual bool is16Bit () const
 Returns if device is 16-Bit. More...
 
virtual uint32_t getSize () const
 Returns the device size (in bytes). More...
 
virtual void setPort (const QString &path)
 Sets the serial port path. More...
 
virtual QString getPort () const
 Returns the serial port path (if any). More...
 
uint8_t getBufferSize () const
 Returns the current buffer size value for buffer operations. More...
 
void setBufferSize (uint8_t value)
 Sets the buffer size value for buffer operations. More...
 
virtual void setTwp (uint32_t us)
 Sets the tWP. More...
 
virtual uint32_t getTwp () const
 Returns the configured tWP (in microseconds). More...
 
virtual void setTwc (uint32_t us)
 Sets the tWC. More...
 
virtual uint32_t getTwc () const
 Returns the configured tWC (in microseconds). More...
 
virtual void setVddRd (float value)
 Sets the VDD to Read. More...
 
virtual float getVddRd () const
 Returns the configured VDD to Read (in volts). More...
 
virtual void setVddWr (float value)
 Sets the VDD to Program. More...
 
virtual float getVddWr () const
 Returns the configured VDD to Program (in volts). More...
 
virtual void setVpp (float value)
 Sets the VPP. More...
 
virtual float getVpp () const
 Returns the configured VPP (in volts). More...
 
virtual void setVee (float value)
 Sets the VEE. More...
 
virtual float getVee () const
 Returns the configured VEE (in volts). More...
 
virtual void setSkipFF (bool value=true)
 Sets the Skip Prog 0xFF. More...
 
virtual bool getSkipFF () const
 Returns the configured Skip Prog 0xFF. More...
 
virtual void setFastProg (bool value=true)
 Sets the Fast Prog/Erase. More...
 
virtual bool getFastProg () const
 Returns the configured Fast Prog/Erase. More...
 
virtual void setSectorSize (uint16_t value)
 Sets the Sector Size. More...
 
virtual uint16_t getSectorSize () const
 Returns the configured Sector Size (in bytes). More...
 
virtual TDeviceInformation getInfo () const
 Returns the Device Information. More...
 
virtual void cancel ()
 Cancels the active operation (if any). More...
 

Protected Types

enum  kDeviceOperation {
  kDeviceOpReset , kDeviceOpRead , kDeviceOpProg , kDeviceOpErase ,
  kDeviceOpGetId
}
 Device Operation. More...
 

Protected Member Functions

virtual bool programDevice (const QByteArray &buffer)
 Program the device. More...
 
virtual bool verifyDevice (const QByteArray &buffer)
 Verify the device. More...
 
virtual bool readDevice (QByteArray &buffer)
 Read the device. More...
 
virtual bool getIdDevice (TDeviceID &deviceId)
 Get ID of the device. More...
 
virtual bool eraseDevice ()
 Erase the device. More...
 
virtual bool blankCheckDevice ()
 Blank Check the device. More...
 
virtual bool protectDevice (bool protect)
 Protect/Unprotect the device. More...
 
virtual bool initDevice (kDeviceOperation operation)
 Open and init resources. More...
 
virtual bool finalizeDevice (uint32_t current, uint32_t total, bool done=false, bool success=true, bool canceled=false)
 Close resources and emit signals for status. More...
 
virtual void finalizeDevice ()
 Close resources. More...
 

Detailed Description

Parallel EPROM Class.

The purpose of this class is to program EPROM Memories.

Member Enumeration Documentation

◆ kDeviceOperation

enum kDeviceOperation
protectedinherited

Device Operation.

Enumerator
kDeviceOpReset 

Device Reset Operation.

kDeviceOpRead 

Device Read Operation.

kDeviceOpProg 

Device Prog Operation.

kDeviceOpErase 

Device Erase Operation.

kDeviceOpGetId 

Device GetId Operation.

Constructor & Destructor Documentation

◆ EPROM()

EPROM ( QObject *  parent = nullptr)
explicit

Constructor.

Parameters
parentPointer to parent object. Default is nullptr.

◆ ~EPROM()

~EPROM ( )
virtual

Destructor.

Member Function Documentation

◆ setSize()

void setSize ( uint32_t  value)
virtual

Sets the device size.

Parameters
valueDevice size, in bytes.

Reimplemented from Device.

◆ read()

bool read ( QByteArray &  buffer)
virtualinherited

Read the Device.

Parameters
[out]bufferReference to QByteArray to receive data.
Returns
True if success, false otherwise.

Reimplemented from Device.

◆ program()

bool program ( const QByteArray &  buffer,
bool  verify = false 
)
virtualinherited

Program the Device.

Parameters
[out]bufferData to write.
verifyIf true, calls Device::verify() after program. Default is false.
Returns
True if success, false otherwise.

Reimplemented from Device.

Reimplemented in SRAM.

◆ verify()

bool verify ( const QByteArray &  buffer)
virtualinherited

Verifies the Device.

Parameters
bufferData to compare.
Returns
True if success, false otherwise.

Reimplemented from Device.

◆ erase()

bool erase ( bool  check = false)
virtualinherited

Erases the Device.

Parameters
checkIf true, calls Device::blankCheck() after erase. Default is false.
Returns
True if success, false otherwise.

Reimplemented from Device.

◆ blankCheck()

bool blankCheck ( )
virtualinherited

Verifies if the Device is blank.

Returns
True if device is blank, false otherwise.

Reimplemented from Device.

◆ getId()

bool getId ( TDeviceID result)
virtualinherited

Gets the Device ID.

Parameters
[out]resultReference to TDeviceID structure to receive data.
Returns
True if success, false otherwise.

Reimplemented from Device.

◆ unprotect()

bool unprotect ( )
virtualinherited

Unprotects the Device.

Returns
True if success, false otherwise.

Reimplemented from Device.

◆ protect()

bool protect ( )
virtualinherited

Protects the Device.

Returns
True if success, false otherwise.

Reimplemented from Device.

◆ programDevice()

bool programDevice ( const QByteArray &  buffer)
protectedvirtualinherited

Program the device.

Parameters
bufferData to write.
Returns
True if success, false otherwise.

◆ verifyDevice()

bool verifyDevice ( const QByteArray &  buffer)
protectedvirtualinherited

Verify the device.

Parameters
bufferData to compare.
Returns
True if success, false otherwise.

◆ readDevice()

bool readDevice ( QByteArray &  buffer)
protectedvirtualinherited

Read the device.

Parameters
buffer[out]Data to read.
Returns
True if success, false otherwise.

◆ getIdDevice()

bool getIdDevice ( TDeviceID deviceId)
protectedvirtualinherited

Get ID of the device.

Parameters
deviceId[out]Device ID to get.
Returns
True if success, false otherwise.

◆ eraseDevice()

bool eraseDevice ( )
protectedvirtualinherited

Erase the device.

Returns
True if success, false otherwise.

Reimplemented in Flash28F, and EEPROM.

◆ blankCheckDevice()

bool blankCheckDevice ( )
protectedvirtualinherited

Blank Check the device.

Returns
True if success, false otherwise.

◆ protectDevice()

bool protectDevice ( bool  protect)
protectedvirtualinherited

Protect/Unprotect the device.

Parameters
protectIf true, protects the device. Otherwise, unprotects the device.
Returns
True if success, false otherwise.

◆ initDevice()

bool initDevice ( kDeviceOperation  operation)
protectedvirtualinherited

Open and init resources.

Parameters
operationDevice operation.
Returns
True if success, false otherwise.

◆ finalizeDevice() [1/2]

bool finalizeDevice ( uint32_t  current,
uint32_t  total,
bool  done = false,
bool  success = true,
bool  canceled = false 
)
protectedvirtualinherited

Close resources and emit signals for status.

Parameters
currentCurrent address (default is zero).
totalTotal size [last address + 1] (default is zero).
doneTrue if operation was finished, false otherwise (default).
successTrue if success (default), false otherwise.
canceledTrue if operation was canceled, false otherwise (default).
Returns
True if success, false otherwise.

◆ finalizeDevice() [2/2]

void finalizeDevice ( )
protectedvirtualinherited

Close resources.

◆ is16Bit()

bool is16Bit ( ) const
virtualinherited

Returns if device is 16-Bit.

Returns
True if device is 16-Bit. False if device is 8-Bit.

◆ getSize()

uint32_t getSize ( ) const
virtualinherited

Returns the device size (in bytes).

Returns
Device size, in bytes.

◆ setPort()

void setPort ( const QString &  path)
virtualinherited

Sets the serial port path.

Parameters
pathSerial port path.

◆ getPort()

QString getPort ( ) const
virtualinherited

Returns the serial port path (if any).

Returns
Path of serial port, or empty if none.

◆ getBufferSize()

uint8_t getBufferSize ( ) const
inherited

Returns the current buffer size value for buffer operations.

Returns
Buffer size, in bytes.

◆ setBufferSize()

void setBufferSize ( uint8_t  value)
inherited

Sets the buffer size value for buffer operations.

Parameters
valueBuffer size, in bytes.

◆ setTwp()

void setTwp ( uint32_t  us)
virtualinherited

Sets the tWP.

Parameters
ustWP value, in microseconds.

◆ getTwp()

uint32_t getTwp ( ) const
virtualinherited

Returns the configured tWP (in microseconds).

Returns
tWP value, in microseconds.

◆ setTwc()

void setTwc ( uint32_t  us)
virtualinherited

Sets the tWC.

Parameters
ustWC value, in microseconds.

◆ getTwc()

uint32_t getTwc ( ) const
virtualinherited

Returns the configured tWC (in microseconds).

Returns
tWC value, in microseconds.

◆ setVddRd()

void setVddRd ( float  value)
virtualinherited

Sets the VDD to Read.

Parameters
valueVDD value, in volts.

◆ getVddRd()

float getVddRd ( ) const
virtualinherited

Returns the configured VDD to Read (in volts).

Returns
VDD value, in volts.

◆ setVddWr()

void setVddWr ( float  value)
virtualinherited

Sets the VDD to Program.

Parameters
valueVDD value, in volts.

◆ getVddWr()

float getVddWr ( ) const
virtualinherited

Returns the configured VDD to Program (in volts).

Returns
VDD value, in volts.

◆ setVpp()

void setVpp ( float  value)
virtualinherited

Sets the VPP.

Parameters
valueVPP value, in volts.

◆ getVpp()

float getVpp ( ) const
virtualinherited

Returns the configured VPP (in volts).

Returns
VPP value, in volts.

◆ setVee()

void setVee ( float  value)
virtualinherited

Sets the VEE.

Parameters
valueVEE value, in volts.

◆ getVee()

float getVee ( ) const
virtualinherited

Returns the configured VEE (in volts).

Returns
VEE value, in volts.

◆ setSkipFF()

void setSkipFF ( bool  value = true)
virtualinherited

Sets the Skip Prog 0xFF.

Parameters
valueIf true (default), enables skip prog 0xFF, disables otherwise.

◆ getSkipFF()

bool getSkipFF ( ) const
virtualinherited

Returns the configured Skip Prog 0xFF.

Returns
If true, skip prog 0xFF is enabled, disabled otherwise.

◆ setFastProg()

void setFastProg ( bool  value = true)
virtualinherited

Sets the Fast Prog/Erase.

Parameters
valueIf true (default), enables fast prog/erase, disables otherwise.

◆ getFastProg()

bool getFastProg ( ) const
virtualinherited

Returns the configured Fast Prog/Erase.

Returns
If true, fast prog/erase is enabled, disabled otherwise.

◆ setSectorSize()

void setSectorSize ( uint16_t  value)
virtualinherited

Sets the Sector Size.

Parameters
valueSector size, in bytes.

◆ getSectorSize()

uint16_t getSectorSize ( ) const
virtualinherited

Returns the configured Sector Size (in bytes).

Returns
Sector size value, in bytes.

◆ getInfo()

TDeviceInformation getInfo ( ) const
virtualinherited

Returns the Device Information.

Returns
Device Information.

◆ cancel()

void cancel ( )
virtualinherited

Cancels the active operation (if any).

◆ onProgress

void onProgress ( uint32_t  current = 0,
uint32_t  total = 0,
bool  done = false,
bool  success = true,
bool  canceled = false 
)
signalinherited

Triggered when progress is changed, or operation is done or canceled.

Parameters
currentCurrent address (default is zero).
totalTotal size [last address + 1] (default is zero).
doneTrue if operation was finished, false otherwise (default).
successTrue if success (default), false otherwise.
canceledTrue if operation was canceled, false otherwise (default).

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