Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); connect(ui->pushButton_Open, SIGNAL(clicked()), this, SLOT(open())); connect(ui->pushButton_Close, SIGNAL(clicked()), this, SLOT(close())); connect(ui->pushButton_WriteWiegand, SIGNAL(clicked()), this, SLOT(writeWiegand())); connect(ui->pushButton_WiegandSetConfig, SIGNAL(clicked()), this, SLOT(wiegandSetConfig())); connect(ui->pushButton_WiegandGetConfig, SIGNAL(clicked()), this, SLOT(wiegandGetConfig())); connect(ui->pushButton_WiegandAutoDetect, SIGNAL(clicked()), this, SLOT(wiegandAutoDetect())); connect(ui->pushButton_WriteGPO1, SIGNAL(clicked()), this, SLOT(writeGPO1())); connect(ui->pushButton_WriteGPO2, SIGNAL(clicked()), this, SLOT(writeGPO2())); connect(ui->pushButton_WriteGPO12, SIGNAL(clicked()), this, SLOT(writeGPO12())); connect(ui->pushButton_WriteRelay, SIGNAL(clicked()), this, SLOT(writeRelay())); connect(ui->pushButton_USBPowerOff, SIGNAL(clicked()), this, SLOT(usbPowerOff())); connect(ui->pushButton_USBPowerOn, SIGNAL(clicked()), this, SLOT(usbPowerOn())); m_eventThread = NULL; m_isOpen = false; if (ema_createEMA(&m_emaHandle) == EMA_SUCCESS) { m_eventThread = new EventThread(NULL, m_emaHandle); if (m_eventThread) { connect(m_eventThread, SIGNAL(dataReceived(EMA_EVENT *)), this, SLOT(showReceivedData(EMA_EVENT *))); } m_eventThread->start(); }
void usbDsbBus(void) { // setPin(USB_DISC_BANK,USB_DISC); usbPowerOff(); // SET_REG(USB_DISC_CR, // (GET_REG(USB_DISC_CR) & USB_DISC_CR_MASK) | USB_DISC_CR_OUTPUT); // resetPin(USB_DISC_BANK, USB_DISC); /* Pull DP+ down */ // volatile unsigned x = 500000; do { ; }while(--x); // SET_REG(USB_DISC_CR, // (GET_REG(USB_DISC_CR) & USB_DISC_CR_MASK) | USB_DISC_CR_INPUT); //Sets the PA12 as floating input }