|
USB EPROM/Flash Programmer
|
#include <emulator.hpp>
Inherits QObject.
Public Member Functions | |
| Emulator (QObject *parent=nullptr) | |
| Constructor. More... | |
| ~Emulator () | |
| Destructor. More... | |
| TSerialPortList | list () const |
| Lists all serial ports that correspond to the device boards. More... | |
| bool | open (const QString &path) |
| Opens a serial port. More... | |
| void | close () |
| Closes an opened serial port. More... | |
| bool | isOpen () const |
| Returns if a serial is opened. More... | |
| bool | hasError () const |
| Returns if an error was occurred. More... | |
| QString | getPath () const |
| Returns the current opened serial port path (if any). More... | |
| uint32_t | getTimeOut () const |
| Returns the current timeout value of the serial port communication. More... | |
| void | setTimeOut (uint32_t value) |
| Sets the timeout value of the serial port communication. 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... | |
| bool | nop () |
| Runs the NOP opcode. More... | |
| bool | vddCtrl (bool on=true) |
| Runs the VDD Control opcode. More... | |
| bool | vddSet (float value) |
| Runs the VDD Set Voltage opcode. More... | |
| float | vddGet () |
| Runs the VDD Get Voltage opcode. More... | |
| float | vddGetDuty () |
| Runs the VDD Get Duty Cycle opcode. More... | |
| bool | vddInitCal () |
| Runs the VDD Init Calibration opcode. More... | |
| bool | vddSaveCal (float value) |
| Runs the VDD Save Calibration opcode. More... | |
| float | vddGetCal () |
| Runs the VDD Get Calibration opcode. More... | |
| bool | vppCtrl (bool on=true) |
| Runs the VPP Control opcode. More... | |
| bool | vppSet (float value) |
| Runs the VPP Set Voltage opcode. More... | |
| float | vppGet () |
| Runs the VPP Get Voltage opcode. More... | |
| float | vppGetDuty () |
| Runs the VPP Get Duty Cycle opcode. More... | |
| bool | vppInitCal () |
| Runs the VPP Init Calibration opcode. More... | |
| bool | vppSaveCal (float value) |
| Runs the VPP Save Calibration opcode. More... | |
| float | vppGetCal () |
| Runs the VPP Get Calibration opcode. More... | |
| bool | vddOnVpp (bool on=true) |
| Runs the VDD on VPP Control opcode. More... | |
| bool | vppOnA9 (bool on=true) |
| Runs the VPP on A9 Control opcode. More... | |
| bool | vppOnA18 (bool on=true) |
| Runs the VPP on A18 Control opcode. More... | |
| bool | vppOnCE (bool on=true) |
| Runs the VPP on CE Control opcode. More... | |
| bool | vppOnOE (bool on=true) |
| Runs the VPP on OE Control opcode. More... | |
| bool | vppOnWE (bool on=true) |
| Runs the VPP on WE Control opcode. More... | |
| bool | setCE (bool on=true) |
| Runs the CE Control opcode. More... | |
| bool | setOE (bool on=true) |
| Runs the OE Control opcode. More... | |
| bool | setWE (bool on=true) |
| Runs the WE Control opcode. More... | |
| bool | addrClr () |
| Runs the Address Clear opcode. More... | |
| bool | addrInc () |
| Runs the Address Increment opcode. More... | |
| bool | addrSet (uint32_t value) |
| Runs the Address Set (DWord) opcode. More... | |
| bool | addrSetB (uint8_t value) |
| Runs the Address Set Byte opcode. More... | |
| bool | addrSetW (uint16_t value) |
| Runs the Address Set Word opcode. More... | |
| uint32_t | addrGet () const |
| Returns the last address. More... | |
| bool | dataClr () |
| Runs the Data Clear opcode. More... | |
| bool | dataSet (uint8_t value) |
| Runs the Data Set Byte opcode. More... | |
| bool | dataSetW (uint16_t value) |
| Runs the Data Set Word opcode. More... | |
| uint8_t | dataGet () |
| Runs the Data Get Byte opcode. More... | |
| uint16_t | dataGetW () |
| Runs the Data Get Word opcode. More... | |
| bool | deviceSetTwp (uint32_t value) |
| Runs the Device Set tWP opcode. More... | |
| bool | deviceSetTwc (uint32_t value) |
| Runs the Device Set tWC opcode. More... | |
| bool | deviceConfigure (kCmdDeviceAlgorithmEnum algo, const TDeviceFlags &flags) |
| bool | deviceSetupBus (kCmdDeviceOperationEnum operation) |
| Runs the Device Setup Bus opcode. More... | |
| bool | deviceResetBus () |
| Runs the Device Setup Bus opcode, with operation Reset. More... | |
| QByteArray | deviceRead () |
| Runs the Device Read Buffer opcode. More... | |
| bool | deviceWrite (const QByteArray &data) |
| Runs the Device Write Buffer opcode. More... | |
| bool | deviceWriteSector (const QByteArray &data, uint16_t sectorSize) |
| Runs the Device Write Sector opcode. More... | |
| bool | deviceVerify (const QByteArray &data) |
| Runs the Device Verify Buffer opcode. More... | |
| bool | deviceBlankCheck () |
| Runs the Device Blank Check Buffer opcode. More... | |
| TDeviceID | deviceGetId () |
| Runs the Device Get ID opcode. More... | |
| bool | deviceErase () |
| Runs the Device Erase opcode. More... | |
| bool | deviceUnprotect () |
| Runs the Device Unprotect opcode. More... | |
| bool | deviceProtect () |
| Runs the Device Protect opcode. More... | |
Static Public Member Functions | |
| static void | usDelay (uint64_t value) |
| Pauses the program execution for a specified time (microsecond precision). More... | |
| static void | msDelay (uint32_t value) |
| Pauses the program execution for a specified time (millisecond precision). More... | |
| static void | processEvents () |
| Process Application Events. More... | |
| static void | setChip (BaseParChip *chip) |
| Sets the chip for emulation (global). More... | |
| static void | randomizeBuffer (QByteArray &buffer, uint32_t size) |
| Fills a buffer with random data. More... | |
Emulator Class.
The purpose of this class is to run commands and get response via Chip Emulator (for tests).
|
explicit |
Constructor.
| parent | Pointer to parent object. Default is nullptr. |
| ~Emulator | ( | ) |
Destructor.
| TSerialPortList list | ( | ) | const |
Lists all serial ports that correspond to the device boards.
| bool open | ( | const QString & | path | ) |
Opens a serial port.
| path | Path of the serial port (system dependent). |
| void close | ( | ) |
Closes an opened serial port.
| bool isOpen | ( | ) | const |
Returns if a serial is opened.
| bool hasError | ( | ) | const |
Returns if an error was occurred.
| QString getPath | ( | ) | const |
Returns the current opened serial port path (if any).
| uint32_t getTimeOut | ( | ) | const |
Returns the current timeout value of the serial port communication.
| void setTimeOut | ( | uint32_t | value | ) |
Sets the timeout value of the serial port communication.
| value | Timeout, in msec. |
| uint8_t getBufferSize | ( | ) | const |
Returns the current buffer size value for buffer operations.
| void setBufferSize | ( | uint8_t | value | ) |
Sets the buffer size value for buffer operations.
| value | Buffer size, in bytes. |
| bool nop | ( | ) |
Runs the NOP opcode.
| bool vddCtrl | ( | bool | on = true | ) |
Runs the VDD Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vddSet | ( | float | value | ) |
Runs the VDD Set Voltage opcode.
| value | Value to set. |
| float vddGet | ( | ) |
Runs the VDD Get Voltage opcode.
| float vddGetDuty | ( | ) |
Runs the VDD Get Duty Cycle opcode.
| bool vddInitCal | ( | ) |
Runs the VDD Init Calibration opcode.
| bool vddSaveCal | ( | float | value | ) |
Runs the VDD Save Calibration opcode.
| value | Value to set. |
| float vddGetCal | ( | ) |
Runs the VDD Get Calibration opcode.
| bool vppCtrl | ( | bool | on = true | ) |
Runs the VPP Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppSet | ( | float | value | ) |
Runs the VPP Set Voltage opcode.
| value | Value to set. |
| float vppGet | ( | ) |
Runs the VPP Get Voltage opcode.
| float vppGetDuty | ( | ) |
Runs the VPP Get Duty Cycle opcode.
| bool vppInitCal | ( | ) |
Runs the VPP Init Calibration opcode.
| bool vppSaveCal | ( | float | value | ) |
Runs the VPP Save Calibration opcode.
| value | Value to set. |
| float vppGetCal | ( | ) |
Runs the VPP Get Calibration opcode.
| bool vddOnVpp | ( | bool | on = true | ) |
Runs the VDD on VPP Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppOnA9 | ( | bool | on = true | ) |
Runs the VPP on A9 Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppOnA18 | ( | bool | on = true | ) |
Runs the VPP on A18 Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppOnCE | ( | bool | on = true | ) |
Runs the VPP on CE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppOnOE | ( | bool | on = true | ) |
Runs the VPP on OE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool vppOnWE | ( | bool | on = true | ) |
Runs the VPP on WE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool setCE | ( | bool | on = true | ) |
Runs the CE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool setOE | ( | bool | on = true | ) |
Runs the OE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool setWE | ( | bool | on = true | ) |
Runs the WE Control opcode.
| on | If true (default), sets the pin. Resets otherwise. |
| bool addrClr | ( | ) |
Runs the Address Clear opcode.
| bool addrInc | ( | ) |
Runs the Address Increment opcode.
| bool addrSet | ( | uint32_t | value | ) |
Runs the Address Set (DWord) opcode.
| value | Value to set. |
| bool addrSetB | ( | uint8_t | value | ) |
Runs the Address Set Byte opcode.
| value | Value to set. |
| bool addrSetW | ( | uint16_t | value | ) |
Runs the Address Set Word opcode.
| value | Value to set. |
| uint32_t addrGet | ( | ) | const |
Returns the last address.
| bool dataClr | ( | ) |
Runs the Data Clear opcode.
| bool dataSet | ( | uint8_t | value | ) |
Runs the Data Set Byte opcode.
| value | Value to set. |
| bool dataSetW | ( | uint16_t | value | ) |
Runs the Data Set Word opcode.
| value | Value to set. |
| uint8_t dataGet | ( | ) |
Runs the Data Get Byte opcode.
| uint16_t dataGetW | ( | ) |
Runs the Data Get Word opcode.
| bool deviceSetTwp | ( | uint32_t | value | ) |
Runs the Device Set tWP opcode.
| value | Value to set. |
| bool deviceSetTwc | ( | uint32_t | value | ) |
Runs the Device Set tWC opcode.
| value | Value to set. |
| bool deviceConfigure | ( | kCmdDeviceAlgorithmEnum | algo, |
| const TDeviceFlags & | flags | ||
| ) |
| bool deviceSetupBus | ( | kCmdDeviceOperationEnum | operation | ) |
Runs the Device Setup Bus opcode.
| operation | Operation to realize. |
| bool deviceResetBus | ( | ) |
Runs the Device Setup Bus opcode, with operation Reset.
| QByteArray deviceRead | ( | ) |
Runs the Device Read Buffer opcode.
| bool deviceWrite | ( | const QByteArray & | data | ) |
Runs the Device Write Buffer opcode.
| data | Data to write. |
| bool deviceWriteSector | ( | const QByteArray & | data, |
| uint16_t | sectorSize | ||
| ) |
Runs the Device Write Sector opcode.
| data | Data to write. |
| sectorSize | Size of sector to write, in bytes. |
| bool deviceVerify | ( | const QByteArray & | data | ) |
Runs the Device Verify Buffer opcode.
| data | Data to verify. |
| bool deviceBlankCheck | ( | ) |
Runs the Device Blank Check Buffer opcode.
| TDeviceID deviceGetId | ( | ) |
Runs the Device Get ID opcode.
| bool deviceErase | ( | ) |
Runs the Device Erase opcode.
| bool deviceUnprotect | ( | ) |
Runs the Device Unprotect opcode.
| bool deviceProtect | ( | ) |
Runs the Device Protect opcode.
|
static |
Pauses the program execution for a specified time (microsecond precision).
| value | Sleep time, in usec. |
|
static |
Pauses the program execution for a specified time (millisecond precision).
| value | Sleep time, in msec. |
|
static |
Process Application Events.
|
static |
Sets the chip for emulation (global).
| chip | Pointer to instance of the Chip Class. |
|
static |
Fills a buffer with random data.
| buffer | Reference to buffer. |
| size | New size of the buffer. |