##// END OF EJS Templates
Improved AHB UART Plugin, now check how many bytes are available on uart...
jeandet -
r33:de3df68ac881 default
parent child
Show More
@@ -1,465 +1,492
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 21 ----------------------------------------------------------------------------*/
22 22 #include <socexplorerengine.h>
23 23 #include "ahbuartplugin.h"
24 24 #include <unistd.h>
25 25 #include <errno.h>
26 26 #include <QApplication>
27 27 #include <QProgressBar>
28 28 #include <stdio.h>
29 29 #include <QThread>
30 30 #include "ahbuartpywrapper.h"
31 31 #include <QCompleter>
32 32 #include <QStringList>
33 33 #include <QLineEdit>
34 34 #include <socexplorerproxy.h>
35 35
36 36 ahbuartplugin::ahbuartplugin(QWidget *parent):socexplorerplugin(parent,false)
37 37 {
38 38 this->port =(rs232port_t)NULL;
39 39 this->portMutex = new QMutex(QMutex::Recursive);
40 40 this->UI = new ahbUartPluginUI();
41 41 this->setWidget((QWidget*)this->UI);
42 42 QObject::connect(this,SIGNAL(activateSig(bool)),this->UI,SLOT(setConnected(bool)));
43 43 QObject::connect(this->UI,SIGNAL(connectPortsig(QString,int)),this,SLOT(togglePort(QString,int)));
44 44 this->pyObject = new ahbuartPywrapper(this);
45 45 QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(open(QString,int)),this,SLOT(open(QString,int)));
46 46 QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(close()),this,SLOT(close()));
47 47 QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(ReadBytes(uint,uint)),this,SLOT(ReadBytes(uint,uint)));
48 48 QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(WriteBytes(uint,QList<QVariant>)),this,SLOT(WriteBytes(uint,QList<QVariant>)));
49 49 QObject::connect(this->UI,SIGNAL(rescanPorts()),this,SLOT(updatePortList()));
50 50 QObject::connect(this,SIGNAL(addReadBytes(int)),this->UI,SLOT(addReadBytes(int)));
51 51 QObject::connect(this,SIGNAL(addWritenBytes(int)),this->UI,SLOT(addWritenBytes(int)));
52 52 this->portListcompleter = NULL;
53 53 this->scanDone = false;
54 54 updatePortList();
55 55 }
56 56
57 57
58 58 ahbuartplugin::~ahbuartplugin()
59 59 {
60 60 if(this->port!=(rs232port_t)NULL)
61 61 {
62 62 rs232close(this->port);
63 63 this->port = (rs232port_t)NULL;
64 64 }
65 65 this->UI->close();
66 66 this->UI->~ahbUartPluginUI();
67 67 }
68 68
69 69
70 70 void ahbuartplugin::closeMe()
71 71 {
72 72 if(this->port!=(rs232port_t)NULL)
73 73 {
74 74 rs232close(this->port);
75 75 this->port = (rs232port_t)NULL;
76 76 }
77 77 emit this->closePlugin(this);
78 78 }
79 79
80 80 int ahbuartplugin::registermenu(QMainWindow *menuHolder)
81 81 {
82 82 this->menu = menuHolder->menuBar()->addMenu(tr("&AHB UART"));
83 83 this->closeAction = this->menu->addAction(tr("Close plugin"));
84 84 QObject::connect(this->closeAction,SIGNAL(triggered()),this,SLOT(closeMe()));
85 85 return 1;
86 86 }
87 87
88 88
89 89
90 90
91 91 bool ahbuartplugin::checkConnection()
92 92 {
93 93 QTime timeout;
94 94 char test[5] ={(char)0x80,(char)0x80,(char)0,(char)0,(char)0};
95 95 char test2[1024];
96 96 int writen =0;
97 97 int read = 0;
98 98 timeout.start();
99 99 SocExplorerEngine::message(this,"Check connection",2);
100 100 QMutexLocker lock(portMutex);
101 101 while(writen!=5)
102 102 {
103 103 writen+=rs232write(this->port,test+writen,5-writen);
104 104 if(timeout.elapsed()>1000)
105 105 {
106 106 SocExplorerEngine::message(this,"Can't write any data on serial port",2);
107 107 return false;
108 108 }
109 109 }
110 110 #ifdef WIN32
111 111 usleep(1000);
112 112 #endif
113 113 timeout.restart();
114 while(read!=4)
114 int avail = 0;
115 do
116 {
117 avail = rs232availablebytes(this->port);
118 if(timeout.elapsed()>1000)
115 119 {
116 read += rs232read(this->port,test2,4-read);
117 if(timeout.elapsed()>1000) break;
120 if(avail)
121 rs232read(this->port,test2,avail);
122 SocExplorerEngine::message(this,"Connection Error",2);
123 return false;
118 124 }
125 }while(avail<4);
126 read = rs232read(this->port,test2,avail);
119 127 if(read>0)
120 128 {
121 129 SocExplorerEngine::message(this,"Connection Ok",2);
122 130 return true;
123 131 }
124 132 else
125 133 {
126 134 SocExplorerEngine::message(this,"Connection Error",2);
127 135 return false;
128 136 }
129
130 137 }
131 138
132 139 void ahbuartplugin::connectPort(QString PortName, int baudrate)
133 140 {
134 141 QTime timeout;
135 142 SocExplorerEngine::message(this,"Try to connect to port "+PortName,2);
136 143 timeout.start();
137 144 QMutexLocker lock(portMutex);
138 145 if(this->port==(rs232port_t)NULL)
139 146 {
140 147 SocExplorerEngine::message(this,"Open port "+PortName,2);
141 148 this->port=rs232open((char*)PortName.toStdString().c_str());
142 149 }
143 150 if(this->port!=badPortValue)
144 151 {
145 152 SocExplorerEngine::message(this,"Port opened "+PortName,2);
146 153 SocExplorerEngine::message(this,"Configure port "+PortName,2);
147 154 rs232setup(this->port,8,baudrate,rs232parityNo,rs232OneStop);
148 155 char test[7] ={(char)0x55,(char)0x51,(char)0x80,(char)0x80,(char)0x0,(char)0x0,(char)0x14};
149 156 char test2[1024];
150 157 SAFEWRITE(test,1,timeout,2000,return);
151 158 SAFEWRITE((test+1),1,timeout,2000,return);
152 159 rs232read(this->port,test2,512);
153 160 int read = 0;
154 161 for(int i=0;i<10;i++)
155 162 {
156 163 SocExplorerEngine::message(this,"Send test patern :0x55,0x55,0x80,0x80,0x0,0x0,0x14",2);
157 164 SAFEWRITE(test+2,5,timeout,2000,return);
158 165 SocExplorerEngine::message(this,"Read Result",2);
159 166 read=rs232read(this->port,test2+read,16);
160 167 SocExplorerEngine::message(this,QString("Get ") + QString::number(read) + " bytes",2);
161 168 if(read>0)
162 169 {
163 170 SocExplorerEngine::message(this,"Flush port ",2);
164 171 while(rs232read(this->port,test2,1)>0);
165 172 this->Connected = true;
166 173 SocExplorerEngine::message(this,QString("Connection success on ")+PortName,2);
167 174 emit this->activate(true);
168 175 if(this->scanDone==false)
169 176 {
170 177 socexplorerproxy::loadChildSysDriver(this,"AMBA_PLUGIN");
171 178 this->scanDone=true;
172 179 }
173 180 break;
174 181 }
175 182 }
176 183 }
177 184 else
178 185 {
179 186 SocExplorerEngine::message(this,QString("Port not opened ")+PortName,2);
180 187 this->port = (rs232port_t)NULL;
181 188 this->Connected = false;
182 189 emit this->activateSig(false);
183 190 return;
184 191 }
185 192 if(this->Connected == false)
186 193 {
187 194 SocExplorerEngine::message(this,QString("Port not opened ")+PortName,2);
188 195 rs232close(this->port);
189 196 this->port = (rs232port_t)NULL;
190 197 emit this->activateSig(false);
191 198 }
192 199
193 200 }
194 201
195 202 bool ahbuartplugin::open(QString PortName,int baudrate)
196 203 {
197 204 if(this->port!=(rs232port_t)NULL)
198 205 this->close();
199 206 this->UI->setconfig(PortName,baudrate);
200 207 this->connectPort(PortName,baudrate);
201 208 return (this->port!=(rs232port_t)NULL);
202 209 }
203 210
204 211 void ahbuartplugin::close()
205 212 {
206 213 if(this->port!=(rs232port_t)NULL)
207 214 {
208 215 rs232close(this->port);
209 216 this->port = (rs232port_t)NULL;
210 217 this->Connected = false;
211 218 emit this->activateSig(false);
212 219 }
213 220 }
214 221
215 222 void ahbuartplugin::togglePort(QString PortName,int baudrate)
216 223 {
217 224 if(this->port!=(rs232port_t)NULL)
218 225 {
219 226 this->close();
220 227 }
221 228 else
222 229 {
223 230 this->connectPort(PortName,baudrate);
224 231 }
225 232 }
226 233
227 234
228 235 unsigned int ahbuartplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
229 236 {
230 237 QTime timeout;
231 238 timeout.start();
232 239 unsigned int read=0;
233 240 unsigned int cnt=count;
234 241 unsigned int nextUpdateTrig=0,updateStep=512;
235 242 SocExplorerEngine::message(this,QString("Read ")+ QString::number(count) + QString(" words @0x")+ QString::number(address,16),2);
236 243 if((this->port!= badPortValue)||(this->port!=(rs232port_t)NULL))
237 244 {
238 245 QMutexLocker lock(portMutex);
239 246 if(!this->checkConnection())
240 247 {
241 248 this->Connected = false;
242 249 emit this->activateSig(false);
243 250 this->portMutex->unlock();
244 251 return 0;
245 252 }
246 253 QProgressBar* progress=NULL;
247 254 if(cnt>128)
248 255 progress= SocExplorerEngine::getProgressBar("Reading on uart @0x"+QString::number(address,16)+" %v of "+QString::number(count)+" words ",count);
249 256 char CMD[5];
250 257 char* result = (char*)malloc(count*4);
251 258 while(count>32)
252 259 {
253 260 CMD[0] = 0x80 | (32-1);
254 261 CMD[1] = (char)((address>>24)&0xFF);
255 262 CMD[2] = (char)((address>>16)&0xFF);
256 263 CMD[3] = (char)((address>>8)&0xFF);
257 264 CMD[4] = (char)((address)&0xFF);
258 265 SAFEWRITE(CMD,5,timeout,1000,return 0);
259 #ifdef WIN32
260 usleep(1000);
261 #endif
262 SAFEREAD(result+((cnt-count)*4),32*4,timeout,1000,return 0);
266 timeout.restart();
267 int avail=0;
268 do{
269 avail=rs232availablebytes(this->port);
270 if(timeout.elapsed()>1000)
271 {
272 rs232close(this->port);
273 this->port = (rs232port_t)NULL;
274 this->Connected = false;
275 emit this->activateSig(false);
276 return 0;
277 }
278 }while(avail<(32*4));
279 rs232read(this->port,result+((cnt-count)*4),32*4);
263 280 count-=32;
264 281 address+=32*4;
265 282 if(cnt>128)
266 283 {
267 284
268 285 if((cnt-count)>=nextUpdateTrig)
269 286 {
270 287 progress->setValue(cnt-count);
271 288 qApp->processEvents();
272 289 nextUpdateTrig+=updateStep;
273 290 }
274 291 }
275 292 }
276 293 if(count>0)
277 294 {
278 295 CMD[0] = 0x80 | (count-1);
279 296 CMD[1] = (char)((address>>24)&0xFF);
280 297 CMD[2] = (char)((address>>16)&0xFF);
281 298 CMD[3] = (char)((address>>8)&0xFF);
282 299 CMD[4] = (char)((address)&0xFF);
283 300 SAFEWRITE(CMD,5,timeout,1000,return 0);
284 #ifdef WIN32
285 usleep(1000);
286 #endif
287 SAFEREAD(result+((cnt-count)*4),(count*4),timeout,1000,return 0);
301 timeout.restart();
302 int avail=0;
303 do{
304 avail=rs232availablebytes(this->port);
305 if(timeout.elapsed()>1000)
306 {
307 rs232close(this->port);
308 this->port = (rs232port_t)NULL;
309 this->Connected = false;
310 emit this->activateSig(false);
311 return 0;
312 }
313 }while(avail<(count*4));
314 rs232read(this->port,result+((cnt-count)*4),count*4);
288 315 }
289 316 if(cnt>128)
290 317 {
291 318 progress->setValue(cnt-count);
292 319 qApp->processEvents();
293 320 }
294 321 for(int i=0;(unsigned int)i<cnt;i++)
295 322 {
296 323 for(int j =0;j<4;j++)
297 324 {
298 325 Value[i]= ((unsigned char)(result[i*4+j])) + Value[i]*256;
299 326 }
300 327 read = cnt*4;
301 328
302 329 }
303 330 if(cnt>128)
304 331 SocExplorerEngine::deleteProgressBar(progress);
305 332 free(result);
306 333 }
307 334 emit this->addReadBytes(read);
308 335 return read/4;
309 336 }
310 337
311 338 unsigned int ahbuartplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
312 339 {
313 340 QTime timeout;
314 341 timeout.start();
315 342 unsigned int writen=0;
316 343 unsigned int nextUpdateTrig=0,updateStep=512;
317 344 SocExplorerEngine::message(this,QString("Write ")+ QString::number(count) + QString(" words @0x")+ QString::number(address,16),2);
318 345 if((this->port!= badPortValue)||(this->port!=(rs232port_t)NULL))
319 346 {
320 347 QMutexLocker lock(portMutex);
321 348 if(!this->checkConnection())
322 349 {
323 350 emit this->activateSig(false);
324 351 this->Connected = false;
325 352 this->portMutex->unlock();
326 353 return 0;
327 354 }
328 355 QProgressBar* progress = NULL;
329 356 if(count>128)
330 357 progress = SocExplorerEngine::getProgressBar("Writing on uart @0x"+QString::number(address,16)+" %v of "+QString::number(count)+" words ",count);
331 358 int offset = 0;
332 359 char* CMD= (char*)malloc((32*4)+5);
333 360 while(count>32)
334 361 {
335 362 writen=0;
336 363 CMD[0] = 0xC0 | (32-1);
337 364 CMD[1] = (char)(((unsigned int)address>>24)&0xFF);
338 365 CMD[2] = (char)(((unsigned int)address>>16)&0xFF);
339 366 CMD[3] = (char)(((unsigned int)address>>8)&0xFF);
340 367 CMD[4] = (char)(((unsigned int)address)&0xFF);
341 368 for(int i=0;i<32;i++)
342 369 {
343 370 CMD[(i*4)+5] = (char)(((unsigned int)Value[i+offset]>>24)&0xFF);
344 371 CMD[(i*4)+6] = (char)(((unsigned int)Value[i+offset]>>16)&0xFF);
345 372 CMD[(i*4)+7] = (char)(((unsigned int)Value[i+offset]>>8)&0xFF);
346 373 CMD[(i*4)+8] = (char)(((unsigned int)Value[i+offset])&0xFF);
347 374 }
348 375 SAFEWRITE(CMD,((32*4)+5),timeout,1000,return 0);
349 376 writen+=32;
350 377 count-=32;
351 378 offset+=32;
352 379 address+=32*4;
353 380 if(offset>=nextUpdateTrig && progress!=NULL)
354 381 {
355 382 progress->setValue(offset);
356 383 qApp->processEvents();
357 384 nextUpdateTrig +=updateStep;
358 385 }
359 386
360 387 }
361 388 if(count>0)
362 389 {
363 390 CMD[0] = 0xC0 | (count-1);
364 391 CMD[1] = (char)(((unsigned int)address>>24)&0xFF);
365 392 CMD[2] = (char)(((unsigned int)address>>16)&0xFF);
366 393 CMD[3] = (char)(((unsigned int)address>>8)&0xFF);
367 394 CMD[4] = (char)(((unsigned int)address)&0xFF);
368 395 for(int i=0;(unsigned int) i<(count);i++)
369 396 {
370 397 CMD[(i*4)+5] = (char)(((unsigned int)Value[i+offset]>>24)&0xFF);
371 398 CMD[(i*4)+6] = (char)(((unsigned int)Value[i+offset]>>16)&0xFF);
372 399 CMD[(i*4)+7] = (char)(((unsigned int)Value[i+offset]>>8)&0xFF);
373 400 CMD[(i*4)+8] = (char)(((unsigned int)Value[i+offset])&0xFF);
374 401 }
375 402 SAFEWRITE(CMD,((count*4)+5),timeout,1000,return 0);
376 403 writen+=count;
377 404 }
378 405 if(progress!=NULL)
379 406 {
380 407 progress->setValue(writen);
381 408 qApp->processEvents();
382 409 SocExplorerEngine::deleteProgressBar(progress);
383 410 }
384 411 free(CMD);
385 412 emit this->addWritenBytes(writen);
386 413 return writen;
387 414 }
388 415 return 0;
389 416 }
390 417
391 418
392 419
393 420
394 421 void ahbuartplugin::updatePortList()
395 422 {
396 423 if(this->portListcompleter==(QCompleter*)NULL)
397 424 {
398 425 this->portListcompleter=new QCompleter(this);
399 426 this->portListcompleter->setCaseSensitivity(Qt::CaseInsensitive);
400 427 this->portListcompleterModel = new QStringListModel(this);
401 428 this->portListcompleter->setModel(this->portListcompleterModel);
402 429 this->UI->setCompleter(this->portListcompleter);
403 430 }
404 431 rs232portslist_t* portlist = rs232getportlist();
405 432 rs232portslist_t* portlistenum = portlist;
406 433 QStringList wordList;
407 434 while(portlistenum!=NULL)
408 435 {
409 436 wordList << portlistenum->name;
410 437 portlistenum = portlistenum->next;
411 438 }
412 439 rs232deleteportlist(portlist);
413 440 this->portListcompleterModel->setStringList(wordList);
414 441 }
415 442
416 443 QVariantList ahbuartplugin::ReadBytes(unsigned int address, unsigned int count)
417 444 {
418 445 unsigned int data[(count/4)+1];
419 446 QVariantList result;
420 447 this->Read(data,(count/4)+1,address);
421 448 for(unsigned int i = 0;i<count/4;i++)
422 449 {
423 450 result.append(QVariant((int)(0x0FF&(data[i]>>24))));
424 451 result.append(QVariant((int)(0x0FF&(data[i]>>16))));
425 452 result.append(QVariant((int)(0x0FF&(data[i]>>8))));
426 453 result.append(QVariant((int)(0x0FF&(data[i]))));
427 454 }
428 455
429 456 for(int i=0;i<(count%4);i++)
430 457 {
431 458 result.append(QVariant((int)(0x0FF&(data[count/4]>>((3-i)*8)))));
432 459 }
433 460
434 461 return result;
435 462 }
436 463
437 464 void ahbuartplugin::WriteBytes(unsigned int address, QList<QVariant> dataList)
438 465 {
439 466 unsigned int data[dataList.count()/4];
440 467 for(int i = 0;i<(dataList.count()/4);i++)
441 468 {
442 469 data[i] = 0x0FF & ((unsigned int)dataList.at(4*i).toUInt());
443 470 data[i] = (data[i]<<8) + (0x0FF & ((unsigned int)dataList.at((4*i)+1).toUInt()));
444 471 data[i] = (data[i]<<8) + (0x0FF & ((unsigned int)dataList.at((4*i)+2).toUInt()));
445 472 data[i] = (data[i]<<8) + (0x0FF & ((unsigned int)dataList.at((4*i)+3).toUInt()));
446 473 }
447 474 this->Write(data,dataList.count()/4,address);
448 475 }
449 476
450 477
451 478
452 479
453 480
454 481
455 482
456 483
457 484
458 485
459 486
460 487
461 488
462 489
463 490
464 491
465 492
@@ -1,112 +1,99
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 21 ----------------------------------------------------------------------------*/
22 22 #ifndef AHBUARTPLUGIN_H
23 23 #define AHBUARTPLUGIN_H
24 24 #include <QMenuBar>
25 25 #include <QMenu>
26 26 #include <QAction>
27 27 #include <QLayout>
28 28 #include <QMutex>
29 29 #include <QProgressDialog>
30 30 #include <QStringListModel>
31 31 #include <QTime>
32 32 #include <socexplorerplugin.h>
33 33 #include "ahbuartpluginui.h"
34 34 #include <RS232.h>
35 #include <unistd.h>
35 36
36 37
37 38 #define SAFEWRITE(data,count,timer,timeout,error) \
38 39 while(1)\
39 40 {\
40 41 unsigned int __writen__=0; \
41 42 (timer).restart(); \
42 43 while(__writen__!=(count)) \
43 44 {\
44 45 __writen__ += rs232write(this->port,((data)+__writen__),((count)-__writen__)); \
45 46 if((timer).elapsed()>(timeout)) \
46 47 {\
47 48 this->port = (rs232port_t)NULL; \
48 49 this->Connected = false; \
49 50 emit this->activateSig(false); \
50 51 error; \
51 52 } \
52 53 } \
53 54 break;\
54 55 }
55 56
56 57
57 #define SAFEREAD(data,count,timer,timeout,error) \
58 unsigned int __read__=0; \
59 (timer).restart(); \
60 while(__read__ != (count)) \
61 { \
62 __read__+=rs232read(this->port,((data)+__read__),((count)-__read__)); \
63 if((timer).elapsed()>(timeout)) \
64 { \
65 this->Connected = false; \
66 emit this->activateSig(false); \
67 this->portMutex->unlock(); \
68 error; \
69 } \
70 } \
71 58
72 59
73 60
74 61 class ahbuartplugin : public socexplorerplugin
75 62 {
76 63 Q_OBJECT
77 64 public:
78 65 ahbuartplugin(QWidget *parent = 0);
79 66 ~ahbuartplugin();
80 67 int registermenu(QMainWindow *menuHolder);
81 68 int VID(){return driver_VID;}
82 69 int PID(){return driver_PID;}
83 70
84 71 public slots:
85 72 void togglePort(QString PortName,int baudrate);
86 73 unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
87 74 unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
88 75 void closeMe();
89 76 void close();
90 77 bool open(QString PortName,int baudrate);
91 78 void updatePortList();
92 79 QVariantList ReadBytes(unsigned int address,unsigned int count);
93 80 void WriteBytes(unsigned int address,QList<QVariant> dataList);
94 81 signals:
95 82 void setProgressValue(int progress);
96 83 void addWritenBytes(int count);
97 84 void addReadBytes(int count);
98 85 private:
99 86 bool scanDone;
100 87 QProgressDialog* progress;
101 88 QLayout * mainLayout;
102 89 ahbUartPluginUI* UI;
103 90 QMutex* portMutex;
104 91 rs232port_t port;
105 92 QCompleter *portListcompleter;
106 93 QStringListModel *portListcompleterModel;
107 94 void connectPort(QString PortName,int baudrate);
108 95 bool checkConnection();
109 96
110 97 };
111 98
112 99 #endif // AHBUARTPLUGIN_H
General Comments 0
You need to be logged in to leave comments. Login now