-
Notifications
You must be signed in to change notification settings - Fork 0
/
Read_Serial_Port.cpp
874 lines (845 loc) · 30.4 KB
/
Read_Serial_Port.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
/*
* File: Read_Serial_Port.cpp
*
*
* --- THIS FILE GENERATED BY S-FUNCTION BUILDER: 3.0 ---
*
* This file is an S-function produced by the S-Function
* Builder which only recognizes certain fields. Changes made
* outside these fields will be lost the next time the block is
* used to load, edit, and resave this file. This file will be overwritten
* by the S-function Builder block. If you want to edit this file by hand,
* you must change it only in the area defined as:
*
* %%%-SFUNWIZ_defines_Changes_BEGIN
* #define NAME 'replacement text'
* %%% SFUNWIZ_defines_Changes_END
*
* DO NOT change NAME--Change the 'replacement text' only.
*
* For better compatibility with the Simulink Coder, the
* "wrapper" S-function technique is used. This is discussed
* in the Simulink Coder's Manual in the Chapter titled,
* "Wrapper S-functions".
*
* -------------------------------------------------------------------------
* | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
* -------------------------------------------------------------------------
*
* Created: Mon Aug 27 13:45:17 2018
*/
#define S_FUNCTION_LEVEL 2
#define S_FUNCTION_NAME Read_Serial_Port
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */
#define NUM_INPUTS 0
#define NUM_OUTPUTS 32
/* Output Port 0 */
#define OUT_PORT_0_NAME dxp1
#define OUTPUT_0_WIDTH 1
#define OUTPUT_DIMS_0_COL 1
#define OUTPUT_0_DTYPE real_T
#define OUTPUT_0_COMPLEX COMPLEX_NO
#define OUT_0_FRAME_BASED FRAME_NO
#define OUT_0_BUS_BASED 0
#define OUT_0_BUS_NAME
#define OUT_0_DIMS 1-D
#define OUT_0_ISSIGNED 1
#define OUT_0_WORDLENGTH 8
#define OUT_0_FIXPOINTSCALING 1
#define OUT_0_FRACTIONLENGTH 3
#define OUT_0_BIAS 0
#define OUT_0_SLOPE 0.125
/* Output Port 1 */
#define OUT_PORT_1_NAME dxp2
#define OUTPUT_1_WIDTH 1
#define OUTPUT_DIMS_1_COL 1
#define OUTPUT_1_DTYPE real_T
#define OUTPUT_1_COMPLEX COMPLEX_NO
#define OUT_1_FRAME_BASED FRAME_NO
#define OUT_1_BUS_BASED 0
#define OUT_1_BUS_NAME
#define OUT_1_DIMS 1-D
#define OUT_1_ISSIGNED 1
#define OUT_1_WORDLENGTH 8
#define OUT_1_FIXPOINTSCALING 1
#define OUT_1_FRACTIONLENGTH 3
#define OUT_1_BIAS 0
#define OUT_1_SLOPE 0.125
/* Output Port 2 */
#define OUT_PORT_2_NAME dxp3
#define OUTPUT_2_WIDTH 1
#define OUTPUT_DIMS_2_COL 1
#define OUTPUT_2_DTYPE real_T
#define OUTPUT_2_COMPLEX COMPLEX_NO
#define OUT_2_FRAME_BASED FRAME_NO
#define OUT_2_BUS_BASED 0
#define OUT_2_BUS_NAME
#define OUT_2_DIMS 1-D
#define OUT_2_ISSIGNED 1
#define OUT_2_WORDLENGTH 8
#define OUT_2_FIXPOINTSCALING 1
#define OUT_2_FRACTIONLENGTH 3
#define OUT_2_BIAS 0
#define OUT_2_SLOPE 0.125
/* Output Port 3 */
#define OUT_PORT_3_NAME dxp4
#define OUTPUT_3_WIDTH 1
#define OUTPUT_DIMS_3_COL 1
#define OUTPUT_3_DTYPE real_T
#define OUTPUT_3_COMPLEX COMPLEX_NO
#define OUT_3_FRAME_BASED FRAME_NO
#define OUT_3_BUS_BASED 0
#define OUT_3_BUS_NAME
#define OUT_3_DIMS 1-D
#define OUT_3_ISSIGNED 1
#define OUT_3_WORDLENGTH 8
#define OUT_3_FIXPOINTSCALING 1
#define OUT_3_FRACTIONLENGTH 3
#define OUT_3_BIAS 0
#define OUT_3_SLOPE 0.125
/* Output Port 4 */
#define OUT_PORT_4_NAME sxp1
#define OUTPUT_4_WIDTH 1
#define OUTPUT_DIMS_4_COL 1
#define OUTPUT_4_DTYPE real_T
#define OUTPUT_4_COMPLEX COMPLEX_NO
#define OUT_4_FRAME_BASED FRAME_NO
#define OUT_4_BUS_BASED 0
#define OUT_4_BUS_NAME
#define OUT_4_DIMS 1-D
#define OUT_4_ISSIGNED 1
#define OUT_4_WORDLENGTH 8
#define OUT_4_FIXPOINTSCALING 1
#define OUT_4_FRACTIONLENGTH 3
#define OUT_4_BIAS 0
#define OUT_4_SLOPE 0.125
/* Output Port 5 */
#define OUT_PORT_5_NAME sxp2
#define OUTPUT_5_WIDTH 1
#define OUTPUT_DIMS_5_COL 1
#define OUTPUT_5_DTYPE real_T
#define OUTPUT_5_COMPLEX COMPLEX_NO
#define OUT_5_FRAME_BASED FRAME_NO
#define OUT_5_BUS_BASED 0
#define OUT_5_BUS_NAME
#define OUT_5_DIMS 1-D
#define OUT_5_ISSIGNED 1
#define OUT_5_WORDLENGTH 8
#define OUT_5_FIXPOINTSCALING 1
#define OUT_5_FRACTIONLENGTH 3
#define OUT_5_BIAS 0
#define OUT_5_SLOPE 0.125
/* Output Port 6 */
#define OUT_PORT_6_NAME sxp3
#define OUTPUT_6_WIDTH 1
#define OUTPUT_DIMS_6_COL 1
#define OUTPUT_6_DTYPE real_T
#define OUTPUT_6_COMPLEX COMPLEX_NO
#define OUT_6_FRAME_BASED FRAME_NO
#define OUT_6_BUS_BASED 0
#define OUT_6_BUS_NAME
#define OUT_6_DIMS 1-D
#define OUT_6_ISSIGNED 1
#define OUT_6_WORDLENGTH 8
#define OUT_6_FIXPOINTSCALING 1
#define OUT_6_FRACTIONLENGTH 3
#define OUT_6_BIAS 0
#define OUT_6_SLOPE 0.125
/* Output Port 7 */
#define OUT_PORT_7_NAME sxp4
#define OUTPUT_7_WIDTH 1
#define OUTPUT_DIMS_7_COL 1
#define OUTPUT_7_DTYPE real_T
#define OUTPUT_7_COMPLEX COMPLEX_NO
#define OUT_7_FRAME_BASED FRAME_NO
#define OUT_7_BUS_BASED 0
#define OUT_7_BUS_NAME
#define OUT_7_DIMS 1-D
#define OUT_7_ISSIGNED 1
#define OUT_7_WORDLENGTH 8
#define OUT_7_FIXPOINTSCALING 1
#define OUT_7_FRACTIONLENGTH 3
#define OUT_7_BIAS 0
#define OUT_7_SLOPE 0.125
/* Output Port 8 */
#define OUT_PORT_8_NAME dxm1
#define OUTPUT_8_WIDTH 1
#define OUTPUT_DIMS_8_COL 1
#define OUTPUT_8_DTYPE real_T
#define OUTPUT_8_COMPLEX COMPLEX_NO
#define OUT_8_FRAME_BASED FRAME_NO
#define OUT_8_BUS_BASED 0
#define OUT_8_BUS_NAME
#define OUT_8_DIMS 1-D
#define OUT_8_ISSIGNED 1
#define OUT_8_WORDLENGTH 8
#define OUT_8_FIXPOINTSCALING 1
#define OUT_8_FRACTIONLENGTH 3
#define OUT_8_BIAS 0
#define OUT_8_SLOPE 0.125
/* Output Port 9 */
#define OUT_PORT_9_NAME dxm2
#define OUTPUT_9_WIDTH 1
#define OUTPUT_DIMS_9_COL 1
#define OUTPUT_9_DTYPE real_T
#define OUTPUT_9_COMPLEX COMPLEX_NO
#define OUT_9_FRAME_BASED FRAME_NO
#define OUT_9_BUS_BASED 0
#define OUT_9_BUS_NAME
#define OUT_9_DIMS 1-D
#define OUT_9_ISSIGNED 1
#define OUT_9_WORDLENGTH 8
#define OUT_9_FIXPOINTSCALING 1
#define OUT_9_FRACTIONLENGTH 3
#define OUT_9_BIAS 0
#define OUT_9_SLOPE 0.125
/* Output Port 10 */
#define OUT_PORT_10_NAME dxm3
#define OUTPUT_10_WIDTH 1
#define OUTPUT_DIMS_10_COL 1
#define OUTPUT_10_DTYPE real_T
#define OUTPUT_10_COMPLEX COMPLEX_NO
#define OUT_10_FRAME_BASED FRAME_NO
#define OUT_10_BUS_BASED 0
#define OUT_10_BUS_NAME
#define OUT_10_DIMS 1-D
#define OUT_10_ISSIGNED 1
#define OUT_10_WORDLENGTH 8
#define OUT_10_FIXPOINTSCALING 1
#define OUT_10_FRACTIONLENGTH 3
#define OUT_10_BIAS 0
#define OUT_10_SLOPE 0.125
/* Output Port 11 */
#define OUT_PORT_11_NAME dxm4
#define OUTPUT_11_WIDTH 1
#define OUTPUT_DIMS_11_COL 1
#define OUTPUT_11_DTYPE real_T
#define OUTPUT_11_COMPLEX COMPLEX_NO
#define OUT_11_FRAME_BASED FRAME_NO
#define OUT_11_BUS_BASED 0
#define OUT_11_BUS_NAME
#define OUT_11_DIMS 1-D
#define OUT_11_ISSIGNED 1
#define OUT_11_WORDLENGTH 8
#define OUT_11_FIXPOINTSCALING 1
#define OUT_11_FRACTIONLENGTH 3
#define OUT_11_BIAS 0
#define OUT_11_SLOPE 0.125
/* Output Port 12 */
#define OUT_PORT_12_NAME sxm1
#define OUTPUT_12_WIDTH 1
#define OUTPUT_DIMS_12_COL 1
#define OUTPUT_12_DTYPE real_T
#define OUTPUT_12_COMPLEX COMPLEX_NO
#define OUT_12_FRAME_BASED FRAME_NO
#define OUT_12_BUS_BASED 0
#define OUT_12_BUS_NAME
#define OUT_12_DIMS 1-D
#define OUT_12_ISSIGNED 1
#define OUT_12_WORDLENGTH 8
#define OUT_12_FIXPOINTSCALING 1
#define OUT_12_FRACTIONLENGTH 3
#define OUT_12_BIAS 0
#define OUT_12_SLOPE 0.125
/* Output Port 13 */
#define OUT_PORT_13_NAME sxm2
#define OUTPUT_13_WIDTH 1
#define OUTPUT_DIMS_13_COL 1
#define OUTPUT_13_DTYPE real_T
#define OUTPUT_13_COMPLEX COMPLEX_NO
#define OUT_13_FRAME_BASED FRAME_NO
#define OUT_13_BUS_BASED 0
#define OUT_13_BUS_NAME
#define OUT_13_DIMS 1-D
#define OUT_13_ISSIGNED 1
#define OUT_13_WORDLENGTH 8
#define OUT_13_FIXPOINTSCALING 1
#define OUT_13_FRACTIONLENGTH 3
#define OUT_13_BIAS 0
#define OUT_13_SLOPE 0.125
/* Output Port 14 */
#define OUT_PORT_14_NAME sxm3
#define OUTPUT_14_WIDTH 1
#define OUTPUT_DIMS_14_COL 1
#define OUTPUT_14_DTYPE real_T
#define OUTPUT_14_COMPLEX COMPLEX_NO
#define OUT_14_FRAME_BASED FRAME_NO
#define OUT_14_BUS_BASED 0
#define OUT_14_BUS_NAME
#define OUT_14_DIMS 1-D
#define OUT_14_ISSIGNED 1
#define OUT_14_WORDLENGTH 8
#define OUT_14_FIXPOINTSCALING 1
#define OUT_14_FRACTIONLENGTH 3
#define OUT_14_BIAS 0
#define OUT_14_SLOPE 0.125
/* Output Port 15 */
#define OUT_PORT_15_NAME sxm4
#define OUTPUT_15_WIDTH 1
#define OUTPUT_DIMS_15_COL 1
#define OUTPUT_15_DTYPE real_T
#define OUTPUT_15_COMPLEX COMPLEX_NO
#define OUT_15_FRAME_BASED FRAME_NO
#define OUT_15_BUS_BASED 0
#define OUT_15_BUS_NAME
#define OUT_15_DIMS 1-D
#define OUT_15_ISSIGNED 1
#define OUT_15_WORDLENGTH 8
#define OUT_15_FIXPOINTSCALING 1
#define OUT_15_FRACTIONLENGTH 3
#define OUT_15_BIAS 0
#define OUT_15_SLOPE 0.125
/* Output Port 16 */
#define OUT_PORT_16_NAME dyp1
#define OUTPUT_16_WIDTH 1
#define OUTPUT_DIMS_16_COL 1
#define OUTPUT_16_DTYPE real_T
#define OUTPUT_16_COMPLEX COMPLEX_NO
#define OUT_16_FRAME_BASED FRAME_NO
#define OUT_16_BUS_BASED 0
#define OUT_16_BUS_NAME
#define OUT_16_DIMS 1-D
#define OUT_16_ISSIGNED 1
#define OUT_16_WORDLENGTH 8
#define OUT_16_FIXPOINTSCALING 1
#define OUT_16_FRACTIONLENGTH 3
#define OUT_16_BIAS 0
#define OUT_16_SLOPE 0.125
/* Output Port 17 */
#define OUT_PORT_17_NAME dyp2
#define OUTPUT_17_WIDTH 1
#define OUTPUT_DIMS_17_COL 1
#define OUTPUT_17_DTYPE real_T
#define OUTPUT_17_COMPLEX COMPLEX_NO
#define OUT_17_FRAME_BASED FRAME_NO
#define OUT_17_BUS_BASED 0
#define OUT_17_BUS_NAME
#define OUT_17_DIMS 1-D
#define OUT_17_ISSIGNED 1
#define OUT_17_WORDLENGTH 8
#define OUT_17_FIXPOINTSCALING 1
#define OUT_17_FRACTIONLENGTH 3
#define OUT_17_BIAS 0
#define OUT_17_SLOPE 0.125
/* Output Port 18 */
#define OUT_PORT_18_NAME dyp3
#define OUTPUT_18_WIDTH 1
#define OUTPUT_DIMS_18_COL 1
#define OUTPUT_18_DTYPE real_T
#define OUTPUT_18_COMPLEX COMPLEX_NO
#define OUT_18_FRAME_BASED FRAME_NO
#define OUT_18_BUS_BASED 0
#define OUT_18_BUS_NAME
#define OUT_18_DIMS 1-D
#define OUT_18_ISSIGNED 1
#define OUT_18_WORDLENGTH 8
#define OUT_18_FIXPOINTSCALING 1
#define OUT_18_FRACTIONLENGTH 3
#define OUT_18_BIAS 0
#define OUT_18_SLOPE 0.125
/* Output Port 19 */
#define OUT_PORT_19_NAME dyp4
#define OUTPUT_19_WIDTH 1
#define OUTPUT_DIMS_19_COL 1
#define OUTPUT_19_DTYPE real_T
#define OUTPUT_19_COMPLEX COMPLEX_NO
#define OUT_19_FRAME_BASED FRAME_NO
#define OUT_19_BUS_BASED 0
#define OUT_19_BUS_NAME
#define OUT_19_DIMS 1-D
#define OUT_19_ISSIGNED 1
#define OUT_19_WORDLENGTH 8
#define OUT_19_FIXPOINTSCALING 1
#define OUT_19_FRACTIONLENGTH 3
#define OUT_19_BIAS 0
#define OUT_19_SLOPE 0.125
/* Output Port 20 */
#define OUT_PORT_20_NAME syp1
#define OUTPUT_20_WIDTH 1
#define OUTPUT_DIMS_20_COL 1
#define OUTPUT_20_DTYPE real_T
#define OUTPUT_20_COMPLEX COMPLEX_NO
#define OUT_20_FRAME_BASED FRAME_NO
#define OUT_20_BUS_BASED 0
#define OUT_20_BUS_NAME
#define OUT_20_DIMS 1-D
#define OUT_20_ISSIGNED 1
#define OUT_20_WORDLENGTH 8
#define OUT_20_FIXPOINTSCALING 1
#define OUT_20_FRACTIONLENGTH 3
#define OUT_20_BIAS 0
#define OUT_20_SLOPE 0.125
/* Output Port 21 */
#define OUT_PORT_21_NAME syp2
#define OUTPUT_21_WIDTH 1
#define OUTPUT_DIMS_21_COL 1
#define OUTPUT_21_DTYPE real_T
#define OUTPUT_21_COMPLEX COMPLEX_NO
#define OUT_21_FRAME_BASED FRAME_NO
#define OUT_21_BUS_BASED 0
#define OUT_21_BUS_NAME
#define OUT_21_DIMS 1-D
#define OUT_21_ISSIGNED 1
#define OUT_21_WORDLENGTH 8
#define OUT_21_FIXPOINTSCALING 1
#define OUT_21_FRACTIONLENGTH 3
#define OUT_21_BIAS 0
#define OUT_21_SLOPE 0.125
/* Output Port 22 */
#define OUT_PORT_22_NAME syp3
#define OUTPUT_22_WIDTH 1
#define OUTPUT_DIMS_22_COL 1
#define OUTPUT_22_DTYPE real_T
#define OUTPUT_22_COMPLEX COMPLEX_NO
#define OUT_22_FRAME_BASED FRAME_NO
#define OUT_22_BUS_BASED 0
#define OUT_22_BUS_NAME
#define OUT_22_DIMS 1-D
#define OUT_22_ISSIGNED 1
#define OUT_22_WORDLENGTH 8
#define OUT_22_FIXPOINTSCALING 1
#define OUT_22_FRACTIONLENGTH 3
#define OUT_22_BIAS 0
#define OUT_22_SLOPE 0.125
/* Output Port 23 */
#define OUT_PORT_23_NAME syp4
#define OUTPUT_23_WIDTH 1
#define OUTPUT_DIMS_23_COL 1
#define OUTPUT_23_DTYPE real_T
#define OUTPUT_23_COMPLEX COMPLEX_NO
#define OUT_23_FRAME_BASED FRAME_NO
#define OUT_23_BUS_BASED 0
#define OUT_23_BUS_NAME
#define OUT_23_DIMS 1-D
#define OUT_23_ISSIGNED 1
#define OUT_23_WORDLENGTH 8
#define OUT_23_FIXPOINTSCALING 1
#define OUT_23_FRACTIONLENGTH 3
#define OUT_23_BIAS 0
#define OUT_23_SLOPE 0.125
/* Output Port 24 */
#define OUT_PORT_24_NAME dym1
#define OUTPUT_24_WIDTH 1
#define OUTPUT_DIMS_24_COL 1
#define OUTPUT_24_DTYPE real_T
#define OUTPUT_24_COMPLEX COMPLEX_NO
#define OUT_24_FRAME_BASED FRAME_NO
#define OUT_24_BUS_BASED 0
#define OUT_24_BUS_NAME
#define OUT_24_DIMS 1-D
#define OUT_24_ISSIGNED 1
#define OUT_24_WORDLENGTH 8
#define OUT_24_FIXPOINTSCALING 1
#define OUT_24_FRACTIONLENGTH 3
#define OUT_24_BIAS 0
#define OUT_24_SLOPE 0.125
/* Output Port 25 */
#define OUT_PORT_25_NAME dym2
#define OUTPUT_25_WIDTH 1
#define OUTPUT_DIMS_25_COL 1
#define OUTPUT_25_DTYPE real_T
#define OUTPUT_25_COMPLEX COMPLEX_NO
#define OUT_25_FRAME_BASED FRAME_NO
#define OUT_25_BUS_BASED 0
#define OUT_25_BUS_NAME
#define OUT_25_DIMS 1-D
#define OUT_25_ISSIGNED 1
#define OUT_25_WORDLENGTH 8
#define OUT_25_FIXPOINTSCALING 1
#define OUT_25_FRACTIONLENGTH 3
#define OUT_25_BIAS 0
#define OUT_25_SLOPE 0.125
/* Output Port 26 */
#define OUT_PORT_26_NAME dym3
#define OUTPUT_26_WIDTH 1
#define OUTPUT_DIMS_26_COL 1
#define OUTPUT_26_DTYPE real_T
#define OUTPUT_26_COMPLEX COMPLEX_NO
#define OUT_26_FRAME_BASED FRAME_NO
#define OUT_26_BUS_BASED 0
#define OUT_26_BUS_NAME
#define OUT_26_DIMS 1-D
#define OUT_26_ISSIGNED 1
#define OUT_26_WORDLENGTH 8
#define OUT_26_FIXPOINTSCALING 1
#define OUT_26_FRACTIONLENGTH 3
#define OUT_26_BIAS 0
#define OUT_26_SLOPE 0.125
/* Output Port 27 */
#define OUT_PORT_27_NAME dym4
#define OUTPUT_27_WIDTH 1
#define OUTPUT_DIMS_27_COL 1
#define OUTPUT_27_DTYPE real_T
#define OUTPUT_27_COMPLEX COMPLEX_NO
#define OUT_27_FRAME_BASED FRAME_NO
#define OUT_27_BUS_BASED 0
#define OUT_27_BUS_NAME
#define OUT_27_DIMS 1-D
#define OUT_27_ISSIGNED 1
#define OUT_27_WORDLENGTH 8
#define OUT_27_FIXPOINTSCALING 1
#define OUT_27_FRACTIONLENGTH 3
#define OUT_27_BIAS 0
#define OUT_27_SLOPE 0.125
/* Output Port 28 */
#define OUT_PORT_28_NAME sym1
#define OUTPUT_28_WIDTH 1
#define OUTPUT_DIMS_28_COL 1
#define OUTPUT_28_DTYPE real_T
#define OUTPUT_28_COMPLEX COMPLEX_NO
#define OUT_28_FRAME_BASED FRAME_NO
#define OUT_28_BUS_BASED 0
#define OUT_28_BUS_NAME
#define OUT_28_DIMS 1-D
#define OUT_28_ISSIGNED 1
#define OUT_28_WORDLENGTH 8
#define OUT_28_FIXPOINTSCALING 1
#define OUT_28_FRACTIONLENGTH 3
#define OUT_28_BIAS 0
#define OUT_28_SLOPE 0.125
/* Output Port 29 */
#define OUT_PORT_29_NAME sym2
#define OUTPUT_29_WIDTH 1
#define OUTPUT_DIMS_29_COL 1
#define OUTPUT_29_DTYPE real_T
#define OUTPUT_29_COMPLEX COMPLEX_NO
#define OUT_29_FRAME_BASED FRAME_NO
#define OUT_29_BUS_BASED 0
#define OUT_29_BUS_NAME
#define OUT_29_DIMS 1-D
#define OUT_29_ISSIGNED 1
#define OUT_29_WORDLENGTH 8
#define OUT_29_FIXPOINTSCALING 1
#define OUT_29_FRACTIONLENGTH 3
#define OUT_29_BIAS 0
#define OUT_29_SLOPE 0.125
/* Output Port 30 */
#define OUT_PORT_30_NAME sym3
#define OUTPUT_30_WIDTH 1
#define OUTPUT_DIMS_30_COL 1
#define OUTPUT_30_DTYPE real_T
#define OUTPUT_30_COMPLEX COMPLEX_NO
#define OUT_30_FRAME_BASED FRAME_NO
#define OUT_30_BUS_BASED 0
#define OUT_30_BUS_NAME
#define OUT_30_DIMS 1-D
#define OUT_30_ISSIGNED 1
#define OUT_30_WORDLENGTH 8
#define OUT_30_FIXPOINTSCALING 1
#define OUT_30_FRACTIONLENGTH 3
#define OUT_30_BIAS 0
#define OUT_30_SLOPE 0.125
/* Output Port 31 */
#define OUT_PORT_31_NAME sym4
#define OUTPUT_31_WIDTH 1
#define OUTPUT_DIMS_31_COL 1
#define OUTPUT_31_DTYPE real_T
#define OUTPUT_31_COMPLEX COMPLEX_NO
#define OUT_31_FRAME_BASED FRAME_NO
#define OUT_31_BUS_BASED 0
#define OUT_31_BUS_NAME
#define OUT_31_DIMS 1-D
#define OUT_31_ISSIGNED 1
#define OUT_31_WORDLENGTH 8
#define OUT_31_FIXPOINTSCALING 1
#define OUT_31_FRACTIONLENGTH 3
#define OUT_31_BIAS 0
#define OUT_31_SLOPE 0.125
#define NPARAMS 0
#define SAMPLE_TIME_0 0.001
#define NUM_DISC_STATES 0
#define DISC_STATES_IC [0]
#define NUM_CONT_STATES 0
#define CONT_STATES_IC [0]
#define SFUNWIZ_GENERATE_TLC 0
#define SOURCEFILES "__SFB__"
#define PANELINDEX 8
#define USE_SIMSTRUCT 1
#define SHOW_COMPILE_STEPS 0
#define CREATE_DEBUG_MEXFILE 0
#define SAVE_CODE_ONLY 0
#define SFUNWIZ_REVISION 3.0
/* %%%-SFUNWIZ_defines_Changes_END --- EDIT HERE TO _BEGIN */
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#include "simstruc.h"
extern void Read_Serial_Port_Start_wrapper(SimStruct *S);
extern void Read_Serial_Port_Outputs_wrapper(real_T *dxp1,
real_T *dxp2,
real_T *dxp3,
real_T *dxp4,
real_T *sxp1,
real_T *sxp2,
real_T *sxp3,
real_T *sxp4,
real_T *dxm1,
real_T *dxm2,
real_T *dxm3,
real_T *dxm4,
real_T *sxm1,
real_T *sxm2,
real_T *sxm3,
real_T *sxm4,
real_T *dyp1,
real_T *dyp2,
real_T *dyp3,
real_T *dyp4,
real_T *syp1,
real_T *syp2,
real_T *syp3,
real_T *syp4,
real_T *dym1,
real_T *dym2,
real_T *dym3,
real_T *dym4,
real_T *sym1,
real_T *sym2,
real_T *sym3,
real_T *sym4,
SimStruct *S);
extern void Read_Serial_Port_Terminate_wrapper(SimStruct *S);
/*====================*
* S-function methods *
*====================*/
/* Function: mdlInitializeSizes ===============================================
* Abstract:
* Setup sizes of the various vectors.
*/
static void mdlInitializeSizes(SimStruct *S)
{
DECL_AND_INIT_DIMSINFO(outputDimsInfo);
ssSetNumSFcnParams(S, NPARAMS);
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
return; /* Parameter mismatch will be reported by Simulink */
}
ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE);
ssSetNumContStates(S, NUM_CONT_STATES);
ssSetNumDiscStates(S, NUM_DISC_STATES);
if (!ssSetNumInputPorts(S, NUM_INPUTS)) return;
if (!ssSetNumOutputPorts(S, NUM_OUTPUTS)) return;
/* Output Port 0 */
ssSetOutputPortWidth(S, 0, OUTPUT_0_WIDTH);
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX);
/* Output Port 1 */
ssSetOutputPortWidth(S, 1, OUTPUT_1_WIDTH);
ssSetOutputPortDataType(S, 1, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 1, OUTPUT_1_COMPLEX);
/* Output Port 2 */
ssSetOutputPortWidth(S, 2, OUTPUT_2_WIDTH);
ssSetOutputPortDataType(S, 2, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 2, OUTPUT_2_COMPLEX);
/* Output Port 3 */
ssSetOutputPortWidth(S, 3, OUTPUT_3_WIDTH);
ssSetOutputPortDataType(S, 3, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 3, OUTPUT_3_COMPLEX);
/* Output Port 4 */
ssSetOutputPortWidth(S, 4, OUTPUT_4_WIDTH);
ssSetOutputPortDataType(S, 4, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 4, OUTPUT_4_COMPLEX);
/* Output Port 5 */
ssSetOutputPortWidth(S, 5, OUTPUT_5_WIDTH);
ssSetOutputPortDataType(S, 5, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 5, OUTPUT_5_COMPLEX);
/* Output Port 6 */
ssSetOutputPortWidth(S, 6, OUTPUT_6_WIDTH);
ssSetOutputPortDataType(S, 6, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 6, OUTPUT_6_COMPLEX);
/* Output Port 7 */
ssSetOutputPortWidth(S, 7, OUTPUT_7_WIDTH);
ssSetOutputPortDataType(S, 7, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 7, OUTPUT_7_COMPLEX);
/* Output Port 8 */
ssSetOutputPortWidth(S, 8, OUTPUT_8_WIDTH);
ssSetOutputPortDataType(S, 8, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 8, OUTPUT_8_COMPLEX);
/* Output Port 9 */
ssSetOutputPortWidth(S, 9, OUTPUT_9_WIDTH);
ssSetOutputPortDataType(S, 9, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 9, OUTPUT_9_COMPLEX);
/* Output Port 10 */
ssSetOutputPortWidth(S, 10, OUTPUT_10_WIDTH);
ssSetOutputPortDataType(S, 10, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 10, OUTPUT_10_COMPLEX);
/* Output Port 11 */
ssSetOutputPortWidth(S, 11, OUTPUT_11_WIDTH);
ssSetOutputPortDataType(S, 11, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 11, OUTPUT_11_COMPLEX);
/* Output Port 12 */
ssSetOutputPortWidth(S, 12, OUTPUT_12_WIDTH);
ssSetOutputPortDataType(S, 12, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 12, OUTPUT_12_COMPLEX);
/* Output Port 13 */
ssSetOutputPortWidth(S, 13, OUTPUT_13_WIDTH);
ssSetOutputPortDataType(S, 13, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 13, OUTPUT_13_COMPLEX);
/* Output Port 14 */
ssSetOutputPortWidth(S, 14, OUTPUT_14_WIDTH);
ssSetOutputPortDataType(S, 14, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 14, OUTPUT_14_COMPLEX);
/* Output Port 15 */
ssSetOutputPortWidth(S, 15, OUTPUT_15_WIDTH);
ssSetOutputPortDataType(S, 15, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 15, OUTPUT_15_COMPLEX);
/* Output Port 16 */
ssSetOutputPortWidth(S, 16, OUTPUT_16_WIDTH);
ssSetOutputPortDataType(S, 16, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 16, OUTPUT_16_COMPLEX);
/* Output Port 17 */
ssSetOutputPortWidth(S, 17, OUTPUT_17_WIDTH);
ssSetOutputPortDataType(S, 17, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 17, OUTPUT_17_COMPLEX);
/* Output Port 18 */
ssSetOutputPortWidth(S, 18, OUTPUT_18_WIDTH);
ssSetOutputPortDataType(S, 18, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 18, OUTPUT_18_COMPLEX);
/* Output Port 19 */
ssSetOutputPortWidth(S, 19, OUTPUT_19_WIDTH);
ssSetOutputPortDataType(S, 19, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 19, OUTPUT_19_COMPLEX);
/* Output Port 20 */
ssSetOutputPortWidth(S, 20, OUTPUT_20_WIDTH);
ssSetOutputPortDataType(S, 20, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 20, OUTPUT_20_COMPLEX);
/* Output Port 21 */
ssSetOutputPortWidth(S, 21, OUTPUT_21_WIDTH);
ssSetOutputPortDataType(S, 21, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 21, OUTPUT_21_COMPLEX);
/* Output Port 22 */
ssSetOutputPortWidth(S, 22, OUTPUT_22_WIDTH);
ssSetOutputPortDataType(S, 22, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 22, OUTPUT_22_COMPLEX);
/* Output Port 23 */
ssSetOutputPortWidth(S, 23, OUTPUT_23_WIDTH);
ssSetOutputPortDataType(S, 23, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 23, OUTPUT_23_COMPLEX);
/* Output Port 24 */
ssSetOutputPortWidth(S, 24, OUTPUT_24_WIDTH);
ssSetOutputPortDataType(S, 24, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 24, OUTPUT_24_COMPLEX);
/* Output Port 25 */
ssSetOutputPortWidth(S, 25, OUTPUT_25_WIDTH);
ssSetOutputPortDataType(S, 25, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 25, OUTPUT_25_COMPLEX);
/* Output Port 26 */
ssSetOutputPortWidth(S, 26, OUTPUT_26_WIDTH);
ssSetOutputPortDataType(S, 26, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 26, OUTPUT_26_COMPLEX);
/* Output Port 27 */
ssSetOutputPortWidth(S, 27, OUTPUT_27_WIDTH);
ssSetOutputPortDataType(S, 27, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 27, OUTPUT_27_COMPLEX);
/* Output Port 28 */
ssSetOutputPortWidth(S, 28, OUTPUT_28_WIDTH);
ssSetOutputPortDataType(S, 28, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 28, OUTPUT_28_COMPLEX);
/* Output Port 29 */
ssSetOutputPortWidth(S, 29, OUTPUT_29_WIDTH);
ssSetOutputPortDataType(S, 29, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 29, OUTPUT_29_COMPLEX);
/* Output Port 30 */
ssSetOutputPortWidth(S, 30, OUTPUT_30_WIDTH);
ssSetOutputPortDataType(S, 30, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 30, OUTPUT_30_COMPLEX);
/* Output Port 31 */
ssSetOutputPortWidth(S, 31, OUTPUT_31_WIDTH);
ssSetOutputPortDataType(S, 31, SS_DOUBLE);
ssSetOutputPortComplexSignal(S, 31, OUTPUT_31_COMPLEX);
ssSetNumPWork(S, 0);
ssSetNumSampleTimes(S, 1);
ssSetNumRWork(S, 0);
ssSetNumIWork(S, 0);
ssSetNumModes(S, 0);
ssSetNumNonsampledZCs(S, 0);
ssSetSimulinkVersionGeneratedIn(S, "9.0");
/* Take care when specifying exception free code - see sfuntmpl_doc.c */
ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |
SS_OPTION_WORKS_WITH_CODE_REUSE));
}
/* Function: mdlInitializeSampleTimes =========================================
* Abstract:
* Specifiy the sample time.
*/
static void mdlInitializeSampleTimes(SimStruct *S)
{
ssSetSampleTime(S, 0, SAMPLE_TIME_0);
ssSetModelReferenceSampleTimeDefaultInheritance(S);
ssSetOffsetTime(S, 0, 0.0);
}
#define MDL_SET_OUTPUT_PORT_DATA_TYPE
static void mdlSetOutputPortDataType(SimStruct *S, int port, DTypeId dType)
{
ssSetOutputPortDataType(S, 0, dType);
}
#define MDL_SET_DEFAULT_PORT_DATA_TYPES
static void mdlSetDefaultPortDataTypes(SimStruct *S)
{
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
}
#define MDL_START /* Change to #undef to remove function */
#if defined(MDL_START)
/* Function: mdlStart =======================================================
* Abstract:
* This function is called once at start of model execution. If you
* have states that should be initialized once, this is the place
* to do it.
*/
static void mdlStart(SimStruct *S)
{
Read_Serial_Port_Start_wrapper(S);
}
#endif /* MDL_START */
/* Function: mdlOutputs =======================================================
*
*/
static void mdlOutputs(SimStruct *S, int_T tid)
{
real_T *dxp1 = (real_T *) ssGetOutputPortRealSignal(S, 0);
real_T *dxp2 = (real_T *) ssGetOutputPortRealSignal(S, 1);
real_T *dxp3 = (real_T *) ssGetOutputPortRealSignal(S, 2);
real_T *dxp4 = (real_T *) ssGetOutputPortRealSignal(S, 3);
real_T *sxp1 = (real_T *) ssGetOutputPortRealSignal(S, 4);
real_T *sxp2 = (real_T *) ssGetOutputPortRealSignal(S, 5);
real_T *sxp3 = (real_T *) ssGetOutputPortRealSignal(S, 6);
real_T *sxp4 = (real_T *) ssGetOutputPortRealSignal(S, 7);
real_T *dxm1 = (real_T *) ssGetOutputPortRealSignal(S, 8);
real_T *dxm2 = (real_T *) ssGetOutputPortRealSignal(S, 9);
real_T *dxm3 = (real_T *) ssGetOutputPortRealSignal(S, 10);
real_T *dxm4 = (real_T *) ssGetOutputPortRealSignal(S, 11);
real_T *sxm1 = (real_T *) ssGetOutputPortRealSignal(S, 12);
real_T *sxm2 = (real_T *) ssGetOutputPortRealSignal(S, 13);
real_T *sxm3 = (real_T *) ssGetOutputPortRealSignal(S, 14);
real_T *sxm4 = (real_T *) ssGetOutputPortRealSignal(S, 15);
real_T *dyp1 = (real_T *) ssGetOutputPortRealSignal(S, 16);
real_T *dyp2 = (real_T *) ssGetOutputPortRealSignal(S, 17);
real_T *dyp3 = (real_T *) ssGetOutputPortRealSignal(S, 18);
real_T *dyp4 = (real_T *) ssGetOutputPortRealSignal(S, 19);
real_T *syp1 = (real_T *) ssGetOutputPortRealSignal(S, 20);
real_T *syp2 = (real_T *) ssGetOutputPortRealSignal(S, 21);
real_T *syp3 = (real_T *) ssGetOutputPortRealSignal(S, 22);
real_T *syp4 = (real_T *) ssGetOutputPortRealSignal(S, 23);
real_T *dym1 = (real_T *) ssGetOutputPortRealSignal(S, 24);
real_T *dym2 = (real_T *) ssGetOutputPortRealSignal(S, 25);
real_T *dym3 = (real_T *) ssGetOutputPortRealSignal(S, 26);
real_T *dym4 = (real_T *) ssGetOutputPortRealSignal(S, 27);
real_T *sym1 = (real_T *) ssGetOutputPortRealSignal(S, 28);
real_T *sym2 = (real_T *) ssGetOutputPortRealSignal(S, 29);
real_T *sym3 = (real_T *) ssGetOutputPortRealSignal(S, 30);
real_T *sym4 = (real_T *) ssGetOutputPortRealSignal(S, 31);
Read_Serial_Port_Outputs_wrapper(dxp1, dxp2, dxp3, dxp4, sxp1, sxp2, sxp3, sxp4, dxm1, dxm2, dxm3, dxm4, sxm1, sxm2, sxm3, sxm4, dyp1, dyp2, dyp3, dyp4, syp1, syp2, syp3, syp4, dym1, dym2, dym3, dym4, sym1, sym2, sym3, sym4, S);
}
/* Function: mdlTerminate =====================================================
* Abstract:
* In this function, you should perform any actions that are necessary
* at the termination of a simulation. For example, if memory was
* allocated in mdlStart, this is the place to free it.
*/
static void mdlTerminate(SimStruct *S)
{
Read_Serial_Port_Terminate_wrapper(S);
}
#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */
#include "simulink.c" /* MEX-file interface mechanism */
#else
#include "cg_sfun.h" /* Code generation registration function */
#endif