-
Notifications
You must be signed in to change notification settings - Fork 2
/
vxlapi.h
6007 lines (5084 loc) · 302 KB
/
vxlapi.h
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
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*----------------------------------------------------------------------------
| File:
| vxlapi.h
| Project:
| Multi Bus driver for Windows 7 / Windows 8 / Windows 10
|
| Description:
| Driver Interface Prototypes - customer version
|
|-----------------------------------------------------------------------------
| $Author: visstz $ $Date: 2016-06-13 15:31:06 +0200 (Mo, 13 Jun 2016) $ $Revision: 58894 $
| $Id: vxlpubbase.h 58894 2016-06-13 13:31:06Z visstz $
|-----------------------------------------------------------------------------
| Copyright (c) 2016 by Vector Informatik GmbH. All rights reserved.
----------------------------------------------------------------------------*/
#ifndef _V_XLAPI_H_
#define _V_XLAPI_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _XL_EXPORT_API __stdcall
#define _EXPORT_API __stdcall
#if defined (DYNAMIC_CANDRIVER_DLL) || defined (DYNAMIC_XLDRIVER_DLL)
#define _XL_EXPORT_DECL _XL_EXPORT_API
#define _XL_EXPORT_DEF _XL_EXPORT_API
#else
// not used for dynamic load of dll
#define _XL_EXPORT_DECL __declspec(dllimport) _XL_EXPORT_API
#define _XL_EXPORT_DEF __declspec(dllimport) _XL_EXPORT_API
#endif
// Functions have the following parameters
#define DEFPARAMS XLportHandle portHandle, XLaccess accessMask, XLuserHandle userHandle
// Almost all xlFr... Functions have the following parameters
#define DEFFRPARAM XLportHandle portHandle, XLaccess accessMask
// Marcos for interface definition and implementation
#ifdef DYNAMIC_XLDRIVER_DLL
#ifdef DO_NOT_DEFINE_EXTERN_DECLARATION
// All DECL_STDXL_FUNC have return type XLstatus
#define DECL_STDXL_FUNC(apiname, apitype, args) \
typedef XLstatus (_XL_EXPORT_API *apitype) args
#else // DO_NOT_DEFINE_EXTERN_DECLARATION
#define DECL_STDXL_FUNC(apiname, apitype, args) \
typedef XLstatus (_XL_EXPORT_API *apitype) args; \
extern apitype apiname
#endif // DO_NOT_DEFINE_EXTERN_DECLARATION
#else // DYNAMIC_XLDRIVER_DLL
// All DECL_STDXL_FUNC have return type XLstatus
#define DECL_STDXL_FUNC(apiname, apitype, args) \
XLstatus _XL_EXPORT_DECL apiname args
#define IMPL_STDXL_FUNC(apiname, args) \
XLstatus _XL_EXPORT_DEF apiname args
#endif // DYNAMIC_XLDRIVER_DLL
// Bus types
#define XL_BUS_TYPE_NONE 0x00000000
#define XL_BUS_TYPE_CAN 0x00000001
#define XL_BUS_TYPE_LIN 0x00000002
#define XL_BUS_TYPE_FLEXRAY 0x00000004
#define XL_BUS_TYPE_AFDX 0x00000008 // former BUS_TYPE_BEAN
#define XL_BUS_TYPE_MOST 0x00000010
#define XL_BUS_TYPE_DAIO 0x00000040 // IO cab/piggy
#define XL_BUS_TYPE_J1708 0x00000100
#define XL_BUS_TYPE_ETHERNET 0x00001000
#define XL_BUS_TYPE_A429 0x00002000
//------------------------------------------------------------------------------
// Transceiver types
//------------------------------------------------------------------------------
// CAN Cab
#define XL_TRANSCEIVER_TYPE_NONE 0x0000
#define XL_TRANSCEIVER_TYPE_CAN_251 0x0001
#define XL_TRANSCEIVER_TYPE_CAN_252 0x0002
#define XL_TRANSCEIVER_TYPE_CAN_DNOPTO 0x0003
#define XL_TRANSCEIVER_TYPE_CAN_SWC_PROTO 0x0005 //!< Prototype. Driver may latch-up.
#define XL_TRANSCEIVER_TYPE_CAN_SWC 0x0006
#define XL_TRANSCEIVER_TYPE_CAN_EVA 0x0007
#define XL_TRANSCEIVER_TYPE_CAN_FIBER 0x0008
#define XL_TRANSCEIVER_TYPE_CAN_1054_OPTO 0x000B //!< 1054 with optical isolation
#define XL_TRANSCEIVER_TYPE_CAN_SWC_OPTO 0x000C //!< SWC with optical isolation
#define XL_TRANSCEIVER_TYPE_CAN_B10011S 0x000D //!< B10011S truck-and-trailer
#define XL_TRANSCEIVER_TYPE_CAN_1050 0x000E //!< 1050
#define XL_TRANSCEIVER_TYPE_CAN_1050_OPTO 0x000F //!< 1050 with optical isolation
#define XL_TRANSCEIVER_TYPE_CAN_1041 0x0010 //!< 1041
#define XL_TRANSCEIVER_TYPE_CAN_1041_OPTO 0x0011 //!< 1041 with optical isolation
#define XL_TRANSCEIVER_TYPE_CAN_VIRTUAL 0x0016 //!< Virtual CAN Trasceiver for Virtual CAN Bus Driver
#define XL_TRANSCEIVER_TYPE_LIN_6258_OPTO 0x0017 //!< Vector LINcab 6258opto with transceiver Infineon TLE6258
#define XL_TRANSCEIVER_TYPE_LIN_6259_OPTO 0x0019 //!< Vector LINcab 6259opto with transceiver Infineon TLE6259
#define XL_TRANSCEIVER_TYPE_DAIO_8444_OPTO 0x001D //!< Vector IOcab 8444 (8 dig.Inp.; 4 dig.Outp.; 4 ana.Inp.; 4 ana.Outp.)
#define XL_TRANSCEIVER_TYPE_CAN_1041A_OPTO 0x0021 //!< 1041A with optical isolation
#define XL_TRANSCEIVER_TYPE_LIN_6259_MAG 0x0023 //!< LIN transceiver 6259, with transceiver Infineon TLE6259, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_LIN_7259_MAG 0x0025 //!< LIN transceiver 7259, with transceiver Infineon TLE7259, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_LIN_7269_MAG 0x0027 //!< LIN transceiver 7269, with transceiver Infineon TLE7269, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_CAN_1054_MAG 0x0033 //!< TJA1054, magnetically isolated, with selectable termination resistor (via 4th IO line)
#define XL_TRANSCEIVER_TYPE_CAN_251_MAG 0x0035 //!< 82C250/251 or equivalent, magnetically isolated
#define XL_TRANSCEIVER_TYPE_CAN_1050_MAG 0x0037 //!< TJA1050, magnetically isolated
#define XL_TRANSCEIVER_TYPE_CAN_1040_MAG 0x0039 //!< TJA1040, magnetically isolated
#define XL_TRANSCEIVER_TYPE_CAN_1041A_MAG 0x003B //!< TJA1041A, magnetically isolated
#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1041A_MAG 0x0080 //!< TWINcab with two TJA1041, magnetically isolated
#define XL_TRANSCEIVER_TYPE_TWIN_LIN_7269_MAG 0x0081 //!< TWINcab with two 7259, Infineon TLE7259, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1041AV2_MAG 0x0082 //!< TWINcab with two TJA1041, magnetically isolated
#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1054_1041A_MAG 0x0083 //!< TWINcab with TJA1054A and TJA1041A with magnetic isolation
// CAN PiggyBack
#define XL_TRANSCEIVER_TYPE_PB_CAN_251 0x0101
#define XL_TRANSCEIVER_TYPE_PB_CAN_1054 0x0103
#define XL_TRANSCEIVER_TYPE_PB_CAN_251_OPTO 0x0105
#define XL_TRANSCEIVER_TYPE_PB_CAN_SWC 0x010B
// 0x010D not supported, 0x010F, 0x0111, 0x0113 reserved for future use!!
#define XL_TRANSCEIVER_TYPE_PB_CAN_1054_OPTO 0x0115
#define XL_TRANSCEIVER_TYPE_PB_CAN_SWC_OPTO 0x0117
#define XL_TRANSCEIVER_TYPE_PB_CAN_TT_OPTO 0x0119
#define XL_TRANSCEIVER_TYPE_PB_CAN_1050 0x011B
#define XL_TRANSCEIVER_TYPE_PB_CAN_1050_OPTO 0x011D
#define XL_TRANSCEIVER_TYPE_PB_CAN_1041 0x011F
#define XL_TRANSCEIVER_TYPE_PB_CAN_1041_OPTO 0x0121
#define XL_TRANSCEIVER_TYPE_PB_LIN_6258_OPTO 0x0129 //!< LIN piggy back with transceiver Infineon TLE6258
#define XL_TRANSCEIVER_TYPE_PB_LIN_6259_OPTO 0x012B //!< LIN piggy back with transceiver Infineon TLE6259
#define XL_TRANSCEIVER_TYPE_PB_LIN_6259_MAG 0x012D //!< LIN piggy back with transceiver Infineon TLE6259, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_PB_CAN_1041A_OPTO 0x012F //!< CAN transceiver 1041A
#define XL_TRANSCEIVER_TYPE_PB_LIN_7259_MAG 0x0131 //!< LIN piggy back with transceiver Infineon TLE7259, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_PB_LIN_7269_MAG 0x0133 //!< LIN piggy back with transceiver Infineon TLE7269, magnetically isolated, stress functionality
#define XL_TRANSCEIVER_TYPE_PB_CAN_251_MAG 0x0135 //!< 82C250/251 or compatible, magnetically isolated
#define XL_TRANSCEIVER_TYPE_PB_CAN_1050_MAG 0x0136 //!< TJA 1050, magnetically isolated
#define XL_TRANSCEIVER_TYPE_PB_CAN_1040_MAG 0x0137 //!< TJA 1040, magnetically isolated
#define XL_TRANSCEIVER_TYPE_PB_CAN_1041A_MAG 0x0138 //!< TJA 1041A, magnetically isolated
#define XL_TRANSCEIVER_TYPE_PB_DAIO_8444_OPTO 0x0139 //!< optically isolated IO piggy
#define XL_TRANSCEIVER_TYPE_PB_CAN_1054_MAG 0x013B //!< TJA1054, magnetically isolated, with selectable termination resistor (via 4th IO line)
#define XL_TRANSCEIVER_TYPE_CAN_1051_CAP_FIX 0x013C //!< TJA1051 - fixed transceiver on e.g. 16xx/8970
#define XL_TRANSCEIVER_TYPE_DAIO_1021_FIX 0x013D //!< Onboard IO of VN1630/VN1640
#define XL_TRANSCEIVER_TYPE_LIN_7269_CAP_FIX 0x013E //!< TLE7269 - fixed transceiver on 1611
#define XL_TRANSCEIVER_TYPE_PB_CAN_1051_CAP 0x013F //!< TJA 1051, capacitive isolated
#define XL_TRANSCEIVER_TYPE_PB_CAN_SWC_7356_CAP 0x0140 //!< Single Wire NCV7356, capacitive isolated
#define XL_TRANSCEIVER_TYPE_PB_CAN_1055_CAP 0x0141 //!< TJA1055, capacitive isolated, with selectable termination resistor (via 4th IO line)
#define XL_TRANSCEIVER_TYPE_PB_CAN_1057_CAP 0x0142 //!< TJA 1057, capacitive isolated
#define XL_TRANSCEIVER_TYPE_A429_HOLT8596_FIX 0x0143 //!< Onboard HOLT 8596 TX transceiver on VN0601
#define XL_TRANSCEIVER_TYPE_A429_HOLT8455_FIX 0x0144 //!< Onboard HOLT 8455 RX transceiver on VN0601
// FlexRay PiggyBacks
#define XL_TRANSCEIVER_TYPE_PB_FR_1080 0x0201 //!< TJA 1080
#define XL_TRANSCEIVER_TYPE_PB_FR_1080_MAG 0x0202 //!< TJA 1080 magnetically isolated piggy
#define XL_TRANSCEIVER_TYPE_PB_FR_1080A_MAG 0x0203 //!< TJA 1080A magnetically isolated piggy
#define XL_TRANSCEIVER_TYPE_PB_FR_1082_CAP 0x0204 //!< TJA 1082 capacitive isolated piggy
#define XL_TRANSCEIVER_TYPE_PB_FRC_1082_CAP 0x0205 //!< TJA 1082 capacitive isolated piggy with CANpiggy form factor
#define XL_TRANSCEIVER_TYPE_FR_1082_CAP_FIX 0x0206 //!< TJA 1082 capacitive isolated piggy fixed transceiver - e.g. 7610
#define XL_TRANSCEIVER_TYPE_MOST150_ONBOARD 0x0220 //!< Onboard MOST150 transceiver of VN2640
// Ethernet Phys
#define XL_TRANSCEIVER_TYPE_ETH_BCM54810_FIX 0x0230 //!< Onboard Broadcom Ethernet PHY on VN5610 and VX0312
#define XL_TRANSCEIVER_TYPE_ETH_AR8031_FIX 0x0231 //!< Onboard Atheros Ethernet PHY
#define XL_TRANSCEIVER_TYPE_ETH_BCM89810_FIX 0x0232 //!< Onboard Broadcom Ethernet PHY
#define XL_TRANSCEIVER_TYPE_ETH_TJA1100_FIX 0x0233 //!< Onboard NXP Ethernet PHY
#define XL_TRANSCEIVER_TYPE_ETH_BCM54810_89811_FIX 0x0234 //!< Onboard Broadcom Ethernet PHYs (e.g. VN5610A - BCM54810: RJ45, BCM89811: DSUB)
// IOpiggy 8642
#define XL_TRANSCEIVER_TYPE_PB_DAIO_8642 0x0280 //!< Iopiggy for VN8900
#define XL_TRANSCEIVER_TYPE_DAIO_AL_ONLY 0x028f //!< virtual piggy type for activation line only (e.g. VN8810ini)
#define XL_TRANSCEIVER_TYPE_DAIO_1021_FIX_WITH_AL 0x0290 //!< On board IO with Activation Line (e.g. VN5640)
#define XL_TRANSCEIVER_TYPE_DAIO_AL_WU 0x0291 //!< virtual piggy type for activation line and WakeUp Line only (e.g. VN5610A)
//------------------------------------------------------------------------------
// Transceiver Operation Modes
//------------------------------------------------------------------------------
#define XL_TRANSCEIVER_LINEMODE_NA ((unsigned int)0x0000)
#define XL_TRANSCEIVER_LINEMODE_TWO_LINE ((unsigned int)0x0001)
#define XL_TRANSCEIVER_LINEMODE_CAN_H ((unsigned int)0x0002)
#define XL_TRANSCEIVER_LINEMODE_CAN_L ((unsigned int)0x0003)
#define XL_TRANSCEIVER_LINEMODE_SWC_SLEEP ((unsigned int)0x0004) //!< SWC Sleep Mode.
#define XL_TRANSCEIVER_LINEMODE_SWC_NORMAL ((unsigned int)0x0005) //!< SWC Normal Mode.
#define XL_TRANSCEIVER_LINEMODE_SWC_FAST ((unsigned int)0x0006) //!< SWC High-Speed Mode.
#define XL_TRANSCEIVER_LINEMODE_SWC_WAKEUP ((unsigned int)0x0007) //!< SWC Wakeup Mode.
#define XL_TRANSCEIVER_LINEMODE_SLEEP ((unsigned int)0x0008)
#define XL_TRANSCEIVER_LINEMODE_NORMAL ((unsigned int)0x0009)
#define XL_TRANSCEIVER_LINEMODE_STDBY ((unsigned int)0x000a) //!< Standby for those who support it
#define XL_TRANSCEIVER_LINEMODE_TT_CAN_H ((unsigned int)0x000b) //!< truck & trailer: operating mode single wire using CAN high
#define XL_TRANSCEIVER_LINEMODE_TT_CAN_L ((unsigned int)0x000c) //!< truck & trailer: operating mode single wire using CAN low
#define XL_TRANSCEIVER_LINEMODE_EVA_00 ((unsigned int)0x000d) //!< CANcab Eva
#define XL_TRANSCEIVER_LINEMODE_EVA_01 ((unsigned int)0x000e) //!< CANcab Eva
#define XL_TRANSCEIVER_LINEMODE_EVA_10 ((unsigned int)0x000f) //!< CANcab Eva
#define XL_TRANSCEIVER_LINEMODE_EVA_11 ((unsigned int)0x0010) //!< CANcab Eva
//------------------------------------------------------------------------------
// Transceiver Status Flags
//------------------------------------------------------------------------------
// (not all used, but for compatibility reasons)
#define XL_TRANSCEIVER_STATUS_PRESENT ((unsigned int)0x0001)
#define XL_TRANSCEIVER_STATUS_POWER_GOOD ((unsigned int)0x0010)
#define XL_TRANSCEIVER_STATUS_EXT_POWER_GOOD ((unsigned int)0x0020)
#define XL_TRANSCEIVER_STATUS_NOT_SUPPORTED ((unsigned int)0x0040)
////////////////////////////////////////////////////////////////////////////////
// driver status
#define XL_SUCCESS 0 //=0x0000
#define XL_PENDING 1 //=0x0001
#define XL_ERR_QUEUE_IS_EMPTY 10 //=0x000A
#define XL_ERR_QUEUE_IS_FULL 11 //=0x000B
#define XL_ERR_TX_NOT_POSSIBLE 12 //=0x000C
#define XL_ERR_NO_LICENSE 14 //=0x000E
#define XL_ERR_WRONG_PARAMETER 101 //=0x0065
#define XL_ERR_TWICE_REGISTER 110 //=0x006E
#define XL_ERR_INVALID_CHAN_INDEX 111 //=0x006F
#define XL_ERR_INVALID_ACCESS 112 //=0x0070
#define XL_ERR_PORT_IS_OFFLINE 113 //=0x0071
#define XL_ERR_CHAN_IS_ONLINE 116 //=0x0074
#define XL_ERR_NOT_IMPLEMENTED 117 //=0x0075
#define XL_ERR_INVALID_PORT 118 //=0x0076
#define XL_ERR_HW_NOT_READY 120 //=0x0078
#define XL_ERR_CMD_TIMEOUT 121 //=0x0079
#define XL_ERR_CMD_HANDLING 122 //=0x007A
#define XL_ERR_HW_NOT_PRESENT 129 //=0x0081
#define XL_ERR_NOTIFY_ALREADY_ACTIVE 131 //=0x0083
#define XL_ERR_INVALID_TAG 132 //=0x0084
#define XL_ERR_INVALID_RESERVED_FLD 133 //=0x0085
#define XL_ERR_INVALID_SIZE 134 //=0x0086
#define XL_ERR_INSUFFICIENT_BUFFER 135 //=0x0087
#define XL_ERR_ERROR_CRC 136 //=0x0088
#define XL_ERR_BAD_EXE_FORMAT 137 //=0x0089
#define XL_ERR_NO_SYSTEM_RESOURCES 138 //=0x008A
#define XL_ERR_NOT_FOUND 139 //=0x008B
#define XL_ERR_INVALID_ADDRESS 140 //=0x008C
#define XL_ERR_REQ_NOT_ACCEP 141 //=0x008D
#define XL_ERR_INVALID_LEVEL 142 //=0x008E
#define XL_ERR_NO_DATA_DETECTED 143 //=0x008F
#define XL_ERR_INTERNAL_ERROR 144 //=0x0090
#define XL_ERR_UNEXP_NET_ERR 145 //=0x0091
#define XL_ERR_INVALID_USER_BUFFER 146 //=0x0092
#define XL_ERR_NO_RESOURCES 152 //=0x0098
#define XL_ERR_WRONG_CHIP_TYPE 153 //=0x0099
#define XL_ERR_WRONG_COMMAND 154 //=0x009A
#define XL_ERR_INVALID_HANDLE 155 //=0x009B
#define XL_ERR_RESERVED_NOT_ZERO 157 //=0x009D
#define XL_ERR_INIT_ACCESS_MISSING 158 //=0x009E
#define XL_ERR_CANNOT_OPEN_DRIVER 201 //=0x00C9
#define XL_ERR_WRONG_BUS_TYPE 202 //=0x00CA
#define XL_ERR_DLL_NOT_FOUND 203 //=0x00CB
#define XL_ERR_INVALID_CHANNEL_MASK 204 //=0x00CC
#define XL_ERR_NOT_SUPPORTED 205 //=0x00CD
// special stream defines
#define XL_ERR_CONNECTION_BROKEN 210 //=0x00D2
#define XL_ERR_CONNECTION_CLOSED 211 //=0x00D3
#define XL_ERR_INVALID_STREAM_NAME 212 //=0x00D4
#define XL_ERR_CONNECTION_FAILED 213 //=0x00D5
#define XL_ERR_STREAM_NOT_FOUND 214 //=0x00D6
#define XL_ERR_STREAM_NOT_CONNECTED 215 //=0x00D7
#define XL_ERR_QUEUE_OVERRUN 216 //=0x00D8
#define XL_ERROR 255 //=0x00FF
#define XL_ERR_INVALID_DLC 0x0201 // DLC with invalid value
#define XL_ERR_INVALID_CANID 0x0202 // CAN Id has invalid bits set
#define XL_ERR_INVALID_FDFLAG_MODE20 0x0203 // flag set that must not be set when configured for CAN20 (e.g. EDL)
#define XL_ERR_EDL_RTR 0x0204 // RTR must not be set in combination with EDL
#define XL_ERR_EDL_NOT_SET 0x0205 // EDL is not set but BRS and/or ESICTRL is
#define XL_ERR_UNKNOWN_FLAG 0x0206 // unknown bit in flags field is set
///////////////////////////////////////////////////////////////////////////////
// Ethernet API error code (range: 0x1100..0x11FF)
#define XL_ERR_ETH_PHY_ACTIVATION_FAILED 0x1100
#define XL_ERR_ETH_MAC_RESET_FAILED 0x1101
#define XL_ERR_ETH_MAC_NOT_READY 0x1102
#define XL_ERR_ETH_PHY_CONFIG_ABORTED 0x1103
#define XL_ERR_ETH_RESET_FAILED 0x1104
#define XL_ERR_ETH_SET_CONFIG_DELAYED 0x1105 //Requested config was stored but could not be immediately activated
#define XL_ERR_ETH_UNSUPPORTED_FEATURE 0x1106 //Requested feature/function not supported by device
#define XL_ERR_ETH_MAC_ACTIVATION_FAILED 0x1107
#define XL_ERR_ETH_FILTER_INVALID 0x1108 //Requested filter setting is invalid
#define XL_ERR_ETH_FILTER_UNAVAILABLE 0x1109 //Filtering is not available (not supported by hardware, in use by other application, ...)
#define XL_ERR_ETH_FILTER_NO_INIT_ACCESS 0x110A //Missing init access for one or more channels referenced by filter
#define XL_ERR_ETH_FILTER_TOO_COMPLEX 0x110B //Specified filter setting is too complex to be fully supported
enum e_XLevent_type {
XL_NO_COMMAND = 0,
XL_RECEIVE_MSG = 1,
XL_CHIP_STATE = 4,
XL_TRANSCEIVER = 6,
XL_TIMER = 8,
XL_TRANSMIT_MSG = 10,
XL_SYNC_PULSE = 11,
XL_APPLICATION_NOTIFICATION = 15,
//for LIN we have special events
XL_LIN_MSG = 20,
XL_LIN_ERRMSG = 21,
XL_LIN_SYNCERR = 22,
XL_LIN_NOANS = 23,
XL_LIN_WAKEUP = 24,
XL_LIN_SLEEP = 25,
XL_LIN_CRCINFO = 26,
// for D/A IO bus
XL_RECEIVE_DAIO_DATA = 32, //!< D/A IO data message
XL_RECEIVE_DAIO_PIGGY = 34, //!< D/A IO Piggy data message
};
//
// common event tags
//
#define XL_RECEIVE_MSG ((unsigned short)0x0001)
#define XL_CHIP_STATE ((unsigned short)0x0004)
#define XL_TRANSCEIVER_INFO ((unsigned short)0x0006)
#define XL_TRANSCEIVER (XL_TRANSCEIVER_INFO)
#define XL_TIMER_EVENT ((unsigned short)0x0008)
#define XL_TIMER (XL_TIMER_EVENT)
#define XL_TRANSMIT_MSG ((unsigned short)0x000A)
#define XL_SYNC_PULSE ((unsigned short)0x000B)
#define XL_APPLICATION_NOTIFICATION ((unsigned short)0x000F)
//
// LIN event tags
//
#define LIN_MSG ((unsigned short)0x0014)
#define LIN_ERRMSG ((unsigned short)0x0015)
#define LIN_SYNCERR ((unsigned short)0x0016)
#define LIN_NOANS ((unsigned short)0x0017)
#define LIN_WAKEUP ((unsigned short)0x0018)
#define LIN_SLEEP ((unsigned short)0x0019)
#define LIN_CRCINFO ((unsigned short)0x001A)
//
// DAIO event tags
//
#define RECEIVE_DAIO_DATA ((unsigned short)0x0020) //!< D/A IO data message
//
// FlexRay event tags
//
#define XL_FR_START_CYCLE ((unsigned short)0x0080)
#define XL_FR_RX_FRAME ((unsigned short)0x0081)
#define XL_FR_TX_FRAME ((unsigned short)0x0082)
#define XL_FR_TXACK_FRAME ((unsigned short)0x0083)
#define XL_FR_INVALID_FRAME ((unsigned short)0x0084)
#define XL_FR_WAKEUP ((unsigned short)0x0085)
#define XL_FR_SYMBOL_WINDOW ((unsigned short)0x0086)
#define XL_FR_ERROR ((unsigned short)0x0087)
#define XL_FR_ERROR_POC_MODE ((unsigned char)0x01)
#define XL_FR_ERROR_SYNC_FRAMES_BELOWMIN ((unsigned char)0x02)
#define XL_FR_ERROR_SYNC_FRAMES_OVERLOAD ((unsigned char)0x03)
#define XL_FR_ERROR_CLOCK_CORR_FAILURE ((unsigned char)0x04)
#define XL_FR_ERROR_NIT_FAILURE ((unsigned char)0x05)
#define XL_FR_ERROR_CC_ERROR ((unsigned char)0x06)
#define XL_FR_STATUS ((unsigned short)0x0088)
#define XL_FR_NM_VECTOR ((unsigned short)0x008A)
#define XL_FR_TRANCEIVER_STATUS ((unsigned short)0x008B)
#define XL_FR_SPY_FRAME ((unsigned short)0x008E)
#define XL_FR_SPY_SYMBOL ((unsigned short)0x008F)
//
// CAPL-On-Board event tags
//
//
// MOST25 event tags
//
#define XL_MOST_START 0x0101
#define XL_MOST_STOP 0x0102
#define XL_MOST_EVENTSOURCES 0x0103
#define XL_MOST_ALLBYPASS 0x0107
#define XL_MOST_TIMINGMODE 0x0108
#define XL_MOST_FREQUENCY 0x0109
#define XL_MOST_REGISTER_BYTES 0x010a
#define XL_MOST_REGISTER_BITS 0x010b
#define XL_MOST_SPECIAL_REGISTER 0x010c
#define XL_MOST_CTRL_RX_SPY 0x010d
#define XL_MOST_CTRL_RX_OS8104 0x010e
#define XL_MOST_CTRL_TX 0x010f
#define XL_MOST_ASYNC_MSG 0x0110
#define XL_MOST_ASYNC_TX 0x0111
#define XL_MOST_SYNC_ALLOCTABLE 0x0112
#define XL_MOST_SYNC_VOLUME_STATUS 0x0116
#define XL_MOST_RXLIGHT 0x0117
#define XL_MOST_TXLIGHT 0x0118
#define XL_MOST_LOCKSTATUS 0x0119
#define XL_MOST_ERROR 0x011a
#define XL_MOST_CTRL_RXBUFFER 0x011c
#define XL_MOST_SYNC_TX_UNDERFLOW 0x011d
#define XL_MOST_SYNC_RX_OVERFLOW 0x011e
#define XL_MOST_CTRL_SYNC_AUDIO 0x011f
#define XL_MOST_SYNC_MUTE_STATUS 0x0120
#define XL_MOST_GENLIGHTERROR 0x0121
#define XL_MOST_GENLOCKERROR 0x0122
#define XL_MOST_TXLIGHT_POWER 0x0123
#define XL_MOST_CTRL_BUSLOAD 0x0126
#define XL_MOST_ASYNC_BUSLOAD 0x0127
#define XL_MOST_CTRL_SYNC_AUDIO_EX 0x012a
#define XL_MOST_TIMINGMODE_SPDIF 0x012b
#define XL_MOST_STREAM_STATE 0x012c
#define XL_MOST_STREAM_BUFFER 0x012d
//
// MOST150 event tags
//
#define XL_START ((unsigned short)0x0200)
#define XL_STOP ((unsigned short)0x0201)
#define XL_MOST150_EVENT_SOURCE ((unsigned short)0x0203)
#define XL_MOST150_DEVICE_MODE ((unsigned short)0x0204)
#define XL_MOST150_SYNC_ALLOC_INFO ((unsigned short)0x0205)
#define XL_MOST150_FREQUENCY ((unsigned short)0x0206)
#define XL_MOST150_SPECIAL_NODE_INFO ((unsigned short)0x0207)
#define XL_MOST150_CTRL_RX ((unsigned short)0x0208)
#define XL_MOST150_CTRL_TX_ACK ((unsigned short)0x0209)
#define XL_MOST150_ASYNC_SPY ((unsigned short)0x020A)
#define XL_MOST150_ASYNC_RX ((unsigned short)0x020B)
#define XL_MOST150_SYNC_VOLUME_STATUS ((unsigned short)0x020D)
#define XL_MOST150_TX_LIGHT ((unsigned short)0x020E)
#define XL_MOST150_RXLIGHT_LOCKSTATUS ((unsigned short)0x020F)
#define XL_MOST150_ERROR ((unsigned short)0x0210)
#define XL_MOST150_CONFIGURE_RX_BUFFER ((unsigned short)0x0211)
#define XL_MOST150_CTRL_SYNC_AUDIO ((unsigned short)0x0212)
#define XL_MOST150_SYNC_MUTE_STATUS ((unsigned short)0x0213)
#define XL_MOST150_LIGHT_POWER ((unsigned short)0x0214)
#define XL_MOST150_GEN_LIGHT_ERROR ((unsigned short)0x0215)
#define XL_MOST150_GEN_LOCK_ERROR ((unsigned short)0x0216)
#define XL_MOST150_CTRL_BUSLOAD ((unsigned short)0x0217)
#define XL_MOST150_ASYNC_BUSLOAD ((unsigned short)0x0218)
#define XL_MOST150_ETHERNET_RX ((unsigned short)0x0219)
#define XL_MOST150_SYSTEMLOCK_FLAG ((unsigned short)0x021A)
#define XL_MOST150_SHUTDOWN_FLAG ((unsigned short)0x021B)
#define XL_MOST150_CTRL_SPY ((unsigned short)0x021C)
#define XL_MOST150_ASYNC_TX_ACK ((unsigned short)0x021D)
#define XL_MOST150_ETHERNET_SPY ((unsigned short)0x021E)
#define XL_MOST150_ETHERNET_TX_ACK ((unsigned short)0x021F)
#define XL_MOST150_SPDIFMODE ((unsigned short)0x0220)
#define XL_MOST150_ECL_LINE_CHANGED ((unsigned short)0x0222)
#define XL_MOST150_ECL_TERMINATION_CHANGED ((unsigned short)0x0223)
#define XL_MOST150_NW_STARTUP ((unsigned short)0x0224)
#define XL_MOST150_NW_SHUTDOWN ((unsigned short)0x0225)
#define XL_MOST150_STREAM_STATE ((unsigned short)0x0226)
#define XL_MOST150_STREAM_TX_BUFFER ((unsigned short)0x0227)
#define XL_MOST150_STREAM_RX_BUFFER ((unsigned short)0x0228)
#define XL_MOST150_STREAM_TX_LABEL ((unsigned short)0x0229)
#define XL_MOST150_STREAM_TX_UNDERFLOW ((unsigned short)0x022B)
#define XL_MOST150_GEN_BYPASS_STRESS ((unsigned short)0x022C)
#define XL_MOST150_ECL_SEQUENCE ((unsigned short)0x022D)
#define XL_MOST150_ECL_GLITCH_FILTER ((unsigned short)0x022E)
#define XL_MOST150_SSO_RESULT ((unsigned short)0x022F)
//
// CAN/CAN-FD event tags
// Rx
#define XL_CAN_EV_TAG_RX_OK ((unsigned short)0x0400)
#define XL_CAN_EV_TAG_RX_ERROR ((unsigned short)0x0401)
#define XL_CAN_EV_TAG_TX_ERROR ((unsigned short)0x0402)
#define XL_CAN_EV_TAG_TX_REQUEST ((unsigned short)0x0403)
#define XL_CAN_EV_TAG_TX_OK ((unsigned short)0x0404)
#define XL_CAN_EV_TAG_CHIP_STATE ((unsigned short)0x0409)
// CAN/CAN-FD event tags
// Tx
#define XL_CAN_EV_TAG_TX_MSG ((unsigned short)0x0440)
//
// Ethernet event tags
//
#define XL_ETH_EVENT_TAG_FRAMERX ((unsigned short)0x0500) //Event data type T_XL_ETH_DATAFRAME_RX
#define XL_ETH_EVENT_TAG_FRAMERX_ERROR ((unsigned short)0x0501) //Event data type T_XL_ETH_DATAFRAME_RX_ERROR
#define XL_ETH_EVENT_TAG_FRAMETX_ERROR ((unsigned short)0x0506) //Event data type T_XL_ETH_DATAFRAME_TX_ERROR
#define XL_ETH_EVENT_TAG_FRAMETX_ERROR_SWITCH ((unsigned short)0x0507) //Event data type T_XL_ETH_DATAFRAME_TX_ERR_SW
#define XL_ETH_EVENT_TAG_FRAMETX_ACK ((unsigned short)0x0510) //Event data type T_XL_ETH_DATAFRAME_TXACK
#define XL_ETH_EVENT_TAG_FRAMETX_ACK_SWITCH ((unsigned short)0x0511) //Event data type T_XL_ETH_DATAFRAME_TXACK_SW
#define XL_ETH_EVENT_TAG_FRAMETX_ACK_OTHER_APP ((unsigned short)0x0513) //Event data type T_XL_ETH_DATAFRAME_TXACK_OTHERAPP
#define XL_ETH_EVENT_TAG_FRAMETX_ERROR_OTHER_APP ((unsigned short)0x0514) //Event data type T_XL_ETH_DATAFRAME_TX_ERR_OTHERAPP
#define XL_ETH_EVENT_TAG_CHANNEL_STATUS ((unsigned short)0x0520) //Event data type T_XL_ETH_CHANNEL_STATUS
#define XL_ETH_EVENT_TAG_CONFIGRESULT ((unsigned short)0x0530) //Event data type T_XL_ETH_CONFIG_RESULT
#define XL_ETH_EVENT_TAG_LOSTEVENT ((unsigned short)0x05fe) //Indication that one or more intended events could not be generated. Event data type T_XL_ETH_LOSTEVENT
#define XL_ETH_EVENT_TAG_ERROR ((unsigned short)0x05ff) //Generic error
//
// ARINC429 event tags
//
#define XL_A429_EV_TAG_TX_OK ((unsigned short)0x0600)
#define XL_A429_EV_TAG_TX_ERR ((unsigned short)0x0601)
#define XL_A429_EV_TAG_RX_OK ((unsigned short)0x0608)
#define XL_A429_EV_TAG_RX_ERR ((unsigned short)0x0609)
#define XL_A429_EV_TAG_BUS_STATISTIC ((unsigned short)0x060F)
typedef unsigned __int64 XLuint64;
#include <pshpack8.h>
// defines for XL_APPLICATION_NOTIFICATION_EV::notifyReason
#define XL_NOTIFY_REASON_CHANNEL_ACTIVATION 1
#define XL_NOTIFY_REASON_CHANNEL_DEACTIVATION 2
#define XL_NOTIFY_REASON_PORT_CLOSED 3
typedef struct s_xl_application_notification {
unsigned int notifyReason; // XL_NOTIFY_REASON_xxx
unsigned int reserved[7];
} XL_APPLICATION_NOTIFICATION_EV;
// defines for XL_SYNC_PULSE_EV::triggerSource and s_xl_sync_pulse::pulseCode
#define XL_SYNC_PULSE_EXTERNAL 0x00
#define XL_SYNC_PULSE_OUR 0x01
#define XL_SYNC_PULSE_OUR_SHARED 0x02
// definition of the sync pulse event for xl interface versions V3 and higher
// (XL_INTERFACE_VERSION_V3, XL_INTERFACE_VERSION_V4, ..)
typedef struct s_xl_sync_pulse_ev {
unsigned int triggerSource; //!< e.g. external or internal trigger source
unsigned int reserved;
XLuint64 time; //!< internally generated timestamp
} XL_SYNC_PULSE_EV;
// definition of the sync pulse event for xl interface versions V1 and V2
// (XL_INTERFACE_VERSION_V1, XL_INTERFACE_VERSION_V2)
#include <pshpack1.h>
struct s_xl_sync_pulse {
unsigned char pulseCode; //!< generated by us
XLuint64 time; //!< 1 ns resolution
};
#include <poppack.h>
#include <poppack.h>
//------------------------------------------------------------------------------
// defines for the supported hardware
#define XL_HWTYPE_NONE 0
#define XL_HWTYPE_VIRTUAL 1
#define XL_HWTYPE_CANCARDX 2
#define XL_HWTYPE_CANAC2PCI 6
#define XL_HWTYPE_CANCARDY 12
#define XL_HWTYPE_CANCARDXL 15
#define XL_HWTYPE_CANCASEXL 21
#define XL_HWTYPE_CANCASEXL_LOG_OBSOLETE 23
#define XL_HWTYPE_CANBOARDXL 25 // CANboardXL, CANboardXL PCIe
#define XL_HWTYPE_CANBOARDXL_PXI 27 // CANboardXL pxi
#define XL_HWTYPE_VN2600 29
#define XL_HWTYPE_VN2610 XL_HWTYPE_VN2600
#define XL_HWTYPE_VN3300 37
#define XL_HWTYPE_VN3600 39
#define XL_HWTYPE_VN7600 41
#define XL_HWTYPE_CANCARDXLE 43
#define XL_HWTYPE_VN8900 45
#define XL_HWTYPE_VN8950 47
#define XL_HWTYPE_VN2640 53
#define XL_HWTYPE_VN1610 55
#define XL_HWTYPE_VN1630 57
#define XL_HWTYPE_VN1640 59
#define XL_HWTYPE_VN8970 61
#define XL_HWTYPE_VN1611 63
#define XL_HWTYPE_VN5610 65
#define XL_HWTYPE_VN7570 67
#define XL_HWTYPE_IPCLIENT 69
#define XL_HWTYPE_IPSERVER 71
#define XL_HWTYPE_VX1121 73
#define XL_HWTYPE_VX1131 75
#define XL_HWTYPE_VT6204 77
#define XL_HWTYPE_VN1630_LOG 79
#define XL_HWTYPE_VN7610 81
#define XL_HWTYPE_VN7572 83
#define XL_HWTYPE_VN8972 85
#define XL_HWTYPE_VN0601 87
#define XL_HWTYPE_VX0312 91
#define XL_HWTYPE_VN8800 95
#define XL_HWTYPE_IPCL8800 96
#define XL_HWTYPE_IPSRV8800 97
#define XL_HWTYPE_CSMCAN 98
#define XL_HWTYPE_VN5610A 101
#define XL_HWTYPE_VN7640 102
#define XL_MAX_HWTYPE 102
#include <pshpack1.h>
////////////////////////////////////////////////////////////////////////////////
typedef char *XLstringType;
////////////////////////////////////////////////////////////////////////////////
// accessmask
typedef XLuint64 XLaccess;
////////////////////////////////////////////////////////////////////////////////
// handle for xlSetNotification
typedef HANDLE XLhandle;
////////////////////////////////////////////////////////////////////////////////
// LIN lib
//------------------------------------------------------------------------------
// defines for LIN
//------------------------------------------------------------------------------
// defines for xlLinSetChannelParams
#define XL_LIN_MASTER (unsigned int) 01 //!< channel is a LIN master
#define XL_LIN_SLAVE (unsigned int) 02 //!< channel is a LIN slave
#define XL_LIN_VERSION_1_3 (unsigned int) 0x01 //!< LIN version 1.3
#define XL_LIN_VERSION_2_0 (unsigned int) 0x02 //!< LIN version 2.0
#define XL_LIN_VERSION_2_1 (unsigned int) 0x03 //!< LIN version 2.1
// defines for xlLinSetSlave
#define XL_LIN_CALC_CHECKSUM (unsigned short) 0x100 //!< flag for automatic 'classic' checksum calculation
#define XL_LIN_CALC_CHECKSUM_ENHANCED (unsigned short) 0x200 //!< flag for automatic 'enhanced' checksum calculation
// defines for xlLinSetSleepMode
#define XL_LIN_SET_SILENT (unsigned int) 0x01 //!< set hardware into sleep mode
#define XL_LIN_SET_WAKEUPID (unsigned int) 0x03 //!< set hardware into sleep mode and send a request at wake-up
// defines for xlLinSetChecksum. For LIN >= 2.0 there can be used two different Checksum models.
#define XL_LIN_CHECKSUM_CLASSIC (unsigned char) 0x00 //!< Use classic CRC
#define XL_LIN_CHECKSUM_ENHANCED (unsigned char) 0x01 //!< Use enhanced CRC
#define XL_LIN_CHECKSUM_UNDEFINED (unsigned char) 0xff //!< Set the checksum calculation to undefined.
// defines for the sleep mode event: XL_LIN_SLEEP
#define XL_LIN_STAYALIVE (unsigned char) 0x00 //!< flag if nothing changes
#define XL_LIN_SET_SLEEPMODE (unsigned char) 0x01 //!< flag if the hardware is set into the sleep mode
#define XL_LIN_COMESFROM_SLEEPMODE (unsigned char) 0x02 //!< flag if the hardware comes from the sleep mode
// defines for the wake up event: XL_LIN_WAKEUP
#define XL_LIN_WAKUP_INTERNAL (unsigned char) 0x01 //!< flag to signal a internal WAKEUP (event)
// defines for xlLINSetDLC
#define XL_LIN_UNDEFINED_DLC (unsigned char) 0xff //!< set the DLC to undefined
// defines for xlLinSwitchSlave
#define XL_LIN_SLAVE_ON (unsigned char) 0xff //!< switch on the LIN slave
#define XL_LIN_SLAVE_OFF (unsigned char) 0x00 //!< switch off the LIN slave
//------------------------------------------------------------------------------
// structures for LIN
//------------------------------------------------------------------------------
typedef struct {
unsigned int LINMode; //!< XL_LIN_SLAVE | XL_LIN_MASTER
int baudrate; //!< the baudrate will be calculated within the API. Here: e.g. 9600, 19200
unsigned int LINVersion; //!< define for the LIN version (actual V1.3 of V2.0)
unsigned int reserved; //!< for future use
} XLlinStatPar;
////////////////////////////////////////////////////////////////////////////////
// Defines
//------------------------------------------------------------------------------
// message flags
#ifndef MAX_MSG_LEN
#define MAX_MSG_LEN 8
#endif
// interface version for our events
#define XL_INTERFACE_VERSION_V2 2
#define XL_INTERFACE_VERSION_V3 3
#define XL_INTERFACE_VERSION_V4 4
//current version
#define XL_INTERFACE_VERSION XL_INTERFACE_VERSION_V3
#define XL_CAN_EXT_MSG_ID 0x80000000
#define XL_CAN_MSG_FLAG_ERROR_FRAME 0x01
#define XL_CAN_MSG_FLAG_OVERRUN 0x02 //!< Overrun in Driver or CAN Controller,
//!< previous msgs have been lost.
#define XL_CAN_MSG_FLAG_NERR 0x04 //!< Line Error on Lowspeed
#define XL_CAN_MSG_FLAG_WAKEUP 0x08 //!< High Voltage Message on Single Wire CAN
#define XL_CAN_MSG_FLAG_REMOTE_FRAME 0x10
#define XL_CAN_MSG_FLAG_RESERVED_1 0x20
#define XL_CAN_MSG_FLAG_TX_COMPLETED 0x40 //!< Message Transmitted
#define XL_CAN_MSG_FLAG_TX_REQUEST 0x80 //!< Transmit Message stored into Controller
#define XL_CAN_MSG_FLAG_SRR_BIT_DOM 0x0200 //!< SRR bit in CAN message is dominant
#define XL_EVENT_FLAG_OVERRUN 0x01 //!< Used in XLevent.flags
// LIN flags
#define XL_LIN_MSGFLAG_TX XL_CAN_MSG_FLAG_TX_COMPLETED //!< LIN TX flag
#define XL_LIN_MSGFLAG_CRCERROR 0x81 //!< Wrong LIN CRC
//------------------------------------------------------------------------------
// structure for XL_RECEIVE_MSG, XL_TRANSMIT_MSG
struct s_xl_can_msg { /* 32 Bytes */
unsigned long id;
unsigned short flags;
unsigned short dlc;
XLuint64 res1;
unsigned char data [MAX_MSG_LEN];
XLuint64 res2;
};
//------------------------------------------------------------------------------
// structure for XL_TRANSMIT_DAIO_DATA
// flags masks
#define XL_DAIO_DATA_GET 0x8000
#define XL_DAIO_DATA_VALUE_DIGITAL 0x0001
#define XL_DAIO_DATA_VALUE_ANALOG 0x0002
#define XL_DAIO_DATA_PWM 0x0010
// optional function flags
#define XL_DAIO_MODE_PULSE 0x0020 // generates pulse in values of PWM
struct s_xl_daio_data { /* 32 Bytes */
unsigned short flags; // 2
unsigned int timestamp_correction; // 4
unsigned char mask_digital; // 1
unsigned char value_digital; // 1
unsigned char mask_analog; // 1
unsigned char reserved0; // 1
unsigned short value_analog[4]; // 8
unsigned int pwm_frequency; // 4
unsigned short pwm_value; // 2
unsigned int reserved1; // 4
unsigned int reserved2; // 4
};
typedef struct s_xl_io_digital_data {
unsigned int digitalInputData;
} XL_IO_DIGITAL_DATA;
typedef struct s_xl_io_analog_data {
unsigned int measuredAnalogData0;
unsigned int measuredAnalogData1;
unsigned int measuredAnalogData2;
unsigned int measuredAnalogData3;
} XL_IO_ANALOG_DATA;
struct s_xl_daio_piggy_data { /* xx Bytes */
unsigned int daioEvtTag;
unsigned int triggerType;
union {
XL_IO_DIGITAL_DATA digital;
XL_IO_ANALOG_DATA analog;
} data;
};
//------------------------------------------------------------------------------
// structure for XL_CHIP_STATE
#define XL_CHIPSTAT_BUSOFF 0x01
#define XL_CHIPSTAT_ERROR_PASSIVE 0x02
#define XL_CHIPSTAT_ERROR_WARNING 0x04
#define XL_CHIPSTAT_ERROR_ACTIVE 0x08
struct s_xl_chip_state {
unsigned char busStatus;
unsigned char txErrorCounter;
unsigned char rxErrorCounter;
};
//------------------------------------------------------------------------------
// structure and defines for XL_TRANSCEIVER
#define XL_TRANSCEIVER_EVENT_NONE 0
#define XL_TRANSCEIVER_EVENT_INSERTED 1 //!< cable was inserted
#define XL_TRANSCEIVER_EVENT_REMOVED 2 //!< cable was removed
#define XL_TRANSCEIVER_EVENT_STATE_CHANGE 3 //!< transceiver state changed
struct s_xl_transceiver {
unsigned char event_reason; //!< reason for what was event sent
unsigned char is_present; //!< allways valid transceiver presence flag
};
//------------------------------------------------------------------------------
// defines for SET_OUTPUT_MODE
#define XL_OUTPUT_MODE_SILENT 0 //!< switch CAN trx into default silent mode
#define XL_OUTPUT_MODE_NORMAL 1 //!< switch CAN trx into normal mode
#define XL_OUTPUT_MODE_TX_OFF 2 //!< switch CAN trx into silent mode with tx pin off
#define XL_OUTPUT_MODE_SJA_1000_SILENT 3 //!< switch CAN trx into SJA1000 silent mode
//------------------------------------------------------------------------------
// Transceiver modes
#define XL_TRANSCEIVER_EVENT_ERROR 1
#define XL_TRANSCEIVER_EVENT_CHANGED 2
////////////////////////////////////////////////////////////////////////////////
// LIN lib
//------------------------------------------------------------------------------
// LIN event structures
struct s_xl_lin_msg {
unsigned char id;
unsigned char dlc;
unsigned short flags;
unsigned char data[8];
unsigned char crc;
};
struct s_xl_lin_sleep {
unsigned char flag;
};
struct s_xl_lin_no_ans {
unsigned char id;
};
struct s_xl_lin_wake_up {
unsigned char flag;
unsigned char unused[3];
unsigned int startOffs; // spec >= 2.0 only, else 0
unsigned int width; // spec >= 2.0 only, else 0
};
struct s_xl_lin_crc_info {
unsigned char id;
unsigned char flags;
};
//------------------------------------------------------------------------------
// LIN messages structure
union s_xl_lin_msg_api {
struct s_xl_lin_msg linMsg;
struct s_xl_lin_no_ans linNoAns;
struct s_xl_lin_wake_up linWakeUp;
struct s_xl_lin_sleep linSleep;
struct s_xl_lin_crc_info linCRCinfo;
};
//------------------------------------------------------------------------------
// BASIC bus message structure
union s_xl_tag_data {
struct s_xl_can_msg msg;
struct s_xl_chip_state chipState;
union s_xl_lin_msg_api linMsgApi;
struct s_xl_sync_pulse syncPulse;
struct s_xl_daio_data daioData;
struct s_xl_transceiver transceiver;
struct s_xl_daio_piggy_data daioPiggyData;
};
typedef unsigned char XLeventTag;
//------------------------------------------------------------------------------
// XL_EVENT structures
// event type definition
struct s_xl_event {
XLeventTag tag; // 1
unsigned char chanIndex; // 1
unsigned short transId; // 2
unsigned short portHandle; // 2 internal use only !!!!
unsigned char flags; // 1 (e.g. XL_EVENT_FLAG_OVERRUN)
unsigned char reserved; // 1
XLuint64 timeStamp; // 8
union s_xl_tag_data tagData; // 32 Bytes
};
// --------
// 48 Bytes
typedef struct s_xl_event XLevent;
// message name to acquire a unique message id from windows
#define DriverNotifyMessageName "VectorCanDriverChangeNotifyMessage"
//------------------------------------------------------------------------------
// build a channels mask from the channels index
#define XL_CHANNEL_MASK(x) (1I64<<(x))
#define XL_MAX_APPNAME 32
//------------------------------------------------------------------------------
// driver status
typedef short XLstatus;
//defines for xlGetDriverConfig structures
#define XL_MAX_LENGTH 31
#define XL_CONFIG_MAX_CHANNELS 64
//activate - channel flags
#define XL_ACTIVATE_NONE 0
#define XL_ACTIVATE_RESET_CLOCK 8
#define XL_BUS_COMPATIBLE_CAN XL_BUS_TYPE_CAN
#define XL_BUS_COMPATIBLE_LIN XL_BUS_TYPE_LIN
#define XL_BUS_COMPATIBLE_FLEXRAY XL_BUS_TYPE_FLEXRAY
#define XL_BUS_COMPATIBLE_MOST XL_BUS_TYPE_MOST
#define XL_BUS_COMPATIBLE_DAIO XL_BUS_TYPE_DAIO //io cab/piggy
#define XL_BUS_COMPATIBLE_J1708 XL_BUS_TYPE_J1708
#define XL_BUS_COMPATIBLE_ETHERNET XL_BUS_TYPE_ETHERNET
#define XL_BUS_COMPATIBLE_A429 XL_BUS_TYPE_A429
// the following bus types can be used with the current cab / piggy
#define XL_BUS_ACTIVE_CAP_CAN (XL_BUS_COMPATIBLE_CAN<<16)
#define XL_BUS_ACTIVE_CAP_LIN (XL_BUS_COMPATIBLE_LIN<<16)
#define XL_BUS_ACTIVE_CAP_FLEXRAY (XL_BUS_COMPATIBLE_FLEXRAY<<16)
#define XL_BUS_ACTIVE_CAP_MOST (XL_BUS_COMPATIBLE_MOST<<16)
#define XL_BUS_ACTIVE_CAP_DAIO (XL_BUS_COMPATIBLE_DAIO<<16)
#define XL_BUS_ACTIVE_CAP_J1708 (XL_BUS_COMPATIBLE_J1708<<16)
#define XL_BUS_ACTIVE_CAP_ETHERNET (XL_BUS_COMPATIBLE_ETHERNET<<16)
#define XL_BUS_ACTIVE_CAP_A429 (XL_BUS_COMPATIBLE_A429<<16)
#define XL_BUS_NAME_NONE ""
#define XL_BUS_NAME_CAN "CAN"
#define XL_BUS_NAME_LIN "LIN"
#define XL_BUS_NAME_FLEXRAY "FlexRay"
#define XL_BUS_NAME_STREAM "Stream"
#define XL_BUS_NAME_MOST "MOST"
#define XL_BUS_NAME_DAIO "DAIO"
#define XL_BUS_NAME_HWSYNC_KEYPAD "HWSYNC_KEYPAD"
#define XL_BUS_NAME_J1708 "J1708"
#define XL_BUS_NAME_KLINE "K-Line"
#define XL_BUS_NAME_ETHERNET "Ethernet"
#define XL_BUS_NAME_AFDX "AFDX"
#define XL_BUS_NAME_A429 "ARINC429"
//------------------------------------------------------------------------------
// acceptance filter
#define XL_CAN_STD 01 //!< flag for standard ID's
#define XL_CAN_EXT 02 //!< flag for extended ID's
//------------------------------------------------------------------------------
// bit timing
typedef struct {
unsigned int arbitrationBitRate;
unsigned int sjwAbr; // CAN bus timing for nominal / arbitration bit rate
unsigned int tseg1Abr;
unsigned int tseg2Abr;
unsigned int dataBitRate;
unsigned int sjwDbr; // CAN bus timing for data bit rate
unsigned int tseg1Dbr;
unsigned int tseg2Dbr;
unsigned int reserved[2]; // has to be zero
} XLcanFdConf;
typedef struct {
unsigned long bitRate;
unsigned char sjw;
unsigned char tseg1;
unsigned char tseg2;
unsigned char sam; // 1 or 3
} XLchipParams;
// defines for XLbusParams::data::most::activeSpeedGrade and compatibleSpeedGrade
#define XL_BUS_PARAMS_MOST_SPEED_GRADE_25 0x01
#define XL_BUS_PARAMS_MOST_SPEED_GRADE_150 0x02
//defines for XLbusParams::data::can/canFD::canOpMode
#define XL_BUS_PARAMS_CANOPMODE_CAN20 0x01 //channel operates in CAN20
#define XL_BUS_PARAMS_CANOPMODE_CANFD 0x02 //channel operates in CANFD
typedef struct {
unsigned int busType;
union {
struct {
unsigned int bitRate;
unsigned char sjw;
unsigned char tseg1;
unsigned char tseg2;
unsigned char sam; // 1 or 3
unsigned char outputMode;
unsigned char reserved[7];
unsigned char canOpMode;
} can;
struct {
unsigned int arbitrationBitRate; // CAN bus timing for nominal / arbitration bit rate
unsigned char sjwAbr;
unsigned char tseg1Abr;
unsigned char tseg2Abr;
unsigned char samAbr; // 1 or 3
unsigned char outputMode;
unsigned char sjwDbr; // CAN bus timing for data bit rate
unsigned char tseg1Dbr;
unsigned char tseg2Dbr;
unsigned int dataBitRate;
unsigned char canOpMode;
} canFD;
struct {
unsigned int activeSpeedGrade;
unsigned int compatibleSpeedGrade;