1
/***************************************************************************
2
* Copyright (C) 2018 by santiago González *
3
* santigoro@gmail.com *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 3 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
18
***************************************************************************/
24
#include "itemlibrary.h"
25
#include "logiccomponent.h"
28
class MAINMODULE_EXPORT I2CRam : public LogicComponent, public eI2C, public MemData
31
Q_PROPERTY( quint64 Propagation_Delay_ns READ propDelay WRITE setPropDelay DESIGNABLE true USER true )
32
Q_PROPERTY( QVector<int> Mem READ mem WRITE setMem )
33
Q_PROPERTY( int Control_Code READ cCode WRITE setCcode DESIGNABLE true USER true )
34
Q_PROPERTY( int Size_bytes READ rSize WRITE setRSize DESIGNABLE true USER true )
35
Q_PROPERTY( bool Persistent READ persistent WRITE setPersistent DESIGNABLE true USER true )
38
I2CRam( QObject* parent, QString type, QString id );
41
static Component* construct( QObject* parent, QString type, QString id );
42
static LibraryItem* libraryItem();
44
void setMem( QVector<int> m );
48
void setCcode( int code );
51
void setRSize( int size );
54
void setPersistent( bool p );
56
virtual void stamp() override;
57
virtual void initialize() override;
58
virtual void voltChanged() override;
60
virtual void startWrite();
61
virtual void writeByte();
62
virtual void readByte();
67
virtual void contextMenu( QGraphicsSceneContextMenuEvent* event, QMenu* menu );
70
virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* event );