You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

201 lines
5.9 KiB

#ifndef TRXBOARD_H
#define TRXBOARD_H
#include <QVector>
#include <QString>
#include <QByteArray>
#include <QDebug>
#include "model/hardware/core/register/clockDistributer/ClockDistributer.h"
#include "model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h"
#include "model/hardware/core/register/fpgaProgram/FpgaProgram.h"
#include "model/hardware/core/register/builtInTest/BuiltInTest.h"
#include "model/hardware/core/register/beamFormer/BeamFormer.h"
#include "model/hardware/core/register/scenPlayer/ScenPlayer.h"
#include "model/hardware/core/register/bpiFlash/BpiFlash.h"
#include "model/hardware/core/register/dsp/Dsp.h"
#include "model/hardware/core/dmaCtrl/DmaCtrl.h"
#include "model/hardware/device/SonoDevice.h"
#define SLAVE_ELEMENT_SEGMENT 64U
#define TOTAL_SCEN_LUT_SRAM 5U //without sram
#define SLAVE_FPGA_NUMBER 3U
#define CLOCK_DIVISION 0x55
#define EEPROM_ID_BYTE_BEGIN 0U
#define EEPROM_ID_BYTE_NUMBER 4U
#define EEPROM_INFO_BYTE_BEGIN 0U
#define EEPROM_INFO_BYTE_NUMBER 30U
struct ProbeElementPosition
{
QList<quint32> xPosition;
QList<quint32> yPosition;
QList<quint32> zPosition;
};
struct HealthStatus
{
float systemTemperature;
float criticalComponentTemperature;
AdcVoltages* adcMon;
VoltagesPg* voltsPg;
};
enum eSelectProbe : quint8
{
prbA = 1,
prbB,
prbC,
prbD,
};
struct ConnectedPrbId
{
quint32 prbA;
quint32 prbB;
quint32 prbC;
quint32 prbD;
};
struct ConnectedPrbInfo
{
QByteArray prbA;
QByteArray prbB;
QByteArray prbC;
QByteArray prbD;
};
class TrxBoard
{
private:
QVector<quint8> _swapVec;
QList<quint32>* _mcsList;
const quint32 _offsetSlave0;
const quint32 _offsetSlave1;
const quint32 _offsetSlave2;
bool _allow;
SonoDevice _device;
AdcVoltages* _adc;
VoltagesPg* _pg;
ClockDistributer* _clkDistributer;
BoardsCtrlMngt* _bCtrlMngt;
FpgaProgram* _fpgaProgram;
BeamFormer* _beamFormerSlave0;
BeamFormer* _beamFormerSlave1;
BeamFormer* _beamFormerSlave2;
ScenPalyer* _scenPlayer;
BpiFlash* _bpiFlash;
DmaCtrl* _dmaCtrl;
Dsp* _dsp;
enum eScenParams : quint8
{
clear,
set
};
void scenParamsFilling(eScenParams cmd);
void setSwapVector (void);
/////////////////////////// Old TRX ///////////////////////////
QString _name;
QString _version;
int _swCounter;
int _hwCounter;
bool _run;
public:
TrxBoard();
~TrxBoard();
///////////////////////////////// BeamFormer API ///////////////////////////////
void scenRxBeamformerProperties (RxBeamformerProperties* rxBeamformer);
void scenProbeElementPosition (ProbeElementPosition* element);
void scenApodizationLut (QList<QList<quint32>>& apodization);
void scenPulseProperties (PulseProperties* pulse);
void scenAfeLut (AfeProperties* afe);
//////////////////////////////////// DSP API ///////////////////////////////////
void scenReceiverConfigurationLut (ReceiverConfiguration* configLut) const;
void scenLineFilterCoefficient (QList<quint32>& lineFilterLut) const;
void scenBlendWeight (QList<QList<quint32>>& blendWeight) const;
void scenAtgcLut (QList<QList<quint32>>& atgcLut) const;
void scenStbCoefficient (QList<quint32>& stbLut) const;
void setAtgcMode (eAtgcMode mode, quint16 value) const;
void scenFrequencyLut (QList<quint32>& freqLut) const;
void scenLpfLut (QList<QList<quint32>>& lpfLut) const;
void scenDtgcLut (QList<quint32>& dtgcLut) const;
////////////////////////////// Slave Programming API ///////////////////////////
void slaveFpgaProgram (QString path);
/////////////////////////////// BeamFormer Mode API ////////////////////////////
void setBeamFormerMode (eClkMode mode) const;
/////////////////////////////// Scenario Player API ////////////////////////////
void setScenPlayerIndex (quint32 startIdx, quint32 endIdx) const;
void scenPlayerStart (void) const;
//void scenPlayerPause (bool pause) const;
void scenPlayerStop (void) const;
///////////////////////////////// Sram Fill API ////////////////////////////////
void sramWrite(QList<quint64>& data, quint32 offsetAddr);
///////////////////////////////// Emulator API /////////////////////////////////
void emulatorInit(EmulatorProperties* config) const;
void emulatorStart(bool start) const;
void emulatorStop(bool stop) const;
////////////////////////////// BoardCtrlMngt API ///////////////////////////////
quint32 deviceId (void) const;
quint32 vendorId (void) const;
quint32 trxId (void) const;
quint32 mpsId (void) const;
quint32 prbCtrlId (void) const;
quint32 prbId (quint8 prbSel) const;
void getConnectedPrbId (ConnectedPrbId* prbId) const;
QString trxInfo (void) const;
QString mpsInfo (void) const;
QString prbCtrlInfo (void) const;
QByteArray prbInfo (quint8 prbSel) const;
void getConnectedPrbInfo (ConnectedPrbInfo* prbInfo) const;
void supervisorRbValue(SupervisorRbValue* sValue) const;
void mpsFaultStatus (MpsFaultStatus* faultStatus) const;
void mpsReset (void) const;
void mpsSetAo (float voltA, float voltB) const;
void selectProbe (eSelectProbe prbSel) const;
void getHealthStatus (HealthStatus* healStat) const;
void init (void) const;
//////////////////////////////// BPI Flash API /////////////////////////////////
void mcsProgram (QString path);
void mcsVerify (QString path) const;
///////////////////////////////// Old TRX //////////////////////////////////////
//HardwarePacketEngine packetEngine;
QString getName();
QString getVersion();
bool selfTest();
bool updateInfo();
bool updateStatus();
void readData();
void start();
void stop();
};
//bool TrxBoard::_allow = false;
#endif // TRXBOARD_H