OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [frmUart.h] - Blame information for rev 32

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 32 robfinch
#pragma once
2
#include "stdafx.h"
3
extern clsSystem system1;
4
 
5
namespace emuThor {
6
 
7
        using namespace System;
8
        using namespace System::ComponentModel;
9
        using namespace System::Collections;
10
        using namespace System::Windows::Forms;
11
        using namespace System::Data;
12
        using namespace System::Drawing;
13
        using namespace System::Runtime::InteropServices;
14
        using namespace System::Threading;
15
 
16
        /// <summary>
17
        /// Summary for frmUart
18
        /// </summary>
19
        public ref class frmUart : public System::Windows::Forms::Form
20
        {
21
        public:
22
                Mutex^ mut;
23
                frmUart(Mutex^ m)
24
                {
25
                        mut = m;
26
                        InitializeComponent();
27
                        //
28
                        //TODO: Add the constructor code here
29
                        //
30
                }
31
 
32
        protected:
33
                /// <summary>
34
                /// Clean up any resources being used.
35
                /// </summary>
36
                ~frmUart()
37
                {
38
                        if (components)
39
                        {
40
                                delete components;
41
                        }
42
                }
43
        private: System::Windows::Forms::TextBox^  txtToUart;
44
        protected:
45
 
46
        protected:
47
        private: System::Windows::Forms::Label^  label1;
48
        private: System::Windows::Forms::Label^  label2;
49
        private: System::Windows::Forms::TextBox^  txtFromUart;
50
 
51
        private: System::Windows::Forms::Button^  button1;
52
        private: System::Windows::Forms::Button^  button2;
53
        private: System::Windows::Forms::Label^  label3;
54
        private: System::Windows::Forms::TextBox^  txtCM0;
55
        private: System::Windows::Forms::TextBox^  txtCM1;
56
 
57
 
58
        private: System::Windows::Forms::Label^  label4;
59
        private: System::Windows::Forms::TextBox^  txtCM2;
60
 
61
        private: System::Windows::Forms::Label^  label5;
62
        private: System::Windows::Forms::TextBox^  txtCM3;
63
 
64
        private: System::Windows::Forms::Label^  label6;
65
        private: System::Windows::Forms::Label^  label7;
66
        private: System::Windows::Forms::TextBox^  txtTB;
67
        private: System::Windows::Forms::TextBox^  txtLS;
68
 
69
 
70
        private: System::Windows::Forms::Label^  label8;
71
        private: System::Windows::Forms::TextBox^  txtMS;
72
 
73
        private: System::Windows::Forms::Label^  label9;
74
        private: System::Windows::Forms::TextBox^  txtIS;
75
 
76
 
77
        private: System::Windows::Forms::Label^  label10;
78
        private: System::Windows::Forms::TextBox^  txtIER;
79
        private: System::Windows::Forms::Label^  label11;
80
        private: System::Windows::Forms::TextBox^  txtFF;
81
 
82
        private: System::Windows::Forms::Label^  label12;
83
        private: System::Windows::Forms::TextBox^  txtMC;
84
 
85
        private: System::Windows::Forms::Label^  label13;
86
        private: System::Windows::Forms::TextBox^  txtCTRL;
87
 
88
        private: System::Windows::Forms::Label^  label14;
89
        private: System::Windows::Forms::TextBox^  txtFC;
90
 
91
        private: System::Windows::Forms::Label^  label15;
92
        private: System::Windows::Forms::Timer^  timer1;
93
        private: System::Windows::Forms::CheckBox^  checkBox1;
94
        private: System::Windows::Forms::CheckBox^  checkBox2;
95
        private: System::Windows::Forms::CheckBox^  checkBox3;
96
        private: System::Windows::Forms::TextBox^  txtRB;
97
 
98
        private: System::Windows::Forms::Label^  label16;
99
        private: System::ComponentModel::IContainer^  components;
100
 
101
        private:
102
                /// <summary>
103
                /// Required designer variable.
104
                /// </summary>
105
        private: bool do_send;
106
 
107
#pragma region Windows Form Designer generated code
108
                /// <summary>
109
                /// Required method for Designer support - do not modify
110
                /// the contents of this method with the code editor.
111
                /// </summary>
112
                void InitializeComponent(void)
113
                {
114
                        this->components = (gcnew System::ComponentModel::Container());
115
                        this->txtToUart = (gcnew System::Windows::Forms::TextBox());
116
                        this->label1 = (gcnew System::Windows::Forms::Label());
117
                        this->label2 = (gcnew System::Windows::Forms::Label());
118
                        this->txtFromUart = (gcnew System::Windows::Forms::TextBox());
119
                        this->button1 = (gcnew System::Windows::Forms::Button());
120
                        this->button2 = (gcnew System::Windows::Forms::Button());
121
                        this->label3 = (gcnew System::Windows::Forms::Label());
122
                        this->txtCM0 = (gcnew System::Windows::Forms::TextBox());
123
                        this->txtCM1 = (gcnew System::Windows::Forms::TextBox());
124
                        this->label4 = (gcnew System::Windows::Forms::Label());
125
                        this->txtCM2 = (gcnew System::Windows::Forms::TextBox());
126
                        this->label5 = (gcnew System::Windows::Forms::Label());
127
                        this->txtCM3 = (gcnew System::Windows::Forms::TextBox());
128
                        this->label6 = (gcnew System::Windows::Forms::Label());
129
                        this->label7 = (gcnew System::Windows::Forms::Label());
130
                        this->txtTB = (gcnew System::Windows::Forms::TextBox());
131
                        this->txtLS = (gcnew System::Windows::Forms::TextBox());
132
                        this->label8 = (gcnew System::Windows::Forms::Label());
133
                        this->txtMS = (gcnew System::Windows::Forms::TextBox());
134
                        this->label9 = (gcnew System::Windows::Forms::Label());
135
                        this->txtIS = (gcnew System::Windows::Forms::TextBox());
136
                        this->label10 = (gcnew System::Windows::Forms::Label());
137
                        this->txtIER = (gcnew System::Windows::Forms::TextBox());
138
                        this->label11 = (gcnew System::Windows::Forms::Label());
139
                        this->txtFF = (gcnew System::Windows::Forms::TextBox());
140
                        this->label12 = (gcnew System::Windows::Forms::Label());
141
                        this->txtMC = (gcnew System::Windows::Forms::TextBox());
142
                        this->label13 = (gcnew System::Windows::Forms::Label());
143
                        this->txtCTRL = (gcnew System::Windows::Forms::TextBox());
144
                        this->label14 = (gcnew System::Windows::Forms::Label());
145
                        this->txtFC = (gcnew System::Windows::Forms::TextBox());
146
                        this->label15 = (gcnew System::Windows::Forms::Label());
147
                        this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
148
                        this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
149
                        this->checkBox2 = (gcnew System::Windows::Forms::CheckBox());
150
                        this->checkBox3 = (gcnew System::Windows::Forms::CheckBox());
151
                        this->txtRB = (gcnew System::Windows::Forms::TextBox());
152
                        this->label16 = (gcnew System::Windows::Forms::Label());
153
                        this->SuspendLayout();
154
                        // 
155
                        // txtToUart
156
                        // 
157
                        this->txtToUart->Location = System::Drawing::Point(31, 27);
158
                        this->txtToUart->Multiline = true;
159
                        this->txtToUart->Name = L"txtToUart";
160
                        this->txtToUart->Size = System::Drawing::Size(318, 124);
161
                        this->txtToUart->TabIndex = 0;
162
                        // 
163
                        // label1
164
                        // 
165
                        this->label1->AutoSize = true;
166
                        this->label1->Location = System::Drawing::Point(28, 11);
167
                        this->label1->Name = L"label1";
168
                        this->label1->Size = System::Drawing::Size(53, 13);
169
                        this->label1->TabIndex = 1;
170
                        this->label1->Text = L"To UART";
171
                        // 
172
                        // label2
173
                        // 
174
                        this->label2->AutoSize = true;
175
                        this->label2->Location = System::Drawing::Point(28, 169);
176
                        this->label2->Name = L"label2";
177
                        this->label2->Size = System::Drawing::Size(95, 13);
178
                        this->label2->TabIndex = 2;
179
                        this->label2->Text = L"UART Transmitted";
180
                        // 
181
                        // txtFromUart
182
                        // 
183
                        this->txtFromUart->Location = System::Drawing::Point(31, 185);
184
                        this->txtFromUart->Multiline = true;
185
                        this->txtFromUart->Name = L"txtFromUart";
186
                        this->txtFromUart->Size = System::Drawing::Size(318, 124);
187
                        this->txtFromUart->TabIndex = 3;
188
                        // 
189
                        // button1
190
                        // 
191
                        this->button1->Location = System::Drawing::Point(474, 353);
192
                        this->button1->Name = L"button1";
193
                        this->button1->Size = System::Drawing::Size(75, 23);
194
                        this->button1->TabIndex = 4;
195
                        this->button1->Text = L"OK";
196
                        this->button1->UseVisualStyleBackColor = true;
197
                        // 
198
                        // button2
199
                        // 
200
                        this->button2->Location = System::Drawing::Point(355, 25);
201
                        this->button2->Name = L"button2";
202
                        this->button2->Size = System::Drawing::Size(75, 23);
203
                        this->button2->TabIndex = 5;
204
                        this->button2->Text = L"Send";
205
                        this->button2->UseVisualStyleBackColor = true;
206
                        this->button2->Click += gcnew System::EventHandler(this, &frmUart::button2_Click);
207
                        // 
208
                        // label3
209
                        // 
210
                        this->label3->AutoSize = true;
211
                        this->label3->Location = System::Drawing::Point(475, 72);
212
                        this->label3->Name = L"label3";
213
                        this->label3->Size = System::Drawing::Size(29, 13);
214
                        this->label3->TabIndex = 6;
215
                        this->label3->Text = L"CM0";
216
                        // 
217
                        // txtCM0
218
                        // 
219
                        this->txtCM0->Location = System::Drawing::Point(510, 69);
220
                        this->txtCM0->Name = L"txtCM0";
221
                        this->txtCM0->ReadOnly = true;
222
                        this->txtCM0->Size = System::Drawing::Size(39, 20);
223
                        this->txtCM0->TabIndex = 7;
224
                        this->txtCM0->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
225
                        // 
226
                        // txtCM1
227
                        // 
228
                        this->txtCM1->Location = System::Drawing::Point(510, 95);
229
                        this->txtCM1->Name = L"txtCM1";
230
                        this->txtCM1->ReadOnly = true;
231
                        this->txtCM1->Size = System::Drawing::Size(39, 20);
232
                        this->txtCM1->TabIndex = 9;
233
                        this->txtCM1->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
234
                        // 
235
                        // label4
236
                        // 
237
                        this->label4->AutoSize = true;
238
                        this->label4->Location = System::Drawing::Point(475, 98);
239
                        this->label4->Name = L"label4";
240
                        this->label4->Size = System::Drawing::Size(29, 13);
241
                        this->label4->TabIndex = 8;
242
                        this->label4->Text = L"CM1";
243
                        // 
244
                        // txtCM2
245
                        // 
246
                        this->txtCM2->Location = System::Drawing::Point(510, 121);
247
                        this->txtCM2->Name = L"txtCM2";
248
                        this->txtCM2->ReadOnly = true;
249
                        this->txtCM2->Size = System::Drawing::Size(39, 20);
250
                        this->txtCM2->TabIndex = 11;
251
                        this->txtCM2->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
252
                        // 
253
                        // label5
254
                        // 
255
                        this->label5->AutoSize = true;
256
                        this->label5->Location = System::Drawing::Point(475, 124);
257
                        this->label5->Name = L"label5";
258
                        this->label5->Size = System::Drawing::Size(29, 13);
259
                        this->label5->TabIndex = 10;
260
                        this->label5->Text = L"CM2";
261
                        // 
262
                        // txtCM3
263
                        // 
264
                        this->txtCM3->Location = System::Drawing::Point(510, 147);
265
                        this->txtCM3->Name = L"txtCM3";
266
                        this->txtCM3->ReadOnly = true;
267
                        this->txtCM3->Size = System::Drawing::Size(39, 20);
268
                        this->txtCM3->TabIndex = 13;
269
                        this->txtCM3->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
270
                        // 
271
                        // label6
272
                        // 
273
                        this->label6->AutoSize = true;
274
                        this->label6->Location = System::Drawing::Point(475, 150);
275
                        this->label6->Name = L"label6";
276
                        this->label6->Size = System::Drawing::Size(29, 13);
277
                        this->label6->TabIndex = 12;
278
                        this->label6->Text = L"CM3";
279
                        // 
280
                        // label7
281
                        // 
282
                        this->label7->AutoSize = true;
283
                        this->label7->Location = System::Drawing::Point(378, 72);
284
                        this->label7->Name = L"label7";
285
                        this->label7->Size = System::Drawing::Size(21, 13);
286
                        this->label7->TabIndex = 14;
287
                        this->label7->Text = L"TB";
288
                        // 
289
                        // txtTB
290
                        // 
291
                        this->txtTB->Location = System::Drawing::Point(413, 69);
292
                        this->txtTB->Name = L"txtTB";
293
                        this->txtTB->ReadOnly = true;
294
                        this->txtTB->Size = System::Drawing::Size(39, 20);
295
                        this->txtTB->TabIndex = 15;
296
                        this->txtTB->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
297
                        // 
298
                        // txtLS
299
                        // 
300
                        this->txtLS->Location = System::Drawing::Point(413, 124);
301
                        this->txtLS->Name = L"txtLS";
302
                        this->txtLS->ReadOnly = true;
303
                        this->txtLS->Size = System::Drawing::Size(39, 20);
304
                        this->txtLS->TabIndex = 17;
305
                        this->txtLS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
306
                        // 
307
                        // label8
308
                        // 
309
                        this->label8->AutoSize = true;
310
                        this->label8->Location = System::Drawing::Point(378, 127);
311
                        this->label8->Name = L"label8";
312
                        this->label8->Size = System::Drawing::Size(20, 13);
313
                        this->label8->TabIndex = 16;
314
                        this->label8->Text = L"LS";
315
                        // 
316
                        // txtMS
317
                        // 
318
                        this->txtMS->Location = System::Drawing::Point(413, 150);
319
                        this->txtMS->Name = L"txtMS";
320
                        this->txtMS->ReadOnly = true;
321
                        this->txtMS->Size = System::Drawing::Size(39, 20);
322
                        this->txtMS->TabIndex = 19;
323
                        this->txtMS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
324
                        // 
325
                        // label9
326
                        // 
327
                        this->label9->AutoSize = true;
328
                        this->label9->Location = System::Drawing::Point(378, 153);
329
                        this->label9->Name = L"label9";
330
                        this->label9->Size = System::Drawing::Size(23, 13);
331
                        this->label9->TabIndex = 18;
332
                        this->label9->Text = L"MS";
333
                        // 
334
                        // txtIS
335
                        // 
336
                        this->txtIS->Location = System::Drawing::Point(413, 176);
337
                        this->txtIS->Name = L"txtIS";
338
                        this->txtIS->ReadOnly = true;
339
                        this->txtIS->Size = System::Drawing::Size(39, 20);
340
                        this->txtIS->TabIndex = 21;
341
                        this->txtIS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
342
                        // 
343
                        // label10
344
                        // 
345
                        this->label10->AutoSize = true;
346
                        this->label10->Location = System::Drawing::Point(378, 179);
347
                        this->label10->Name = L"label10";
348
                        this->label10->Size = System::Drawing::Size(17, 13);
349
                        this->label10->TabIndex = 20;
350
                        this->label10->Text = L"IS";
351
                        // 
352
                        // txtIER
353
                        // 
354
                        this->txtIER->Location = System::Drawing::Point(413, 202);
355
                        this->txtIER->Name = L"txtIER";
356
                        this->txtIER->Size = System::Drawing::Size(39, 20);
357
                        this->txtIER->TabIndex = 23;
358
                        this->txtIER->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
359
                        // 
360
                        // label11
361
                        // 
362
                        this->label11->AutoSize = true;
363
                        this->label11->Location = System::Drawing::Point(378, 205);
364
                        this->label11->Name = L"label11";
365
                        this->label11->Size = System::Drawing::Size(25, 13);
366
                        this->label11->TabIndex = 22;
367
                        this->label11->Text = L"IER";
368
                        // 
369
                        // txtFF
370
                        // 
371
                        this->txtFF->Location = System::Drawing::Point(413, 228);
372
                        this->txtFF->Name = L"txtFF";
373
                        this->txtFF->Size = System::Drawing::Size(39, 20);
374
                        this->txtFF->TabIndex = 25;
375
                        this->txtFF->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
376
                        // 
377
                        // label12
378
                        // 
379
                        this->label12->AutoSize = true;
380
                        this->label12->Location = System::Drawing::Point(378, 231);
381
                        this->label12->Name = L"label12";
382
                        this->label12->Size = System::Drawing::Size(19, 13);
383
                        this->label12->TabIndex = 24;
384
                        this->label12->Text = L"FF";
385
                        // 
386
                        // txtMC
387
                        // 
388
                        this->txtMC->Location = System::Drawing::Point(413, 254);
389
                        this->txtMC->Name = L"txtMC";
390
                        this->txtMC->Size = System::Drawing::Size(39, 20);
391
                        this->txtMC->TabIndex = 27;
392
                        this->txtMC->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
393
                        // 
394
                        // label13
395
                        // 
396
                        this->label13->AutoSize = true;
397
                        this->label13->Location = System::Drawing::Point(378, 257);
398
                        this->label13->Name = L"label13";
399
                        this->label13->Size = System::Drawing::Size(23, 13);
400
                        this->label13->TabIndex = 26;
401
                        this->label13->Text = L"MC";
402
                        // 
403
                        // txtCTRL
404
                        // 
405
                        this->txtCTRL->Location = System::Drawing::Point(413, 280);
406
                        this->txtCTRL->Name = L"txtCTRL";
407
                        this->txtCTRL->Size = System::Drawing::Size(39, 20);
408
                        this->txtCTRL->TabIndex = 29;
409
                        this->txtCTRL->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
410
                        // 
411
                        // label14
412
                        // 
413
                        this->label14->AutoSize = true;
414
                        this->label14->Location = System::Drawing::Point(378, 283);
415
                        this->label14->Name = L"label14";
416
                        this->label14->Size = System::Drawing::Size(35, 13);
417
                        this->label14->TabIndex = 28;
418
                        this->label14->Text = L"CTRL";
419
                        // 
420
                        // txtFC
421
                        // 
422
                        this->txtFC->Location = System::Drawing::Point(510, 176);
423
                        this->txtFC->Name = L"txtFC";
424
                        this->txtFC->Size = System::Drawing::Size(39, 20);
425
                        this->txtFC->TabIndex = 31;
426
                        this->txtFC->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
427
                        // 
428
                        // label15
429
                        // 
430
                        this->label15->AutoSize = true;
431
                        this->label15->Location = System::Drawing::Point(475, 179);
432
                        this->label15->Name = L"label15";
433
                        this->label15->Size = System::Drawing::Size(20, 13);
434
                        this->label15->TabIndex = 30;
435
                        this->label15->Text = L"FC";
436
                        // 
437
                        // timer1
438
                        // 
439
                        this->timer1->Enabled = true;
440
                        this->timer1->Tick += gcnew System::EventHandler(this, &frmUart::timer1_Tick);
441
                        // 
442
                        // checkBox1
443
                        // 
444
                        this->checkBox1->AutoSize = true;
445
                        this->checkBox1->Checked = true;
446
                        this->checkBox1->CheckState = System::Windows::Forms::CheckState::Checked;
447
                        this->checkBox1->Location = System::Drawing::Point(31, 315);
448
                        this->checkBox1->Name = L"checkBox1";
449
                        this->checkBox1->Size = System::Drawing::Size(47, 17);
450
                        this->checkBox1->TabIndex = 32;
451
                        this->checkBox1->Text = L"CTS";
452
                        this->checkBox1->UseVisualStyleBackColor = true;
453
                        // 
454
                        // checkBox2
455
                        // 
456
                        this->checkBox2->AutoSize = true;
457
                        this->checkBox2->Checked = true;
458
                        this->checkBox2->CheckState = System::Windows::Forms::CheckState::Checked;
459
                        this->checkBox2->Location = System::Drawing::Point(31, 338);
460
                        this->checkBox2->Name = L"checkBox2";
461
                        this->checkBox2->Size = System::Drawing::Size(49, 17);
462
                        this->checkBox2->TabIndex = 33;
463
                        this->checkBox2->Text = L"DSR";
464
                        this->checkBox2->UseVisualStyleBackColor = true;
465
                        // 
466
                        // checkBox3
467
                        // 
468
                        this->checkBox3->AutoSize = true;
469
                        this->checkBox3->Checked = true;
470
                        this->checkBox3->CheckState = System::Windows::Forms::CheckState::Checked;
471
                        this->checkBox3->Location = System::Drawing::Point(31, 361);
472
                        this->checkBox3->Name = L"checkBox3";
473
                        this->checkBox3->Size = System::Drawing::Size(49, 17);
474
                        this->checkBox3->TabIndex = 34;
475
                        this->checkBox3->Text = L"DCD";
476
                        this->checkBox3->UseVisualStyleBackColor = true;
477
                        // 
478
                        // txtRB
479
                        // 
480
                        this->txtRB->Location = System::Drawing::Point(413, 95);
481
                        this->txtRB->Name = L"txtRB";
482
                        this->txtRB->ReadOnly = true;
483
                        this->txtRB->Size = System::Drawing::Size(39, 20);
484
                        this->txtRB->TabIndex = 36;
485
                        this->txtRB->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
486
                        // 
487
                        // label16
488
                        // 
489
                        this->label16->AutoSize = true;
490
                        this->label16->Location = System::Drawing::Point(378, 98);
491
                        this->label16->Name = L"label16";
492
                        this->label16->Size = System::Drawing::Size(22, 13);
493
                        this->label16->TabIndex = 35;
494
                        this->label16->Text = L"RB";
495
                        // 
496
                        // frmUart
497
                        // 
498
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
499
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
500
                        this->ClientSize = System::Drawing::Size(571, 388);
501
                        this->Controls->Add(this->txtRB);
502
                        this->Controls->Add(this->label16);
503
                        this->Controls->Add(this->checkBox3);
504
                        this->Controls->Add(this->checkBox2);
505
                        this->Controls->Add(this->checkBox1);
506
                        this->Controls->Add(this->txtFC);
507
                        this->Controls->Add(this->label15);
508
                        this->Controls->Add(this->txtCTRL);
509
                        this->Controls->Add(this->label14);
510
                        this->Controls->Add(this->txtMC);
511
                        this->Controls->Add(this->label13);
512
                        this->Controls->Add(this->txtFF);
513
                        this->Controls->Add(this->label12);
514
                        this->Controls->Add(this->txtIER);
515
                        this->Controls->Add(this->label11);
516
                        this->Controls->Add(this->txtIS);
517
                        this->Controls->Add(this->label10);
518
                        this->Controls->Add(this->txtMS);
519
                        this->Controls->Add(this->label9);
520
                        this->Controls->Add(this->txtLS);
521
                        this->Controls->Add(this->label8);
522
                        this->Controls->Add(this->txtTB);
523
                        this->Controls->Add(this->label7);
524
                        this->Controls->Add(this->txtCM3);
525
                        this->Controls->Add(this->label6);
526
                        this->Controls->Add(this->txtCM2);
527
                        this->Controls->Add(this->label5);
528
                        this->Controls->Add(this->txtCM1);
529
                        this->Controls->Add(this->label4);
530
                        this->Controls->Add(this->txtCM0);
531
                        this->Controls->Add(this->label3);
532
                        this->Controls->Add(this->button2);
533
                        this->Controls->Add(this->button1);
534
                        this->Controls->Add(this->txtFromUart);
535
                        this->Controls->Add(this->label2);
536
                        this->Controls->Add(this->label1);
537
                        this->Controls->Add(this->txtToUart);
538
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
539
                        this->Name = L"frmUart";
540
                        this->Text = L"rtfSimpleUart Emulator";
541
                        this->ResumeLayout(false);
542
                        this->PerformLayout();
543
 
544
                }
545
#pragma endregion
546
        private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
547
                                 do_send = true;
548
                         }
549
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
550
                         int dat;
551
                         char buf[5];
552
 
553
                         if (do_send && txtToUart->Text->Length > 0) {
554
                                 char* str = (char*)(void*)Marshal::StringToHGlobalAnsi(txtToUart->Text->Substring(0,1));
555
                                 txtToUart->Text = txtToUart->Text->Substring(1);
556
                                 mut->WaitOne();
557
                                 system1.uart1.RxPort(str[0]);
558
                                 mut->ReleaseMutex();
559
                         }
560
                         if (txtToUart->Text->Length <= 0)
561
                                 do_send = false;
562
                         mut->WaitOne();
563
                         dat = system1.uart1.TxPort() & 0xFF;
564
                         mut->ReleaseMutex();
565
                         buf[0] = dat;
566
                         buf[1] = '\0';
567
                         if (dat != 0xFF)
568
                                 txtFromUart->Text = txtFromUart->Text + gcnew String(buf);
569
                         mut->WaitOne();
570
                         sprintf(buf, "%02X", system1.uart1.cm1);
571
                         txtCM1->Text = gcnew String(buf);
572
                         sprintf(buf, "%02X", system1.uart1.cm2);
573
                         txtCM2->Text = gcnew String(buf);
574
                         sprintf(buf, "%02X", system1.uart1.cm3);
575
                         txtCM3->Text = gcnew String(buf);
576
                         sprintf(buf, "%02X", system1.uart1.ls);
577
                         txtLS->Text = gcnew String(buf);
578
                         sprintf(buf, "%02X", system1.uart1.rb);
579
                         txtRB->Text = gcnew String(buf);
580
                         sprintf(buf, "%02X", system1.uart1.tb);
581
                         txtTB->Text = gcnew String(buf);
582
                         sprintf(buf, "%02X", system1.uart1.ier);
583
                         txtIER->Text = gcnew String(buf);
584
                         sprintf(buf, "%02X", system1.uart1.is);
585
                         mut->ReleaseMutex();
586
                         txtIS->Text = gcnew String(buf);
587
                 }
588
};
589
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.