Example #1
0
void VIHWClass::initializeHWLibraries()
{
    //ApplicationInterfacePlugin
    QPluginLoader loader1("libPTApplicationcardInterface.so");
    IAppCard = qobject_cast<IApplicationCardInterface*>(loader1.instance());
    IAppCard->setDeviceName(SLOT0);
    IAppCard->enumerateAPPCard();
    qDebug() << "APPCard Code ID:" <<IAppCard->readAppCardCodeId();
    m_nInterruptValue = IAppCard->readScratchPad();
    qDebug()<<"Scratch:"<<m_nInterruptValue;
        //BackPanel Interface Plugin
    QPluginLoader loader2("libBackPlaneInterface.so");
    IBackPlane = qobject_cast<IntefaceBackPlane*> (loader2.instance());
    IBackPlane->InitializeBpObject();
    qDebug() << "BACKPlane Code ID:" <<IBackPlane->readBackPlaneCodeID();
	IBackPlane->writeBackPlaneRegister(0x01, 0x48);
        //PSOC Interface Plugin
    QPluginLoader loader3("libPTPsocInterface2.so");
    IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance());
    IPsoc->openSerial();
	QPluginLoader loaderSPIMemory("libSPIMemoryInterface.so");
	ISPIMemory = qobject_cast<ISPIMemoryInterface*> (loaderSPIMemory.instance());
	ISPIMemory->setHardwarwObject(IAppCard);
	ISPIMemory->accessSPIMemory(BACKPLANE);
	m_objAD5318Component = new AD5318Components(IAppCard);
	m_objAD5293Component = new AD5293(IAppCard);
	resetDAC();
	//IPsoc->closeSerial();
	//IPsoc->changeBaudRate(1);

	//IPsoc->writeSerial(0x50);
	//IPsoc->writeSerial(0x01);
	peformDriveConfiguration();
}
Example #2
0
GPIOEvent::GPIOEvent(QWidget *parent,int *pKeyCode):QWidget(parent){
    //qDebug()<<"----------------------------GPIO LIBRARY STARTS----------------------------";

        m_TW = parent;
        m_nKey = pKeyCode;
    //Backpanel Interface Plugin
    QPluginLoader loader2("libBackPlaneInterface.so",this);
    IBackPlane = qobject_cast<IntefaceBackPlane*>(loader2.instance());
    IBackPlane->InitializeBpObject();
    QPluginLoader loader1("libPTApplicationcardInterface.so");
    IAppCard = qobject_cast<IApplicationCardInterface*>(loader1.instance());
    IAppCard->setDeviceName(SLOT0);
    IAppCard->enumerateAPPCard();
    m_nInterruptValue = IAppCard->readScratchPad();
	QPluginLoader loaderSPIMemory("libSPIMemoryInterface.so");
	ISPIMemory = qobject_cast<ISPIMemoryInterface*> (loaderSPIMemory.instance());
	IAppCard->setSPIAppendBit(0xC000);
    QPluginLoader loader3("libPTPsocInterface2.so");
    IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance());
    IPsoc->openSerial();
	m_nReceiveData = new unsigned short int[300];
	m_stopFlag = false;
	m_strReceiveName =".\ActualData.bin";
	//m_objEvent = new QEvent(APPCARDDRIVEEVENT);
}