concentrator.h 3.48 KB
Newer Older
Alexander Steffens's avatar
Alexander Steffens committed
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
#ifndef CONCENTRATOR_H
#define CONCENTRATOR_H

#include "device.h"
#include "concentrator_def.h"

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

//    virtual quint32  ReadLinkMemReg(quint32 regno, bool *ok = 0, bool check = true);    // Register im Memory Bereich > 0x800
    virtual quint32  ReadLinkMemReg(quint32 regno, bool *ok, bool check);    // Register im Memory Bereich > 0x800
    virtual bool     WriteLinkMemReg(quint32 regno, quint32 value, bool check );
    virtual bool     DMA_DataAvail(quint32 FifoReadAllData, quint32 *sr);


    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);


    bool                ReadI2CDevice(  quint32 regI2CAdr,
                                        quint32 regI2CData,
                                        quint32 i2cDevAdr,
                                        quint32 fromi2cAdr,
                                        quint32 i2cAdrBytes,
                                        quint32 i2cDataBytes,
                                        quint8  *buf);

    bool                WriteI2CDevice( quint32 regI2CAdr,
                                        quint32 regI2CData,
                                        quint32 i2cDevAdr,
                                        quint32 fromi2cAdr,
                                        quint32 i2cAdrBytes,
                                        quint32 i2cDataBytes,
                                        quint8  *buf);

private:
    tConSettings    *_ConSettings;
    quint32         _DeviceNo;

    quint32         _RegOffset;
    QList<quint32>  _RegList;

    quint32         OldControl;
    quint32         OldStatus;

};

#endif // CONCENTRATOR_H