Browse Source
The reducing of the hardware API RAM is done by decreasing the software buffer to 16 instead of 100. Some features in developedUi are added. The preprocessors are fixed to using the upper layer of sono software.master v3.0
Arash Aletayeb
3 years ago
287 changed files with 1564 additions and 603 deletions
@ -1,29 +1,50 @@ |
|||
#ifndef BPIFLASH_H |
|||
#define BPIFLASH_H |
|||
|
|||
#include "registerDefinition/McsRdWr.h" |
|||
#include "model/hardware/core/lowLevelApi/register/fpgaProgram/FpgaProgram.h" |
|||
#include "model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h" |
|||
#include "model/hardware/device/SonoDevice.h" |
|||
#include <QDataStream> |
|||
#include <QTimer> |
|||
|
|||
class BpiFlash |
|||
#define BPI_FLASH_SIZE 64 * 1024 * 1024 //Byte
|
|||
#define UNLOCK_ERASE_BLOCK 256U |
|||
#define BPI_NO_ERR_STATUS 0x80 |
|||
#define MAXIMUM_WR_NUM 1024 |
|||
#define STEP_128KB 0x20000 |
|||
|
|||
class BpiFlash : public QObject |
|||
{ |
|||
Q_OBJECT |
|||
|
|||
private: |
|||
McsRdWr* _mcsRdWr; |
|||
SonoDevice* _device; |
|||
QTimer* _timer; |
|||
|
|||
template<class T> |
|||
T byteArray2UintLittleEndian(QByteArray& byte) const; |
|||
|
|||
void bpiInitialize(void) const; |
|||
void bpiReset(void) const; |
|||
void bpiErase(void) const; |
|||
void timerShot(quint16 ms) const; |
|||
bool checkTimeout(void) const; |
|||
void timerStop(void) const; |
|||
|
|||
void bpiClearStatus(void) const; |
|||
void bpiUnlock(quint16& blockOffset); |
|||
void bpiErase(quint16& blockOffset); |
|||
void bpiWrite(quint16& wrCount); //max = 511 word
|
|||
void bpiWriteCmplt(quint16& num); |
|||
void bpiRead(void) const; |
|||
void bpiWrite(void) const; |
|||
|
|||
signals: |
|||
void startTimerShot(quint16 ms); |
|||
void remainingTime(QString message); |
|||
void stopTimer(void); |
|||
|
|||
public: |
|||
explicit BpiFlash(SonoDevice* device); |
|||
~BpiFlash(); |
|||
|
|||
void writeMcs (QByteArray& mcs) const; |
|||
QList<quint32> readMcs (void) const; |
|||
|
|||
void readCommand(void) const; |
|||
void writeCommand(void) const; |
|||
void writeMcs(QByteArray& mcs); |
|||
QList<quint32> readMcs(void) const; |
|||
}; |
|||
|
|||
#endif // BPIFLASH_H
|
|||
#endif //BPIFLASH_H
|
|||
|
@ -1,49 +0,0 @@ |
|||
#ifndef MCSRDWR_H |
|||
#define MCSRDWR_H |
|||
|
|||
#include "model/hardware/core/lowLevelApi/register/Register.h" |
|||
#include "model/hardware/core/lowLevelApi/register/RegUtils.h" |
|||
|
|||
#undef BAR |
|||
|
|||
#define MASTER_MCS_DATA_MASK 0xFFFFFFFF |
|||
|
|||
#define BAR 1U |
|||
#define OFFSET 0X4000000 |
|||
#define MCS_FILE_SIZE 32*1024*1024 |
|||
|
|||
class McsRdWr : public Register |
|||
{ |
|||
private: |
|||
QList<quint32> _mcsListWr; |
|||
|
|||
void prepareData(quint32 index) override |
|||
{ |
|||
masterMcsData->setValue(_mcsListWr[static_cast<qint32>(index)]); |
|||
} |
|||
|
|||
public: |
|||
Field* masterMcsData; |
|||
QList<quint32> mcsListRd; |
|||
|
|||
void mcsWrite (QList<quint32>& mcsList) { |
|||
_mcsListWr = mcsList; |
|||
} |
|||
|
|||
void receiveData (void) override |
|||
{ |
|||
mcsListRd.push_back(this->masterMcsData->getValue()); |
|||
} |
|||
|
|||
McsRdWr(SonoDevice* device) : Register(BAR, OFFSET, device, MCS_FILE_SIZE) |
|||
{ |
|||
ADD_UNSIGNED_FIELD(masterMcsData, MASTER_MCS_DATA_MASK); |
|||
} |
|||
}; |
|||
|
|||
#undef MASTER_MCS_DATA_MASK |
|||
|
|||
#undef BAR |
|||
#undef OFFSET |
|||
|
|||
#endif // MCSRDWR_H
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue