maroc.h 2.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#ifndef MAROC_H
#define MAROC_H

#include <QList>
#include "qmaroc.h"
#include "device.h"
#include "maroc_def.h"


class Maroc : public Device
{
public:
    explicit        Maroc(int vendor, int devnr, int marocnr, DEVICE_DATA *devdata, bool *ok , quint32 Offset);
    virtual         ~Maroc();

    virtual quint32 ReadLinkMemReg(quint32 regno, bool *ok = 0);
    virtual bool    WriteLinkMemReg(quint32 regno, quint32 value);
    virtual bool    DMA_DataAvail(bool FifoReadAllData);

    virtual quint32     ReadEEProm(  quint32 regI2CAdr,
                            quint32 regI2CData,
                            quint32 i2cDevAdr,
                            quint32 fromAdr,
                            bool *ok);

    virtual bool        WriteEEProm(quint32 regI2CAdr,
                                quint32 regI2CData,
                                quint32 i2cDevAdr,
                                quint32 toAdr,
                                quint32 data);

    virtual bool        WriteEEPromStr( quint32 regI2CAdr,      // I2C Adress Register
                                        quint32 regI2CData,     // I2C Data Register
                                        quint32 i2cDevAdr,      // I2C Adresse des Bausteins EEPRom = 0x50
                                        quint32 toAdr,          // Adresse innerhalb des Bausteins
                                        QString StrData,        // zu schreibende Daten
                                        int hw);                // Hardware, CCS oder Maroc/Concentrator

    virtual QString     ReadEEPromStr(  quint32 regI2CAdr,      // I2C Adress Register
                                        quint32 regI2CData,     // I2C Data Register
                                        quint32 i2cDevAdr,      // I2C Adresse des Bausteins EEPRom = 0x50
                                        quint32 fromAdr,        // Adresse innerhalb des Bausteins
                                        bool    *ok,            // true wenn erfolgreich
                                        int     hw);            // Hardware, CCS oder Maroc/Concentrator

    quint32             GetRegByteOffset(quint32 reg);

private:
    quint32         _DeviceNo;
    qint32          _MarocNo;
    bool            _OnConcentrator;

    quint32         _RegOffset;
    QList<quint32>  _RegList;
};

#endif // MAROC_H