source: pacpussensors/trunk/CanGateway/driver/vxlapi.h@ 134

Last change on this file since 134 was 1, checked in by DHERBOMEZ Gérald, 11 years ago

ajout des capteurs CanGateway et Alasca

File size: 231.9 KB
RevLine 
[1]1/*----------------------------------------------------------------------------
2| File:
3| vxlapi.h
4| Project:
5| Multi Bus driver for Win98/WinNT/Win2000/WinXP
6|
7| Description:
8| Driver Interface Prototypes - customer version
9|
10|-----------------------------------------------------------------------------
11| $Author: vissj $ $Date: 2011-12-15 12:20:48 +0100 (Do, 15 Dez 2011) $ $Revision: 14101 $
12| $Id: vxlapi.h 14101 2011-12-15 11:20:48Z vissj $
13|-----------------------------------------------------------------------------
14| Copyright (c) 2010 by Vector Informatik GmbH. All rights reserved.
15 ----------------------------------------------------------------------------*/
16
17
18#ifndef _V_XLAPI_H_
19#define _V_XLAPI_H_
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25
26#define _XL_EXPORT_API __stdcall
27#define _EXPORT_API __stdcall
28 #if defined (DYNAMIC_CANDRIVER_DLL) || defined (DYNAMIC_XLDRIVER_DLL)
29 #define _XL_EXPORT_DECL _XL_EXPORT_API
30 #define _XL_EXPORT_DEF _XL_EXPORT_API
31 #else
32 // not used for dynamic load of dll
33 #define _XL_EXPORT_DECL __declspec(dllimport) _XL_EXPORT_API
34 #define _XL_EXPORT_DEF __declspec(dllimport) _XL_EXPORT_API
35 #endif
36
37
38
39// Functions have the following parameters
40#define DEFPARAMS XLportHandle portHandle, XLaccess accessMask, XLuserHandle userHandle
41// Almost all xlFr... Functions have the following parameters
42#define DEFFRPARAM XLportHandle portHandle, XLaccess accessMask
43
44// Marcos for interface definition and implementation
45#ifdef DYNAMIC_XLDRIVER_DLL
46
47 #ifdef DO_NOT_DEFINE_EXTERN_DECLARATION
48
49 // All DECL_STDXL_FUNC have return type XLstatus
50 #define DECL_STDXL_FUNC(apiname, apitype, args) \
51 typedef XLstatus (_XL_EXPORT_API *apitype) args
52
53 #else // DO_NOT_DEFINE_EXTERN_DECLARATION
54
55 #define DECL_STDXL_FUNC(apiname, apitype, args) \
56 typedef XLstatus (_XL_EXPORT_API *apitype) args; \
57 extern apitype apiname
58
59 #endif // DO_NOT_DEFINE_EXTERN_DECLARATION
60
61#else // DYNAMIC_XLDRIVER_DLL
62
63 // All DECL_STDXL_FUNC have return type XLstatus
64 #define DECL_STDXL_FUNC(apiname, apitype, args) \
65 XLstatus _XL_EXPORT_DECL apiname args
66 #define IMPL_STDXL_FUNC(apiname, args) \
67 XLstatus _XL_EXPORT_DEF apiname args
68
69#endif // DYNAMIC_XLDRIVER_DLL
70
71// the pshpack1.h which is shipped with BCB 6 has
72// some problem with one byte alignment. So we use the pragma
73#if (__BORLANDC__ >= 0x0560)
74#pragma pack(push,1)
75#else
76#include <pshpack1.h>
77#endif
78
79
80//------------------------------------------------------------------------------
81// Transceiver types
82//------------------------------------------------------------------------------
83// CAN Cab
84#define XL_TRANSCEIVER_TYPE_NONE 0x0000
85#define XL_TRANSCEIVER_TYPE_CAN_251 0x0001
86#define XL_TRANSCEIVER_TYPE_CAN_252 0x0002
87#define XL_TRANSCEIVER_TYPE_CAN_DNOPTO 0x0003
88#define XL_TRANSCEIVER_TYPE_CAN_SWC_PROTO 0x0005 //!< Prototype. Driver may latch-up.
89#define XL_TRANSCEIVER_TYPE_CAN_SWC 0x0006
90#define XL_TRANSCEIVER_TYPE_CAN_EVA 0x0007
91#define XL_TRANSCEIVER_TYPE_CAN_FIBER 0x0008
92#define XL_TRANSCEIVER_TYPE_CAN_1054_OPTO 0x000B //!< 1054 with optical isolation
93#define XL_TRANSCEIVER_TYPE_CAN_SWC_OPTO 0x000C //!< SWC with optical isolation
94#define XL_TRANSCEIVER_TYPE_CAN_B10011S 0x000D //!< B10011S truck-and-trailer
95#define XL_TRANSCEIVER_TYPE_CAN_1050 0x000E //!< 1050
96#define XL_TRANSCEIVER_TYPE_CAN_1050_OPTO 0x000F //!< 1050 with optical isolation
97#define XL_TRANSCEIVER_TYPE_CAN_1041 0x0010 //!< 1041
98#define XL_TRANSCEIVER_TYPE_CAN_1041_OPTO 0x0011 //!< 1041 with optical isolation
99#define XL_TRANSCEIVER_TYPE_LIN_6258_OPTO 0x0017 //!< Vector LINcab 6258opto with transceiver Infineon TLE6258
100#define XL_TRANSCEIVER_TYPE_LIN_6259_OPTO 0x0019 //!< Vector LINcab 6259opto with transceiver Infineon TLE6259
101#define XL_TRANSCEIVER_TYPE_DAIO_8444_OPTO 0x001D //!< Vector IOcab 8444 (8 dig.Inp.; 4 dig.Outp.; 4 ana.Inp.; 4 ana.Outp.)
102#define XL_TRANSCEIVER_TYPE_CAN_1041A_OPTO 0x0021 //!< 1041A with optical isolation
103#define XL_TRANSCEIVER_TYPE_LIN_6259_MAG 0x0023 //!< LIN transceiver 6259, with transceiver Infineon TLE6259, magnetically isolated, stress functionality
104#define XL_TRANSCEIVER_TYPE_LIN_7259_MAG 0x0025 //!< LIN transceiver 7259, with transceiver Infineon TLE7259, magnetically isolated, stress functionality
105#define XL_TRANSCEIVER_TYPE_LIN_7269_MAG 0x0027 //!< LIN transceiver 7269, with transceiver Infineon TLE7269, magnetically isolated, stress functionality
106#define XL_TRANSCEIVER_TYPE_CAN_1054_MAG 0x0033 //!< TJA1054, magnetically isolated, with selectable termination resistor (via 4th IO line)
107#define XL_TRANSCEIVER_TYPE_CAN_251_MAG 0x0035 //!< 82C250/251 or equivalent, magnetically isolated
108#define XL_TRANSCEIVER_TYPE_CAN_1050_MAG 0x0037 //!< TJA1050, magnetically isolated
109#define XL_TRANSCEIVER_TYPE_CAN_1040_MAG 0x0039 //!< TJA1040, magnetically isolated
110#define XL_TRANSCEIVER_TYPE_CAN_1041A_MAG 0x003B //!< TJA1041A, magnetically isolated
111#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1041A_MAG 0x0080 //!< TWINcab with two TJA1041, magnetically isolated
112#define XL_TRANSCEIVER_TYPE_TWIN_LIN_7269_MAG 0x0081 //!< TWINcab with two 7259, Infineon TLE7259, magnetically isolated, stress functionality
113#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1041AV2_MAG 0x0082 //!< TWINcab with two TJA1041, magnetically isolated
114#define XL_TRANSCEIVER_TYPE_TWIN_CAN_1054_1041A_MAG 0x0083 //!< TWINcab with TJA1054A and TJA1041A with magnetic isolation
115
116// CAN PiggyBack
117#define XL_TRANSCEIVER_TYPE_PB_CAN_251 0x0101
118#define XL_TRANSCEIVER_TYPE_PB_CAN_1054 0x0103
119#define XL_TRANSCEIVER_TYPE_PB_CAN_251_OPTO 0x0105
120#define XL_TRANSCEIVER_TYPE_PB_CAN_SWC 0x010B
121// 0x010D not supported, 0x010F, 0x0111, 0x0113 reserved for future use!!
122#define XL_TRANSCEIVER_TYPE_PB_CAN_1054_OPTO 0x0115
123#define XL_TRANSCEIVER_TYPE_PB_CAN_SWC_OPTO 0x0117
124#define XL_TRANSCEIVER_TYPE_PB_CAN_TT_OPTO 0x0119
125#define XL_TRANSCEIVER_TYPE_PB_CAN_1050 0x011B
126#define XL_TRANSCEIVER_TYPE_PB_CAN_1050_OPTO 0x011D
127#define XL_TRANSCEIVER_TYPE_PB_CAN_1041 0x011F
128#define XL_TRANSCEIVER_TYPE_PB_CAN_1041_OPTO 0x0121
129#define XL_TRANSCEIVER_TYPE_PB_LIN_6258_OPTO 0x0129 //!< LIN piggy back with transceiver Infineon TLE6258
130#define XL_TRANSCEIVER_TYPE_PB_LIN_6259_OPTO 0x012B //!< LIN piggy back with transceiver Infineon TLE6259
131#define XL_TRANSCEIVER_TYPE_PB_LIN_6259_MAG 0x012D //!< LIN piggy back with transceiver Infineon TLE6259, magnetically isolated, stress functionality
132#define XL_TRANSCEIVER_TYPE_PB_CAN_1041A_OPTO 0x012F //!< CAN transceiver 1041A
133#define XL_TRANSCEIVER_TYPE_PB_LIN_7259_MAG 0x0131 //!< LIN piggy back with transceiver Infineon TLE7259, magnetically isolated, stress functionality
134#define XL_TRANSCEIVER_TYPE_PB_LIN_7269_MAG 0x0133 //!< LIN piggy back with transceiver Infineon TLE7269, magnetically isolated, stress functionality
135#define XL_TRANSCEIVER_TYPE_PB_CAN_251_MAG 0x0135 //!< 82C250/251 or compatible, magnetically isolated
136#define XL_TRANSCEIVER_TYPE_PB_CAN_1050_MAG 0x0136 //!< TJA 1050, magnetically isolated
137#define XL_TRANSCEIVER_TYPE_PB_CAN_1040_MAG 0x0137 //!< TJA 1040, magnetically isolated
138#define XL_TRANSCEIVER_TYPE_PB_CAN_1041A_MAG 0x0138 //!< TJA 1041A, magnetically isolated
139#define XL_TRANSCEIVER_TYPE_PB_DAIO_8444_OPTO 0x0139 //!< optically isolated IO piggy
140#define XL_TRANSCEIVER_TYPE_PB_CAN_1054_MAG 0x013B //!< TJA1054, magnetically isolated, with selectable termination resistor (via 4th IO line)
141#define XL_TRANSCEIVER_TYPE_PB_CAN_1051_CAP_FIX 0x013C //!< TJA1051 - fixed transceiver on e.g. 16xx/8970
142#define XL_TRANSCEIVER_TYPE_DAIO_1021_FIX 0x013D //!< Onboard IO of VN1630/VN1640
143#define XL_TRANSCEIVER_TYPE_LIN_7269_CAP_FIX 0x013E //!< TLE7269 - fixed transceiver on 1611
144
145
146// FlexRay PiggyBacks
147#define XL_TRANSCEIVER_TYPE_PB_FR_1080 0x0201 //!< TJA 1080
148#define XL_TRANSCEIVER_TYPE_PB_FR_1080_MAG 0x0202 //!< TJA 1080 magnetically isolated piggy
149#define XL_TRANSCEIVER_TYPE_PB_FR_1080A_MAG 0x0203 //!< TJA 1080A magnetically isolated piggy
150#define XL_TRANSCEIVER_TYPE_PB_FR_1082_CAP 0x0204 //!< TJA 1082 capacitive isolated piggy
151
152#define XL_TRANSCEIVER_TYPE_MOST150_ONBOARD 0x0220 //!< Onboard MOST150 transceiver of VN2640
153
154// IOpiggy 8642
155#define XL_TRANSCEIVER_TYPE_PB_DAIO_8642 0x0280 //!< Iopiggy for VN8900
156
157//------------------------------------------------------------------------------
158// Transceiver Operation Modes
159//------------------------------------------------------------------------------
160#define XL_TRANSCEIVER_LINEMODE_NA ((unsigned int)0x0000)
161#define XL_TRANSCEIVER_LINEMODE_TWO_LINE ((unsigned int)0x0001)
162#define XL_TRANSCEIVER_LINEMODE_CAN_H ((unsigned int)0x0002)
163#define XL_TRANSCEIVER_LINEMODE_CAN_L ((unsigned int)0x0003)
164#define XL_TRANSCEIVER_LINEMODE_SWC_SLEEP ((unsigned int)0x0004) //!< SWC Sleep Mode.
165#define XL_TRANSCEIVER_LINEMODE_SWC_NORMAL ((unsigned int)0x0005) //!< SWC Normal Mode.
166#define XL_TRANSCEIVER_LINEMODE_SWC_FAST ((unsigned int)0x0006) //!< SWC High-Speed Mode.
167#define XL_TRANSCEIVER_LINEMODE_SWC_WAKEUP ((unsigned int)0x0007) //!< SWC Wakeup Mode.
168#define XL_TRANSCEIVER_LINEMODE_SLEEP ((unsigned int)0x0008)
169#define XL_TRANSCEIVER_LINEMODE_NORMAL ((unsigned int)0x0009)
170#define XL_TRANSCEIVER_LINEMODE_STDBY ((unsigned int)0x000a) //!< Standby for those who support it
171#define XL_TRANSCEIVER_LINEMODE_TT_CAN_H ((unsigned int)0x000b) //!< truck & trailer: operating mode single wire using CAN high
172#define XL_TRANSCEIVER_LINEMODE_TT_CAN_L ((unsigned int)0x000c) //!< truck & trailer: operating mode single wire using CAN low
173#define XL_TRANSCEIVER_LINEMODE_EVA_00 ((unsigned int)0x000d) //!< CANcab Eva
174#define XL_TRANSCEIVER_LINEMODE_EVA_01 ((unsigned int)0x000e) //!< CANcab Eva
175#define XL_TRANSCEIVER_LINEMODE_EVA_10 ((unsigned int)0x000f) //!< CANcab Eva
176#define XL_TRANSCEIVER_LINEMODE_EVA_11 ((unsigned int)0x0010) //!< CANcab Eva
177
178//------------------------------------------------------------------------------
179// Transceiver Status Flags
180//------------------------------------------------------------------------------
181// (not all used, but for compatibility reasons)
182#define XL_TRANSCEIVER_STATUS_PRESENT ((unsigned int)0x0001)
183#define XL_TRANSCEIVER_STATUS_POWER ((unsigned int)0x0002)
184#define XL_TRANSCEIVER_STATUS_MEMBLANK ((unsigned int)0x0004)
185#define XL_TRANSCEIVER_STATUS_MEMCORRUPT ((unsigned int)0x0008)
186#define XL_TRANSCEIVER_STATUS_POWER_GOOD ((unsigned int)0x0010)
187#define XL_TRANSCEIVER_STATUS_EXT_POWER_GOOD ((unsigned int)0x0020)
188#define XL_TRANSCEIVER_STATUS_NOT_SUPPORTED ((unsigned int)0x0040)
189
190
191////////////////////////////////////////////////////////////////////////////////
192// driver status
193#define XL_SUCCESS 0 //=0x0000
194#define XL_PENDING 1 //=0x0001
195
196#define XL_ERR_QUEUE_IS_EMPTY 10 //=0x000A
197#define XL_ERR_QUEUE_IS_FULL 11 //=0x000B
198#define XL_ERR_TX_NOT_POSSIBLE 12 //=0x000C
199#define XL_ERR_NO_LICENSE 14 //=0x000E
200#define XL_ERR_WRONG_PARAMETER 101 //=0x0065
201#define XL_ERR_TWICE_REGISTER 110 //=0x006E
202#define XL_ERR_INVALID_CHAN_INDEX 111 //=0x006F
203#define XL_ERR_INVALID_ACCESS 112 //=0x0070
204#define XL_ERR_PORT_IS_OFFLINE 113 //=0x0071
205#define XL_ERR_CHAN_IS_ONLINE 116 //=0x0074
206#define XL_ERR_NOT_IMPLEMENTED 117 //=0x0075
207#define XL_ERR_INVALID_PORT 118 //=0x0076
208#define XL_ERR_HW_NOT_READY 120 //=0x0078
209#define XL_ERR_CMD_TIMEOUT 121 //=0x0079
210#define XL_ERR_HW_NOT_PRESENT 129 //=0x0081
211#define XL_ERR_NOTIFY_ALREADY_ACTIVE 131 //=0x0083
212#define XL_ERR_NO_RESOURCES 152 //=0x0098
213#define XL_ERR_WRONG_CHIP_TYPE 153 //=0x0099
214#define XL_ERR_WRONG_COMMAND 154 //=0x009A
215#define XL_ERR_INVALID_HANDLE 155 //=0x009B
216#define XL_ERR_RESERVED_NOT_ZERO 157 //=0x009D
217#define XL_ERR_CANNOT_OPEN_DRIVER 201 //=0x00C9
218#define XL_ERR_WRONG_BUS_TYPE 202 //=0x00CA
219#define XL_ERR_DLL_NOT_FOUND 203 //=0x00CB
220#define XL_ERR_INVALID_CHANNEL_MASK 204 //=0x00CC
221// special stream defines
222#define XL_ERR_CONNECTION_BROKEN 210 //=0x00D2
223#define XL_ERR_CONNECTION_CLOSED 211 //=0x00D3
224#define XL_ERR_INVALID_STREAM_NAME 212 //=0x00D4
225#define XL_ERR_CONNECTION_FAILED 213 //=0x00D5
226#define XL_ERR_STREAM_NOT_FOUND 214 //=0x00D6
227#define XL_ERR_STREAM_NOT_CONNECTED 215 //=0x00D7
228#define XL_ERR_QUEUE_OVERRUN 216 //=0x00D8
229#define XL_ERROR 255 //=0x00FF
230
231////////////////////////////////////////////////////////////////////////////////
232// For the timestamps and the access mask the API use 64 bit values
233typedef unsigned __int64 XLuint64;
234
235////////////////////////////////////////////////////////////////////////////////
236typedef char *XLstringType;
237
238////////////////////////////////////////////////////////////////////////////////
239// accessmask
240typedef XLuint64 XLaccess;
241
242////////////////////////////////////////////////////////////////////////////////
243// handle for xlSetNotification
244typedef HANDLE XLhandle;
245
246////////////////////////////////////////////////////////////////////////////////
247// LIN lib
248//------------------------------------------------------------------------------
249// defines for LIN
250//------------------------------------------------------------------------------
251
252// defines for xlLinSetChannelParams
253#define XL_LIN_MASTER (unsigned int) 01 //!< channel is a LIN master
254#define XL_LIN_SLAVE (unsigned int) 02 //!< channel is a LIN slave
255#define XL_LIN_VERSION_1_3 (unsigned int) 0x01 //!< LIN version 1.3
256#define XL_LIN_VERSION_2_0 (unsigned int) 0x02 //!< LIN version 2.0
257#define XL_LIN_VERSION_2_1 (unsigned int) 0x03 //!< LIN version 2.1
258
259// defines for xlLinSetSlave
260#define XL_LIN_CALC_CHECKSUM (unsigned short) 0x100 //!< flag for automatic 'classic' checksum calculation
261#define XL_LIN_CALC_CHECKSUM_ENHANCED (unsigned short) 0x200 //!< flag for automatic 'enhanced' checksum calculation
262
263// defines for the SleepMode function call
264#define XL_LIN_SET_SILENT (unsigned int) 0x01 //!< set hardware into sleep mode
265#define XL_LIN_SET_WAKEUPID (unsigned int) 0x03 //!< set hardware into sleep mode and send a request at wake-up
266
267// defines for xlLinSetChecksum. For LIN >= 2.0 there can be used two different Checksum models.
268#define XL_LIN_CHECKSUM_CLASSIC (unsigned char) 0x00 //!< Use classic CRC
269#define XL_LIN_CHECKSUM_ENHANCED (unsigned char) 0x01 //!< Use enhanced CRC
270#define XL_LIN_CHECKSUM_UNDEFINED (unsigned char) 0xff //!< Set the checksum calculation to undefined.
271
272// defines for the wake-up events
273#define XL_LIN_STAYALIVE (unsigned char) 0x00 //!< flag if nothing changes
274#define XL_LIN_SET_SLEEPMODE (unsigned char) 0x01 //!< flag if the hardware is set into the sleep mode
275#define XL_LIN_COMESFROM_SLEEPMODE (unsigned char) 0x02 //!< flag if the hardware comes from the sleep mode
276
277#define XL_LIN_WAKUP_INTERNAL (unsigned char) 0x01 //!< flag to signal a internal WAKEUP (event)
278#define XL_LIN_UNDEFINED_DLC (unsigned char) 0xff //!< set the DLC to undefined (xlLINSetDLC)
279
280// defines for xlLinSwitchSlave
281#define XL_LIN_SLAVE_ON (unsigned char) 0xff //!< switch on the LIN slave
282#define XL_LIN_SLAVE_OFF (unsigned char) 0x00 //!< switch off the LIN slave
283
284//------------------------------------------------------------------------------
285// structures for LIN
286//------------------------------------------------------------------------------
287typedef struct {
288 unsigned int LINMode; //!< XL_LIN_SLAVE | XL_LIN_MASTER
289 int baudrate; //!< the baudrate will be calculated within the API. Here: e.g. 9600, 19200
290 unsigned int LINVersion; //!< define for the LIN version (actual V1.3 of V2.0)
291 unsigned int reserved; //!< for future use
292} XLlinStatPar;
293
294
295////////////////////////////////////////////////////////////////////////////////
296// Defines
297//------------------------------------------------------------------------------
298// message flags
299#ifndef MAX_MSG_LEN
300#define MAX_MSG_LEN 8
301#endif
302
303// interface version for our events
304#define XL_INTERFACE_VERSION_V2 2
305#define XL_INTERFACE_VERSION_V3 3
306#define XL_INTERFACE_VERSION_V4 4
307//current version
308#define XL_INTERFACE_VERSION XL_INTERFACE_VERSION_V3
309
310#define XL_CAN_EXT_MSG_ID 0x80000000
311
312#define XL_CAN_MSG_FLAG_ERROR_FRAME 0x01
313#define XL_CAN_MSG_FLAG_OVERRUN 0x02 //!< Overrun in Driver or CAN Controller,
314 //!< previous msgs have been lost
315#define XL_CAN_MSG_FLAG_NERR 0x04 //!< Line Error on Lowspeed
316#define XL_CAN_MSG_FLAG_WAKEUP 0x08 //!< High Voltage Message on Single Wire CAN
317#define XL_CAN_MSG_FLAG_REMOTE_FRAME 0x10
318#define XL_CAN_MSG_FLAG_RESERVED_1 0x20
319#define XL_CAN_MSG_FLAG_TX_COMPLETED 0x40 //!< Message Transmitted
320#define XL_CAN_MSG_FLAG_TX_REQUEST 0x80 //!< Transmit Message stored into Controller
321
322// LIN flags
323#define XL_LIN_MSGFLAG_TX XL_CAN_MSG_FLAG_TX_COMPLETED //!< LIN TX flag
324#define XL_LIN_MSGFLAG_CRCERROR 0x81 //!< Wrong LIN CRC
325
326//------------------------------------------------------------------------------
327// structure for XL_RECEIVE_MSG, XL_TRANSMIT_MSG
328
329struct s_xl_can_msg { /* 32 Bytes */
330 unsigned long id;
331 unsigned short flags;
332 unsigned short dlc;
333 XLuint64 res1;
334 unsigned char data [MAX_MSG_LEN];
335 XLuint64 res2;
336 };
337
338
339
340//------------------------------------------------------------------------------
341// structure for XL_TRANSMIT_DAIO_DATA
342
343// flags masks
344#define XL_DAIO_DATA_GET 0x8000
345#define XL_DAIO_DATA_VALUE_DIGITAL 0x0001
346#define XL_DAIO_DATA_VALUE_ANALOG 0x0002
347#define XL_DAIO_DATA_PWM 0x0010
348
349// optional function flags
350#define XL_DAIO_MODE_PULSE 0x0020 // generates pulse in values of PWM
351
352struct s_xl_daio_data { /* 32 Bytes */
353 unsigned short flags; // 2
354 unsigned int timestamp_correction; // 4
355 unsigned char mask_digital; // 1
356 unsigned char value_digital; // 1
357 unsigned char mask_analog; // 1
358 unsigned char reserved0; // 1
359 unsigned short value_analog[4]; // 8
360 unsigned int pwm_frequency; // 4
361 unsigned short pwm_value; // 2
362 unsigned int reserved1; // 4
363 unsigned int reserved2; // 4
364};
365
366//------------------------------------------------------------------------------
367// structure for XL_CHIP_STATE
368
369#define XL_CHIPSTAT_BUSOFF 0x01
370#define XL_CHIPSTAT_ERROR_PASSIVE 0x02
371#define XL_CHIPSTAT_ERROR_WARNING 0x04
372#define XL_CHIPSTAT_ERROR_ACTIVE 0x08
373
374
375struct s_xl_chip_state {
376 unsigned char busStatus;
377 unsigned char txErrorCounter;
378 unsigned char rxErrorCounter;
379 };
380
381//------------------------------------------------------------------------------
382// structure for XL_SYNC_PULSE
383#define XL_SYNC_PULSE_EXTERNAL 0x00
384#define XL_SYNC_PULSE_OUR 0x01
385#define XL_SYNC_PULSE_OUR_SHARED 0x02
386
387struct s_xl_sync_pulse {
388 unsigned char pulseCode; //!< generated by us
389 XLuint64 time; //!< 1ns resolution
390 };
391
392//------------------------------------------------------------------------------
393// structure and defines for XL_TRANSCEIVER
394#define XL_TRANSCEIVER_EVENT_NONE 0
395#define XL_TRANSCEIVER_EVENT_INSERTED 1 //!< cable was inserted
396#define XL_TRANSCEIVER_EVENT_REMOVED 2 //!< cable was removed
397#define XL_TRANSCEIVER_EVENT_STATE_CHANGE 3 //!< transceiver state changed
398
399struct s_xl_transceiver {
400 unsigned char event_reason; //!< reason for what was event sent
401 unsigned char is_present; //!< allways valid transceiver presence flag
402 };
403
404//------------------------------------------------------------------------------
405// defines for SET_OUTPUT_MODE
406#define XL_OUTPUT_MODE_SILENT 0 //!< switch CAN trx into default silent mode
407#define XL_OUTPUT_MODE_NORMAL 1 //!< switch CAN trx into normal mode
408#define XL_OUTPUT_MODE_TX_OFF 2 //!< switch CAN trx into silent mode with tx pin off
409#define XL_OUTPUT_MODE_SJA_1000_SILENT 3 //!< switch CAN trx into SJA1000 silent mode
410
411//------------------------------------------------------------------------------
412// Transceiver modes
413#define XL_TRANSCEIVER_EVENT_ERROR 1
414#define XL_TRANSCEIVER_EVENT_CHANGED 2
415
416//------------------------------------------------------------------------------
417// definitions for the events and commands used by the driver
418enum e_XLevent_type {
419 XL_NO_COMMAND = 0,
420 XL_RECEIVE_MSG = 1,
421 XL_CHIP_STATE = 4,
422 XL_TRANSCEIVER = 6,
423 XL_TIMER = 8,
424 XL_TRANSMIT_MSG =10,
425 XL_SYNC_PULSE =11,
426 XL_APPLICATION_NOTIFICATION =15,
427
428 //for LIN we have special events
429 XL_LIN_MSG =20,
430 XL_LIN_ERRMSG =21,
431 XL_LIN_SYNCERR =22,
432 XL_LIN_NOANS =23,
433 XL_LIN_WAKEUP =24,
434 XL_LIN_SLEEP =25,
435 XL_LIN_CRCINFO =26,
436
437 // for D/A IO bus
438 XL_RECEIVE_DAIO_DATA =32, //!< D/A IO data message
439
440 };
441
442////////////////////////////////////////////////////////////////////////////////
443// LIN lib
444//------------------------------------------------------------------------------
445// LIN event structures
446struct s_xl_lin_msg {
447 unsigned char id;
448 unsigned char dlc;
449 unsigned short flags;
450 unsigned char data[8];
451 unsigned char crc;
452};
453struct s_xl_lin_sleep {
454 unsigned char flag;
455};
456
457struct s_xl_lin_no_ans {
458 unsigned char id;
459};
460
461struct s_xl_lin_wake_up {
462 unsigned char flag;
463};
464
465struct s_xl_lin_crc_info {
466 unsigned char id;
467 unsigned char flags;
468};
469
470//------------------------------------------------------------------------------
471// LIN messages structure
472union s_xl_lin_msg_api {
473 struct s_xl_lin_msg linMsg;
474 struct s_xl_lin_no_ans linNoAns;
475 struct s_xl_lin_wake_up linWakeUp;
476 struct s_xl_lin_sleep linSleep;
477 struct s_xl_lin_crc_info linCRCinfo;
478};
479
480
481//------------------------------------------------------------------------------
482// BASIC bus message structure
483union s_xl_tag_data {
484 struct s_xl_can_msg msg;
485 struct s_xl_chip_state chipState;
486 union s_xl_lin_msg_api linMsgApi;
487 struct s_xl_sync_pulse syncPulse;
488 struct s_xl_daio_data daioData;
489 struct s_xl_transceiver transceiver;
490 };
491
492typedef unsigned char XLeventTag;
493
494//------------------------------------------------------------------------------
495// XL_EVENT structures
496// event type definition
497
498struct s_xl_event {
499 XLeventTag tag; // 1
500 unsigned char chanIndex; // 1
501 unsigned short transId; // 2
502 unsigned short portHandle; // 2 internal use only !!!!
503 unsigned short reserved; // 2
504 XLuint64 timeStamp; // 8
505 union s_xl_tag_data tagData; // 32 Bytes
506 };
507 // --------
508 // 48 Bytes
509
510typedef struct s_xl_event XLevent;
511// message name to aquire a unique message id from windows
512#define DriverNotifyMessageName "VectorCanDriverChangeNotifyMessage"
513
514// defines for the supported hardware
515#define XL_HWTYPE_NONE 0
516#define XL_HWTYPE_VIRTUAL 1
517#define XL_HWTYPE_CANCARDX 2
518#define XL_HWTYPE_CANAC2PCI 6
519#define XL_HWTYPE_CANCARDY 12
520#define XL_HWTYPE_CANCARDXL 15
521#define XL_HWTYPE_CANCASEXL 21
522#define XL_HWTYPE_CANCASEXL_LOG_OBSOLETE 23
523#define XL_HWTYPE_CANBOARDXL 25
524#define XL_HWTYPE_CANBOARDXL_PXI 27
525#define XL_HWTYPE_VN2600 29
526#define XL_HWTYPE_VN2610 XL_HWTYPE_VN2600
527#define XL_HWTYPE_VN3300 37
528#define XL_HWTYPE_VN3600 39
529#define XL_HWTYPE_VN7600 41
530#define XL_HWTYPE_CANCARDXLE 43
531#define XL_HWTYPE_VN8900 45
532#define XL_HWTYPE_VN2640 53
533#define XL_HWTYPE_VN1610 55
534#define XL_HWTYPE_VN1630 57
535#define XL_HWTYPE_VN1640 59
536#define XL_HWTYPE_VN1611 63
537
538#define XL_MAX_HWTYPE 63
539
540//------------------------------------------------------------------------------
541// build a channels mask from the channels index
542#define XL_CHANNEL_MASK(x) (1I64<<(x))
543
544#define XL_MAX_APPNAME 32
545
546
547//------------------------------------------------------------------------------
548// driver status
549typedef short XLstatus;
550
551
552//defines for xlGetDriverConfig structures
553#define XL_MAX_LENGTH 31
554#define XL_CONFIG_MAX_CHANNELS 64
555
556//activate - channel flags
557#define XL_ACTIVATE_NONE 0
558#define XL_ACTIVATE_RESET_CLOCK 8
559
560//activate - bus types
561#define XL_BUS_TYPE_NONE 0x00000000
562#define XL_BUS_TYPE_CAN 0x00000001
563#define XL_BUS_TYPE_LIN 0x00000002
564#define XL_BUS_TYPE_FLEXRAY 0x00000004
565#define XL_BUS_TYPE_MOST 0x00000010
566#define XL_BUS_TYPE_DAIO 0x00000040 // IO cab/piggy
567#define XL_BUS_TYPE_J1708 0x00000100
568
569// device capabilities
570#define XL_CHCAP_LOG_CAPABLE 0x00002000
571
572#define XL_BUS_COMPATIBLE_CAN XL_BUS_TYPE_CAN
573#define XL_BUS_COMPATIBLE_LIN XL_BUS_TYPE_LIN
574#define XL_BUS_COMPATIBLE_FLEXRAY XL_BUS_TYPE_FLEXRAY
575#define XL_BUS_COMPATIBLE_MOST XL_BUS_TYPE_MOST
576#define XL_BUS_COMPATIBLE_DAIO XL_BUS_TYPE_DAIO //io cab/piggy
577#define XL_BUS_COMPATIBLE_J1708 XL_BUS_TYPE_J1708
578
579// the following bus types can be used with the current cab / piggy
580#define XL_BUS_ACTIVE_CAP_CAN (XL_BUS_COMPATIBLE_CAN<<16)
581#define XL_BUS_ACTIVE_CAP_LIN (XL_BUS_COMPATIBLE_LIN<<16)
582#define XL_BUS_ACTIVE_CAP_FLEXRAY (XL_BUS_COMPATIBLE_FLEXRAY<<16)
583#define XL_BUS_ACTIVE_CAP_MOST (XL_BUS_COMPATIBLE_MOST<<16)
584#define XL_BUS_ACTIVE_CAP_DAIO (XL_BUS_COMPATIBLE_DAIO<<16)
585#define XL_BUS_ACTIVE_CAP_J1708 (XL_BUS_COMPATIBLE_J1708<<16)
586
587
588//------------------------------------------------------------------------------
589// acceptance filter
590
591#define XL_CAN_STD 01 //!< flag for standard ID's
592#define XL_CAN_EXT 02 //!< flag for extended ID's
593
594//------------------------------------------------------------------------------
595// bit timing
596typedef struct {
597 unsigned long bitRate;
598 unsigned char sjw;
599 unsigned char tseg1;
600 unsigned char tseg2;
601 unsigned char sam; // 1 or 3
602 } XLchipParams;
603
604// defines for XLbusParams::data::most::activeSpeedGrade and compatibleSpeedGrade
605#define XL_BUS_PARAMS_MOST_SPEED_GRADE_25 0x01
606#define XL_BUS_PARAMS_MOST_SPEED_GRADE_150 0x02
607
608typedef struct {
609 unsigned int busType;
610 union {
611 struct {
612 unsigned int bitRate;
613 unsigned char sjw;
614 unsigned char tseg1;
615 unsigned char tseg2;
616 unsigned char sam; // 1 or 3
617 unsigned char outputMode;
618 } can;
619 struct {
620 unsigned int activeSpeedGrade;
621 unsigned int compatibleSpeedGrade;
622 } most;
623 unsigned char raw[32];
624 }data;
625} XLbusParams;
626
627// porthandle
628#define XL_INVALID_PORTHANDLE (-1)
629typedef long XLportHandle, *pXLportHandle;
630
631// defines for FPGA core types (fpgaCoreCapabilities)
632#define XL_FPGA_CORE_TYPE_NONE 0
633#define XL_FPGA_CORE_TYPE_CAN 1
634#define XL_FPGA_CORE_TYPE_LIN 2
635#define XL_FPGA_CORE_TYPE_LIN_RX 3
636
637//#defines for specialDeviceStatus
638#define XL_SPECIAL_DEVICE_STAT_FPGA_UPDATE_DONE 0x01 //!< automatic driver FPGA flashing done
639
640// structure for xlGetLicenseInfo function
641// This structure is returned as an array from the xlGetLicenseInfo. It contains all available licenses on
642// the queried channels. The position inside the array is defined by the license itself, e.g. the license for
643// the Advanced-Flexray-Library is always at the same array index.
644typedef struct s_xl_license_info {
645 unsigned char bAvailable; //!< License is available
646 char licName[65]; //!< Name of the license as NULL-terminated string
647} XL_LICENSE_INFO;
648typedef XL_LICENSE_INFO XLlicenseInfo;
649
650// structures for xlGetDriverConfig
651typedef struct s_xl_channel_config {
652 char name [XL_MAX_LENGTH + 1];
653 unsigned char hwType; //!< HWTYPE_xxxx (see above)
654 unsigned char hwIndex; //!< Index of the hardware (same type) (0,1,...)
655 unsigned char hwChannel; //!< Index of the channel (same hardware) (0,1,...)
656 unsigned short transceiverType; //!< TRANSCEIVER_TYPE_xxxx (see above)
657 unsigned short transceiverState; //!< transceiver state (XL_TRANSCEIVER_STATUS...)
658 unsigned short configError; //!< XL_CHANNEL_CONFIG_ERROR_XXX (see above)
659 unsigned char channelIndex; //!< Global channel index (0,1,...)
660 XLuint64 channelMask; //!< Global channel mask (=1<<channelIndex)
661 unsigned int channelCapabilities; //!< capabilities which are supported (e.g CHANNEL_FLAG_XXX)
662 unsigned int channelBusCapabilities; //!< what buses are supported and which are possible to be
663 //!< activated (e.g. XXX_BUS_ACTIVE_CAP_CAN)
664
665 // Channel
666 unsigned char isOnBus; //!< The channel is on bus
667 unsigned int connectedBusType; //!< currently selected bus
668 XLbusParams busParams;
669
670 unsigned int driverVersion;
671 unsigned int interfaceVersion; //!< version of interface with driver
672 unsigned int raw_data[10];
673
674 unsigned int serialNumber;
675 unsigned int articleNumber;
676
677 char transceiverName [XL_MAX_LENGTH + 1]; //!< name for CANcab or another transceiver
678
679 unsigned int specialCabFlags; //!< XL_SPECIAL_CAB_LIN_RECESSIVE_STRESS, XL_SPECIAL_CAB_LIN_DOMINANT_TIMEOUT flags
680 unsigned int dominantTimeout; //!< Dominant Timeout in us.
681 unsigned char dominantRecessiveDelay; //!< Delay in us.
682 unsigned char recessiveDominantDelay; //!< Delay in us.
683 unsigned char connectionInfo; //!< XL_CONNECTION_INFO_XXX
684 unsigned char currentlyAvailableTimestamps; //!< XL_CURRENTLY_AVAILABLE_TIMESTAMP...
685 unsigned short minimalSupplyVoltage; //!< Minimal Supply Voltage of the Cab/Piggy in 1/100 V
686 unsigned short maximalSupplyVoltage; //!< Maximal Supply Voltage of the Cab/Piggy in 1/100 V
687 unsigned int maximalBaudrate; //!< Maximal supported LIN baudrate
688 unsigned char fpgaCoreCapabilities; //!< e.g.: XL_FPGA_CORE_TYPE_XXX
689 unsigned char specialDeviceStatus; //!< e.g.: XL_SPECIAL_DEVICE_STAT_XXX
690 unsigned short channelBusActiveCapabilities; //!< like channelBusCapabilities (but without core dependencies)
691 unsigned short breakOffset; //!< compensation for edge asymmetry in ns
692 unsigned short delimiterOffset; //!< compensation for edgdfde asymmetry in ns
693 unsigned int reserved[3];
694 } XL_CHANNEL_CONFIG;
695
696typedef XL_CHANNEL_CONFIG XLchannelConfig;
697typedef XL_CHANNEL_CONFIG *pXLchannelConfig;
698
699typedef struct s_xl_driver_config {
700 unsigned int dllVersion;
701 unsigned int channelCount; // total number of channels
702 unsigned int reserved[10];
703 XLchannelConfig channel[XL_CONFIG_MAX_CHANNELS]; // [channelCount]
704 } XL_DRIVER_CONFIG;
705
706typedef XL_DRIVER_CONFIG XLdriverConfig;
707typedef XL_DRIVER_CONFIG *pXLdriverConfig;
708
709///////////////////////////////////////////////////////
710// DAIO params definition
711
712// analog and digital port configuration
713#define XL_DAIO_DIGITAL_ENABLED 0x00000001 // digital port is enabled
714#define XL_DAIO_DIGITAL_INPUT 0x00000002 // digital port is input, otherwise it is an output
715#define XL_DAIO_DIGITAL_TRIGGER 0x00000004 // digital port is trigger
716
717#define XL_DAIO_ANALOG_ENABLED 0x00000001 // analog port is enabled
718#define XL_DAIO_ANALOG_INPUT 0x00000002 // analog port is input, otherwise it is an output
719#define XL_DAIO_ANALOG_TRIGGER 0x00000004 // analog port is trigger
720#define XL_DAIO_ANALOG_RANGE_32V 0x00000008 // analog port is in range 0..32,768V, otherwise 0..8,192V
721
722// XL_DAIO trigger mode
723#define XL_DAIO_TRIGGER_MODE_NONE 0x00000000 // no trigger configured
724#define XL_DAIO_TRIGGER_MODE_DIGITAL 0x00000001 // trigger on preconfigured digital lines
725#define XL_DAIO_TRIGGER_MODE_ANALOG_ASCENDING 0x00000002 // trigger on input 3 ascending
726#define XL_DAIO_TRIGGER_MODE_ANALOG_DESCENDING 0x00000004 // trigger on input 3 ascending
727#define XL_DAIO_TRIGGER_MODE_ANALOG (XL_DAIO_TRIGGER_MODE_ANALOG_ASCENDING | \
728 XL_DAIO_TRIGGER_MODE_ANALOG_DESCENDING) // trigger on input 3
729
730// XL_DAIO trigger level
731#define XL_DAIO_TRIGGER_LEVEL_NONE 0 // no trigger level is defined
732
733// periodic measurement setting
734#define XL_DAIO_POLLING_NONE 0 // periodic measurement is disabled
735
736// structure for the acceptance filter
737struct _XLacc_filt {
738 unsigned char isSet;
739 unsigned long code;
740 unsigned long mask; // relevant = 1
741};
742typedef struct _XLacc_filt XLaccFilt;
743
744// structure for the acceptance filter of one CAN chip
745struct _XLacceptance {
746 XLaccFilt std;
747 XLaccFilt xtd;
748};
749typedef struct _XLacceptance XLacceptance;
750
751// defines for xlSetGlobalTimeSync
752#define XL_SET_TIMESYNC_NO_CHANGE (unsigned long) 0
753#define XL_SET_TIMESYNC_ON (unsigned long) 1
754#define XL_SET_TIMESYNC_OFF (unsigned long) 2
755
756
757#include <poppack.h>
758
759////////////////////////////////////////////////////////////////////////////////
760// MOST lib
761//------------------------------------------------------------------------------
762// special MOST defines
763
764#define XLuserHandle unsigned short
765
766// size of allocation table
767#define MOST_ALLOC_TABLE_SIZE 64 // size of channel alloctaion table + 4Bytes (MPR, MDR; ?, ?)
768
769// max. size of rx fifo for rx event in bytes
770#define RX_FIFO_MOST_QUEUE_SIZE_MAX 1048576
771
772// defines for the event tags
773#define XL_MOST_START 0x0101
774#define XL_MOST_STOP 0x0102
775#define XL_MOST_EVENTSOURCES 0x0103
776#define XL_MOST_ALLBYPASS 0x0107
777#define XL_MOST_TIMINGMODE 0x0108
778#define XL_MOST_FREQUENCY 0x0109
779#define XL_MOST_REGISTER_BYTES 0x010a
780#define XL_MOST_REGISTER_BITS 0x010b
781#define XL_MOST_SPECIAL_REGISTER 0x010c
782#define XL_MOST_CTRL_RX_SPY 0x010d
783#define XL_MOST_CTRL_RX_OS8104 0x010e
784#define XL_MOST_CTRL_TX 0x010f
785#define XL_MOST_ASYNC_MSG 0x0110
786#define XL_MOST_ASYNC_TX 0x0111
787#define XL_MOST_SYNC_ALLOCTABLE 0x0112
788#define XL_MOST_SYNC_VOLUME_STATUS 0x0116
789#define XL_MOST_RXLIGHT 0x0117
790#define XL_MOST_TXLIGHT 0x0118
791#define XL_MOST_LOCKSTATUS 0x0119
792#define XL_MOST_ERROR 0x011a
793#define XL_MOST_CTRL_RXBUFFER 0x011c
794#define XL_MOST_CTRL_SYNC_AUDIO 0x011f
795#define XL_MOST_SYNC_MUTE_STATUS 0x0120
796#define XL_MOST_GENLIGHTERROR 0x0121
797#define XL_MOST_GENLOCKERROR 0x0122
798#define XL_MOST_TXLIGHT_POWER 0x0123
799#define XL_MOST_CTRL_BUSLOAD 0x0126
800#define XL_MOST_ASYNC_BUSLOAD 0x0127
801#define XL_MOST_CTRL_SYNC_AUDIO_EX 0x012a
802#define XL_MOST_TIMINGMODE_SPDIF 0x012b
803#define XL_MOST_STREAM_STATE 0x012c
804#define XL_MOST_STREAM_BUFFER 0x012d
805
806// defines for xlMostSwitchEventSources
807#define XL_MOST_SOURCE_ASYNC_SPY 0x8000
808#define XL_MOST_SOURCE_ASYNC_RX 0x1000
809#define XL_MOST_SOURCE_ASYNC_TX 0x0800
810#define XL_MOST_SOURCE_CTRL_OS8104A 0x0400
811#define XL_MOST_SOURCE_CTRL_SPY 0x0100
812#define XL_MOST_SOURCE_SYNCLINE 0x0010
813#define XL_MOST_SOURCE_ASYNC_RX_FIFO_OVER 0x0008
814
815// data for XL_MOST_ERROR:
816#define XL_MOST_OS8104_TX_LOCK_ERROR 0x00000001
817#define XL_MOST_OS8104_SPDIF_LOCK_ERROR 0x00000002
818#define XL_MOST_OS8104_ASYNC_BUFFER_FULL 0x00000003
819#define XL_MOST_OS8104_ASYNC_CRC_ERROR 0x00000004
820#define XL_MOST_ASYNC_TX_UNDERRUN 0x00000005
821#define XL_MOST_CTRL_TX_UNDERRUN 0x00000006
822#define XL_MOST_MCU_TS_CMD_QUEUE_UNDERRUN 0x00000007
823#define XL_MOST_MCU_TS_CMD_QUEUE_OVERRUN 0x00000008
824#define XL_MOST_CMD_TX_UNDERRUN 0x00000009
825#define XL_MOST_SYNCPULSE_ERROR 0x0000000A
826#define XL_MOST_OS8104_CODING_ERROR 0x0000000B
827#define XL_MOST_ERROR_UNKNOWN_COMMAND 0x0000000C
828#define XL_MOST_ASYNC_RX_OVERFLOW_ERROR 0x0000000D
829#define XL_MOST_FPGA_TS_FIFO_OVERFLOW 0x0000000E
830#define XL_MOST_SPY_OVERFLOW_ERROR 0x0000000F
831#define XL_MOST_CTRL_TYPE_QUEUE_OVERFLOW 0x00000010
832#define XL_MOST_ASYNC_TYPE_QUEUE_OVERFLOW 0x00000011
833#define XL_MOST_CTRL_UNKNOWN_TYPE 0x00000012
834#define XL_MOST_CTRL_QUEUE_UNDERRUN 0x00000013
835#define XL_MOST_ASYNC_UNKNOWN_TYPE 0x00000014
836#define XL_MOST_ASYNC_QUEUE_UNDERRUN 0x00000015
837
838// data for demanded timstamps
839#define XL_MOST_DEMANDED_START 0x00000001
840
841#define XL_MOST_RX_DATA_SIZE 1028
842#define XL_MOST_TS_DATA_SIZE 12
843#define XL_MOST_RX_ELEMENT_HEADER_SIZE 32
844#define XL_MOST_CTRL_RX_SPY_SIZE 36
845#define XL_MOST_CTRL_RX_OS8104_SIZE 28
846#define XL_MOST_SPECIAL_REGISTER_CHANGE_SIZE 20
847#define XL_MOST_ERROR_EV_SIZE_4 4 // dwords
848#define XL_MOST_ERROR_EV_SIZE 16 // bytes
849
850
851// defines for the audio devices
852#define XL_MOST_DEVICE_CASE_LINE_IN 0
853#define XL_MOST_DEVICE_CASE_LINE_OUT 1
854#define XL_MOST_DEVICE_SPDIF_IN 7
855#define XL_MOST_DEVICE_SPDIF_OUT 8
856#define XL_MOST_DEVICE_SPDIF_IN_OUT_SYNC 11
857
858// defines for xlMostCtrlSyncAudioEx, mode
859#define XL_MOST_SPDIF_LOCK_OFF 0
860#define XL_MOST_SPDIF_LOCK_ON 1
861
862// defines for the XL_MOST_SYNC_MUTES_STATUS event
863#define XL_MOST_NO_MUTE 0
864#define XL_MOST_MUTE 1
865
866// defines for the event sources in XLmostEvent
867#define XL_MOST_VN2600 0x01
868#define XL_MOST_OS8104A 0x02
869#define XL_MOST_OS8104B 0x04
870#define XL_MOST_SPY 0x08
871
872// defines for xlMostSetAllBypass and XL_MOST_ALLBYPASS
873#define XL_MOST_MODE_DEACTIVATE 0
874#define XL_MOST_MODE_ACTIVATE 1
875#define XL_MOST_MODE_FORCE_DEACTIVATE 2
876
877#define XL_MOST_RX_BUFFER_CLEAR_ONCE 2
878
879// defines for xlMostSetTimingMode and the XL_MOST_TIMINGMODE(_SPDIF)_EV event.
880#define XL_MOST_TIMING_SLAVE 0
881#define XL_MOST_TIMING_MASTER 1
882#define XL_MOST_TIMING_SLAVE_SPDIF_MASTER 2
883#define XL_MOST_TIMING_SLAVE_SPDIF_SLAVE 3
884#define XL_MOST_TIMING_MASTER_SPDIF_MASTER 4
885#define XL_MOST_TIMING_MASTER_SPDIF_SLAVE 5
886#define XL_MOST_TIMING_MASTER_FROM_SPDIF_SLAVE 6
887
888
889// defines for xlMostSetFrequency and the XL_MOST_FREQUENCY_EV event.
890#define XL_MOST_FREQUENCY_44100 0
891#define XL_MOST_FREQUENCY_48000 1
892#define XL_MOST_FREQUENCY_ERROR 2
893
894// defines for xlMostSetTxLight
895#define XL_MOST_LIGHT_OFF 0
896#define XL_MOST_LIGHT_FORCE_ON 1 // unmodulated on
897#define XL_MOST_LIGHT_MODULATED 2 // modulated light
898
899//defines for xlMostSetTxLightPower and the XL_MOST_TXLIGHT_POWER_EV event.
900#define XL_MOST_LIGHT_FULL 100
901#define XL_MOST_LIGHT_3DB 50
902
903// defines for the XL_MOST_LOCKSTATUS event
904#define XL_MOST_UNLOCK 5
905#define XL_MOST_LOCK 6
906#define XL_MOST_STATE_UNKNOWN 9
907
908// defines for the XL_MOST_CTRL_RX_OS8104 event (tx event)
909#define XL_MOST_TX_WHILE_UNLOCKED 0x80000000
910#define XL_MOST_TX_TIMEOUT 0x40000000
911#define XL_MOST_DIRECTION_RX 0
912#define XL_MOST_DIRECTION_TX 1
913
914#define XL_MOST_NO_QUEUE_OVERFLOW 0x0000 // No rx-queue overflow occured
915#define XL_MOST_QUEUE_OVERFLOW 0x8000 // Overflow of rx-queue in firmware when trying to add a rx-event
916#define XL_MOST_COMMAND_FAILED 0x4000
917#define XL_MOST_INTERNAL_OVERFLOW 0x2000 // Overflow of command-timestamp-queue in firmware
918#define XL_MOST_MEASUREMENT_NOT_ACTIVE 0x1000
919#define XL_MOST_QUEUE_OVERFLOW_ASYNC 0x0800 // Overflow of async rx-queue in firmware when trying to add a packet
920#define XL_MOST_QUEUE_OVERFLOW_CTRL 0x0400 // Overflow of rx-queue in firmware when trying to add a message
921#define XL_MOST_NOT_SUPPORTED 0x0200
922#define XL_MOST_QUEUE_OVERFLOW_DRV 0x0100 // Overflow occured when trying to add an event to application rx-queue
923
924#define XL_MOST_NA_CHANGED 0x0001 // node address changed
925#define XL_MOST_GA_CHANGED 0x0002 // group address changed
926#define XL_MOST_APA_CHANGED 0x0004 // alternative packet address changed
927#define XL_MOST_NPR_CHANGED 0x0008 // node position register changed
928#define XL_MOST_MPR_CHANGED 0x0010 // max position register changed
929#define XL_MOST_NDR_CHANGED 0x0020 // node delay register changed
930#define XL_MOST_MDR_CHANGED 0x0040 // max delay register changed
931#define XL_MOST_SBC_CHANGED 0x0080 //
932#define XL_MOST_XTIM_CHANGED 0x0100 //
933#define XL_MOST_XRTY_CHANGED 0x0200 //
934
935// defines for the MOST register (xlMostWriteRegister)
936#define XL_MOST_bGA 0x89 // Group Address
937#define XL_MOST_bNAH 0x8A // Node Address High
938#define XL_MOST_bNAL 0x8B // Node Address Low
939#define XL_MOST_bSDC2 0x8C // Source Data Control 2
940#define XL_MOST_bSDC3 0x8D // Source Data Control 3
941#define XL_MOST_bCM2 0x8E // Clock Manager 2
942#define XL_MOST_bNDR 0x8F // Node Delay
943#define XL_MOST_bMPR 0x90 // Maximum Position
944#define XL_MOST_bMDR 0x91 // Maximum Delay
945#define XL_MOST_bCM4 0x93 // Clock Manager 4
946#define XL_MOST_bSBC 0x96 // Synchronous Bandwidth Control
947#define XL_MOST_bXSR2 0x97 // Transceiver Status 2
948
949#define XL_MOST_bRTYP 0xA0 // Receive Message Type
950#define XL_MOST_bRSAH 0xA1 // Source Address High
951#define XL_MOST_bRSAL 0xA2 // Source Address Low
952#define XL_MOST_bRCD0 0xA3 // Receive Control Data 0 --> bRCD16 = bRCD0+16
953
954#define XL_MOST_bXTIM 0xBE // Transmit Retry Time
955#define XL_MOST_bXRTY 0xBF // Transmit Retries
956
957#define XL_MOST_bXPRI 0xC0 // Transmit Priority
958#define XL_MOST_bXTYP 0xC1 // Transmit Message Type
959#define XL_MOST_bXTAH 0xC2 // Target Address High
960#define XL_MOST_bXTAL 0xC3 // Target Address Low
961#define XL_MOST_bXCD0 0xC4 // Transmit Control Data 0 --> bXCD16 = bXCD0+16
962
963#define XL_MOST_bXTS 0xD5 // Transmit Transfer Status
964
965#define XL_MOST_bPCTC 0xE2 // Packet Control
966#define XL_MOST_bPCTS 0xE3 // Packet Status
967
968// defines
969#define XL_MOST_SPY_RX_STATUS_NO_LIGHT 0x01
970#define XL_MOST_SPY_RX_STATUS_NO_LOCK 0x02
971#define XL_MOST_SPY_RX_STATUS_BIPHASE_ERROR 0x04
972#define XL_MOST_SPY_RX_STATUS_MESSAGE_LENGTH_ERROR 0x08
973#define XL_MOST_SPY_RX_STATUS_PARITY_ERROR 0x10
974#define XL_MOST_SPY_RX_STATUS_FRAME_LENGTH_ERROR 0x20
975#define XL_MOST_SPY_RX_STATUS_PREAMBLE_TYPE_ERROR 0x40
976#define XL_MOST_SPY_RX_STATUS_CRC_ERROR 0x80
977
978// defines for status of async frames
979#define XL_MOST_ASYNC_NO_ERROR 0x00
980#define XL_MOST_ASYNC_SBC_ERROR 0x0C
981#define XL_MOST_ASYNC_NEXT_STARTS_TO_EARLY 0x0D
982#define XL_MOST_ASYNC_TO_LONG 0x0E
983
984#define XL_MOST_ASYNC_UNLOCK 0x0F // unlock occured within receiption of packet
985
986// defines for XL_MOST_SYNC_PULSE_EV member trigger_source
987#define SYNC_PULSE_EXTERNAL 0x00
988#define SYNC_PULSE_OUR 0x01
989
990// ctrlType value within the XL_CTRL_SPY event
991#define XL_MOST_CTRL_TYPE_NORMAL 0x00
992#define XL_MOST_CTRL_TYPE_REMOTE_READ 0x01
993#define XL_MOST_CTRL_TYPE_REMOTE_WRITE 0x02
994#define XL_MOST_CTRL_TYPE_RESOURCE_ALLOCATE 0x03
995#define XL_MOST_CTRL_TYPE_RESOURCE_DEALLOCATE 0x04
996#define XL_MOST_CTRL_TYPE_GET_SOURCE 0x05
997
998// counterType for the xlMost****GenerateBusload function
999#define XL_MOST_BUSLOAD_COUNTER_TYPE_NONE 0x00
1000#define XL_MOST_BUSLOAD_COUNTER_TYPE_1_BYTE 0x01
1001#define XL_MOST_BUSLOAD_COUNTER_TYPE_2_BYTE 0x02
1002#define XL_MOST_BUSLOAD_COUNTER_TYPE_3_BYTE 0x03
1003#define XL_MOST_BUSLOAD_COUNTER_TYPE_4_BYTE 0x04
1004
1005// selection bits for xlMostGetDeviceStates / CMD_GET_DEVICE_STATE->selection_mask
1006#define XL_MOST_STATESEL_LIGHTLOCK 0x0001
1007#define XL_MOST_STATESEL_REGISTERBUNCH1 0x0002
1008#define XL_MOST_STATESEL_BYPASSTIMING 0x0004
1009#define XL_MOST_STATESEL_REGISTERBUNCH2 0x0008
1010#define XL_MOST_STATESEL_REGISTERBUNCH3 0x0010
1011#define XL_MOST_STATESEL_VOLUMEMUTE 0x0020
1012#define XL_MOST_STATESEL_EVENTSOURCE 0x0040
1013#define XL_MOST_STATESEL_RXBUFFERMODE 0x0080
1014#define XL_MOST_STATESEL_ALLOCTABLE 0x0100
1015#define XL_MOST_STATESEL_SUPERVISOR_LOCKSTATUS 0x0200
1016#define XL_MOST_STATESEL_SUPERVISOR_MESSAGE 0x0400
1017
1018// defines for sync data streaming
1019#define XL_MOST_STREAM_RX_DATA 0 // RX streaming: MOST -> PC
1020#define XL_MOST_STREAM_TX_DATA 1 // TX streaming: PC -> MOST
1021
1022#define XL_MOST_STREAM_ADD_FRAME_HEADER 1 // only for RX: additionally the orig. TS + status information are reported
1023
1024// stream states
1025#define XL_MOST_STREAM_STATE_CLOSED 0x01
1026#define XL_MOST_STREAM_STATE_OPENED 0x02
1027#define XL_MOST_STREAM_STATE_STARTED 0x03
1028#define XL_MOST_STREAM_STATE_STOPPED 0x04
1029#define XL_MOST_STREAM_STATE_START_PENDING 0x05 // waiting for result from hw
1030#define XL_MOST_STREAM_STATE_STOP_PENDING 0x06 // waiting for result from hw
1031#define XL_MOST_STREAM_STATE_UNKNOWN 0xFF
1032
1033// stream modes
1034#define XL_MOST_STREAM_ACTIVATE 0
1035#define XL_MOST_STREAM_DEACTIVATE 1
1036
1037#define XL_MOST_STREAM_INVALID_HANDLE 0
1038
1039// latency values
1040#define XL_MOST_STREAM_LATENCY_VERY_LOW 0
1041#define XL_MOST_STREAM_LATENCY_LOW 1
1042#define XL_MOST_STREAM_LATENCY_MEDIUM 2
1043#define XL_MOST_STREAM_LATENCY_HIGH 3
1044#define XL_MOST_STREAM_LATENCY_VERY_HIGH 4
1045
1046// error defines for sync data streaming
1047#define XL_MOST_STREAM_ERR_NO_ERROR 0x00
1048#define XL_MOST_STREAM_ERR_INVALID_HANDLE 0x01
1049#define XL_MOST_STREAM_ERR_NO_MORE_BUFFERS_AVAILABLE 0x02
1050#define XL_MOST_STREAM_ERR_ANY_BUFFER_LOCKED 0x03
1051#define XL_MOST_STREAM_ERR_WRITE_RE_FAILED 0x04
1052#define XL_MOST_STREAM_ERR_STREAM_ALREADY_STARTED 0x05
1053#define XL_MOST_STREAM_ERR_TX_BUFFER_UNDERRUN 0x06
1054#define XL_MOST_STREAM_ERR_RX_BUFFER_OVERFLOW 0x07
1055#define XL_MOST_STREAM_ERR_INSUFFICIENT_RESOURCES 0x08
1056
1057
1058#include <pshpack8.h>
1059// -------------------------------------------------------------
1060// Structures for MOST events
1061// -------------------------------------------------------------
1062
1063typedef struct s_xl_most_ctrl_spy {
1064 unsigned int arbitration;
1065 unsigned short targetAddress;
1066 unsigned short sourceAddress;
1067 unsigned char ctrlType;
1068 unsigned char ctrlData[17];
1069 unsigned short crc;
1070 unsigned short txStatus;
1071 unsigned short ctrlRes;
1072 unsigned int spyRxStatus;
1073} XL_MOST_CTRL_SPY_EV;
1074
1075typedef struct s_xl_most_ctrl_msg {
1076 unsigned char ctrlPrio;
1077 unsigned char ctrlType;
1078 unsigned short targetAddress;
1079 unsigned short sourceAddress;
1080 unsigned char ctrlData[17];
1081 unsigned char direction; // transmission or real receiption
1082 unsigned int status; // unused for real rx msgs
1083} XL_MOST_CTRL_MSG_EV;
1084
1085typedef struct s_xl_most_async_msg {
1086 unsigned int status; // read as last data from PLD but stored first
1087 unsigned int crc; // not used
1088 unsigned char arbitration;
1089 unsigned char length; // real length of async data in quadlets
1090 unsigned short targetAddress;
1091 unsigned short sourceAddress;
1092 unsigned char asyncData[1018]; // max size but only used data is transmitted to pc
1093} XL_MOST_ASYNC_MSG_EV;
1094
1095typedef struct s_xl_most_async_tx {
1096 unsigned char arbitration;
1097 unsigned char length; // real length of async data in quadlets
1098 unsigned short targetAddress;
1099 unsigned short sourceAddress;
1100 unsigned char asyncData[1014]; // worst case
1101} XL_MOST_ASYNC_TX_EV;
1102
1103typedef struct s_xl_most_special_register {
1104 unsigned int changeMask; // see defines "XL_MOST_..._CHANGED"
1105 unsigned int lockStatus;
1106 unsigned char register_bNAH;
1107 unsigned char register_bNAL;
1108 unsigned char register_bGA;
1109 unsigned char register_bAPAH;
1110 unsigned char register_bAPAL;
1111 unsigned char register_bNPR;
1112 unsigned char register_bMPR;
1113 unsigned char register_bNDR;
1114 unsigned char register_bMDR;
1115 unsigned char register_bSBC;
1116 unsigned char register_bXTIM;
1117 unsigned char register_bXRTY;
1118} XL_MOST_SPECIAL_REGISTER_EV;
1119
1120typedef struct s_xl_most_event_source {
1121 unsigned int mask;
1122 unsigned int state;
1123} XL_MOST_EVENT_SOURCE_EV;
1124
1125typedef struct s_xl_most_all_bypass {
1126 unsigned int bypassState;
1127} XL_MOST_ALL_BYPASS_EV;
1128
1129typedef struct s_xl_most_timing_mode {
1130 unsigned int timingmode;
1131} XL_MOST_TIMING_MODE_EV;
1132
1133typedef struct s_xl_most_timing_mode_spdif {
1134 unsigned int timingmode;
1135} XL_MOST_TIMING_MODE_SPDIF_EV;
1136
1137typedef struct s_xl_most_frequency {
1138 unsigned int frequency;
1139} XL_MOST_FREQUENCY_EV;
1140
1141typedef struct s_xl_most_register_bytes {
1142 unsigned int number;
1143 unsigned int address;
1144 unsigned char value[16];
1145} XL_MOST_REGISTER_BYTES_EV;
1146
1147typedef struct s_xl_most_register_bits {
1148 unsigned int address;
1149 unsigned int value;
1150 unsigned int mask;
1151} XL_MOST_REGISTER_BITS_EV;
1152
1153typedef struct s_xl_most_sync_alloc {
1154 unsigned char allocTable[MOST_ALLOC_TABLE_SIZE];
1155} XL_MOST_SYNC_ALLOC_EV;
1156
1157typedef struct s_xl_most_ctrl_sync_audio {
1158 unsigned int channelMask[4];
1159 unsigned int device;
1160 unsigned int mode;
1161} XL_MOST_CTRL_SYNC_AUDIO_EV;
1162
1163typedef struct s_xl_most_ctrl_sync_audio_ex {
1164 unsigned int channelMask[16];
1165 unsigned int device;
1166 unsigned int mode;
1167} XL_MOST_CTRL_SYNC_AUDIO_EX_EV;
1168
1169typedef struct s_xl_most_sync_volume_status {
1170 unsigned int device;
1171 unsigned int volume;
1172} XL_MOST_SYNC_VOLUME_STATUS_EV;
1173
1174typedef struct s_xl_most_sync_mutes_status {
1175 unsigned int device;
1176 unsigned int mute;
1177} XL_MOST_SYNC_MUTES_STATUS_EV;
1178
1179typedef struct s_xl_most_rx_light {
1180 unsigned int light;
1181} XL_MOST_RX_LIGHT_EV;
1182
1183typedef struct s_xl_most_tx_light {
1184 unsigned int light;
1185} XL_MOST_TX_LIGHT_EV;
1186
1187typedef struct s_xl_most_light_power {
1188 unsigned int lightPower;
1189} XL_MOST_LIGHT_POWER_EV;
1190
1191typedef struct s_xl_most_lock_status {
1192 unsigned int lockStatus;
1193} XL_MOST_LOCK_STATUS_EV;
1194
1195typedef struct s_xl_most_supervisor_lock_status {
1196 unsigned int supervisorLockStatus;
1197} XL_MOST_SUPERVISOR_LOCK_STATUS_EV;
1198
1199typedef struct s_xl_most_gen_light_error {
1200 unsigned int lightOnTime;
1201 unsigned int lightOffTime;
1202 unsigned int repeat;
1203} XL_MOST_GEN_LIGHT_ERROR_EV;
1204
1205typedef struct s_xl_most_gen_lock_error {
1206 unsigned int lockOnTime;
1207 unsigned int lockOffTime;
1208 unsigned int repeat;
1209} XL_MOST_GEN_LOCK_ERROR_EV;
1210
1211typedef struct s_xl_most_rx_buffer {
1212 unsigned int mode;
1213} XL_MOST_RX_BUFFER_EV;
1214
1215typedef struct s_xl_most_error {
1216 unsigned int errorCode;
1217 unsigned int parameter[3];
1218} XL_MOST_ERROR_EV;
1219
1220typedef struct s_xl_most_sync_pulse {
1221 unsigned int triggerSource; // e.g. external or internal trigger source
1222 unsigned __int64 time; // internal generated timestamp
1223} XL_MOST_SYNC_PULSE_EV;
1224
1225typedef struct s_xl_most_ctrl_busload {
1226 unsigned int busloadCtrlStarted;
1227} XL_MOST_CTRL_BUSLOAD_EV;
1228
1229typedef struct s_xl_most_async_busload {
1230 unsigned int busloadAsyncStarted;
1231} XL_MOST_ASYNC_BUSLOAD_EV;
1232
1233typedef struct s_xl_most_stream_state {
1234 unsigned int streamHandle;
1235 unsigned int streamState; // see XL_MOST_STREAM_STATE_...
1236 unsigned int streamError; // see XL_MOST_STREAM_ERR_...
1237 unsigned int reserved;
1238} XL_MOST_STREAM_STATE_EV;
1239
1240typedef struct s_xl_most_stream_buffer {
1241 unsigned int streamHandle;
1242 unsigned char *POINTER_32 pBuffer;
1243 unsigned int validBytes;
1244 unsigned int status; // // see XL_MOST_STREAM_ERR_...
1245 unsigned int pBuffer_highpart;
1246} XL_MOST_STREAM_BUFFER_EV;
1247
1248
1249#define XL_MOST_EVENT_HEADER_SIZE 32
1250#define XL_MOST_EVENT_MAX_DATA_SIZE 1024
1251#define XL_MOST_EVENT_MAX_SIZE (XL_MOST_EVENT_HEADER_SIZE + XL_MOST_EVENT_MAX_DATA_SIZE)
1252
1253// rx event definition
1254union s_xl_most_tag_data {
1255 XL_MOST_CTRL_SPY_EV mostCtrlSpy;
1256 XL_MOST_CTRL_MSG_EV mostCtrlMsg;
1257 XL_MOST_ASYNC_MSG_EV mostAsyncMsg; // received async frame
1258 XL_MOST_ASYNC_TX_EV mostAsyncTx; // async frame tx acknowledge
1259 XL_MOST_SPECIAL_REGISTER_EV mostSpecialRegister;
1260 XL_MOST_EVENT_SOURCE_EV mostEventSource;
1261 XL_MOST_ALL_BYPASS_EV mostAllBypass;
1262 XL_MOST_TIMING_MODE_EV mostTimingMode;
1263 XL_MOST_TIMING_MODE_SPDIF_EV mostTimingModeSpdif;
1264 XL_MOST_FREQUENCY_EV mostFrequency;
1265 XL_MOST_REGISTER_BYTES_EV mostRegisterBytes;
1266 XL_MOST_REGISTER_BITS_EV mostRegisterBits;
1267 XL_MOST_SYNC_ALLOC_EV mostSyncAlloc;
1268 XL_MOST_CTRL_SYNC_AUDIO_EV mostCtrlSyncAudio;
1269 XL_MOST_CTRL_SYNC_AUDIO_EX_EV mostCtrlSyncAudioEx;
1270 XL_MOST_SYNC_VOLUME_STATUS_EV mostSyncVolumeStatus;
1271 XL_MOST_SYNC_MUTES_STATUS_EV mostSyncMuteStatus;
1272 XL_MOST_RX_LIGHT_EV mostRxLight;
1273 XL_MOST_TX_LIGHT_EV mostTxLight;
1274 XL_MOST_LIGHT_POWER_EV mostLightPower;
1275 XL_MOST_LOCK_STATUS_EV mostLockStatus;
1276 XL_MOST_GEN_LIGHT_ERROR_EV mostGenLightError;
1277 XL_MOST_GEN_LOCK_ERROR_EV mostGenLockError;
1278 XL_MOST_RX_BUFFER_EV mostRxBuffer;
1279 XL_MOST_ERROR_EV mostError;
1280 XL_MOST_SYNC_PULSE_EV mostSyncPulse;
1281 XL_MOST_CTRL_BUSLOAD_EV mostCtrlBusload;
1282 XL_MOST_ASYNC_BUSLOAD_EV mostAsyncBusload;
1283 XL_MOST_STREAM_STATE_EV mostStreamState;
1284 XL_MOST_STREAM_BUFFER_EV mostStreamBuffer;
1285};
1286
1287
1288typedef unsigned short XLmostEventTag;
1289
1290struct s_xl_most_event {
1291 unsigned int size; // 4 - overall size of the complete event
1292 XLmostEventTag tag; // 2 - type of the event
1293 unsigned short channelIndex; // 2
1294 unsigned int userHandle; // 4 - internal use only
1295 unsigned short flagsChip; // 2
1296 unsigned short reserved; // 2
1297 XLuint64 timeStamp; // 8
1298 XLuint64 timeStampSync; // 8
1299 // ---------
1300 // 32 bytes -> XL_MOST_EVENT_HEADER_SIZE
1301 union s_xl_most_tag_data tagData;
1302};
1303
1304typedef struct s_xl_most_event XLmostEvent;
1305
1306typedef XL_MOST_CTRL_MSG_EV XLmostCtrlMsg;
1307typedef XL_MOST_ASYNC_TX_EV XLmostAsyncMsg;
1308
1309typedef struct s_xl_most_ctrl_busload_configuration {
1310 unsigned int transmissionRate;
1311 unsigned int counterType;
1312 unsigned int counterPosition;
1313 XL_MOST_CTRL_MSG_EV busloadCtrlMsg;
1314} XL_MOST_CTRL_BUSLOAD_CONFIGURATION;
1315
1316
1317typedef struct s_xl_most_async_busload_configuration {
1318 unsigned int transmissionRate;
1319 unsigned int counterType;
1320 unsigned int counterPosition;
1321 XL_MOST_ASYNC_TX_EV busloadAsyncMsg;
1322} XL_MOST_ASYNC_BUSLOAD_CONFIGURATION;
1323
1324typedef XL_MOST_CTRL_BUSLOAD_CONFIGURATION XLmostCtrlBusloadConfiguration;
1325typedef XL_MOST_ASYNC_BUSLOAD_CONFIGURATION XLmostAsyncBusloadConfiguration;
1326
1327typedef struct s_xl_most_device_state {
1328 unsigned int selectionMask;
1329 // XL_MOST_STATESEL_LIGHTLOCK
1330 unsigned int lockState; // see XL_MOST_LOCK_STATUS_EV
1331 unsigned int rxLight; // see XL_MOST_RX_LIGHT_EV
1332 unsigned int txLight; // see XL_MOST_TX_LIGHT_EV
1333 unsigned int txLightPower; // see XL_MOST_LIGHT_POWER_EV
1334 // XL_MOST_STATESEL_REGISTERBUNCH1
1335 unsigned char registerBunch1[16]; // 16 OS8104 registers (0x87...0x96 -> NPR...SBC)
1336 // XL_MOST_STATESEL_BYPASSTIMING
1337 unsigned int bypassState; // see XL_MOST_ALL_BYPASS_EV
1338 unsigned int timingMode; // see XL_MOST_TIMING_MODE_EV
1339 unsigned int frequency; // frame rate (if master); see XL_MOST_FREQUENCY_EV
1340 // XL_MOST_STATESEL_REGISTERBUNCH2
1341 unsigned char registerBunch2[2]; // 2 OS8104 registers (0xBE, 0xBF -> XTIM, XRTY)
1342 // XL_MOST_STATESEL_REGISTERBUNCH3
1343 unsigned char registerBunch3[2]; // 2 OS8104 registers (0xE8, 0xE9 -> APAH, APAL)
1344 // XL_MOST_STATESEL_VOLUMEMUTE
1345 unsigned int volume[2]; // volume state for DEVICE_CASE_LINE_IN, DEVICE_CASE_LINE_OUT
1346 unsigned int mute[2]; // mute state for DEVICE_CASE_LINE_IN, DEVICE_CASE_LINE_OUT
1347 // XL_MOST_STATESEL_EVENTSOURCE
1348 unsigned int eventSource; // see XL_MOST_EVENT_SOURCE_EV
1349 // XL_MOST_STATESEL_RXBUFFERMODE
1350 unsigned int rxBufferMode; // see XL_MOST_RX_BUFFER_EV
1351 // XL_MOST_STATESEL_ALLOCTABLE
1352 unsigned char allocTable[MOST_ALLOC_TABLE_SIZE]; // see XL_MOST_SYNC_ALLOC_EV
1353 // XL_MOST_STATESEL_SUPERVISOR_LOCKSTATUS
1354 unsigned int supervisorLockStatus;
1355 // XL_MOST_STATESEL_SUPERVISOR_MESSAGE
1356 unsigned int broadcastedConfigStatus;
1357 unsigned int adrNetworkMaster;
1358 unsigned int abilityToWake;
1359} XL_MOST_DEVICE_STATE;
1360
1361typedef XL_MOST_DEVICE_STATE XLmostDeviceState;
1362
1363typedef struct s_xl_most_stream_open {
1364 unsigned int* pStreamHandle;
1365 unsigned int numSyncChannels;
1366 unsigned int direction;
1367 unsigned int options;
1368 unsigned int latency;
1369} XL_MOST_STREAM_OPEN;
1370
1371typedef XL_MOST_STREAM_OPEN XLmostStreamOpen;
1372
1373typedef struct s_xl_most_stream_info {
1374 unsigned int streamHandle;
1375 unsigned int numSyncChannels;
1376 unsigned int direction;
1377 unsigned int options;
1378 unsigned int latency;
1379 unsigned int streamState;
1380 unsigned int reserved;
1381 unsigned char syncChannels[60];
1382} XL_MOST_STREAM_INFO;
1383
1384typedef XL_MOST_STREAM_INFO XLmostStreamInfo;
1385
1386
1387/////////////////////////////////////////////////////////////////////////////////////////////////////////
1388// FlexRay XL API
1389/////////////////////////////////////////////////////////////////////////////////////////////////////////
1390
1391#define XL_FR_MAX_DATA_LENGTH 254
1392
1393/////////////////////////////////////////////////////////////////////////////////////////////////////////
1394// event tags
1395/////////////////////////////////////////////////////////////////////////////////////////////////////////
1396
1397#define XL_FR_START_CYCLE ((unsigned short)0x0080)
1398#define XL_FR_RX_FRAME ((unsigned short)0x0081)
1399#define XL_FR_TX_FRAME ((unsigned short)0x0082)
1400#define XL_FR_TXACK_FRAME ((unsigned short)0x0083)
1401#define XL_FR_INVALID_FRAME ((unsigned short)0x0084)
1402#define XL_FR_WAKEUP ((unsigned short)0x0085)
1403#define XL_FR_SYMBOL_WINDOW ((unsigned short)0x0086)
1404#define XL_FR_ERROR ((unsigned short)0x0087)
1405 #define XL_FR_ERROR_POC_MODE ((unsigned char)0x01)
1406 #define XL_FR_ERROR_SYNC_FRAMES_BELOWMIN ((unsigned char)0x02)
1407 #define XL_FR_ERROR_SYNC_FRAMES_OVERLOAD ((unsigned char)0x03)
1408 #define XL_FR_ERROR_CLOCK_CORR_FAILURE ((unsigned char)0x04)
1409 #define XL_FR_ERROR_NIT_FAILURE ((unsigned char)0x05)
1410 #define XL_FR_ERROR_CC_ERROR ((unsigned char)0x06)
1411#define XL_FR_STATUS ((unsigned short)0x0088)
1412#define XL_FR_NM_VECTOR ((unsigned short)0x008A)
1413#define XL_FR_TRANCEIVER_STATUS ((unsigned short)0x008B)
1414#define XL_FR_SPY_FRAME ((unsigned short)0x008E)
1415#define XL_FR_SPY_SYMBOL ((unsigned short)0x008F)
1416
1417
1418// Attention: The timer event type has to have the same number as CANcardXL, CANboardXL, ...
1419
1420/////////////////////////////////////////////////////////////////////////////////////////////////////////
1421// function structures
1422/////////////////////////////////////////////////////////////////////////////////////////////////////////
1423
1424// structure for xlFrSetConfiguration
1425typedef struct s_xl_fr_cluster_configuration {
1426
1427 unsigned int busGuardianEnable;
1428 unsigned int baudrate;
1429 unsigned int busGuardianTick;
1430 unsigned int externalClockCorrectionMode;
1431 unsigned int gColdStartAttempts;
1432 unsigned int gListenNoise;
1433 unsigned int gMacroPerCycle;
1434 unsigned int gMaxWithoutClockCorrectionFatal;
1435 unsigned int gMaxWithoutClockCorrectionPassive;
1436 unsigned int gNetworkManagementVectorLength;
1437 unsigned int gNumberOfMinislots;
1438 unsigned int gNumberOfStaticSlots;
1439 unsigned int gOffsetCorrectionStart;
1440 unsigned int gPayloadLengthStatic;
1441 unsigned int gSyncNodeMax;
1442 unsigned int gdActionPointOffset;
1443 unsigned int gdDynamicSlotIdlePhase;
1444 unsigned int gdMacrotick;
1445 unsigned int gdMinislot;
1446 unsigned int gdMiniSlotActionPointOffset;
1447 unsigned int gdNIT;
1448 unsigned int gdStaticSlot;
1449 unsigned int gdSymbolWindow;
1450 unsigned int gdTSSTransmitter;
1451 unsigned int gdWakeupSymbolRxIdle;
1452 unsigned int gdWakeupSymbolRxLow;
1453 unsigned int gdWakeupSymbolRxWindow;
1454 unsigned int gdWakeupSymbolTxIdle;
1455 unsigned int gdWakeupSymbolTxLow;
1456 unsigned int pAllowHaltDueToClock;
1457 unsigned int pAllowPassiveToActive;
1458 unsigned int pChannels;
1459 unsigned int pClusterDriftDamping;
1460 unsigned int pDecodingCorrection;
1461 unsigned int pDelayCompensationA;
1462 unsigned int pDelayCompensationB;
1463 unsigned int pExternOffsetCorrection;
1464 unsigned int pExternRateCorrection;
1465 unsigned int pKeySlotUsedForStartup;
1466 unsigned int pKeySlotUsedForSync;
1467 unsigned int pLatestTx;
1468 unsigned int pMacroInitialOffsetA;
1469 unsigned int pMacroInitialOffsetB;
1470 unsigned int pMaxPayloadLengthDynamic;
1471 unsigned int pMicroInitialOffsetA;
1472 unsigned int pMicroInitialOffsetB;
1473 unsigned int pMicroPerCycle;
1474 unsigned int pMicroPerMacroNom;
1475 unsigned int pOffsetCorrectionOut;
1476 unsigned int pRateCorrectionOut;
1477 unsigned int pSamplesPerMicrotick;
1478 unsigned int pSingleSlotEnabled;
1479 unsigned int pWakeupChannel;
1480 unsigned int pWakeupPattern;
1481 unsigned int pdAcceptedStartupRange;
1482 unsigned int pdListenTimeout;
1483 unsigned int pdMaxDrift;
1484 unsigned int pdMicrotick;
1485 unsigned int gdCASRxLowMax;
1486 unsigned int gChannels;
1487 unsigned int vExternOffsetControl;
1488 unsigned int vExternRateControl;
1489 unsigned int pChannelsMTS;
1490
1491 unsigned int framePresetData; //!< 16-bit value with data for pre-initializing the Flexray payload data words
1492
1493 unsigned int reserved[15];
1494} XLfrClusterConfig;
1495
1496
1497// structure and defines for function xlFrGetChannelConfig
1498typedef struct s_xl_fr_channel_config {
1499 unsigned int status; // XL_FR_CHANNEL_CFG_STATUS_xxx
1500 unsigned int cfgMode; // XL_FR_CHANNEL_CFG_MODE_xxx
1501 unsigned int reserved[6];
1502 XLfrClusterConfig xlFrClusterConfig; // same as used in function xlFrSetConfig
1503} XLfrChannelConfig;
1504
1505// defines for XLfrChannelConfig::status
1506#define XL_FR_CHANNEL_CFG_STATUS_INIT_APP_PRESENT ((unsigned int) 0x01)
1507#define XL_FR_CHANNEL_CFG_STATUS_CHANNEL_ACTIVATED ((unsigned int) 0x02)
1508#define XL_FR_CHANNEL_CFG_STATUS_VALID_CLUSTER_CFG ((unsigned int) 0x04)
1509#define XL_FR_CHANNEL_CFG_STATUS_VALID_CFG_MODE ((unsigned int) 0x08)
1510
1511// defines for XLfrChannelConfig::cfgMode
1512#define XL_FR_CHANNEL_CFG_MODE_SYNCHRONOUS 1
1513#define XL_FR_CHANNEL_CFG_MODE_COMBINED 2
1514#define XL_FR_CHANNEL_CFG_MODE_ASYNCHRONOUS 3
1515
1516
1517// defines for xlFrSetMode (frModes)
1518#define XL_FR_MODE_NORMAL 0x00 //!< setup the VN3000 (eRay) normal operation mode. (default mode)
1519#define XL_FR_MODE_COLD_NORMAL 0x04 //!< setup the VN3000 (Fujitsu) normal operation mode. (default mode)
1520
1521// defines for xlFrSetMode (frStartupAttributes)
1522#define XL_FR_MODE_NONE 0x00 //!< for normal use
1523#define XL_FR_MODE_WAKEUP 0x01 //!< for wakeup
1524#define XL_FR_MODE_COLDSTART_LEADING 0x02 //!< Coldstart path initiating the schedule synchronization
1525#define XL_FR_MODE_COLDSTART_FOLLOWING 0x03 //!< Coldstart path joining other coldstart nodes
1526#define XL_FR_MODE_WAKEUP_AND_COLDSTART_LEADING 0x04 //!< Send Wakeup and Coldstart path initiating the schedule synchronization
1527#define XL_FR_MODE_WAKEUP_AND_COLDSTART_FOLLOWING 0x05 //!< Send Wakeup and Coldstart path joining other coldstart nodes
1528
1529// structure for xlFrSetMode
1530typedef struct s_xl_fr_set_modes {
1531 unsigned int frMode;
1532 unsigned int frStartupAttributes;
1533 unsigned int reserved[30];
1534} XLfrMode;
1535
1536// defines for xlFrSetupSymbolWindow
1537#define XL_FR_SYMBOL_MTS 0x01 //!< defines a MTS (Media Access Test Symbol)
1538#define XL_FR_SYMBOL_CAS 0x02 //!< defines a CAS (Collision Avoidance Symbol)
1539
1540
1541// FR transceiver xlFrSetTransceiverMode modes
1542#define XL_FR_TRANSCEIVER_MODE_SLEEP 0x01
1543#define XL_FR_TRANSCEIVER_MODE_NORMAL 0x02
1544#define XL_FR_TRANSCEIVER_MODE_RECEIVE_ONLY 0x03
1545#define XL_FR_TRANSCEIVER_MODE_STANDBY 0x04
1546
1547// defines for XL_FR_SYNC_PULSE_EV member triggerSource
1548#define XL_FR_SYNC_PULSE_EXTERNAL 0x00
1549#define XL_FR_SYNC_PULSE_OUR 0x01
1550#define XL_FR_SYNC_PULSE_OUR_SHARED 0x02
1551
1552// defines for xlFrActivateSpy, mode
1553#define XL_FR_SPY_MODE_ASYNCHRONOUS 0x01
1554
1555/////////////////////////////////////////////////////////////////////////////////////////////////////////
1556// Flags for the flagsChip parameter
1557/////////////////////////////////////////////////////////////////////////////////////////////////////////
1558#define XL_FR_CHANNEL_A ((unsigned short)0x01)
1559#define XL_FR_CHANNEL_B ((unsigned short)0x02)
1560#define XL_FR_CHANNEL_AB ((unsigned short)(XL_FR_CHANNEL_A|XL_FR_CHANNEL_B))
1561#define XL_FR_CC_COLD_A ((unsigned short)0x04) //!< second CC channel A to initiate the coldstart
1562#define XL_FR_CC_COLD_B ((unsigned short)0x08) //!< second CC channel B to initiate the coldstart
1563#define XL_FR_CC_COLD_AB ((unsigned short)(XL_FR_CC_COLD_A|XL_FR_CC_COLD_B))
1564#define XL_FR_SPY_CHANNEL_A ((unsigned short)0x10) //!< Spy mode flags
1565#define XL_FR_SPY_CHANNEL_B ((unsigned short)0x20) //!< Spy mode flags
1566
1567#define XL_FR_QUEUE_OVERFLOW ((unsigned short)0x0100) //!< driver queue overflow
1568
1569
1570/////////////////////////////////////////////////////////////////////////////////////////////////////////
1571// T_FLEXRAY_FRAME structure flags / defines
1572/////////////////////////////////////////////////////////////////////////////////////////////////////////
1573// defines for T_FLEXRAY_FRAME member flags
1574#define XL_FR_FRAMEFLAG_STARTUP ((unsigned short) 0x0001) //!< indicates a startup frame
1575#define XL_FR_FRAMEFLAG_SYNC ((unsigned short) 0x0002) //!< indicates a sync frame
1576#define XL_FR_FRAMEFLAG_NULLFRAME ((unsigned short) 0x0004) //!< indicates a nullframe
1577#define XL_FR_FRAMEFLAG_PAYLOAD_PREAMBLE ((unsigned short) 0x0008) //!< indicates a present payload preamble bit
1578#define XL_FR_FRAMEFLAG_FR_RESERVED ((unsigned short) 0x0010) //!< reserved by Flexray protocol
1579
1580#define XL_FR_FRAMEFLAG_REQ_TXACK ((unsigned short) 0x0020) //!< used for Tx events only
1581#define XL_FR_FRAMEFLAG_TXACK_SS XL_FR_FRAMEFLAG_REQ_TXACK //!< indicates TxAck of SingleShot; used for TxAck events only
1582#define XL_FR_FRAMEFLAG_RX_UNEXPECTED XL_FR_FRAMEFLAG_REQ_TXACK //!< indicates unexpected Rx frame; used for Rx events only
1583
1584#define XL_FR_FRAMEFLAG_NEW_DATA_TX ((unsigned short) 0x0040) //!< flag used with TxAcks to indicate first TxAck after data update
1585#define XL_FR_FRAMEFLAG_DATA_UPDATE_LOST ((unsigned short) 0x0080) //!< flag used with TxAcks indicating that data update has been lost
1586
1587#define XL_FR_FRAMEFLAG_SYNTAX_ERROR ((unsigned short) 0x0200)
1588#define XL_FR_FRAMEFLAG_CONTENT_ERROR ((unsigned short) 0x0400)
1589#define XL_FR_FRAMEFLAG_SLOT_BOUNDARY_VIOLATION ((unsigned short) 0x0800)
1590#define XL_FR_FRAMEFLAG_TX_CONFLICT ((unsigned short) 0x1000)
1591#define XL_FR_FRAMEFLAG_EMPTY_SLOT ((unsigned short) 0x2000)
1592#define XL_FR_FRAMEFLAG_FRAME_TRANSMITTED ((unsigned short) 0x8000) //!< Only used with TxAcks: Frame has been transmitted. If not set after transmission, an error has occurred.
1593
1594// XL_FR_SPY_FRAME_EV event: frameError value
1595#define XL_FR_SPY_FRAMEFLAG_FRAMING_ERROR ((unsigned char)0x01)
1596#define XL_FR_SPY_FRAMEFLAG_HEADER_CRC_ERROR ((unsigned char)0x02)
1597#define XL_FR_SPY_FRAMEFLAG_FRAME_CRC_ERROR ((unsigned char)0x04)
1598
1599// XL_FR_SPY_FRAME_EV event: frameCRC value
1600#define XL_FR_SPY_FRAMEFLAG_FRAME_CRC_NEW_LAYOUT ((unsigned int)0x80000000)
1601
1602// XL_FR_TX_FRAME event: txMode flags
1603#define XL_FR_TX_MODE_CYCLIC ((unsigned char)0x01) //!< 'normal' cyclic mode
1604#define XL_FR_TX_MODE_SINGLE_SHOT ((unsigned char)0x02) //!< sends only a single shot
1605#define XL_FR_TX_MODE_NONE ((unsigned char)0xff) //!< switch off TX
1606
1607// XL_FR_TX_FRAME event: incrementSize values
1608#define XL_FR_PAYLOAD_INCREMENT_8BIT ((unsigned char) 8)
1609#define XL_FR_PAYLOAD_INCREMENT_16BIT ((unsigned char) 16)
1610#define XL_FR_PAYLOAD_INCREMENT_32BIT ((unsigned char) 32)
1611
1612// XL_FR_STATUS event: statusType (POC status)
1613#define XL_FR_STATUS_DEFAULT_CONFIG 0x00 //!< indicates the actual state of the POC in operation control
1614#define XL_FR_STATUS_READY 0x01 //!< ...
1615#define XL_FR_STATUS_NORMAL_ACTIVE 0x02 //!< ...
1616#define XL_FR_STATUS_NORMAL_PASSIVE 0x03 //!< ...
1617#define XL_FR_STATUS_HALT 0x04 //!< ...
1618#define XL_FR_STATUS_MONITOR_MODE 0x05 //!< ...
1619#define XL_FR_STATUS_CONFIG 0x0f //!< ...
1620
1621#define XL_FR_STATUS_WAKEUP_STANDBY 0x10 //!< indicates the actual state of the POC in the wakeup path
1622#define XL_FR_STATUS_WAKEUP_LISTEN 0x11 //!< ...
1623#define XL_FR_STATUS_WAKEUP_SEND 0x12 //!< ...
1624#define XL_FR_STATUS_WAKEUP_DETECT 0x13 //!< ...
1625
1626#define XL_FR_STATUS_STARTUP_PREPARE 0x20 //!< indicates the actual state of the POC in the startup path
1627#define XL_FR_STATUS_COLDSTART_LISTEN 0x21 //!< ...
1628#define XL_FR_STATUS_COLDSTART_COLLISION_RESOLUTION 0x22 //!< ...
1629#define XL_FR_STATUS_COLDSTART_CONSISTENCY_CHECK 0x23 //!< ...
1630#define XL_FR_STATUS_COLDSTART_GAP 0x24 //!< ...
1631#define XL_FR_STATUS_COLDSTART_JOIN 0x25 //!< ...
1632#define XL_FR_STATUS_INTEGRATION_COLDSTART_CHECK 0x26 //!< ...
1633#define XL_FR_STATUS_INTEGRATION_LISTEN 0x27 //!< ...
1634#define XL_FR_STATUS_INTEGRATION_CONSISTENCY_CHECK 0x28 //!< ...
1635#define XL_FR_STATUS_INITIALIZE_SCHEDULE 0x29 //!< ...
1636#define XL_FR_STATUS_ABORT_STARTUP 0x2a //!< ...
1637#define XL_FR_STATUS_STARTUP_SUCCESS 0x2b //!< ...
1638
1639// XL_FR_ERROR event: XL_FR_ERROR_POC_MODE, errorMode
1640#define XL_FR_ERROR_POC_ACTIVE 0x00 //!< Indicates the actual error mode of the POC: active (green)
1641#define XL_FR_ERROR_POC_PASSIVE 0x01 //!< Indicates the actual error mode of the POC: passive (yellow)
1642#define XL_FR_ERROR_POC_COMM_HALT 0x02 //!< Indicates the actual error mode of the POC: comm-halt (red)
1643
1644// XL_FR_ERROR event: XL_FR_ERROR_NIT_FAILURE, flags
1645#define XL_FR_ERROR_NIT_SENA 0x100 //!< Syntax Error during NIT Channel A
1646#define XL_FR_ERROR_NIT_SBNA 0x200 //!< Slot Boundary Violation during NIT Channel B
1647#define XL_FR_ERROR_NIT_SENB 0x400 //!< Syntax Error during NIT Channel A
1648#define XL_FR_ERROR_NIT_SBNB 0x800 //!< Slot Boundary Violation during NIT Channel B
1649
1650// XL_FR_ERROR event: XL_FR_ERROR_CLOCK_CORR_FAILURE, flags
1651#define XL_FR_ERROR_MISSING_OFFSET_CORRECTION 0x00000001 //!< Set if no sync frames were received. -> no offset correction possible.
1652#define XL_FR_ERROR_MAX_OFFSET_CORRECTION_REACHED 0x00000002 //!< Set if max. offset correction limit is reached.
1653#define XL_FR_ERROR_MISSING_RATE_CORRECTION 0x00000004 //!< Set if no even/odd sync frames were received -> no rate correction possible.
1654#define XL_FR_ERROR_MAX_RATE_CORRECTION_REACHED 0x00000008 //!< Set if max. rate correction limit is reached.
1655
1656// XL_FR_ERROR event: XL_FR_ERROR_CC_ERROR, erayEir
1657#define XL_FR_ERROR_CC_PERR 0x00000040 //!< Parity Error, data from MHDS (internal ERay error)
1658#define XL_FR_ERROR_CC_IIBA 0x00000200 //!< Illegal Input Buffer Access (internal ERay error)
1659#define XL_FR_ERROR_CC_IOBA 0x00000400 //!< Illegal Output Buffer Access (internal ERay error)
1660#define XL_FR_ERROR_CC_MHF 0x00000800 //!< Message Handler Constraints Flag data from MHDF (internal ERay error)
1661#define XL_FR_ERROR_CC_EDA 0x00010000 //!< Error Detection on channel A, data from ACS
1662#define XL_FR_ERROR_CC_LTVA 0x00020000 //!< Latest Transmit Violation on channel A
1663#define XL_FR_ERROR_CC_TABA 0x00040000 //!< Transmit Across Boundary on Channel A
1664#define XL_FR_ERROR_CC_EDB 0x01000000 //!< Error Detection on channel B, data from ACS
1665#define XL_FR_ERROR_CC_LTVB 0x02000000 //!< Latest Transmit Violation on channel B
1666#define XL_FR_ERROR_CC_TABB 0x04000000 //!< Transmit Across Boundary on Channel B
1667
1668// XL_FR_WAKEUP event: wakeupStatus
1669#define XL_FR_WAKEUP_UNDEFINED 0x00 //!< No wakeup attempt since CONFIG state was left. (e.g. when a wakeup pattern A|B is received)
1670#define XL_FR_WAKEUP_RECEIVED_HEADER 0x01 //!< Frame header without coding violation received.
1671#define XL_FR_WAKEUP_RECEIVED_WUP 0x02 //!< Wakeup pattern on the configured wakeup channel received.
1672#define XL_FR_WAKEUP_COLLISION_HEADER 0x03 //!< Detected collision during wakeup pattern transmission received.
1673#define XL_FR_WAKEUP_COLLISION_WUP 0x04 //!< Collision during wakeup pattern transmission received.
1674#define XL_FR_WAKEUP_COLLISION_UNKNOWN 0x05 //!< Set when the CC stops wakeup.
1675#define XL_FR_WAKEUP_TRANSMITTED 0x06 //!< Completed the transmission of the wakeup pattern.
1676#define XL_FR_WAKEUP_EXTERNAL_WAKEUP 0x07 //!< wakeup comes from external
1677#define XL_FR_WAKEUP_WUP_RECEIVED_WITHOUT_WUS_TX 0x10 //!< wakeupt pattern received from flexray bus
1678#define XL_FR_WAKEUP_RESERVED 0xFF
1679
1680// XL_FR_SYMBOL_WINDOW event: flags
1681#define XL_FR_SYMBOL_STATUS_SESA 0x01 //!< Syntax Error in Symbol Window Channel A
1682#define XL_FR_SYMBOL_STATUS_SBSA 0x02 //!< Slot Boundary Violation in Symbol Window Channel A
1683#define XL_FR_SYMBOL_STATUS_TCSA 0x04 //!< Transmission Conflict in Symbol Window Channel A
1684#define XL_FR_SYMBOL_STATUS_SESB 0x08 //!< Syntax Error in Symbol Window Channel B
1685#define XL_FR_SYMBOL_STATUS_SBSB 0x10 //!< Slot Boundary Violation in Symbol Window Channel B
1686#define XL_FR_SYMBOL_STATUS_TCSB 0x20 //!< Transmission Conflict in Symbol Window Channel B
1687#define XL_FR_SYMBOL_STATUS_MTSA 0x40 //!< MTS received in Symbol Window Channel A
1688#define XL_FR_SYMBOL_STATUS_MTSB 0x80 //!< MTS received in Symbol Window Channel B
1689
1690
1691#include <pshpack8.h>
1692
1693#define XL_FR_RX_EVENT_HEADER_SIZE 32
1694#define XL_FR_MAX_EVENT_SIZE 512
1695
1696/////////////////////////////////////////////////////////////////////////////////////////////////////////
1697// Structures for FlexRay events
1698/////////////////////////////////////////////////////////////////////////////////////////////////////////
1699
1700typedef struct s_xl_fr_start_cycle {
1701 unsigned int cycleCount;
1702 int vRateCorrection;
1703 int vOffsetCorrection;
1704 unsigned int vClockCorrectionFailed;
1705 unsigned int vAllowPassivToActive;
1706 unsigned int reserved[3];
1707} XL_FR_START_CYCLE_EV;
1708
1709typedef struct s_xl_fr_rx_frame {
1710 unsigned short flags;
1711 unsigned short headerCRC;
1712 unsigned short slotID;
1713 unsigned char cycleCount;
1714 unsigned char payloadLength;
1715 unsigned char data[XL_FR_MAX_DATA_LENGTH];
1716} XL_FR_RX_FRAME_EV;
1717
1718typedef struct s_xl_fr_tx_frame {
1719 unsigned short flags;
1720 unsigned short slotID;
1721 unsigned char offset;
1722 unsigned char repetition;
1723 unsigned char payloadLength;
1724 unsigned char txMode;
1725 unsigned char incrementSize;
1726 unsigned char incrementOffset;
1727 unsigned char reserved0;
1728 unsigned char reserved1;
1729 unsigned char data[XL_FR_MAX_DATA_LENGTH];
1730} XL_FR_TX_FRAME_EV;
1731
1732typedef struct s_xl_fr_wakeup {
1733 unsigned char cycleCount; //!< Actual cyclecount.
1734 unsigned char wakeupStatus; //!< XL_FR_WAKEUP_UNDEFINED, ...
1735 unsigned char reserved[6];
1736} XL_FR_WAKEUP_EV;
1737
1738typedef struct s_xl_fr_symbol_window {
1739 unsigned int symbol; //!< XL_FR_SYMBOL_MTS, ...
1740 unsigned int flags; //!< XL_FR_SYMBOL_STATUS_SESA, ...
1741 unsigned char cycleCount; //!< Actual cyclecount.
1742 unsigned char reserved[7];
1743} XL_FR_SYMBOL_WINDOW_EV;
1744
1745typedef struct s_xl_fr_status {
1746 unsigned int statusType; //!< POC status XL_FR_STATUS_ defines like, normal, active...
1747 unsigned int reserved;
1748} XL_FR_STATUS_EV;
1749
1750typedef struct s_xl_fr_nm_vector {
1751 unsigned char nmVector[12];
1752 unsigned char cycleCount; //!< Actual cyclecount.
1753 unsigned char reserved[3];
1754} XL_FR_NM_VECTOR_EV;
1755
1756typedef struct s_xl_fr_sync_pulse {
1757 unsigned int triggerSource; //!< e.g. external or internal trigger source
1758 XLuint64 time; //!< internal generated timestamp
1759} XL_FR_SYNC_PULSE_EV;
1760
1761typedef struct s_xl_fr_error_poc_mode {
1762 unsigned char errorMode; //!< error mode like: active, passive, comm_halt
1763 unsigned char reserved[3];
1764} XL_FR_ERROR_POC_MODE_EV;
1765
1766typedef struct s_xl_fr_error_sync_frames {
1767 unsigned short evenSyncFramesA; //!< valid RX/TX sync frames on frCh A for even cycles
1768 unsigned short oddSyncFramesA; //!< valid RX/TX sync frames on frCh A for odd cycles
1769 unsigned short evenSyncFramesB; //!< valid RX/TX sync frames on frCh B for even cycles
1770 unsigned short oddSyncFramesB; //!< valid RX/TX sync frames on frCh B for odd cycles
1771 unsigned int reserved;
1772} XL_FR_ERROR_SYNC_FRAMES_EV;
1773
1774typedef struct s_xl_fr_error_clock_corr_failure {
1775 unsigned short evenSyncFramesA; //!< valid RX/TX sync frames on frCh A for even cycles
1776 unsigned short oddSyncFramesA; //!< valid RX/TX sync frames on frCh A for odd cycles
1777 unsigned short evenSyncFramesB; //!< valid RX/TX sync frames on frCh B for even cycles
1778 unsigned short oddSyncFramesB; //!< valid RX/TX sync frames on frCh B for odd cycles
1779 unsigned int flags; //!< missing/maximum rate/offset correction flags.
1780 unsigned int clockCorrFailedCounter; //!< E-Ray: CCEV register (CCFC value)
1781 unsigned int reserved;
1782} XL_FR_ERROR_CLOCK_CORR_FAILURE_EV;
1783
1784typedef struct s_xl_fr_error_nit_failure {
1785 unsigned int flags; //!< flags for NIT boundary, syntax error...
1786 unsigned int reserved;
1787} XL_FR_ERROR_NIT_FAILURE_EV;
1788
1789typedef struct s_xl_fr_error_cc_error {
1790 unsigned int ccError; //!< internal CC errors (Transmit Across Boundary, Transmit Violation...)
1791 unsigned int reserved;
1792} XL_FR_ERROR_CC_ERROR_EV;
1793
1794union s_xl_fr_error_info {
1795 XL_FR_ERROR_POC_MODE_EV frPocMode; //!< E-RAY: EIR_PEMC
1796 XL_FR_ERROR_SYNC_FRAMES_EV frSyncFramesBelowMin; //!< E-RAY: EIR_SFBM
1797 XL_FR_ERROR_SYNC_FRAMES_EV frSyncFramesOverload; //!< E-RAY: EIR_SFO
1798 XL_FR_ERROR_CLOCK_CORR_FAILURE_EV frClockCorrectionFailure;//!< E-RAY: EIR_CCF
1799 XL_FR_ERROR_NIT_FAILURE_EV frNitFailure; //!< NIT part of the E_RAY: SWNIT register
1800 XL_FR_ERROR_CC_ERROR_EV frCCError; //!< internal CC error flags (E-RAY: EIR)
1801};
1802
1803typedef struct s_xl_fr_error {
1804 unsigned char tag;
1805 unsigned char cycleCount;
1806 unsigned char reserved[6];
1807 union s_xl_fr_error_info errorInfo;
1808} XL_FR_ERROR_EV;
1809
1810typedef struct s_xl_fr_spy_frame {
1811 unsigned int frameLength;
1812 unsigned char frameError; //!< XL_FR_SPY_FRAMEFLAG_XXX values
1813 unsigned char tssLength;
1814 unsigned short headerFlags;
1815 unsigned short slotID;
1816 unsigned short headerCRC;
1817 unsigned char payloadLength;
1818 unsigned char cycleCount;
1819 unsigned short reserved;
1820 unsigned int frameCRC;
1821 unsigned char data[XL_FR_MAX_DATA_LENGTH];
1822} XL_FR_SPY_FRAME_EV;
1823
1824typedef struct s_xl_fr_spy_symbol {
1825 unsigned short lowLength;
1826 unsigned short reserved;
1827 } XL_FR_SPY_SYMBOL_EV;
1828
1829
1830#define XL_NOTIFY_REASON_CHANNEL_ACTIVATION 1
1831#define XL_NOTIFY_REASON_CHANNEL_DEACTIVATION 2
1832#define XL_NOTIFY_REASON_PORT_CLOSED 3
1833
1834typedef struct s_xl_application_notification {
1835 unsigned int notifyReason; // XL_NOTIFY_REASON_xxx
1836 unsigned int reserved[7];
1837} XL_APPLICATION_NOTIFICATION_EV;
1838
1839
1840
1841/////////////////////////////////////////////////////////////////////////////////////////////////////////
1842// rx event definition
1843/////////////////////////////////////////////////////////////////////////////////////////////////////////
1844
1845union s_xl_fr_tag_data {
1846 XL_FR_START_CYCLE_EV frStartCycle;
1847 XL_FR_RX_FRAME_EV frRxFrame;
1848 XL_FR_TX_FRAME_EV frTxFrame;
1849 XL_FR_WAKEUP_EV frWakeup;
1850 XL_FR_SYMBOL_WINDOW_EV frSymbolWindow;
1851 XL_FR_ERROR_EV frError;
1852 XL_FR_STATUS_EV frStatus;
1853 XL_FR_NM_VECTOR_EV frNmVector;
1854 XL_FR_SYNC_PULSE_EV frSyncPulse;
1855 XL_FR_SPY_FRAME_EV frSpyFrame;
1856 XL_FR_SPY_SYMBOL_EV frSpySymbol;
1857
1858 XL_APPLICATION_NOTIFICATION_EV applicationNotification;
1859
1860 unsigned char raw[XL_FR_MAX_EVENT_SIZE - XL_FR_RX_EVENT_HEADER_SIZE];
1861};
1862
1863typedef unsigned short XLfrEventTag;
1864
1865struct s_xl_fr_event {
1866 unsigned int size; // 4 - overall size of the complete event
1867 XLfrEventTag tag; // 2 - type of the event
1868 unsigned short channelIndex; // 2
1869 unsigned int userHandle; // 4
1870 unsigned short flagsChip; // 2 - frChannel e.g. XL_FR_CHANNEL_A (lower 8 bit), queue overflow (upper 8bit)
1871 unsigned short reserved; // 2
1872 XLuint64 timeStamp; // 8 - raw timestamp
1873 XLuint64 timeStampSync; // 8 - timestamp which is synchronized by the driver
1874 // ---------
1875 // 32 bytes -> XL_FR_RX_EVENT_HEADER_SIZE
1876 union s_xl_fr_tag_data tagData;
1877};
1878
1879typedef struct s_xl_fr_event XLfrEvent;
1880
1881
1882#include <poppack.h>
1883
1884/////////////////////////////////////////////////////////////////////////////////////////////////////////
1885// MOST150 XL API
1886/////////////////////////////////////////////////////////////////////////////////////////////////////////
1887
1888#define XL_MOST150_RX_EVENT_HEADER_SIZE (unsigned short) 32
1889#define XL_MOST150_MAX_EVENT_DATA_SIZE (unsigned int) 2048
1890#define MOST150_SYNC_ALLOC_INFO_SIZE (unsigned int) 372
1891
1892#define XL_MOST150_CTRL_PAYLOAD_MAX_SIZE (unsigned short) 45
1893#define XL_MOST150_ASYNC_PAYLOAD_MAX_SIZE (unsigned short) 1524 // maximum valid length (s. INIC User Manual)
1894#define XL_MOST150_ETHERNET_PAYLOAD_MAX_SIZE (unsigned short) 1506 // maximum valid length (s. INIC User Manual)
1895#define XL_MOST150_ASYNC_SEND_PAYLOAD_MAX_SIZE (unsigned short) 1600 // maximum length for sending a MDP
1896#define XL_MOST150_ETHERNET_SEND_PAYLOAD_MAX_SIZE (unsigned short) 1600 // maximum length for sending a MEP
1897
1898//////////////////////////////////////////////////////////////
1899// event tags
1900//////////////////////////////////////////////////////////////
1901#define XL_START (unsigned short) 0x0200
1902#define XL_STOP (unsigned short) 0x0201
1903#define XL_MOST150_EVENT_SOURCE (unsigned short) 0x0203
1904#define XL_MOST150_DEVICE_MODE (unsigned short) 0x0204
1905#define XL_MOST150_SYNC_ALLOC_INFO (unsigned short) 0x0205
1906#define XL_MOST150_FREQUENCY (unsigned short) 0x0206
1907#define XL_MOST150_SPECIAL_NODE_INFO (unsigned short) 0x0207
1908#define XL_MOST150_CTRL_RX (unsigned short) 0x0208
1909#define XL_MOST150_CTRL_TX_ACK (unsigned short) 0x0209
1910#define XL_MOST150_ASYNC_SPY (unsigned short) 0x020A
1911#define XL_MOST150_ASYNC_RX (unsigned short) 0x020B
1912#define XL_MOST150_SYNC_VOLUME_STATUS (unsigned short) 0x020D
1913#define XL_MOST150_TX_LIGHT (unsigned short) 0x020E
1914#define XL_MOST150_RXLIGHT_LOCKSTATUS (unsigned short) 0x020F
1915#define XL_MOST150_ERROR (unsigned short) 0x0210
1916#define XL_MOST150_CONFIGURE_RX_BUFFER (unsigned short) 0x0211
1917#define XL_MOST150_CTRL_SYNC_AUDIO (unsigned short) 0x0212
1918#define XL_MOST150_SYNC_MUTE_STATUS (unsigned short) 0x0213
1919#define XL_MOST150_LIGHT_POWER (unsigned short) 0x0214
1920#define XL_MOST150_GEN_LIGHT_ERROR (unsigned short) 0x0215
1921#define XL_MOST150_GEN_LOCK_ERROR (unsigned short) 0x0216
1922#define XL_MOST150_CTRL_BUSLOAD (unsigned short) 0x0217
1923#define XL_MOST150_ASYNC_BUSLOAD (unsigned short) 0x0218
1924#define XL_MOST150_ETHERNET_RX (unsigned short) 0x0219
1925#define XL_MOST150_SYSTEMLOCK_FLAG (unsigned short) 0x021A
1926#define XL_MOST150_SHUTDOWN_FLAG (unsigned short) 0x021B
1927#define XL_MOST150_CTRL_SPY (unsigned short) 0x021C
1928#define XL_MOST150_ASYNC_TX_ACK (unsigned short) 0x021D
1929#define XL_MOST150_ETHERNET_SPY (unsigned short) 0x021E
1930#define XL_MOST150_ETHERNET_TX_ACK (unsigned short) 0x021F
1931#define XL_MOST150_SPDIFMODE (unsigned short) 0x0220
1932#define XL_MOST150_ECL_LINE_CHANGED (unsigned short) 0x0222
1933#define XL_MOST150_ECL_TERMINATION_CHANGED (unsigned short) 0x0223
1934#define XL_MOST150_NW_STARTUP (unsigned short) 0x0224
1935#define XL_MOST150_NW_SHUTDOWN (unsigned short) 0x0225
1936#define XL_MOST150_STREAM_STATE (unsigned short) 0x0226
1937#define XL_MOST150_STREAM_TX_BUFFER (unsigned short) 0x0227
1938#define XL_MOST150_STREAM_RX_BUFFER (unsigned short) 0x0228
1939#define XL_MOST150_STREAM_TX_LABEL (unsigned short) 0x0229
1940#define XL_MOST150_STREAM_TX_UNDERFLOW (unsigned short) 0x022B
1941#define XL_MOST150_GEN_BYPASS_STRESS (unsigned short) 0x022C
1942#define XL_MOST150_ECL_SEQUENCE (unsigned short) 0x022D
1943#define XL_MOST150_ECL_GLITCH_FILTER (unsigned short) 0x022E
1944
1945/////////////////////////////////////////////////////////////////////////////////////////////////////////
1946// Flags for the flagsChip parameter
1947/////////////////////////////////////////////////////////////////////////////////////////////////////////
1948#define XL_MOST150_VN2640 (unsigned short) 0x0001 //!< common VN2640 event
1949#define XL_MOST150_INIC (unsigned short) 0x0002 //!< event was generated by INIC
1950#define XL_MOST150_SPY (unsigned short) 0x0004 //!< event was generated by spy
1951#define XL_MOST150_QUEUE_OVERFLOW (unsigned short) 0x0100 //!< queue overflow occured (some events are lost)
1952
1953// XL_MOST150_EVENT_SOURCE_EV.mask
1954#define XL_MOST150_SOURCE_SPECIAL_NODE (unsigned int) 0x00000001
1955#define XL_MOST150_SOURCE_SYNC_ALLOC_INFO (unsigned int) 0x00000004
1956#define XL_MOST150_SOURCE_CTRL_SPY (unsigned int) 0x00000008
1957#define XL_MOST150_SOURCE_ASYNC_SPY (unsigned int) 0x00000010
1958#define XL_MOST150_SOURCE_ETH_SPY (unsigned int) 0x00000020
1959#define XL_MOST150_SOURCE_SHUTDOWN_FLAG (unsigned int) 0x00000040
1960#define XL_MOST150_SOURCE_SYSTEMLOCK_FLAG (unsigned int) 0x00000080
1961#define XL_MOST150_SOURCE_LIGHTLOCK_SPY (unsigned int) 0x00000200
1962#define XL_MOST150_SOURCE_LIGHTLOCK_INIC (unsigned int) 0x00000400
1963#define XL_MOST150_SOURCE_ECL_CHANGE (unsigned int) 0x00000800
1964#define XL_MOST150_SOURCE_LIGHT_STRESS (unsigned int) 0x00001000
1965#define XL_MOST150_SOURCE_LOCK_STRESS (unsigned int) 0x00002000
1966#define XL_MOST150_SOURCE_BUSLOAD_CTRL (unsigned int) 0x00004000
1967#define XL_MOST150_SOURCE_BUSLOAD_ASYNC (unsigned int) 0x00008000
1968#define XL_MOST150_SOURCE_CTRL_MLB (unsigned int) 0x00010000
1969#define XL_MOST150_SOURCE_ASYNC_MLB (unsigned int) 0x00020000
1970#define XL_MOST150_SOURCE_ETH_MLB (unsigned int) 0x00040000
1971#define XL_MOST150_SOURCE_TXACK_MLB (unsigned int) 0x00080000
1972#define XL_MOST150_SOURCE_STREAM_UNDERFLOW (unsigned int) 0x00100000
1973#define XL_MOST150_SOURCE_STREAM_OVERFLOW (unsigned int) 0x00200000
1974#define XL_MOST150_SOURCE_STREAM_RX_DATA (unsigned int) 0x00400000
1975#define XL_MOST150_SOURCE_ECL_SEQUENCE (unsigned int) 0x00800000
1976
1977// XL_MOST150_DEVICE_MODE_EV.deviceMode
1978#define XL_MOST150_DEVICEMODE_SLAVE (unsigned char) 0x00
1979#define XL_MOST150_DEVICEMODE_MASTER (unsigned char) 0x01
1980#define XL_MOST150_DEVICEMODE_STATIC_MASTER (unsigned char) 0x03
1981#define XL_MOST150_DEVICEMODE_RETIMED_BYPASS_SLAVE (unsigned char) 0x04
1982#define XL_MOST150_DEVICEMODE_RETIMED_BYPASS_MASTER (unsigned char) 0x05
1983
1984// XL_MOST150_FREQUENCY_EV.frequency
1985#define XL_MOST150_FREQUENCY_44100 (unsigned int) 0x00000000
1986#define XL_MOST150_FREQUENCY_48000 (unsigned int) 0x00000001
1987#define XL_MOST150_FREQUENCY_ERROR (unsigned int) 0x00000002
1988
1989// XL_MOST150_SPECIAL_NODE_INFO_EV.changeMask
1990#define XL_MOST150_NA_CHANGED (unsigned int) 0x00000001
1991#define XL_MOST150_GA_CHANGED (unsigned int) 0x00000002
1992#define XL_MOST150_NPR_CHANGED (unsigned int) 0x00000004
1993#define XL_MOST150_MPR_CHANGED (unsigned int) 0x00000008
1994#define XL_MOST150_SBC_CHANGED (unsigned int) 0x00000010
1995#define XL_MOST150_CTRL_RETRY_PARAMS_CHANGED (unsigned int) 0x00000060
1996#define XL_MOST150_ASYNC_RETRY_PARAMS_CHANGED (unsigned int) 0x00000180
1997#define XL_MOST150_MAC_ADDR_CHANGED (unsigned int) 0x00000200
1998#define XL_MOST150_NPR_SPY_CHANGED (unsigned int) 0x00000400
1999#define XL_MOST150_MPR_SPY_CHANGED (unsigned int) 0x00000800
2000#define XL_MOST150_SBC_SPY_CHANGED (unsigned int) 0x00001000
2001#define XL_MOST150_INIC_NISTATE_CHANGED (unsigned int) 0x00002000
2002#define XL_MOST150_SPECIAL_NODE_MASK_CHANGED (unsigned int) 0x00003FFF
2003
2004// Retry Parameters
2005#define XL_MOST150_CTRL_RETRY_TIME_MIN (unsigned int) 3 // Time Unit: 16 MOST Frames
2006#define XL_MOST150_CTRL_RETRY_TIME_MAX (unsigned int) 31
2007#define XL_MOST150_CTRL_SEND_ATTEMPT_MIN (unsigned int) 1
2008#define XL_MOST150_CTRL_SEND_ATTEMPT_MAX (unsigned int) 16
2009#define XL_MOST150_ASYNC_RETRY_TIME_MIN (unsigned int) 0 // Time Unit: 1 MOST Frame
2010#define XL_MOST150_ASYNC_RETRY_TIME_MAX (unsigned int) 255
2011#define XL_MOST150_ASYNC_SEND_ATTEMPT_MIN (unsigned int) 1 // For both MDP and MEP
2012#define XL_MOST150_ASYNC_SEND_ATTEMPT_MAX (unsigned int) 16
2013
2014// NIStates
2015#define XL_MOST150_INIC_NISTATE_NET_OFF (unsigned int) 0x00000000
2016#define XL_MOST150_INIC_NISTATE_NET_INIT (unsigned int) 0x00000001
2017#define XL_MOST150_INIC_NISTATE_NET_RBD (unsigned int) 0x00000002
2018#define XL_MOST150_INIC_NISTATE_NET_ON (unsigned int) 0x00000003
2019#define XL_MOST150_INIC_NISTATE_NET_RBD_RESULT (unsigned int) 0x00000004
2020
2021// XL_MOST150_CTRL_TX_ACK_EV.status
2022#define XL_MOST150_TX_OK (unsigned int) 0x00000001
2023#define XL_MOST150_TX_FAILED_FORMAT_ERROR (unsigned int) 0x00000002
2024#define XL_MOST150_TX_FAILED_NETWORK_OFF (unsigned int) 0x00000004
2025#define XL_MOST150_TX_FAILED_TIMEOUT (unsigned int) 0x00000005
2026#define XL_MOST150_TX_FAILED_WRONG_TARGET (unsigned int) 0x00000008
2027#define XL_MOST150_TX_OK_ONE_SUCCESS (unsigned int) 0x00000009
2028#define XL_MOST150_TX_FAILED_BAD_CRC (unsigned int) 0x0000000C
2029#define XL_MOST150_TX_FAILED_RECEIVER_BUFFER_FULL (unsigned int) 0x0000000E
2030
2031// XL_MOST150_CTRL_SPY_EV.validMask
2032// XL_MOST150_ASYNC_SPY_EV.validMask
2033// XL_MOST150_ETHERNET_SPY_EV.validMask
2034#define XL_MOST150_VALID_DATALENANNOUNCED (unsigned int) 0x00000001
2035#define XL_MOST150_VALID_SOURCEADDRESS (unsigned int) 0x00000002
2036#define XL_MOST150_VALID_TARGETADDRESS (unsigned int) 0x00000004
2037#define XL_MOST150_VALID_PACK (unsigned int) 0x00000008
2038#define XL_MOST150_VALID_CACK (unsigned int) 0x00000010
2039#define XL_MOST150_VALID_PINDEX (unsigned int) 0x00000020
2040#define XL_MOST150_VALID_PRIORITY (unsigned int) 0x00000040
2041#define XL_MOST150_VALID_CRC (unsigned int) 0x00000080
2042#define XL_MOST150_VALID_CRCCALCULATED (unsigned int) 0x00000100
2043#define XL_MOST150_VALID_MESSAGE (unsigned int) 0x80000000
2044
2045// XL_MOST150_CTRL_SPY_EV.pAck
2046// XL_MOST150_ASYNC_SPY_EV.pAck
2047// XL_MOST150_ETHERNET_SPY_EV.pAck
2048#define XL_MOST150_PACK_OK (unsigned int) 0x00000004
2049#define XL_MOST150_PACK_BUFFER_FULL (unsigned int) 0x00000001
2050#define XL_MOST150_PACK_NO_RESPONSE (unsigned int) 0x00000000 // maybe spy before receiver
2051
2052// XL_MOST150_CTRL_SPY_EV.cAck
2053// XL_MOST150_ASYNC_SPY_EV.cAck
2054// XL_MOST150_ETHERNET_SPY_EV.cAck
2055#define XL_MOST150_CACK_OK (unsigned int) 0x00000004
2056#define XL_MOST150_CACK_CRC_ERROR (unsigned int) 0x00000001
2057#define XL_MOST150_CACK_NO_RESPONSE (unsigned int) 0x00000000 // maybe spy before receiver
2058
2059//XL_MOST150_ASYNC_RX_EV.length
2060#define XL_MOST150_ASYNC_INVALID_RX_LENGTH (unsigned int) 0x00008000 // flag indicating a received MDP with length > XL_MOST150_ASYNC_PAYLOAD_MAX_SIZE
2061
2062//XL_MOST150_ETHERNET_RX_EV.length
2063#define XL_MOST150_ETHERNET_INVALID_RX_LENGTH (unsigned int) 0x80000000 // flag indicating a received MEP with length > XL_MOST150_ETHERNET_PAYLOAD_MAX_SIZE
2064
2065// XL_MOST150_TX_LIGHT_EV.light
2066#define XL_MOST150_LIGHT_OFF (unsigned int) 0x00000000
2067#define XL_MOST150_LIGHT_FORCE_ON (unsigned int) 0x00000001
2068#define XL_MOST150_LIGHT_MODULATED (unsigned int) 0x00000002
2069
2070// XL_MOST150_RXLIGHT_LOCKSTATUS_EV.status
2071//#define XL_MOST150_LIGHT_OFF (unsigned int) 0x00000000
2072#define XL_MOST150_LIGHT_ON_UNLOCK (unsigned int) 0x00000003
2073#define XL_MOST150_LIGHT_ON_LOCK (unsigned int) 0x00000004
2074#define XL_MOST150_LIGHT_ON_STABLE_LOCK (unsigned int) 0x00000005
2075#define XL_MOST150_LIGHT_ON_CRITICAL_UNLOCK (unsigned int) 0x00000006
2076
2077// XL_MOST150_ERROR_EV.errorCode
2078#define XL_MOST150_ERROR_ASYNC_TX_ACK_HANDLE (unsigned int) 0x00000001
2079#define XL_MOST150_ERROR_ETH_TX_ACK_HANDLE (unsigned int) 0x00000002
2080
2081// XL_MOST150_CONFIGURE_RX_BUFFER_EV.bufferType
2082#define XL_MOST150_RX_BUFFER_TYPE_CTRL (unsigned int) 0x00000001
2083#define XL_MOST150_RX_BUFFER_TYPE_ASYNC (unsigned int) 0x00000002
2084
2085// XL_MOST150_CONFIGURE_RX_BUFFER_EV.bufferMode
2086#define XL_MOST150_RX_BUFFER_NORMAL_MODE (unsigned int) 0x00000000
2087#define XL_MOST150_RX_BUFFER_BLOCK_MODE (unsigned int) 0x00000001
2088
2089// XL_MOST150_CTRL_SYNC_AUDIO_EV.device
2090#define XL_MOST150_DEVICE_LINE_IN (unsigned int) 0x00000000
2091#define XL_MOST150_DEVICE_LINE_OUT (unsigned int) 0x00000001
2092#define XL_MOST150_DEVICE_SPDIF_IN (unsigned int) 0x00000002
2093#define XL_MOST150_DEVICE_SPDIF_OUT (unsigned int) 0x00000003
2094#define XL_MOST150_DEVICE_ALLOC_BANDWIDTH (unsigned int) 0x00000004
2095
2096// XL_MOST150_CTRL_SYNC_AUDIO_EV.mode
2097#define XL_MOST150_DEVICE_MODE_OFF (unsigned int) 0x00000000
2098#define XL_MOST150_DEVICE_MODE_ON (unsigned int) 0x00000001
2099#define XL_MOST150_DEVICE_MODE_OFF_BYPASS_CLOSED (unsigned int) 0x00000002
2100#define XL_MOST150_DEVICE_MODE_OFF_NOT_IN_NETON (unsigned int) 0x00000003
2101#define XL_MOST150_DEVICE_MODE_OFF_NO_MORE_RESOURCES (unsigned int) 0x00000004
2102#define XL_MOST150_DEVICE_MODE_OFF_NOT_ENOUGH_FREE_BW (unsigned int) 0x00000005
2103#define XL_MOST150_DEVICE_MODE_OFF_DUE_TO_NET_OFF (unsigned int) 0x00000006
2104#define XL_MOST150_DEVICE_MODE_OFF_DUE_TO_CFG_NOT_OK (unsigned int) 0x00000007
2105#define XL_MOST150_DEVICE_MODE_OFF_COMMUNICATION_ERROR (unsigned int) 0x00000008
2106#define XL_MOST150_DEVICE_MODE_OFF_STREAM_CONN_ERROR (unsigned int) 0x00000009
2107#define XL_MOST150_DEVICE_MODE_OFF_CL_ALREADY_USED (unsigned int) 0x0000000A
2108#define XL_MOST150_DEVICE_MODE_CL_NOT_ALLOCATED (unsigned int) 0x000000FF
2109
2110// Maximum number of CL that can be allocated for device XL_MOST150_DEVICE_ALLOC_BANDWIDTH
2111#define XL_MOST150_ALLOC_BANDWIDTH_NUM_CL_MAX 10
2112
2113// special CL for xlMost150CtrlSyncAudio to de-allocate all CLs for device XL_MOST150_DEVICE_ALLOC_BANDWIDTH
2114#define XL_MOST150_CL_DEALLOC_ALL (unsigned int) 0x00000FFF
2115
2116// XL_MOST150_SYNC_VOLUME_STATUS_EV.volume
2117#define XL_MOST150_VOLUME_MIN (unsigned int) 0x00000000
2118#define XL_MOST150_VOLUME_MAX (unsigned int) 0x000000FF
2119
2120// XL_MOST150_SYNC_MUTE_STATUS_EV.mute
2121#define XL_MOST150_NO_MUTE (unsigned int) 0x00000000
2122#define XL_MOST150_MUTE (unsigned int) 0x00000001
2123
2124// XL_MOST150_LIGHT_POWER_EV.lightPower
2125#define XL_MOST150_LIGHT_FULL (unsigned int) 0x00000064
2126#define XL_MOST150_LIGHT_3DB (unsigned int) 0x00000032
2127
2128// XL_MOST150_SYSTEMLOCK_FLAG_EV.state
2129#define XL_MOST150_SYSTEMLOCK_FLAG_NOT_SET (unsigned int) 0x00000000
2130#define XL_MOST150_SYSTEMLOCK_FLAG_SET (unsigned int) 0x00000001
2131
2132// XL_MOST150_SHUTDOWN_FLAG_EV.state
2133#define XL_MOST150_SHUTDOWN_FLAG_NOT_SET (unsigned int) 0x00000000
2134#define XL_MOST150_SHUTDOWN_FLAG_SET (unsigned int) 0x00000001
2135
2136// ECL
2137// xlMost150SetECLLine
2138#define XL_MOST150_ECL_LINE_LOW (unsigned int) 0x00000000
2139#define XL_MOST150_ECL_LINE_HIGH (unsigned int) 0x00000001
2140// xlMost150SetECLTermination
2141#define XL_MOST150_ECL_LINE_PULL_UP_NOT_ACTIVE (unsigned int) 0x00000000
2142#define XL_MOST150_ECL_LINE_PULL_UP_ACTIVE (unsigned int) 0x00000001
2143
2144// xlMost150EclConfigureSeq
2145// Maximum number of states that can be configured for a sequence
2146#define XL_MOST150_ECL_SEQ_NUM_STATES_MAX 200
2147// Value range for duration of ECL sequence states
2148#define XL_MOST150_ECL_SEQ_DURATION_MIN 1 // -> 100 µs
2149#define XL_MOST150_ECL_SEQ_DURATION_MAX 655350 // -> 65535 ms
2150
2151// xlMost150EclSetGlitchFilter
2152// Value range for setting the glitch filter
2153#define XL_MOST150_ECL_GLITCH_FILTER_MIN 50 // -> 50 µs
2154#define XL_MOST150_ECL_GLITCH_FILTER_MAX 50000 // -> 50 ms
2155
2156// XL_MOST150_GEN_LIGHT_ERROR_EV.stressStarted
2157// XL_MOST150_GEN_LOCK_ERROR_EV.stressStarted
2158// XL_MOST150_CTRL_BUSLOAD.busloadStarted
2159// XL_MOST150_ASYNC_BUSLOAD.busloadStarted
2160// XL_MOST150_ECL_SEQUENCE_EV.sequenceStarted
2161#define XL_MOST150_MODE_DEACTIVATED 0
2162#define XL_MOST150_MODE_ACTIVATED 1
2163
2164// busloadType for xlMost150AsyncConfigureBusload
2165#define XL_MOST150_BUSLOAD_TYPE_DATA_PACKET 0
2166#define XL_MOST150_BUSLOAD_TYPE_ETHERNET_PACKET 1
2167
2168// counterType for the xlMost150****ConfigureBusload function
2169#define XL_MOST150_BUSLOAD_COUNTER_TYPE_NONE 0x00
2170#define XL_MOST150_BUSLOAD_COUNTER_TYPE_1_BYTE 0x01
2171#define XL_MOST150_BUSLOAD_COUNTER_TYPE_2_BYTE 0x02
2172#define XL_MOST150_BUSLOAD_COUNTER_TYPE_3_BYTE 0x03
2173#define XL_MOST150_BUSLOAD_COUNTER_TYPE_4_BYTE 0x04
2174
2175
2176// XL_MOST150_SPDIF_MODE_EV.spdifMode
2177#define XL_MOST150_SPDIF_MODE_SLAVE (unsigned int) 0x00000000
2178#define XL_MOST150_SPDIF_MODE_MASTER (unsigned int) 0x00000001
2179
2180// XL_MOST150_SPDIF_MODE_EV.spdifError
2181#define XL_MOST150_SPDIF_ERR_NO_ERROR (unsigned int) 0x00000000
2182#define XL_MOST150_SPDIF_ERR_HW_COMMUNICATION (unsigned int) 0x00000001
2183
2184// XL_MOST150_NW_STARTUP_EV.error
2185#define XL_MOST150_STARTUP_NO_ERROR (unsigned int) 0x00000000
2186// XL_MOST150_NW_STARTUP_EV.errorInfo
2187#define XL_MOST150_STARTUP_NO_ERRORINFO (unsigned int) 0xFFFFFFFF
2188
2189// XL_MOST150_NW_SHUTDOWN_EV.error
2190#define XL_MOST150_SHUTDOWN_NO_ERROR (unsigned int) 0x00000000
2191// XL_MOST150_NW_SHUTDOWN_EV.errorInfo
2192#define XL_MOST150_SHUTDOWN_NO_ERRORINFO (unsigned int) 0xFFFFFFFF
2193
2194/// Values for synchronous streaming API
2195#define XL_MOST150_STREAM_RX_DATA 0 // RX streaming: MOST -> PC
2196#define XL_MOST150_STREAM_TX_DATA 1 // TX streaming: PC -> MOST
2197
2198#define XL_MOST150_STREAM_INVALID_HANDLE 0
2199
2200// stream states
2201#define XL_MOST150_STREAM_STATE_CLOSED 0x01
2202#define XL_MOST150_STREAM_STATE_OPENED 0x02
2203#define XL_MOST150_STREAM_STATE_STARTED 0x03
2204#define XL_MOST150_STREAM_STATE_STOPPED 0x04
2205#define XL_MOST150_STREAM_STATE_START_PENDING 0x05 // waiting for result from hw
2206#define XL_MOST150_STREAM_STATE_STOP_PENDING 0x06 // waiting for result from hw
2207#define XL_MOST150_STREAM_STATE_OPEN_PENDING 0x07 // waiting for result from hw
2208#define XL_MOST150_STREAM_STATE_CLOSE_PENDING 0x08 // waiting for result from hw
2209
2210// TX Streaming: Maximum number of bytes that can be streamed per MOST frame
2211#define XL_MOST150_STREAM_TX_BYTES_PER_FRAME_MIN 1
2212#define XL_MOST150_STREAM_TX_BYTES_PER_FRAME_MAX 152
2213
2214// RX Streaming: Maximum number of connection labels that can be streamed
2215#define XL_MOST150_STREAM_RX_NUM_CL_MAX 8
2216
2217// valid connection label range
2218#define XL_MOST150_STREAM_CL_MIN (unsigned int) 0x000C
2219#define XL_MOST150_STREAM_CL_MAX (unsigned int) 0x017F
2220
2221// XL_MOST150_STREAM_STATE_EV.streamError
2222// XL_MOST150_STREAM_TX_LABEL_EV.errorInfo
2223#define XL_MOST150_STREAM_STATE_ERROR_NO_ERROR 0
2224#define XL_MOST150_STREAM_STATE_ERROR_NOT_ENOUGH_BW 1
2225#define XL_MOST150_STREAM_STATE_ERROR_NET_OFF 2
2226#define XL_MOST150_STREAM_STATE_ERROR_CONFIG_NOT_OK 3
2227#define XL_MOST150_STREAM_STATE_ERROR_CL_DISAPPEARED 4
2228#define XL_MOST150_STREAM_STATE_ERROR_INIC_SC_ERROR 5
2229#define XL_MOST150_STREAM_STATE_ERROR_DEVICEMODE_BYPASS 6
2230#define XL_MOST150_STREAM_STATE_ERROR_NISTATE_NOT_NETON 7
2231#define XL_MOST150_STREAM_STATE_ERROR_INIC_BUSY 8
2232#define XL_MOST150_STREAM_STATE_ERROR_CL_MISSING 9
2233#define XL_MOST150_STREAM_STATE_ERROR_NUM_BYTES_MISMATCH 10
2234#define XL_MOST150_STREAM_STATE_ERROR_INIC_COMMUNICATION 11
2235
2236// XL_MOST150_STREAM_TX_BUFFER_EV.status
2237#define XL_MOST150_STREAM_BUFFER_ERROR_NO_ERROR 0
2238#define XL_MOST150_STREAM_BUFFER_ERROR_NOT_ENOUGH_DATA 1
2239
2240// XL_MOST150_STREAM_RX_BUFFER_EV.status
2241//#define XL_MOST150_STREAM_BUFFER_ERROR_NO_ERROR 0
2242#define XL_MOST150_STREAM_BUFFER_ERROR_STOP_BY_APP 1
2243#define XL_MOST150_STREAM_BUFFER_ERROR_MOST_SIGNAL_OFF 2
2244#define XL_MOST150_STREAM_BUFFER_ERROR_UNLOCK 3
2245#define XL_MOST150_STREAM_BUFFER_ERROR_CL_MISSING 4
2246#define XL_MOST150_STREAM_BUFFER_ERROR_ALL_CL_MISSING 5
2247#define XL_MOST150_STREAM_BUFFER_ERROR_OVERFLOW 128 // overflow bit
2248
2249// latency values
2250#define XL_MOST150_STREAM_LATENCY_VERY_LOW 0
2251#define XL_MOST150_STREAM_LATENCY_LOW 1
2252#define XL_MOST150_STREAM_LATENCY_MEDIUM 2
2253#define XL_MOST150_STREAM_LATENCY_HIGH 3
2254#define XL_MOST150_STREAM_LATENCY_VERY_HIGH 4
2255
2256
2257// bypass stress maximum/minimum timing parameter in msec
2258#define XL_MOST150_BYPASS_STRESS_TIME_MIN 10
2259#define XL_MOST150_BYPASS_STRESS_TIME_MAX 65535
2260
2261// XL_MOST150_GEN_BYPASS_STRESS_EV.stressStarted
2262#define XL_MOST150_BYPASS_STRESS_STOPPED 0
2263#define XL_MOST150_BYPASS_STRESS_STARTED 1
2264#define XL_MOST150_BYPASS_STRESS_STOPPED_LIGHT_OFF 2
2265#define XL_MOST150_BYPASS_STRESS_STOPPED_DEVICE_MODE 3
2266
2267
2268
2269#include <pshpack1.h>
2270
2271//////////////////////////////////////////////////////////////
2272// Structures for MOST150 events
2273//////////////////////////////////////////////////////////////
2274
2275typedef unsigned short XLmostEventTag;
2276
2277
2278typedef struct s_xl_most150_event_source{
2279 unsigned int sourceMask;
2280} XL_MOST150_EVENT_SOURCE_EV;
2281
2282typedef struct s_xl_most150_device_mode {
2283 unsigned int deviceMode;
2284} XL_MOST150_DEVICE_MODE_EV;
2285
2286typedef struct s_xl_most150_frequency {
2287 unsigned int frequency;
2288} XL_MOST150_FREQUENCY_EV;
2289
2290typedef struct s_xl_most150_special_node_info{
2291 unsigned int changeMask;
2292 unsigned short nodeAddress;
2293 unsigned short groupAddress;
2294 unsigned char npr;
2295 unsigned char mpr;
2296 unsigned char sbc;
2297 unsigned char ctrlRetryTime;
2298 unsigned char ctrlSendAttempts;
2299 unsigned char asyncRetryTime;
2300 unsigned char asyncSendAttempts;
2301 unsigned char macAddr[6];
2302 unsigned char nprSpy;
2303 unsigned char mprSpy;
2304 unsigned char sbcSpy;
2305 unsigned char inicNIState;
2306 unsigned char reserved1[3];
2307 unsigned int reserved2[3];
2308} XL_MOST150_SPECIAL_NODE_INFO_EV;
2309
2310typedef struct s_xl_most150_ctrl_rx {
2311 unsigned short targetAddress;
2312 unsigned short sourceAddress;
2313 unsigned char fblockId;
2314 unsigned char instId;
2315 unsigned short functionId;
2316 unsigned char opType;
2317 unsigned char telId;
2318 unsigned short telLen;
2319 unsigned char ctrlData[45];
2320} XL_MOST150_CTRL_RX_EV;
2321
2322typedef struct s_xl_most150_ctrl_spy{
2323 unsigned int frameCount;
2324 unsigned int msgDuration; // duration of message transmission in [ns]
2325 unsigned char priority;
2326 unsigned short targetAddress;
2327 unsigned char pAck;
2328 unsigned short ctrlDataLenAnnounced;
2329 unsigned char reserved0;
2330 unsigned char pIndex;
2331 unsigned short sourceAddress;
2332 unsigned short reserved1;
2333 unsigned short crc;
2334 unsigned short crcCalculated;
2335 unsigned char cAck;
2336 unsigned short ctrlDataLen; // number of bytes contained in ctrlData[]
2337 unsigned char reserved2;
2338 unsigned int status; // currently not used
2339 unsigned int validMask;
2340 unsigned char ctrlData[51];
2341} XL_MOST150_CTRL_SPY_EV;
2342
2343typedef struct s_xl_most150_async_rx_msg {
2344 unsigned short length;
2345 unsigned short targetAddress;
2346 unsigned short sourceAddress;
2347 unsigned char asyncData[1524];
2348} XL_MOST150_ASYNC_RX_EV;
2349
2350typedef struct s_xl_most150_async_spy_msg {
2351 unsigned int frameCount;
2352 unsigned int pktDuration; // duration of data packet transmission in [ns]
2353 unsigned short asyncDataLenAnnounced;
2354 unsigned short targetAddress;
2355 unsigned char pAck;
2356 unsigned char pIndex;
2357 unsigned short sourceAddress;
2358 unsigned int crc;
2359 unsigned int crcCalculated;
2360 unsigned char cAck;
2361 unsigned short asyncDataLen; // number of bytes contained in asyncData[]
2362 unsigned char reserved;
2363 unsigned int status; // currently not used
2364 unsigned int validMask;
2365 unsigned char asyncData[1524];
2366} XL_MOST150_ASYNC_SPY_EV;
2367
2368typedef struct s_xl_most150_ethernet_rx {
2369 unsigned char sourceAddress[6];
2370 unsigned char targetAddress[6];
2371 unsigned int length;
2372 unsigned char ethernetData[1510];
2373} XL_MOST150_ETHERNET_RX_EV;
2374
2375typedef struct s_xl_most150_ethernet_spy {
2376 unsigned int frameCount;
2377 unsigned int pktDuration; // duration of ethernet packet transmission in [ns]
2378 unsigned short ethernetDataLenAnnounced;
2379 unsigned char targetAddress[6];
2380 unsigned char pAck;
2381 unsigned char sourceAddress[6];
2382 unsigned char reserved0;
2383 unsigned int crc;
2384 unsigned int crcCalculated;
2385 unsigned char cAck;
2386 unsigned short ethernetDataLen; // number of bytes contained in ethernetData[]
2387 unsigned char reserved1;
2388 unsigned int status; // currently not used
2389 unsigned int validMask;
2390 unsigned char ethernetData[1506];
2391} XL_MOST150_ETHERNET_SPY_EV;
2392
2393typedef struct s_xl_most150_cl_info {
2394 unsigned short label;
2395 unsigned short channelWidth;
2396} XL_MOST150_CL_INFO;
2397
2398typedef struct s_xl_most150_sync_alloc_info {
2399 XL_MOST150_CL_INFO allocTable[MOST150_SYNC_ALLOC_INFO_SIZE];
2400} XL_MOST150_SYNC_ALLOC_INFO_EV;
2401
2402
2403typedef struct s_xl_most150_sync_volume_status {
2404 unsigned int device;
2405 unsigned int volume;
2406} XL_MOST150_SYNC_VOLUME_STATUS_EV;
2407
2408typedef struct s_xl_most150_tx_light {
2409 unsigned int light;
2410} XL_MOST150_TX_LIGHT_EV;
2411
2412typedef struct s_xl_most150_rx_light_lock_status {
2413 unsigned int status;
2414} XL_MOST150_RXLIGHT_LOCKSTATUS_EV;
2415
2416typedef struct s_xl_most150_error {
2417 unsigned int errorCode;
2418 unsigned int parameter[3];
2419} XL_MOST150_ERROR_EV;
2420
2421typedef struct s_xl_most150_configure_rx_buffer {
2422 unsigned int bufferType;
2423 unsigned int bufferMode;
2424} XL_MOST150_CONFIGURE_RX_BUFFER_EV;
2425
2426typedef struct s_xl_most150_ctrl_sync_audio {
2427 unsigned int label;
2428 unsigned int width;
2429 unsigned int device;
2430 unsigned int mode;
2431} XL_MOST150_CTRL_SYNC_AUDIO_EV;
2432
2433typedef struct s_xl_most150_sync_mute_status {
2434 unsigned int device;
2435 unsigned int mute;
2436} XL_MOST150_SYNC_MUTE_STATUS_EV;
2437
2438typedef struct s_xl_most150_tx_light_power {
2439 unsigned int lightPower;
2440} XL_MOST150_LIGHT_POWER_EV;
2441
2442typedef struct s_xl_most150_gen_light_error {
2443 unsigned int stressStarted;
2444} XL_MOST150_GEN_LIGHT_ERROR_EV;
2445
2446typedef struct s_xl_most150_gen_lock_error {
2447 unsigned int stressStarted;
2448} XL_MOST150_GEN_LOCK_ERROR_EV;
2449
2450typedef struct s_xl_most150_ctrl_busload {
2451 unsigned long busloadStarted;
2452} XL_MOST150_CTRL_BUSLOAD_EV;
2453
2454typedef struct s_xl_most150_async_busload {
2455 unsigned long busloadStarted;
2456} XL_MOST150_ASYNC_BUSLOAD_EV;
2457
2458typedef struct s_xl_most150_systemlock_flag {
2459 unsigned int state;
2460} XL_MOST150_SYSTEMLOCK_FLAG_EV;
2461
2462typedef struct s_xl_most150_shutdown_flag {
2463 unsigned int state;
2464} XL_MOST150_SHUTDOWN_FLAG_EV;
2465
2466typedef struct s_xl_most150_spdif_mode {
2467 unsigned int spdifMode;
2468 unsigned int spdifError;
2469} XL_MOST150_SPDIF_MODE_EV;
2470
2471typedef struct s_xl_most150_ecl {
2472 unsigned int eclLineState;
2473} XL_MOST150_ECL_EV;
2474
2475typedef struct s_xl_most150_ecl_termination {
2476 unsigned int resistorEnabled;
2477} XL_MOST150_ECL_TERMINATION_EV;
2478
2479typedef struct s_xl_most150_nw_startup {
2480 unsigned int error;
2481 unsigned int errorInfo;
2482} XL_MOST150_NW_STARTUP_EV;
2483
2484typedef struct s_xl_most150_nw_shutdown {
2485 unsigned int error;
2486 unsigned int errorInfo;
2487} XL_MOST150_NW_SHUTDOWN_EV;
2488
2489typedef struct s_xl_most150_stream_state {
2490 unsigned int streamHandle;
2491 unsigned int streamState;
2492 unsigned int streamError;
2493} XL_MOST150_STREAM_STATE_EV;
2494
2495typedef struct s_xl_most150_stream_tx_buffer {
2496 unsigned int streamHandle;
2497 unsigned int numberOfBytes;
2498 unsigned int status;
2499} XL_MOST150_STREAM_TX_BUFFER_EV;
2500
2501typedef struct s_xl_most150_stream_rx_buffer {
2502 unsigned int streamHandle;
2503 unsigned int numberOfBytes;
2504 unsigned int status;
2505 unsigned int labelInfo;
2506} XL_MOST150_STREAM_RX_BUFFER_EV;
2507
2508typedef struct s_xl_most150_stream_tx_underflow {
2509 unsigned int streamHandle;
2510 unsigned int reserved;
2511} XL_MOST150_STREAM_TX_UNDERFLOW_EV;
2512
2513typedef struct s_xl_most150_stream_tx_label {
2514 unsigned int streamHandle;
2515 unsigned int errorInfo;
2516 unsigned int connLabel;
2517 unsigned int width;
2518} XL_MOST150_STREAM_TX_LABEL_EV;
2519
2520typedef struct s_xl_most150_gen_bypass_stress {
2521 unsigned int stressStarted;
2522} XL_MOST150_GEN_BYPASS_STRESS_EV;
2523
2524typedef struct s_xl_most150_ecl_sequence {
2525 unsigned int sequenceStarted;
2526} XL_MOST150_ECL_SEQUENCE_EV;
2527
2528typedef struct s_xl_most150_ecl_glitch_filter {
2529 unsigned int duration;
2530} XL_MOST150_ECL_GLITCH_FILTER_EV;
2531
2532
2533typedef struct s_xl_most150_ctrl_tx_ack {
2534 unsigned short targetAddress;
2535 unsigned short sourceAddress;
2536 unsigned char ctrlPrio;
2537 unsigned char ctrlSendAttempts;
2538 unsigned char reserved[2];
2539 unsigned int status;
2540
2541 // ctrlData structure:
2542 // -----------------------------------------------------------------------
2543 // FBlockID | InstID | FunctionID | OpType | TelID | TelLen | Payload
2544 // -----------------------------------------------------------------------
2545 // 8 bit | 8 bit | 12 bit | 4 bit | 4 bit | 12 bit | 0 .. 45 byte
2546 // -----------------------------------------------------------------------
2547 // ctrlData[0]: FBlockID
2548 // ctrlData[1]: InstID
2549 // ctrlData[2]: FunctionID (upper 8 bits)
2550 // ctrlData[3]: FunctionID (lower 4 bits) + OpType (4 bits)
2551 // ctrlData[4]: TelId (4 bits) + TelLen (upper 4 bits)
2552 // ctrlData[5]: TelLen (lower 8 bits)
2553 // ctrlData[6..50]: Payload
2554 unsigned char ctrlData[51];
2555} XL_MOST150_CTRL_TX_ACK_EV;
2556
2557typedef struct s_xl_most150_async_tx_ack {
2558 unsigned char priority;
2559 unsigned char asyncSendAttempts;
2560 unsigned short length;
2561 unsigned short targetAddress;
2562 unsigned short sourceAddress;
2563 unsigned int status;
2564 unsigned char asyncData[1524];
2565} XL_MOST150_ASYNC_TX_ACK_EV;
2566
2567typedef struct s_xl_most150_ethernet_tx {
2568 unsigned char priority;
2569 unsigned char ethSendAttempts;
2570 unsigned char sourceAddress[6];
2571 unsigned char targetAddress[6];
2572 unsigned char reserved[2];
2573 unsigned int length;
2574 unsigned char ethernetData[1510];
2575} XL_MOST150_ETHERNET_TX_ACK_EV;
2576
2577typedef struct s_xl_most150_hw_sync {
2578 unsigned int pulseCode;
2579} XL_MOST150_HW_SYNC_EV;
2580
2581typedef struct s_xl_event_most150 {
2582
2583 unsigned int size; // 4 - overall size of the complete event
2584 XLmostEventTag tag; // 2 - type of the event
2585 unsigned short channelIndex; // 2
2586 unsigned int userHandle; // 4
2587 unsigned short flagsChip; // 2
2588 unsigned short reserved; // 2
2589 XLuint64 timeStamp; // 8 - raw timestamp
2590 XLuint64 timeStampSync; // 8 - timestamp which is synchronized by the driver
2591 // ---------
2592 // 32 bytes -> XL_MOST_EVENT_HEADER_SIZE
2593 union {
2594 unsigned char rawData[XL_MOST150_MAX_EVENT_DATA_SIZE];
2595 XL_MOST150_EVENT_SOURCE_EV mostEventSource;
2596 XL_MOST150_DEVICE_MODE_EV mostDeviceMode;
2597 XL_MOST150_FREQUENCY_EV mostFrequency;
2598 XL_MOST150_SPECIAL_NODE_INFO_EV mostSpecialNodeInfo;
2599 XL_MOST150_CTRL_RX_EV mostCtrlRx;
2600 XL_MOST150_CTRL_TX_ACK_EV mostCtrlTxAck;
2601 XL_MOST150_ASYNC_SPY_EV mostAsyncSpy;
2602 XL_MOST150_ASYNC_RX_EV mostAsyncRx;
2603 XL_MOST150_SYNC_ALLOC_INFO_EV mostSyncAllocInfo;
2604 XL_MOST150_SYNC_VOLUME_STATUS_EV mostSyncVolumeStatus;
2605 XL_MOST150_TX_LIGHT_EV mostTxLight;
2606 XL_MOST150_RXLIGHT_LOCKSTATUS_EV mostRxLightLockStatus;
2607 XL_MOST150_ERROR_EV mostError;
2608 XL_MOST150_CONFIGURE_RX_BUFFER_EV mostConfigureRxBuffer;
2609 XL_MOST150_CTRL_SYNC_AUDIO_EV mostCtrlSyncAudio;
2610 XL_MOST150_SYNC_MUTE_STATUS_EV mostSyncMuteStatus;
2611 XL_MOST150_LIGHT_POWER_EV mostLightPower;
2612 XL_MOST150_GEN_LIGHT_ERROR_EV mostGenLightError;
2613 XL_MOST150_GEN_LOCK_ERROR_EV mostGenLockError;
2614 XL_MOST150_CTRL_BUSLOAD_EV mostCtrlBusload;
2615 XL_MOST150_ASYNC_BUSLOAD_EV mostAsyncBusload;
2616 XL_MOST150_ETHERNET_RX_EV mostEthernetRx;
2617 XL_MOST150_SYSTEMLOCK_FLAG_EV mostSystemLockFlag;
2618 XL_MOST150_SHUTDOWN_FLAG_EV mostShutdownFlag;
2619 XL_MOST150_SPDIF_MODE_EV mostSpdifMode;
2620 XL_MOST150_ECL_EV mostEclEvent;
2621 XL_MOST150_ECL_TERMINATION_EV mostEclTermination;
2622 XL_MOST150_CTRL_SPY_EV mostCtrlSpy;
2623 XL_MOST150_ASYNC_TX_ACK_EV mostAsyncTxAck;
2624 XL_MOST150_ETHERNET_SPY_EV mostEthernetSpy;
2625 XL_MOST150_ETHERNET_TX_ACK_EV mostEthernetTxAck;
2626 XL_MOST150_HW_SYNC_EV mostHWSync;
2627 XL_MOST150_NW_STARTUP_EV mostStartup;
2628 XL_MOST150_NW_SHUTDOWN_EV mostShutdown;
2629 XL_MOST150_STREAM_STATE_EV mostStreamState;
2630 XL_MOST150_STREAM_TX_BUFFER_EV mostStreamTxBuffer;
2631 XL_MOST150_STREAM_RX_BUFFER_EV mostStreamRxBuffer;
2632 XL_MOST150_STREAM_TX_UNDERFLOW_EV mostStreamTxUnderflow;
2633 XL_MOST150_STREAM_TX_LABEL_EV mostStreamTxLabel;
2634 XL_MOST150_GEN_BYPASS_STRESS_EV mostGenBypassStress;
2635 XL_MOST150_ECL_SEQUENCE_EV mostEclSequence;
2636 XL_MOST150_ECL_GLITCH_FILTER_EV mostEclGlitchFilter;
2637 } tagData;
2638} XLmost150event;
2639
2640
2641///////////////////////////////////////////////////////////////////////////////////
2642// Structures for MOST150 API commands
2643///////////////////////////////////////////////////////////////////////////////////
2644
2645//XLstatus xlMost150SetSpecialNodeInfo(DEFPARAMS, XLmost150SetSpecialNodeInfo *specialodeInfo);
2646typedef struct s_xl_set_most150_special_node_info {
2647 unsigned int changeMask; // see XL_MOST150_SPECIAL_NODE_MASK_CHANGED
2648 unsigned int nodeAddress;
2649 unsigned int groupAddress;
2650 unsigned int sbc;
2651 unsigned int ctrlRetryTime;
2652 unsigned int ctrlSendAttempts;
2653 unsigned int asyncRetryTime;
2654 unsigned int asyncSendAttempts;
2655 unsigned char macAddr[6];
2656} XLmost150SetSpecialNodeInfo;
2657
2658//XLstatus xlMost150CtrlTransmit(DEFPARAMS, XLmost150CtrlTxMsg *pCtrlTxMsg);
2659typedef struct s_xl_most150_ctrl_tx_msg {
2660 unsigned int ctrlPrio; // Prio: Currently fixed to 0x01 for Control Messages
2661 unsigned int ctrlSendAttempts; // 1..16 attempts, set an invalid value to use the default value set by xlMost150SetCtrlRetryParameters
2662 unsigned int targetAddress;
2663
2664 // ctrlData structure:
2665 // -----------------------------------------------------------------------
2666 // FBlockID | InstID | FunctionID | OpType | TelID | TelLen | Payload
2667 // -----------------------------------------------------------------------
2668 // 8 bit | 8 bit | 12 bit | 4 bit | 4 bit | 12 bit | 0 .. 45 byte
2669 // -----------------------------------------------------------------------
2670 // ctrlData[0]: FBlockID
2671 // ctrlData[1]: InstID
2672 // ctrlData[2]: FunctionID (upper 8 bits)
2673 // ctrlData[3]: FunctionID (lower 4 bits) + OpType (4 bits)
2674 // ctrlData[4]: TelId (4 bits) + TelLen (upper 4 bits)
2675 // ctrlData[5]: TelLen (lower 8 bits)
2676 // ctrlData[6..50]: Payload
2677 unsigned char ctrlData[51];
2678} XLmost150CtrlTxMsg;
2679
2680//XLstatus xlMost150AsyncTransmit(DEFPARAMS, XLmost150AsyncTxMsg *pAsyncTxMsg);
2681typedef struct s_xl_most150_async_tx_msg {
2682 unsigned int priority; // Prio: Currently fixed to 0x00 for MDP /MEP
2683 unsigned int asyncSendAttempts; // 1..16 attempts,set an invalid value to use the default value set by xlMost150SetAsyncRetryParameters
2684 unsigned int length; // max. 1600 bytes
2685 unsigned int targetAddress;
2686 unsigned char asyncData[XL_MOST150_ASYNC_SEND_PAYLOAD_MAX_SIZE];
2687} XLmost150AsyncTxMsg;
2688
2689//XLstatus xlMost150EthernetTransmit(DEFPARAMS, XLmost150EthernetTxMsg *pEthernetTxMsg);
2690typedef struct s_xl_most150_ethernet_tx_msg {
2691 unsigned int priority; // Prio: Currently fixed to 0x00 for MDP /MEP
2692 unsigned int ethSendAttempts; // 1..16 attempts, set an invalid value to use the default value set by xlMost150SetAsyncRetryParameters
2693 unsigned char sourceAddress[6];
2694 unsigned char targetAddress[6];
2695 unsigned int length; // max. 1600 bytes
2696 unsigned char ethernetData[XL_MOST150_ETHERNET_SEND_PAYLOAD_MAX_SIZE];
2697} XLmost150EthernetTxMsg;
2698
2699//XLstatus xlMost150CtrlSyncAudio(DEFPARAMS, XLmost150SyncAudioParameter *syncAudioParameter);
2700typedef struct s_xl_most150_sync_audio_parameter {
2701 unsigned int label;
2702 unsigned int width;
2703 unsigned int device;
2704 unsigned int mode;
2705} XLmost150SyncAudioParameter;
2706
2707//XLstatus xlMost150CtrlConfigureBusload(DEFPARAMS, XLmost150CtrlBusloadConfig *pCtrlBusloadConfig);
2708typedef struct s_xl_most150_ctrl_busload_config {
2709 unsigned int transmissionRate;
2710 unsigned int counterType;
2711 unsigned int counterPosition; // counter can be only be set in the payload -> position 0 means first payload byte!
2712 XLmost150CtrlTxMsg busloadCtrlMsg;
2713} XLmost150CtrlBusloadConfig;
2714
2715//XLstatus xlMost150AsyncConfigureBusload(DEFPARAMS, XLmost150AsyncBusloadConfig *pAsyncBusloadConfig);
2716typedef struct s_xl_most150_async_busload_config {
2717 unsigned int busloadType;
2718 unsigned int transmissionRate;
2719 unsigned int counterType;
2720 unsigned int counterPosition;
2721 union {
2722 unsigned char rawBusloadPkt[1540];
2723 XLmost150AsyncTxMsg busloadAsyncPkt;
2724 XLmost150EthernetTxMsg busloadEthernetPkt;
2725 } busloadPkt;
2726} XLmost150AsyncBusloadConfig;
2727
2728//XLstatus xlMost150StreamOpen(DEFPARAMS, XLmost150StreamOpen* pStreamOpen);
2729typedef struct s_xl_most150_stream_open {
2730 unsigned int* pStreamHandle;
2731 unsigned int direction;
2732 unsigned int numBytesPerFrame;
2733 unsigned int reserved;
2734 unsigned int latency;
2735} XLmost150StreamOpen;
2736
2737//XLstatus xlMost150StreamGetInfo(DEFPARAMS, XLmost150StreamInfo* pStreamInfo);
2738typedef struct s_xl_most150_stream_get_info {
2739 unsigned int streamHandle;
2740 unsigned int numBytesPerFrame;
2741 unsigned int direction;
2742 unsigned int reserved;
2743 unsigned int latency;
2744 unsigned int streamState;
2745 unsigned int connLabels[XL_MOST150_STREAM_RX_NUM_CL_MAX];
2746} XLmost150StreamInfo;
2747
2748
2749#include <poppack.h>
2750
2751///////////////////////////////////////////////////////////////////////////////
2752// Function calls
2753////////////////////////////////////////////////////////////////////////////////
2754// common functions
2755/*------------------------------------------------------------------------------
2756xlOpenDriver():
2757--------------------------------------------------------------------------------
2758The Application calls this function to get access to the driver.
2759*/
2760
2761#ifdef DYNAMIC_XLDRIVER_DLL
2762 // in case of dynamic loading the application defines this function
2763 typedef XLstatus (_XL_EXPORT_API *XLOPENDRIVER) (void);
2764#else
2765 XLstatus _XL_EXPORT_DECL xlOpenDriver(void);
2766#endif
2767
2768/*------------------------------------------------------------------------------
2769xlCloseDriver ():
2770--------------------------------------------------------------------------------
2771The driver is closed.
2772This is used to unload the driver, if no more application is useing it.
2773Does not close the open ports !!!
2774*/
2775
2776#ifdef DYNAMIC_XLDRIVER_DLL
2777 typedef XLstatus (_XL_EXPORT_API *XLCLOSEDRIVER) (void);
2778#else
2779 XLstatus _XL_EXPORT_DECL xlCloseDriver(void);
2780#endif
2781
2782/*------------------------------------------------------------------------------
2783xlSetApplConfig():
2784xlGetApplConfig():
2785--------------------------------------------------------------------------------
2786Handle the application configuration for VCANCONF.EXE
2787*/
2788
2789/*
2790Returns the hwIndex, hwChannel and hwType for a specific Application and application channel.
2791This gives the ability to register own applications into the Vector
2792CAN DRIVER CONFIGURATION.
2793AppName: Zero terminated string containing the Name of the Application.
2794AppChannel: Channel of the application
2795hwType, hwIndex, hwChannel: contains the the hardware information on success.
2796This values can be used in a subsequent call to xlGetChannelMask or xlGetChannelIndex.
2797*/
2798
2799DECL_STDXL_FUNC( xlGetApplConfig, XLGETAPPLCONFIG, (
2800 char *appName, //<! Name of Application
2801 unsigned int appChannel, //<! 0,1
2802 unsigned int *pHwType, //<! HWTYPE_xxxx
2803 unsigned int *pHwIndex, //<! Index of the hardware (slot) (0,1,...)
2804 unsigned int *pHwChannel, //<! Index of the channel (connector) (0,1,...)
2805 unsigned int busType //<! Bus type of configuration, should be BUS_TYPE_NONE when no bus type is set
2806 ));
2807
2808DECL_STDXL_FUNC( xlSetApplConfig, XLSETAPPLCONFIG, (
2809 char *appName, //<! Name of Application
2810 unsigned int appChannel, //<! 0,1
2811 unsigned int hwType, //<! HWTYPE_xxxx
2812 unsigned int hwIndex, //<! Index of the hardware (slot) (0,1,...)
2813 unsigned int hwChannel, //<! Index of the channel (connector) (0,1,...)
2814 unsigned int busType //<! Bus type of configuration, should be BUS_TYPE_NONE when no bus type is set
2815 ));
2816
2817/*------------------------------------------------------------------------------
2818xlGetDriverConfig():
2819--------------------------------------------------------------------------------
2820The application gets the information, which
2821channels are available in the system. The user
2822must provide the memory (pointer to XLdriverConfig structure).
2823*/
2824
2825DECL_STDXL_FUNC( xlGetDriverConfig, XLGETDRIVERCONFIG, (XLdriverConfig *pDriverConfig));
2826
2827/*------------------------------------------------------------------------------
2828xlGetChannelIndex():
2829xlGetChannelMask():
2830--------------------------------------------------------------------------------
2831
2832Get the channel index for a channel of a certain hardware.
2833Parameter -1 means "don't care"
2834Result -1 (xlGetChannelIndex) or 0 (xlGetChannelMask) means "not found"
2835*/
2836
2837#ifdef DYNAMIC_XLDRIVER_DLL
2838 typedef int (_XL_EXPORT_API *XLGETCHANNELINDEX) (
2839 int hwType, // [-1,HWTYPE_CANCARDX,HWTYPE_VIRTUAL,...]
2840 int hwIndex, // [-1,0,1]
2841 int hwChannel // [-1,0,1]
2842 );
2843
2844 typedef XLaccess (_XL_EXPORT_API *XLGETCHANNELMASK) (
2845 int hwType, // [-1,HWTYPE_CANCARDX,HWTYPE_VIRTUAL,...]
2846 int hwIndex, // [-1,0,1]
2847 int hwChannel // [-1,0,1]
2848 );
2849#else
2850 int _XL_EXPORT_DECL xlGetChannelIndex(
2851 int hwType, // [-1,HWTYPE_CANCARDX,HWTYPE_VIRTUAL,...]
2852 int hwIndex, // [-1,0,1]
2853 int hwChannel // [-1,0,1]
2854 );
2855
2856 XLaccess _XL_EXPORT_DECL xlGetChannelMask(
2857 int hwType, // [-1,HWTYPE_CANCARDX,HWTYPE_VIRTUAL,...]
2858 int hwIndex, // [-1,0,1]
2859 int hwChannel // [-1,0,1]
2860 );
2861#endif
2862
2863
2864/*------------------------------------------------------------------------------
2865xlOpenPort():
2866--------------------------------------------------------------------------------
2867The application tells the driver to which channels
2868it wants to get access to and which of these channels
2869it wants to get the permission to initialize the channel (on input must be
2870in variable where pPermissionMask points).
2871Only one port can get the permission to initialize a channel.
2872The port handle and permitted init access is returned.
2873*/
2874
2875DECL_STDXL_FUNC( xlOpenPort, XLOPENPORT, (
2876 XLportHandle *pPortHandle,
2877 char *userName,
2878 XLaccess accessMask,
2879 XLaccess *pPermissionMask,
2880 unsigned int rxQueueSize,
2881 unsigned int xlInterfaceVersion,
2882 unsigned int busType)
2883 );
2884
2885/*------------------------------------------------------------------------------
2886xlSetTimerRate():
2887--------------------------------------------------------------------------------
2888The timer of the port will be activated/deacticated and the
2889rate for cyclic timer events is set.
2890The resolution of the parameter 'timerRate' is 10us.
2891The accepted values for this parameter are 100, 200, 300,... resulting
2892in an effective timerrate of 1000us, 2000us, 3000us,...
2893*/
2894
2895DECL_STDXL_FUNC ( xlSetTimerRate, XLSETTIMERRATE, (
2896 XLportHandle portHandle,
2897 unsigned long timerRate)
2898 );
2899
2900/*------------------------------------------------------------------------------
2901xlSetTimerRateAndChannel():
2902--------------------------------------------------------------------------------
2903This function sets the timerrate for timerbased-notify feature using out from
2904the specified channels the one which is best suitable for exact timestamps.
2905If only one channel is specified, this channel is used for timer event generation.
2906Only channels that are assigned to the port specified by parameter portHandle may be used.
2907 Parameter timerRate specifies the requested timer event's cyclic rate; passed back is
2908the timer rate used by the driver. The resolution of this parameter is 10us.
2909A value timerRate=0 would disable timer events.
2910 Returns in parameter timerChannelMask the channel that is best suitable
2911for timer event generation out of the channels specified by paramter
2912timerChannelMask. The timer rate value may be below 1ms, but is limited to the following
2913discrete values (with 'x' as unsigned decimal value):
2914CAN/LIN : 250 us ... (250 us + x * 250 us)
2915Flexray(USB): 250 us ... (250 us + x * 50 us)
2916Flexray(PCI): 100 us ... (100 us + x * 50 us)
2917
2918Example: timerRate=25 ==> Used timerrate would be 250us.
2919*/
2920
2921DECL_STDXL_FUNC ( xlSetTimerRateAndChannel, XLSETTIMERRATEANDCHANNEL, (
2922 XLportHandle portHandle,
2923 XLaccess *timerChannelMask,
2924 unsigned long *timerRate)
2925 );
2926
2927
2928/*------------------------------------------------------------------------------
2929xlResetClock():
2930--------------------------------------------------------------------------------
2931The clock generating timestamps for the port will be reset
2932*/
2933
2934DECL_STDXL_FUNC ( xlResetClock, XLRESETCLOCK, (XLportHandle portHandle));
2935
2936/*------------------------------------------------------------------------------
2937xlSetNotification():
2938--------------------------------------------------------------------------------
2939Setup a event to notify the application if there are messages in the
2940ports receive queue.
2941queueLevel specifies the number of messages that triggeres the event.
2942Note that the event is triggered only once, when the queueLevel is
2943reached. An application should read all available messages by xlReceive
2944to be sure to reenable the event. The API generates the handle by
2945itself. For LIN the queueLevel is fix to one.
2946*/
2947
2948DECL_STDXL_FUNC ( xlSetNotification, XLSETNOTIFICATION, (
2949 XLportHandle portHandle,
2950 XLhandle *handle,
2951 int queueLevel)
2952 );
2953
2954
2955/*------------------------------------------------------------------------------
2956xlSetTimerBasedNotifiy():
2957--------------------------------------------------------------------------------
2958Setup a event to notify the application based on the timerrate which can
2959be set by xlSetTimerRate()/xlSetTimerRateAndChannel().
2960*/
2961
2962DECL_STDXL_FUNC ( xlSetTimerBasedNotify, XLSETTIMERBASEDNOTIFY, (
2963 XLportHandle portHandle,
2964 XLhandle *pHandle)
2965 );
2966
2967/*------------------------------------------------------------------------------
2968xlFlushReceiveQueue():
2969--------------------------------------------------------------------------------
2970The receive queue of the port will be flushed.
2971*/
2972
2973DECL_STDXL_FUNC ( xlFlushReceiveQueue, XLFLUSHRECEIVEQUEUE, (XLportHandle portHandle));
2974
2975/*------------------------------------------------------------------------------
2976xlGetReceiveQueueLevel():
2977--------------------------------------------------------------------------------
2978The count of events in the receive queue of the port will be returned.
2979*/
2980
2981DECL_STDXL_FUNC ( xlGetReceiveQueueLevel, XLGETRECEIVEQUEUELEVEL, (
2982 XLportHandle portHandle,
2983 int *level)
2984 );
2985
2986/*------------------------------------------------------------------------------
2987xlActivateChannel():
2988--------------------------------------------------------------------------------
2989The selected channels go 'on the bus'. Type of the bus is specified by busType parameter.
2990Additional parameters can be specified by flags parameter.
2991*/
2992
2993DECL_STDXL_FUNC ( xlActivateChannel, XLACTIVATECHANNEL, (
2994 XLportHandle portHandle,
2995 XLaccess accessMask,
2996 unsigned int busType,
2997 unsigned int flags)
2998 );
2999
3000
3001/*------------------------------------------------------------------------------
3002xlReceive():
3003--------------------------------------------------------------------------------
3004The driver is asked to retrieve burst of Events from the
3005application's receive queue. This function is optimized
3006for speed. pEventCount on start must contain size of the buffer in
3007messages, on return it sets number of realy received messages (messages
3008written to pEvents buffer).
3009Application must allocate pEvents buffer big enough to hold number of
3010messages requested by pEventCount parameter.
3011It returns VERR_QUEUE_IS_EMPTY and *pEventCount=0 if no event
3012was received.
3013The function only works for CAN, LIN, DAIO. For MOST there is a different
3014function
3015*/
3016
3017DECL_STDXL_FUNC ( xlReceive, XLRECEIVE, (
3018 XLportHandle portHandle,
3019 unsigned int *pEventCount,
3020 XLevent *pEvents)
3021 );
3022
3023/*------------------------------------------------------------------------------
3024xlGetErrorString():
3025xlGetEventString():
3026--------------------------------------------------------------------------------
3027Utility Functions
3028*/
3029#ifdef DYNAMIC_XLDRIVER_DLL
3030 typedef XLstringType (_XL_EXPORT_API *XLGETERRORSTRING) ( XLstatus err );
3031 typedef XLstringType (_XL_EXPORT_API *XLGETEVENTSTRING)( XLevent *pEv );
3032#else
3033 XLstringType _XL_EXPORT_DECL xlGetErrorString( XLstatus err );
3034 XLstringType _XL_EXPORT_DECL xlGetEventString( XLevent *pEv );
3035#endif
3036
3037/*------------------------------------------------------------------------------
3038xlOemContact():
3039--------------------------------------------------------------------------------
3040*/
3041
3042DECL_STDXL_FUNC ( xlOemContact, XLOEMCONTACT, (XLportHandle portHandle, unsigned long Channel, XLuint64 context1, XLuint64 *context2));
3043
3044/*------------------------------------------------------------------------------
3045xlGetSyncTime():
3046--------------------------------------------------------------------------------
3047Function is reading high precision (1ns) card time used for time synchronization
3048of Party Line trigger (sync line).
3049*/
3050
3051DECL_STDXL_FUNC ( xlGetSyncTime, XLGETSYNCTIME, (
3052 XLportHandle portHandle,
3053 XLuint64 *pTime )
3054 );
3055
3056/*------------------------------------------------------------------------------
3057xlGenerateSyncPulse():
3058--------------------------------------------------------------------------------
3059Activates short sync pulse on desired channel. Channels mask should not
3060define two channels of one hardware.
3061
3062*/
3063
3064DECL_STDXL_FUNC ( xlGenerateSyncPulse, XLGENERATESYNCPULSE, (
3065 XLportHandle portHandle,
3066 XLaccess accessMask)
3067 );
3068
3069/*------------------------------------------------------------------------------
3070xlPopupHwConfig():
3071--------------------------------------------------------------------------------
3072*/
3073
3074DECL_STDXL_FUNC ( xlPopupHwConfig, XLPOPUPHWCONFIG, (
3075 char *callSign,
3076 unsigned int waitForFinish)
3077 );
3078
3079/*------------------------------------------------------------------------------
3080xlDeactivateChannel():
3081--------------------------------------------------------------------------------
3082The selected channels go 'off the bus'.
3083Its now possible to initialize
3084*/
3085
3086DECL_STDXL_FUNC ( xlDeactivateChannel, XLDEACTIVATECHANNEL, (
3087 XLportHandle portHandle,
3088 XLaccess accessMask)
3089 );
3090
3091/*------------------------------------------------------------------------------
3092xlClosePort():
3093--------------------------------------------------------------------------------
3094The port is closed, channels are deactivated.
3095*/
3096
3097DECL_STDXL_FUNC ( xlClosePort, XLCLOSEPORT, (
3098 XLportHandle portHandle)
3099 );
3100
3101////////////////////////////////////////////////////////////////////////////////
3102// CAN functions
3103////////////////////////////////////////////////////////////////////////////////
3104/*------------------------------------------------------------------------------
3105xlCanFlushTransmitQueue():
3106// TODO: fr MOST nutzen
3107--------------------------------------------------------------------------------
3108The transmit queue of the selected channel will be flushed.
3109*/
3110
3111DECL_STDXL_FUNC ( xlCanFlushTransmitQueue, XLCANFLUSHTRANSMITQUEUE, (
3112 XLportHandle portHandle, XLaccess accessMask)
3113 );
3114
3115
3116/*------------------------------------------------------------------------------
3117xlCanSetChannelOutput():
3118--------------------------------------------------------------------------------
3119The output mode for the CAN chips of the channels defined by accessMask, is set
3120to OUTPUT_MODE_NORMAL or OUTPUT_MODE_SILENT.
3121The port must have init access to the channels.
3122*/
3123
3124DECL_STDXL_FUNC ( xlCanSetChannelOutput, XLCANSETCHANNELOUTPUT, (
3125 XLportHandle portHandle,
3126 XLaccess accessMask,
3127 int mode)
3128 );
3129
3130
3131/*------------------------------------------------------------------------------
3132xlCanSetChannelMode():
3133--------------------------------------------------------------------------------
3134For the CAN channels defined by AccessMask is set
3135whether the caller will get a TX and/or a TXRQ
3136receipt for transmitted messages.
3137The port must have init access to the channels.
3138*/
3139
3140DECL_STDXL_FUNC ( xlCanSetChannelMode, XLCANSETCHANNELMODE, (
3141 XLportHandle portHandle,
3142 XLaccess accessMask,
3143 int tx,
3144 int txrq)
3145 );
3146
3147/*------------------------------------------------------------------------------
3148xlCanSetReceiveMode():
3149--------------------------------------------------------------------------------
3150*/
3151
3152DECL_STDXL_FUNC (xlCanSetReceiveMode, XLCANSETRECEIVEMODE, (
3153 XLportHandle Port, // Port Handle
3154 unsigned char ErrorFrame, // suppress Error Frames
3155 unsigned char ChipState // suppress Chip States
3156 )
3157 );
3158
3159
3160/*------------------------------------------------------------------------------*/
3161/** xlCanSetChannelTransceiver():
3162 *\brief The transceiver mode is set for all channels defined by accessMask.
3163 * The port must have init access to the channels.
3164 * \param portHandle [IN] handle to port from which the information is requested
3165 * \param accessMask [IN] mask specifying the port's channel from where to get the device state
3166 * \param type [IN] Reserved. Should always be set to zero!
3167 * \param lineMode [IN] Transceiver operation mode (specified by defines 'XL_TRANSCEIVER_LINEMODE_*')
3168 * \param resNet [IN] Reserved. Should always be set to zero!
3169 */
3170
3171DECL_STDXL_FUNC ( xlCanSetChannelTransceiver, XLCANSETCHANNELTRANSCEIVER, (
3172 XLportHandle portHandle,
3173 XLaccess accessMask,
3174 int type,
3175 int lineMode,
3176 int resNet)
3177 );
3178
3179/*------------------------------------------------------------------------------
3180xlCanSetChannelParams():
3181xlCanSetChannelParamsC200():
3182xlCanSetChannelBitrate():
3183--------------------------------------------------------------------------------
3184The channels defined by accessMask will be initialized with the
3185given parameters.
3186The port must have init access to the channels.
3187*/
3188
3189DECL_STDXL_FUNC ( xlCanSetChannelParams, XLCANSETCHANNELPARAMS, (
3190 XLportHandle portHandle,
3191 XLaccess accessMask,
3192 XLchipParams* pChipParams)
3193 );
3194
3195DECL_STDXL_FUNC ( xlCanSetChannelParamsC200, XLCANSETCHANNELPARAMSC200, (
3196 XLportHandle portHandle,
3197 XLaccess accessMask,
3198 unsigned char btr0,
3199 unsigned char btr1)
3200 );
3201
3202DECL_STDXL_FUNC ( xlCanSetChannelBitrate, XLCANSETCHANNELBITRATE, (
3203 XLportHandle portHandle,
3204 XLaccess accessMask,
3205 unsigned long bitrate)
3206 );
3207
3208/*------------------------------------------------------------------------------
3209xlCanSetAcceptance():
3210--------------------------------------------------------------------------------
3211Set the acceptance filter
3212Filters for std and ext ids are handled independant in the driver.
3213Use mask=0xFFFF,code=0xFFFF or mask=0xFFFFFFFF,code=0xFFFFFFFF to fully close
3214the filter.
3215*/
3216
3217DECL_STDXL_FUNC ( xlCanSetChannelAcceptance, XLCANSETCHANNELACCEPTANCE, (
3218 XLportHandle portHandle,
3219 XLaccess accessMask,
3220 unsigned long code,
3221 unsigned long mask,
3222 unsigned int idRange)
3223 );
3224
3225/*------------------------------------------------------------------------------
3226xlCanAddAcceptanceRange():
3227xlCanRemoveAcceptanceRange():
3228xlCanResetAcceptance():
3229--------------------------------------------------------------------------------
3230*/
3231
3232DECL_STDXL_FUNC ( xlCanAddAcceptanceRange, XLCANADDACCEPTANCERANGE, (
3233 XLportHandle portHandle,
3234 XLaccess accessMask,
3235 unsigned long first_id,
3236 unsigned long last_id)
3237 );
3238DECL_STDXL_FUNC ( xlCanRemoveAcceptanceRange, XLCANREMOVEACCEPTANCERANGE, (
3239 XLportHandle portHandle,
3240 XLaccess accessMask,
3241 unsigned long first_id,
3242 unsigned long last_id)
3243 );
3244DECL_STDXL_FUNC ( xlCanResetAcceptance, XLCANRESETACCEPTANCE, (
3245 XLportHandle portHandle,
3246 XLaccess accessMask,
3247 unsigned int idRange);
3248 );
3249
3250/*------------------------------------------------------------------------------
3251xlCanRequestChipState():
3252--------------------------------------------------------------------------------
3253The state of the selected channels is requested.
3254The answer will be received as an event (XL_CHIP_STATE).
3255*/
3256
3257DECL_STDXL_FUNC ( xlCanRequestChipState, XLCANREQUESTCHIPSTATE, (
3258 XLportHandle portHandle,
3259 XLaccess accessMask)
3260 );
3261
3262/*------------------------------------------------------------------------------
3263xlCanTransmit():
3264--------------------------------------------------------------------------------
3265This function is designed to send different messages to supported bus.
3266Usualy pEvents is a pointer to XLevent array. pEvents points to variable
3267which contains information about how many messages should be transmitted
3268to desired channels. It must be less or same as pEventCount buffer size
3269in messages. On return function writes number of transmitted messages
3270(moved to device queue for transmitting).
3271
3272*/
3273
3274DECL_STDXL_FUNC ( xlCanTransmit, XLCANTRANSMIT, (
3275 XLportHandle portHandle,
3276 XLaccess accessMask,
3277 unsigned int *pEventCount,
3278 void *pEvents)
3279 );
3280
3281
3282/*------------------------------------------------------------------------------
3283xlSetGlobalTimeSync():
3284--------------------------------------------------------------------------------
3285To query and change the globale time sync setting
3286*/
3287DECL_STDXL_FUNC ( xlSetGlobalTimeSync, XLSETGLOBALTIMESYNC, (unsigned long newValue,
3288 unsigned long *previousValue));
3289
3290
3291/*------------------------------------------------------------------------------
3292xlCheckLicense():
3293--------------------------------------------------------------------------------
3294For all channels the port wants to use it is checked wether
3295the hardware is licensed for the type of application.
3296If not the application should terminate.
3297*/
3298
3299DECL_STDXL_FUNC ( xlCheckLicense, XLCHECKLICENSE, (
3300 XLportHandle portHandle,
3301 XLaccess accessMask,
3302 unsigned long protectionCode)
3303 );
3304
3305
3306/********************************************************************/
3307/** xlGetLicenseInfo()
3308 *\brief Function to get available licenses from Vector devices.
3309 * This function returns the available licenses in an array of XLlicenseInfo structures. This array contains all available licenses on
3310 * the queried channels. The position inside the array is defined by the license itself, e.g. the license for
3311 * the Advanced-Flexray-Library is always at the same array index.
3312 * \param channelMask [IN] : Channelmask for which to query the available licenses
3313 * \param *pLicInfoArray [OUT]: Array with license overview
3314 * \param licInfoArraySize [IN] : Size of array pointed to with 'pLicInfo' (number of array entries)
3315 * \return XLstatus General status information is returned.
3316 * XL_SUCCESS if no error occured.
3317 * XL_ERR_NO_RESOURCES if the given array size is too small to copy all available licenses into it.
3318 * XL_ERROR if general error occured.
3319*/
3320DECL_STDXL_FUNC ( xlGetLicenseInfo, XLGETLICENSEINFO, (
3321 XLaccess channelMask,
3322 XLlicenseInfo *pLicInfoArray,
3323 unsigned int licInfoArraySize)
3324 );
3325
3326
3327////////////////////////////////////////////////////////////////////////////////
3328// LIN functions
3329////////////////////////////////////////////////////////////////////////////////
3330
3331DECL_STDXL_FUNC( xlLinSetChannelParams, XLLINSETCHANNELPARAMS, (XLportHandle portHandle, XLaccess accessMask, XLlinStatPar vStatPar));
3332DECL_STDXL_FUNC( xlLinSetDLC, XLLINSETDLC, (XLportHandle portHandle, XLaccess accessMask, unsigned char dlc[64]));
3333DECL_STDXL_FUNC( xlLinSetSlave, XLLINSETSLAVE, (XLportHandle portHandle, XLaccess accessMask, unsigned char linId, unsigned char data[8], unsigned char dlc, unsigned short checksum));
3334DECL_STDXL_FUNC( xlLinSendRequest, XLLINSENDREQUEST, (XLportHandle portHandle, XLaccess accessMask, unsigned char linId, unsigned int flags));
3335DECL_STDXL_FUNC( xlLinSetSleepMode, XLLINSETSLEEPMODE, (XLportHandle portHandle, XLaccess accessMask, unsigned int flags, unsigned char linId));
3336DECL_STDXL_FUNC( xlLinWakeUp, XLLINWAKEUP, (XLportHandle portHandle, XLaccess accessMask));
3337DECL_STDXL_FUNC( xlLinSetChecksum, XLLINSETCHECKSUM, (XLportHandle portHandle, XLaccess accessMask, unsigned char checksum[60]));
3338DECL_STDXL_FUNC( xlLinSwitchSlave, XLLINSWITCHSLAVE, (XLportHandle portHandle, XLaccess accessMask, unsigned char linID, unsigned char mode));
3339
3340////////////////////////////////////////////////////////////////////////////////
3341// DAIO Function Declarations
3342////////////////////////////////////////////////////////////////////////////////
3343
3344DECL_STDXL_FUNC (xlDAIOSetPWMOutput , XLDAIOSETPWMOUTPUT, (XLportHandle portHandle, XLaccess accessMask, unsigned int frequency, unsigned int value));
3345DECL_STDXL_FUNC (xlDAIOSetDigitalOutput , XLDAIOSETDIGITALOUTPUT, (XLportHandle portHandle, XLaccess accessMask, unsigned int outputMask, unsigned int valuePattern));
3346DECL_STDXL_FUNC (xlDAIOSetAnalogOutput , XLDAIOSETANALOGOUTPUT, (XLportHandle portHandle, XLaccess accessMask, unsigned int analogLine1, unsigned int analogLine2, unsigned int analogLine3, unsigned int analogLine4));
3347DECL_STDXL_FUNC (xlDAIORequestMeasurement , XLDAIOREQUESTMEASUREMENT, (XLportHandle portHandle, XLaccess accessMask));
3348DECL_STDXL_FUNC (xlDAIOSetDigitalParameters , XLDAIOSETDIGITALPARAMETERS, (XLportHandle portHandle, XLaccess accessMask, unsigned int inputMask, unsigned int outputMask));
3349DECL_STDXL_FUNC (xlDAIOSetAnalogParameters , XLDAIOSETANALOGPARAMETERS, (XLportHandle portHandle, XLaccess accessMask, unsigned int inputMask, unsigned int outputMask, unsigned int highRangeMask));
3350DECL_STDXL_FUNC (xlDAIOSetAnalogTrigger , XLDAIOSETANALOGTRIGGER, (XLportHandle portHandle, XLaccess accessMask, unsigned int triggerMask, unsigned int triggerLevel, unsigned int triggerEventMode));
3351DECL_STDXL_FUNC (xlDAIOSetMeasurementFrequency , XLDAIOSETMEASUREMENTFREQUENCY, (XLportHandle portHandle, XLaccess accessMask, unsigned int measurementInterval));
3352DECL_STDXL_FUNC (xlDAIOSetDigitalTrigger , XLDAIOSETDIGITALTRIGGER, (XLportHandle portHandle, XLaccess accessMask, unsigned int triggerMask));
3353
3354
3355////////////////////////////////////////////////////////////////////////////////
3356// extern declaration for dynamically linking... for functions without the macro
3357////////////////////////////////////////////////////////////////////////////////
3358
3359#ifdef DYNAMIC_XLDRIVER_DLL
3360# ifndef DO_NOT_DEFINE_EXTERN_DECLARATION
3361
3362 XLstatus xlOpenDriver(void);
3363 XLstatus xlCloseDriver(void);
3364
3365 extern XLGETCHANNELINDEX xlGetChannelIndex;
3366 extern XLGETCHANNELMASK xlGetChannelMask;
3367
3368 extern XLGETEVENTSTRING xlGetEventString;
3369 extern XLGETERRORSTRING xlGetErrorString;
3370
3371# endif
3372#endif
3373
3374////////////////////////////////////////////////////////////////////////////////
3375// MOST Function Declarations
3376////////////////////////////////////////////////////////////////////////////////
3377
3378// apiname, apitype, parameters in paranthesis
3379
3380/**
3381 * Common principles:
3382 * If not mentioned otherwise, all APIs are asynchronous and will trigger an action in VN2600.
3383 * Results are delivered in events which can be fetched by xlMostReceive.
3384 *
3385 * Common Parameters: DEFPARAMS
3386 * XLportHandle portHandle: was previously fetched by xlOpenPort API.
3387 * XLaccess accessMask: determines on which channels an API should work.
3388 * XLuserHandle userHandle: used to match the response of the driver to the requests of the application
3389 * if an event is received spontaneously, e.g. MPR changed then the userHandle == 0
3390 * Common Return Value:
3391 * XLstatus: common return value of most APIs which indicates whether a command was
3392 * successfully launched or e.g. whether a command queue overflow happend
3393 */
3394
3395/** \brief fetching events from driver queue.
3396 * This method is used to fetch events, either bus events or acknowledgements
3397 * for commands from the driver queue. Each call delivers only one event (if an event is available). \n
3398 * It is a synchronous mode and either delivers event data immediately, or
3399 * indicates an error condition with its return value.
3400 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API (TODO)
3401 * \param XLaccess accessMask: [IN] determines on which channels an API should work (TODO)
3402 * \param pEventBuffer [IN] This parameter must point to a buffer to which the driver can copy
3403 * the next event of the receive queue
3404 * \return XLstatus general status information
3405 */
3406DECL_STDXL_FUNC( xlMostReceive, XLFP_MOSTRECEIVE, (XLportHandle portHandle, XLmostEvent* pEventBuffer));
3407
3408/** \brief Activates or deactivates the different event sources of VN2600.
3409 * This method is used to select which bus events should be delivered by VN2600.
3410 * Either CtrlNode, CtrlSpy, AsyncNode or AsyncSpy messages \n
3411 * ResponseEvent: XL_MOST_EVENTSOURCES
3412 * \param sourceMask [IN] each bit stands for an event source and can separately be set.
3413 * Use the definitions of the sourcemask...
3414 * \return XLstatus general status information
3415 */
3416DECL_STDXL_FUNC( xlMostSwitchEventSources, XLFP_MOSTSWITCHEVENTSOURCES,(DEFPARAMS, unsigned short sourceMask));
3417
3418/** \brief Activates or deactivates the bypass of the OS8104.
3419 * This method is used to switch the Bypass OS8104 (register TODO:) on and off \n
3420 * ResponseEvent: XL_MOST_ALLBYPASS
3421 * \param bypassMode [IN] bypass open/close
3422 * \return XLstatus general status information
3423 */
3424DECL_STDXL_FUNC( xlMostSetAllBypass, XLFP_MOSTSETALLBYPASS, (DEFPARAMS, unsigned char bypassMode));
3425
3426/** \brief Reads out the bypass mode of the OS8104.
3427 * This method is asynchronous and requests the event used to switch the Bypass OS8104.
3428 * ResponseEvent: XL_MOST_ALLBYPASS
3429 * \return XLstatus general status information
3430 */
3431DECL_STDXL_FUNC( xlMostGetAllBypass, XLFP_MOSTGETALLBYPASS, (DEFPARAMS));
3432
3433/** \brief Switches the OS8104 into slave or master mode.
3434 * This method is used to switch the OS8104 into the timing master or slave mode\n
3435 * ResponseEvent: XL_MOST_TIMINGMODE
3436 * \param timingMode [IN] MOST master/slave
3437 * \return XLstatus general status information
3438 */
3439DECL_STDXL_FUNC( xlMostSetTimingMode, XLFP_MOSTSETTIMINGMODE, (DEFPARAMS, unsigned char timingMode));
3440
3441/** \brief Triggers the event XL_MOST_TIMINGMODE.
3442 * This method is used to trigger the event XL_MOST_TIMINGMODE, which will deliver
3443 * information whether the OS8104 is configured in slave or master mode.\n
3444 * ResponseEvent: XL_MOST_TIMINGMODE
3445 * \return XLstatus general status information
3446 */
3447DECL_STDXL_FUNC( xlMostGetTimingMode, XLFP_MOSTGETTIMINGMODE, (DEFPARAMS));
3448
3449/** \brief Selects the MOST frequency either to 44.1 kHz or 48 kHz.
3450 * This method is used to select either 44.1 kHz or 48 kHz as
3451 * bus clock when the OS8104 of VN2600 acts as timing master \n
3452 * ResponseEvent: XL_MOST_FREQUENCY
3453 * \param frequency [IN] 44,1kHz, 48kHz
3454 * \return XLstatus general status information
3455 */
3456DECL_STDXL_FUNC( xlMostSetFrequency, XLFP_MOSTSETFREQUENCY, (DEFPARAMS, unsigned short frequency));
3457
3458/** \brief Triggers the event XL_MOST_FREQUENCY.
3459 * This method is used to trigger the event XL_MOST_FREQUENCY, which will deliver
3460 * information whether the OS8104 of VN2600 as timing master
3461 * generates 44.1 kHz or 48 kHz as bus clock.\n
3462 * ResponseEvent: XL_MOST_FREQUENCY
3463 * \return XLstatus general status information
3464 */
3465DECL_STDXL_FUNC( xlMostGetFrequency, XLFP_MOSTGETFREQUENCY, (DEFPARAMS));
3466
3467/** \brief Allows to write up to 16 byte register in the OS8104.
3468 * This method is used to write numbyte (up to 16) bytes into the registers of the OS8104
3469 * beginning from adr. \n
3470 * ResponseEvent: XL_MOST_REGISTER_BYTES
3471 * \param adr [IN] address (MAP) of register to which the first byte is written
3472 * \param numBytes [IN] number of successive bytes to be written to the registers
3473 * \param data [IN] bytes to be written
3474 * \return XLstatus general status information
3475 */
3476DECL_STDXL_FUNC( xlMostWriteRegister, XLFP_MOSTWRITEREGISTER, (DEFPARAMS, unsigned short adr, unsigned char numBytes, unsigned char data[16]));
3477
3478/** \brief Triggers the event XL_MOST_REGISTER_BYTES.
3479 * This method is used to read out registers of the OS8104.
3480 * The results will be delivered in the event XL_MOST_REGISTER_BYTES\n
3481 * ResponseEvent: XL_MOST_REGISTER_BYTES
3482 * \param adr [IN] address (MAP) of register from which the first byte is read
3483 * \param numBytes [IN] number of successive bytes to be read
3484 * \return XLstatus general status information
3485 */
3486DECL_STDXL_FUNC( xlMostReadRegister, XLFP_MOSTREADREGISTER, (DEFPARAMS, unsigned short adr, unsigned char numBytes));
3487
3488/** \brief Allows to write single or multiple bits of one byte register in the OS8104.
3489 * This method is used to write bits into a register of the OS8104 \n
3490 * ResponseEvent: XL_MOST_REGISTER_BYTES
3491 * \param adr [IN] address (MAP) of the register
3492 * \param mask [IN] each bit in mask corresponds to a bit in the register.
3493 * 1 means this bit will be written, 0 means that the bit is not influenced
3494 * \param value [IN] the byte to be written respecting the parameter mask
3495 * \return XLstatus general status information
3496 */
3497DECL_STDXL_FUNC( xlMostWriteRegisterBit, XLFP_MOSTWRITEREGISTERBIT, (DEFPARAMS, unsigned short adr, unsigned char mask, unsigned char value));
3498
3499/** \brief Sending a MOST Ctrl Message.
3500 * This method is used to send a ctrl message to the MOST ring.
3501 * The members ctrlType, targetAdr, ctrlData[17], TODO: prio of pCtrlMsg will be used,
3502 * all other members don't care for the transmit request.
3503 * A XL_MOST_CTRL_MSG event will be delivered with dir==Tx and txStatus set to
3504 * report success or failure of the transmission.\n
3505 * ResponseEvent: XL_MOST_CTRL_MSG
3506 * \param pCtrlMsg [IN] structure with all relevant data needed for a transmit request
3507 * \return XLstatus general status information
3508 */
3509DECL_STDXL_FUNC( xlMostCtrlTransmit, XLFP_MOSTCTRLTRANSMIT, (DEFPARAMS, XLmostCtrlMsg* pCtrlMsg));
3510
3511/** \brief Sending a MOST Async Message (Packet).
3512 * This method is used to send an asynchronous message (packet) to the MOST ring.
3513 * The members arbitration, targetAdr, asyncData[1014], length, TODO: prio of pAsyncMsg will be used,
3514 * all other members don't care for the transmit request.
3515 * TODO: arbitration has to be calculated by the sender or will be calculated by the driver/firmware?
3516 * A XL_MOST_ASYNC_MSG event will be delivered with dir==Tx and txStatus set to
3517 * report success or failure of the transmission.\n
3518 * ResponseEvent: XL_MOST_ASYNC_MSG
3519 * \param pAsyncMsg [IN] structure with all relevant data needed for a transmit request
3520 * \return XLstatus general status information
3521 */
3522DECL_STDXL_FUNC( xlMostAsyncTransmit, XLFP_MOSTASYNCTRANSMIT, (DEFPARAMS, XLmostAsyncMsg* pAsyncMsg));
3523
3524/** \brief Triggers the event XL_MOST_SYNC_ALLOCTABLE.
3525 * This method is used to trigger the event XL_MOST_SYNC_ALLOCTABLE,
3526 * which delivers the complete allocation table of the OS8104.\n
3527 * ResponseEvent: XL_MOST_SYNC_ALLOCTABLE
3528 * \return XLstatus general status information
3529 */
3530DECL_STDXL_FUNC( xlMostSyncGetAllocTable, XLFP_MOSTSYNCGETALLOCTABLE, (DEFPARAMS));
3531
3532/** \brief Programming the routing egine (RE) for audio channels.
3533 * This method is used to program the routing engine (RE) of the OS8104 in order
3534 * to either stream audio data from the line in of VN2600 to certain MOST channels allocated before,
3535 * or to stream audio data from certain MOST channels to the headphone output of VN2600. \n
3536 * ResponseEvent: XL_MOST_CTRL_SYNC_AUDIO
3537 * \param channel[4] [IN] channel numbers to be routed
3538 * \param device [IN] device, e.g.: audio line in/audio line out
3539 * \param mode [IN] audio mode
3540 * \return XLstatus general status information
3541 */
3542DECL_STDXL_FUNC( xlMostCtrlSyncAudio, XLFP_MOSTCTRLSYNCAUDIO, (DEFPARAMS, unsigned int channel[4], unsigned int device, unsigned int mode));
3543
3544/** \brief Programming the routing egine (RE) for audio channels.
3545 * This method is used to program the routing engine (RE) of the OS8104 in order
3546 * to either stream audio data from the line in of VN2600 to certain MOST channels allocated before,
3547 * or to stream audio data from certain MOST channels to the headphone output of VN2600. \n
3548 * ResponseEvent: XL_MOST_CTRL_SYNC_AUDIO_EX
3549 * \param channel[16] [IN] channel numbers to be routed (including SPDIF)
3550 * \param device [IN] device, e.g.: audio line in/audio line out, SPDIF in/out
3551 * \param mode [IN] audio mode
3552 * \return XLstatus general status information
3553 */
3554DECL_STDXL_FUNC( xlMostCtrlSyncAudioEx, XLFP_MOSTCTRLSYNCAUDIOEX, (DEFPARAMS, unsigned int channel[16], unsigned int device, unsigned int mode));
3555
3556/** \brief Setting the volume/attenuation for line in and line out.
3557 * This method is used to set the volume/attenuation of the line in or line out of VN2600.\n
3558 * ResponseEvent: XL_MOST_SYNC_VOLUME_STATUS
3559 * \param device [IN] device, e.g.: audio line in/audio line out
3560 * \param volume [IN] 0..255: 0..100% of volume
3561 * \return XLstatus general status information
3562*/
3563DECL_STDXL_FUNC( xlMostSyncVolume, XLFP_MOSTSYNCVOLUME, (DEFPARAMS, unsigned int device, unsigned char volume));
3564
3565/** \brief Setting mute for line in and line out.
3566 * This method is used to switch mute on or off for the line in or line out of VN2600.\n
3567 * ResponseEvent: XL_MOST_SYNC_VOLUME_STATUS
3568 * \param device [IN] device, e.g.: audio line in/audio line out
3569 * \param mute [IN] mute on/mute off
3570 * \return XLstatus general status information
3571 */
3572DECL_STDXL_FUNC( xlMostSyncMute, XLFP_MOSTSYNCMUTE, (DEFPARAMS, unsigned int device, unsigned char mute));
3573
3574/** \brief Triggers the event XL_MOST_SYNC_VOLUME_STATUS.
3575 * This method is used to trigger the event XL_MOST_SYNC_VOLUME_STATUS,
3576 * which delivers the information about volume status of line in and line out.\n
3577 * ResponseEvent: XL_MOST_SYNC_VOLUME_STATUS
3578 * \param device [IN] device, e.g.: audio line in/audio line out
3579 * \return XLstatus general status information
3580 */
3581DECL_STDXL_FUNC( xlMostSyncGetVolumeStatus,XLFP_MOSTSYNCGETVOLUMESTATUS,(DEFPARAMS, unsigned int device));
3582
3583/** \brief Triggers the event XL_MOST_SYNC_MUTE_STATUS.
3584 * This method is used to trigger the event XL_MOST_SYNC_MUTE_STATUS,
3585 * which delivers the information about mute status of line in and line out.\n
3586 * ResponseEvent: XL_MOST_SYNC_MUTE_STATUS
3587 * \param device [IN] device, e.g.: audio line in/audio line out
3588 * \return XLstatus general status information
3589 */
3590DECL_STDXL_FUNC( xlMostSyncGetMuteStatus, XLFP_MOSTSYNCGETMUTESTATUS,(DEFPARAMS, unsigned int device));
3591
3592/** \brief Triggers the event XL_MOST_SYNC_MUTE_STATUS.
3593 * This method delivers the recent light status at the Rx Pin of the OS8104.\n
3594 * ResponseEvent: XL_MOST_SYNC_MUTE_STATUS
3595 * \param device [IN] device, e.g.: audio line in/audio line out
3596 * \return XLstatus general status information
3597 */
3598DECL_STDXL_FUNC( xlMostGetRxLight, XLFP_MOSTGETRXLIGHT, (DEFPARAMS));
3599
3600/** \brief Switching the Tx light of VN2600.
3601 * This method is used to switch the Tx light of VN2600 off, to normal or to constant on\n
3602 * ResponseEvent: XL_MOST_TXLIGHT
3603 * \param txLight [IN] tx light on, off or modulated
3604 * \return XLstatus general status information
3605 */
3606DECL_STDXL_FUNC( xlMostSetTxLight, XLFP_MOSTSETTXLIGHT, (DEFPARAMS, unsigned char txLight));
3607
3608/** \brief Triggers the event XL_MOST_TXLIGHT.
3609 * This method is used to trigger the event XL_MOST_TXLIGHT,
3610 * which delivers the recent light status at the Tx Pin of the OS8104.\n
3611 * ResponseEvent: XL_MOST_TXLIGHT
3612 * \return XLstatus general status information
3613 */
3614DECL_STDXL_FUNC( xlMostGetTxLight, XLFP_MOSTGETTXLIGHT, (DEFPARAMS));
3615
3616/** \brief Switching the Tx light power of the FOT.
3617 * This method is used to switch the Tx light power of the FOT to normal or -3 dB\n
3618 * ResponseEvent: XL_MOST_TXLIGHT
3619 * \param attenuation [IN] tx power
3620 * \return XLstatus general status information
3621 */
3622DECL_STDXL_FUNC( xlMostSetLightPower, XLFP_MOSTSETLIGHTPOWER, (DEFPARAMS, unsigned char attenuation));
3623
3624// TODO: GetLightPower??
3625
3626/** \brief Triggers the event XL_MOST_LOCKSTATUS.
3627 * This method is used to trigger the event XL_MOST_LOCKSTATUS,
3628 * which delivers the recent lock status at the Rx Pin of the OS8104.\n
3629 * ResponseEvent: XL_MOST_LOCKSTATUS
3630 * \return XLstatus general status information
3631 */
3632DECL_STDXL_FUNC( xlMostGetLockStatus, XLFP_MOSTGETLOCKSTATUS, (DEFPARAMS));
3633
3634/** \brief Starts and stops the light error generator.
3635 * This method is used to start (repeat>0) or stop (repeat==0) the light error generator
3636 * which switches the Tx light on and off or configured periods.\n
3637 * ResponseEvent: XL_MOST_GENLIGHTERROR
3638 * \param lightOffTime [IN] duration of light off in ms
3639 * \param lightOnTime [IN] duration of modulated light on in ms
3640 * \param repeat [IN] repetition of light on light off sequence, or repeat==0: stop the generation
3641 * \return XLstatus general status information
3642 */
3643DECL_STDXL_FUNC( xlMostGenerateLightError, XLFP_MOSTGENERATELIGHTERROR,(DEFPARAMS, unsigned long lightOffTime, unsigned long lightOnTime, unsigned short repeat));
3644
3645/** \brief Starts and stops the lock error generator.
3646 * This method is used to start (repeat>0) or stop (repeat==0) the lock error generator
3647 * which switches the Tx light between modulated on and permanent on for configured periods.\n
3648 * ResponseEvent: XL_MOST_GENLOCKERROR
3649 * \param unmodTime [IN] duration of light off in ms
3650 * \param modTime [IN] duration of modulated light on in ms
3651 * \param repeat [IN] repetition of sequence, or repeat==0: stop the generation
3652 * \return XLstatus general status information
3653 */
3654DECL_STDXL_FUNC( xlMostGenerateLockError, XLFP_MOSTGENERATELOCKERROR, (DEFPARAMS, unsigned long unmodTime, unsigned long modTime, unsigned short repeat));
3655
3656/** \brief prevent firmware from emptying the Rx buffer of the OS8104
3657 * This method is used to Switch the stress mode on or off, where the
3658 * Rx buffer of the OS8104 is not emptied by the firmware
3659 * which switches the Tx light between modulated on and permanent on for configured periods.\n
3660 * ResponseEvent: XL_MOST_CTRL_RXBUFFER
3661 * \param bufferMode [IN] specifies the buffer mode
3662 * \return XLstatus general status information
3663 */
3664DECL_STDXL_FUNC( xlMostCtrlRxBuffer, XLFP_MOSTCTRLRXBUFFER, (DEFPARAMS, unsigned short bufferMode));
3665
3666/** \brief Twinkle the power led from the VN2600.
3667 * ResponseEvent: none
3668 * \return XLstatus general status information
3669 */
3670DECL_STDXL_FUNC( xlMostTwinklePowerLed, XLFP_MOSTTWINKLEPOWERLED, (DEFPARAMS));
3671
3672/** \brief Prepares and configures busload generation with MOST control frames.
3673 * Attention: Has to be called before "xlMostCtrlGenerateBusload".
3674 * ResponseEvent: none
3675 * \param portHandle [IN] handle to port from which the information is requested
3676 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3677 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3678 * if an event is received spontaneously
3679 * \param pCtrlBusloadConfiguration [IN] structure containg the ctrl msg used for busload generation and configuration,
3680 * it's storage has has to be supplied by the caller
3681 * \return XLstatus general status information
3682 */
3683DECL_STDXL_FUNC (xlMostCtrlConfigureBusload, XLFP_MOSTCTRLCONFIGUREBUSLOAD, (DEFPARAMS,
3684 XLmostCtrlBusloadConfiguration* pCtrlBusloadConfiguration));
3685
3686/** \brief Starts busload generation with MOST control frames.
3687 * Attention: "xlMostCtrlConfigureBusload" has to be called before.
3688 * ResponseEvent: XL_MOST_CTRL_BUSLOAD
3689 * \param portHandle [IN] handle to port from which the information is requested
3690 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3691 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3692 * if an event is received spontaneously
3693 * \param numberCtrlFrames [IN] number of busload ctrl messages (0xFFFFFFFF indicates infinite number of msgs)
3694 * \return XLstatus general status information
3695 */
3696DECL_STDXL_FUNC (xlMostCtrlGenerateBusload, XLFP_MOSTCTRLGENERATEBUSLOAD, (DEFPARAMS, unsigned long numberCtrlFrames));
3697
3698/** \brief Prepares and configures busload generation of MOST asynchronous frames.
3699 * Attention: Has to be called before "xlMostAsyncGenerateBusload".
3700 * ResponseEvent: none
3701 * \param portHandle [IN] handle to port from which the information is requested
3702 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3703 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3704 * if an event is received spontaneously
3705 * \param pAsyncBusloadConfiguration [IN] structure containg the async msg used for busload generation and configuration,
3706 * it's storage has has to be supplied by the caller
3707 * \return XLstatus general status information
3708 */
3709DECL_STDXL_FUNC (xlMostAsyncConfigureBusload, XLFP_MOSTASYNCCONFIGUREBUSLOAD, (DEFPARAMS,
3710 XLmostAsyncBusloadConfiguration* pAsyncBusloadConfiguration));
3711
3712/** \brief Starts busload generation with MOST asynchronous frames.
3713 * Attention: "xlMostAsyncConfigureBusload" has to be called before.
3714 * ResponseEvent: XL_MOST_ASYNC_BUSLOAD
3715 * \param portHandle [IN] handle to port from which the information is requested
3716 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3717 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3718 * if an event is received spontaneously
3719 * \param numberAsyncFrames [IN] number of busload async messages (0xFFFFFFFF indicates infinite number of msgs)
3720 * \return XLstatus general status information
3721 */
3722DECL_STDXL_FUNC (xlMostAsyncGenerateBusload, XLFP_MOSTASYNCGENERATEBUSLOAD, (DEFPARAMS, unsigned long numberAsyncFrames));
3723
3724
3725/** \brief Opens a stream (Rx / Tx) for routing synchronous data to or from the MOST bus (synchronous channel).
3726 * Attention: Has to be called before "xlMostStreamBufferAllocate".
3727 * ResponseEvent: none
3728 * \param portHandle [IN] handle to port from which the information is requested
3729 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3730 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3731 * if an event is received spontaneously
3732 * \param pStreamOpen [IN] structure containg the stream parameters -
3733 * it's storage has has to be supplied by the caller
3734 * \return XLstatus general status information
3735 */
3736DECL_STDXL_FUNC (xlMostStreamOpen, XLFP_MOSTSTREAMOPEN, (DEFPARAMS, XLmostStreamOpen* pStreamOpen));
3737
3738
3739/** \brief Closes an opened a stream (Rx / Tx) used for routing synchronous data to or from the MOST bus (synchronous channel).
3740 * ResponseEvent: none
3741 * \param portHandle [IN] handle to port from which the information is requested
3742 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3743 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3744 * if an event is received spontaneously
3745 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3746 * \return XLstatus general status information
3747 */
3748DECL_STDXL_FUNC (xlMostStreamClose, XLFP_MOSTSTREAMCLOSE, (DEFPARAMS, unsigned int streamHandle));
3749
3750
3751/** \brief Starts the streaming (Rx / Tx) of synchronous data to or from the MOST bus (synchronous channel).
3752 * Attention: Has to be called after "xlMostStreamOpen and xlMostStreamBufferAllocate" were called.
3753 * ResponseEvent: none
3754 * \param portHandle [IN] handle to port from which the information is requested
3755 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3756 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3757 * if an event is received spontaneously
3758 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3759 * \param syncChannels [IN] synchronous channels (bytes) used for streaming.
3760 * \return XLstatus general status information
3761 */
3762DECL_STDXL_FUNC (xlMostStreamStart, XLFP_MOSTSTREAMSTART, (DEFPARAMS, unsigned int streamHandle, unsigned char syncChannels[60]));
3763
3764
3765/** \brief Stops the streaming (Rx / Tx) of synchronous data to or from the MOST bus (synchronous channel).
3766 * Attention: Has to be called before "xlMostStreamBufferDeallocate".
3767 * ResponseEvent: none
3768 * \param portHandle [IN] handle to port from which the information is requested
3769 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3770 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3771 * if an event is received spontaneously
3772 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3773 * \return XLstatus general status information
3774 */
3775DECL_STDXL_FUNC (xlMostStreamStop, XLFP_MOSTSTREAMSTOP, (DEFPARAMS, unsigned int streamHandle));
3776
3777
3778/** \brief Allocates a buffer for streaming (RX / Tx) of synchronous data to or from the MOST bus (synchronous channel).
3779 * Attention: Has to be called before "xlMostStreamStart".
3780 * ResponseEvent: none
3781 * \param portHandle [IN] handle to port from which the information is requested
3782 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3783 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3784 * if an event is received spontaneously
3785 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3786 * \param ppBuffer [OUT] pointer to the buffer used for streaming
3787 * memory allocation is done by the driver
3788 * has to be realeased by calling xlMostStreamBufferDeallocate
3789 * \param pBufferSize [OUT] buffer size.
3790 * \return XLstatus general status information
3791 */
3792DECL_STDXL_FUNC (xlMostStreamBufferAllocate, XLFP_MOSTSTREAMBUFFERALLOCATE, (DEFPARAMS, unsigned int streamHandle, unsigned char** ppBuffer, unsigned int* pBufferSize));
3793
3794
3795/** \brief Deallocates any buffer allocated with "xlMostStreamBufferAllocate".
3796 * Attention: Has to be called before "xlMostStreamClose". Afterwards no buffer must be accessed!
3797 * ResponseEvent: none
3798 * \param portHandle [IN] handle to port from which the information is requested
3799 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3800 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3801 * if an event is received spontaneously
3802 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3803 * \return XLstatus general status information
3804 */
3805DECL_STDXL_FUNC (xlMostStreamBufferDeallocateAll, XLFP_MOSTSTREAMBUFFERDEALLOCATEALL, (DEFPARAMS, unsigned int streamHandle));
3806
3807
3808/** \brief Notifies the driver the next buffer to be used for streaming synchronous data to or from the MOST bus (synchronous channel).
3809 * ResponseEvent: none
3810 * \param portHandle [IN] handle to port from which the information is requested
3811 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3812 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3813 * if an event is received spontaneously
3814 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
3815 * \param pBuffer [IN] pointer to the next buffer used for streaming
3816 * \param filledBytes [IN] size of the next buffer to be used for streaming
3817 * \return XLstatus general status information
3818 */
3819DECL_STDXL_FUNC (xlMostStreamBufferSetNext, XLFP_MOSTSTREAMBUFFERSETNEXT, (DEFPARAMS, unsigned int streamHandle, unsigned char* pBuffer, unsigned int filledBytes));
3820
3821
3822/** \brief Retrieves the stream information.
3823 * This method is used to gather the recent stream state information.\n
3824 * ResponseEvent: None
3825 * \param portHandle [IN] handle to port from which the information is requested
3826 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3827 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3828 * if an event is received spontaneously
3829 * \param pStreamInfo [OUT] Pointer to the stream information.
3830 * \return XLstatus general status information
3831 */
3832DECL_STDXL_FUNC (xlMostStreamGetInfo, XLFP_MOSTSTREAMGETINFO, (DEFPARAMS, XLmostStreamInfo* pStreamInfo));
3833
3834
3835/** \brief Clears the content of the buffer(s) which are not already sent.
3836 * This method is used to clear the content of any TX streaming buffer which has not been sent yet.\n
3837 * ResponseEvent: None
3838 * \param portHandle [IN] handle to port from which the information is requested
3839 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3840 * \param userHandle [IN] used to match the response of the driver to the requests of the application
3841 * if an event is received spontaneously
3842 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen.
3843 * \return XLstatus general status information
3844 */
3845DECL_STDXL_FUNC (xlMostStreamBufferClearAll, XLFP_MOSTSTREAMBUFFERCLEARALL, (DEFPARAMS, unsigned int streamHandle));
3846
3847
3848////////////////////////////////////////////////////////////////////////////////
3849// FlexRay Function Declarations
3850////////////////////////////////////////////////////////////////////////////////
3851
3852/** \brief Setup the FlexRay node
3853 * ResponseEvent:
3854 * \param portHandle [IN] handle specifying the port to be configured
3855 * \param accessMask [IN] mask specifying the port's channel
3856 * \param pxlClusterConfig [IN] structure to the cluster config structure
3857 * \return XLstatus general status information
3858 */
3859
3860DECL_STDXL_FUNC (xlFrSetConfiguration, XLFP_FRSETCONFIGURATION, (DEFFRPARAM, XLfrClusterConfig *pxlClusterConfig));
3861
3862/** \brief Get configuration of a FlexRay channel
3863 * ResponseEvent:
3864 * \param portHandle [IN] handle to port from which the information is requested
3865 * \param accessMask [IN] mask specifying the port's channel from where to get the information
3866 * \param XLfrChannelConfig [OUT] pointer to the FlexRay channel configuration structure
3867 * \return XLstatus general status information
3868 */
3869
3870DECL_STDXL_FUNC (xlFrGetChannelConfiguration, XLFP_FRGETCHANNELCONFIGURATION, (DEFFRPARAM, XLfrChannelConfig* pxlFrChannelConfig));
3871
3872/** \brief Setup the FlexRay mode
3873 * ResponseEvent:
3874 * \param portHandle [IN] handle to port from which the information is requested
3875 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3876 * \param pxlFrMode [IN] structure to the FlexRay mode structure (e.g.: normal-, monitor-, clusterScan mode).
3877 * \return XLstatus general status information
3878 */
3879
3880DECL_STDXL_FUNC (xlFrSetMode, XLFP_FRSETMODE, (DEFFRPARAM, XLfrMode *pxlFrMode));
3881
3882/** \brief Initialize the cold start and define the sync event
3883 * ResponseEvent:
3884 * \param portHandle [IN] handle to port from which the information is requested
3885 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3886 * \param pEventBuffer [IN] pointer to the startup and sync frame
3887 * \return XLstatus general status information
3888 */
3889
3890DECL_STDXL_FUNC (xlFrInitStartupAndSync, XLFP_FRINITSTARTUPANDSYNC, (DEFFRPARAM, XLfrEvent *pEventBuffer));
3891
3892/** \brief setup the symbol window.
3893 * ResponseEvent:
3894 * \param portHandle [IN] handle to port from which the information is requested
3895 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3896 * \param frChannel [IN] FlexRay channel, like A,B, both...
3897 * \param symbolWindowMask [IN] symbol window mask like MTS.
3898 * \return XLstatus general status information
3899 */
3900
3901DECL_STDXL_FUNC (xlFrSetupSymbolWindow, XLFP_FRSETUPSYMBOLWINDOW, (DEFFRPARAM, unsigned int frChannel,
3902 unsigned int symbolWindowMask));
3903
3904/** \brief Reads the FlexRay events
3905 * ResponseEvent:
3906 * \param portHandle [IN] handle to port from which the information is requested
3907 * \param pEventBuffer [OUT] pointer to the FlexRay RX event
3908 * \return XLstatus general status information
3909 */
3910
3911DECL_STDXL_FUNC (xlFrReceive, XLFP_FRRECEIVE, (XLportHandle portHandle, XLfrEvent *pEventBuffer));
3912
3913/** \brief Transmit a FlexRay event
3914 * ResponseEvent:
3915 * \param portHandle [IN] handle to port from which the information is requested
3916 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3917 * \param pEventBuffer [IN] pointer to the FlexRay TX event
3918 * \return XLstatus general status information
3919 */
3920
3921DECL_STDXL_FUNC (xlFrTransmit, XLFP_FRTRANSMIT, (DEFFRPARAM, XLfrEvent *pEventBuffer));
3922
3923/** \brief
3924 * ResponseEvent:
3925 * \param portHandle [IN] handle to port from which the information is requested
3926 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3927 * \param frChannel [IN] FlexRay channel. e.g. CHANNEL_A...
3928 * \param mode [IN] transceiver mode. e.g. sleep
3929 * \return XLstatus general status information
3930 */
3931
3932DECL_STDXL_FUNC (xlFrSetTransceiverMode, XLFP_FRSETTRANSCEIVERMODE, (DEFFRPARAM, unsigned int frChannel, unsigned int mode));
3933
3934/** \brief
3935 * ResponseEvent:
3936 * \param portHandle [IN] handle to port from which the information is requested
3937 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3938 * \param symbolWindow [IN] defines the symbol window (e.g. MTS).
3939 * \return XLstatus general status information
3940 */
3941
3942DECL_STDXL_FUNC (xlFrSendSymbolWindow, XLFP_FRSENDSYMBOLWINDOW, (DEFFRPARAM, unsigned int symbolWindow));
3943
3944/** \brief
3945 * ResponseEvent:
3946 * \param portHandle [IN] handle to port from which the information is requested
3947 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
3948 * \param mode [IN] specifies the spy mode: XL_FR_SPY_MODE_***
3949 * \return XLstatus general status information
3950 */
3951
3952DECL_STDXL_FUNC (xlFrActivateSpy, XLFP_FRACTIVATESPY, (DEFFRPARAM, unsigned int mode));
3953
3954
3955/** \brief The application gets the information, which remote channels are available in the system. The user
3956 * must provide the memory (pointer to XLdriverConfig structure).
3957 * \param pDriverConfig [OUT] The remote driver configuration structure.
3958 * \return XLstatus general status information
3959 */
3960
3961
3962DECL_STDXL_FUNC( xlGetRemoteDriverConfig, XLGETREMOTEDRIVERCONFIG, (XLdriverConfig *pDriverConfig));
3963
3964////////////////////////////////////////////////////////////////////////////////
3965// MOST150 Function Declarations
3966////////////////////////////////////////////////////////////////////////////////
3967
3968// apiname, apitype, parameters in paranthesis
3969
3970/**
3971 * Common principles:
3972 * If not mentioned otherwise, all APIs are asynchronous and will trigger an action in VN2640.
3973 * Results are delivered in events which can be fetched by xlMost150Receive.
3974 *
3975 * Common Parameters: DEFPARAMS
3976 * XLportHandle portHandle: was previously fetched by xlOpenPort API.
3977 * XLaccess accessMask: determines on which channels an API should work.
3978 * XLuserHandle userHandle: used to match the response of the driver to the requests of the application
3979 * if an event is received spontaneously, e.g. MPR changed then the userHandle == 0
3980 * Common Return Value:
3981 * XLstatus: common return value of most APIs which indicates whether a command was
3982 * successfully launched or e.g. whether a command queue overflow happend
3983 */
3984
3985/** \brief fetching events from driver queue.
3986 * This method is used to fetch events, either bus events or acknowledgements
3987 * for commands from the driver queue. Each call delivers only one event (if an event is available). \n
3988 * It is a synchronous mode and either delivers event data immediately, or
3989 * indicates an error condition with its return value.
3990 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
3991 * \param XLaccess accessMask: [IN] determines on which channels an API should work
3992 * \param pEventBuffer [IN] This parameter must point to a buffer to which the driver can copy
3993 * the next event of the receive queue
3994 * \return XLstatus general status information
3995 */
3996DECL_STDXL_FUNC( xlMost150Receive, XLFP_MOST150RECEIVE, (XLportHandle portHandle, XLmost150event* pEventBuffer));
3997
3998/** \brief Twinkle the power led from the VN2640.
3999 * ResponseEvent: none
4000 * \return XLstatus general status information
4001 */
4002DECL_STDXL_FUNC( xlMost150TwinklePowerLed, XLFP_MOST150TWINKLEPOWERLED, (DEFPARAMS));
4003
4004/** \brief Activates or deactivates the different event sources of VN2640.
4005 * This method is used to select which bus events should be delivered by VN2640.
4006 * ResponseEvent: XL_MOST150_EVENT_SOURCE
4007 * \param sourceMask [IN] each bit stands for an event source and can separately be set.
4008 * Use the definitions of the sourcemask (see XL_MOST150_SOURCE_...).
4009 * \return XLstatus general status information
4010 */
4011DECL_STDXL_FUNC( xlMost150SwitchEventSources, XLFP_MOST150SWITCHEVENTSOURCES,(DEFPARAMS, unsigned int sourceMask));
4012
4013
4014/** \brief Sets the device mode.
4015 * This method is used to switch the device mode to either Master, Slave or bypass \n
4016 * ResponseEvent: XL_MOST150_DEVICE_MODE
4017 * \param deviceMode [IN] device mode (see XL_MOST150_DEVICEMODE_...)
4018 * \return XLstatus general status information
4019 */
4020DECL_STDXL_FUNC( xlMost150SetDeviceMode, XLFP_MOST150SETDEVICEMODE, (DEFPARAMS, unsigned int deviceMode));
4021
4022/** \brief Requests the current device mode.
4023 * This method is asynchronous and requests the event used to switch device mode.
4024 * ResponseEvent: XL_MOST150_DEVICE_MODE
4025 * \return XLstatus general status information
4026 */
4027DECL_STDXL_FUNC( xlMost150GetDeviceMode, XLFP_MOST150GETDEVICEMODE, (DEFPARAMS));
4028
4029/** \brief Switches the SPDIF mode to slave or master mode.
4030 * This method is used to switch into the SPDIF master or SPDIF slave mode \n
4031 * ResponseEvent: XL_MOST150_SPDIFMODE
4032 * \param spdifMode [IN] MOST master/slave, ...
4033 * \return XLstatus general status information
4034 */
4035DECL_STDXL_FUNC( xlMost150SetSPDIFMode, XLFP_MOST150SETSPDIFMODE, (DEFPARAMS, unsigned int spdifMode));
4036
4037/** \brief Requests the current SPDIF mode.
4038 * This method is used to trigger the event XL_MOST150_SPDIFMODE, which will deliver
4039 * information whether the SPDIF is configured in slave or master mode.\n
4040 * ResponseEvent: XL_MOST150_SPDIFMODE
4041 * \return XLstatus general status information
4042 */
4043DECL_STDXL_FUNC( xlMost150GetSPDIFMode, XLFP_MOST150GETSPDIFMODE, (DEFPARAMS));
4044
4045
4046/** \brief Set one or more parameters of the special node info at once.
4047 * ResponseEvent: XL_MOST150_SPECIAL_NODE_INFO
4048 * \param pSpecialNodeInfo [IN] contains the parameter to set
4049 * \return XLstatus general status information
4050 */
4051DECL_STDXL_FUNC( xlMost150SetSpecialNodeInfo, XLFP_MOST150SETSPECIALNODEINFO, (DEFPARAMS, XLmost150SetSpecialNodeInfo *pSpecialNodeInfo));
4052
4053/** \brief Requests one or more parameters of the special node info at once.
4054 * ResponseEvent: XL_MOST150_SPECIAL_NODE_INFO
4055 * \param requestMask [IN] contains a mask of parameter to get (see XL_MOST150_SPECIAL_NODE_MASK_CHANGED)
4056 * \return XLstatus general status information
4057 */
4058DECL_STDXL_FUNC( xlMost150GetSpecialNodeInfo, XLFP_MOST150GETSPECIALNODEINFO, (DEFPARAMS, unsigned int requestMask));
4059
4060/** \brief Set the frequency of the MOST150 ring.
4061 * ResponseEvent: XL_MOST150_FREQUENCY
4062 * \param frequency [IN] contains the frequency to be set. Only as timing master! (see XL_MOST150_FREQUENCY_...)
4063 * \return XLstatus general status information
4064 */
4065DECL_STDXL_FUNC( xlMost150SetFrequency, XLFP_MOST150SETFREQUENCY, (DEFPARAMS, unsigned int frequency));
4066
4067/** \brief Requests the frequency of the MOST150 ring.
4068 * ResponseEvent: XL_MOST150_FREQUENCY
4069 * \return XLstatus general status information
4070 */
4071DECL_STDXL_FUNC( xlMost150GetFrequency, XLFP_MOST150GETFREQUENCY, (DEFPARAMS));
4072
4073/** \brief Transmit a control message on the MOST150 ring.
4074 * ResponseEvent: XL_MOST150_CTRL_TX
4075 * \param pCtrlTxMsg [IN] pointer to structure that contains the control message to be sent
4076 * \return XLstatus general status information
4077 */
4078DECL_STDXL_FUNC( xlMost150CtrlTransmit, XLFP_MOST150CTRLTRANSMIT, (DEFPARAMS, XLmost150CtrlTxMsg *pCtrlTxMsg));
4079
4080/** \brief Transmit a data packet (MDP) on the MOST150 ring.
4081 * ResponseEvent: XL_MOST150_ASYNC_TX
4082 * \param pAsyncTxMsg [IN] pointer to structure that contains the MOST Data Packet (MDP) to be sent
4083 * \return XLstatus general status information
4084 */
4085DECL_STDXL_FUNC( xlMost150AsyncTransmit, XLFP_MOST150ASYNCTRANSMIT, (DEFPARAMS, XLmost150AsyncTxMsg *pAsyncTxMsg));
4086
4087/** \brief Transmit a ethernet packet (MEP) on the MOST150 ring.
4088 * ResponseEvent: XL_MOST150_ETHERNET_TX
4089 * \param pEthernetTxMsg [IN] pointer to structure that contains the MOST Ethernet Packet (MEP) to be sent
4090 * \return XLstatus general status information
4091 */
4092DECL_STDXL_FUNC( xlMost150EthernetTransmit, XLFP_MOST150ETHTRANSMIT, (DEFPARAMS, XLmost150EthernetTxMsg *pEthernetTxMsg));
4093
4094/** \brief Requests the state of the system lock flag.
4095 * ResponseEvent: XL_MOST150_SYSTEMLOCK_FLAG
4096 * \return XLstatus general status information
4097 */
4098DECL_STDXL_FUNC( xlMost150GetSystemLockFlag, XLFP_MOST150GETSYSTEMLOCK, (DEFPARAMS));
4099
4100/** \brief Requests the state of the shutdown flag.
4101 * ResponseEvent: XL_MOST150_SHUTDOWN_FLAG
4102 * \return XLstatus general status information
4103 */
4104DECL_STDXL_FUNC( xlMost150GetShutdownFlag, XLFP_MOST150GETSHUTDOWN, (DEFPARAMS));
4105
4106/** \brief Shutdown the MOST150 ring.
4107 * ResponseEvent:
4108 * \return XLstatus general status information
4109 */
4110DECL_STDXL_FUNC( xlMost150Shutdown, XLFP_MOST150SHUTDOWN, (DEFPARAMS));
4111
4112/** \brief Startup the MOST150 ring.
4113 * ResponseEvent:
4114 * \return XLstatus general status information
4115 */
4116DECL_STDXL_FUNC( xlMost150Startup, XLFP_MOST150STARTUP, (DEFPARAMS));
4117
4118/** \brief Requests the current allocation information.
4119 * \n
4120 * ResponseEvent: XL_MOST150_SYNC_ALLOC_INFO
4121 * \return XLstatus general status information
4122 */
4123DECL_STDXL_FUNC( xlMost150SyncGetAllocTable, XLFP_MOST150GETALLOCTABLE, (DEFPARAMS));
4124
4125/** \brief Set the parameters for audio functions.
4126 * ResponseEvent: XL_MOST150_CTRL_SYNC_AUDIO
4127 * \param pSyncAudioParameter [IN] pointer to structure that contains the data
4128 * \return XLstatus general status information
4129 */
4130DECL_STDXL_FUNC( xlMost150CtrlSyncAudio, XLFP_MOST150CTRLSYNCAUDIO, (DEFPARAMS, XLmost150SyncAudioParameter *pSyncAudioParameter));
4131
4132/** \brief Set the volume of Line In/Out audio device.
4133 * ResponseEvent: XL_MOST150_SYNC_VOLUME_STATUS
4134 * \param device [IN] specifies the device (see XL_MOST150_DEVICE_LINE_IN, ...)
4135 * \param volume [IN] specifies the volume
4136 * \return XLstatus general status information
4137 */
4138DECL_STDXL_FUNC( xlMost150SyncSetVolume, XLFP_MOST150SYNCSETVOLUME, (DEFPARAMS, unsigned int device, unsigned int volume));
4139
4140/** \brief Requests the volume of Line In/Out audio device.
4141 * \n
4142 * ResponseEvent: XL_MOST150_SYNC_VOLUME_STATUS
4143 * \param device [IN] specifies the device (see XL_MOST150_DEVICE_LINE_IN, ...)
4144 * \return XLstatus general status information
4145 */
4146DECL_STDXL_FUNC( xlMost150SyncGetVolume, XLFP_MOST150SYNCGETVOLUME, (DEFPARAMS, unsigned int device));
4147
4148/** \brief Set mute state of Line In/Out or S/PDIF In/Out audio device.
4149 * ResponseEvent: XL_MOST150_SYNC_MUTE_STATUS
4150 * \param device [IN] specifies the device (see XL_MOST150_DEVICE_...)
4151 * \param mute [IN] specifies the mute status (on / off)
4152 * \return XLstatus general status information
4153 */
4154DECL_STDXL_FUNC( xlMost150SyncSetMute, XLFP_MOST150SYNCSETMUTE, (DEFPARAMS, unsigned int device, unsigned int mute));
4155
4156/** \brief Requests mute state of Line In/Out or S/PDIF In/Out audio device.
4157 * ResponseEvent: XL_MOST150_SYNC_MUTE_STATUS
4158 * \param device [IN] specifies the device (see XL_MOST150_DEVICE_LINE_IN, ...)
4159 * \return XLstatus general status information
4160 */
4161DECL_STDXL_FUNC( xlMost150SyncGetMute, XLFP_MOST150SYNCGETMUTE, (DEFPARAMS, unsigned int device));
4162
4163/** \brief Requests the FOR and lock status either from the spy or from INIC.
4164 * ResponseEvent: XL_MOST150_RXLIGHT_LOCKSTATUS
4165 * \param fromSpy [IN] defines the source, to get the light & lock status from
4166 * \return XLstatus general status information
4167 */
4168DECL_STDXL_FUNC( xlMost150GetRxLightLockStatus, XLFP_MOST150GETLIGHTLOCKSTATUS, (DEFPARAMS, unsigned int fromSpy));
4169
4170/** \brief Set the FOT output mode.
4171 * \n
4172 * ResponseEvent: XL_MOST150_TX_LIGHT
4173 * \param txLight [IN] mode of the output (modulated (on) or off)
4174 * \return XLstatus general status information
4175 */
4176DECL_STDXL_FUNC( xlMost150SetTxLight, XLFP_MOST150SETTXLIGHT, (DEFPARAMS, unsigned int txLight));
4177
4178/** \brief Requests the FOT output mode.
4179 * ResponseEvent: XL_MOST150_TX_LIGHT
4180 * \return XLstatus general status information
4181 */
4182DECL_STDXL_FUNC( xlMost150GetTxLight, XLFP_MOST150GETTXLIGHT, (DEFPARAMS));
4183
4184/** \brief Set the FOT output power.
4185 * \n
4186 * ResponseEvent: XL_MOST150_LIGHT_POWER
4187 * \param attenuation [IN] tx light power (no attenuation / -3dB attenuation)
4188 * \return XLstatus general status information
4189 */
4190DECL_STDXL_FUNC( xlMost150SetTxLightPower, XLFP_MOST150SETTXLIGHTPOWER, (DEFPARAMS, unsigned int attenuation));
4191
4192/** \brief Controls the light error generation.
4193 * \n
4194 * ResponseEvent: XL_MOST150_GEN_LIGHT_ERROR
4195 * \param lightOffTime [IN] duration of light off in [ms]
4196 * \param lightOnTime [IN] duration of light on in [ms]
4197 * \param repeat [IN] number of error intervals
4198 * \return XLstatus general status information
4199 */
4200DECL_STDXL_FUNC( xlMost150GenerateLightError, XLFP_MOST150GENLIGHTERROR, (DEFPARAMS, unsigned int lightOffTime, unsigned int lightOnTime, unsigned int repeat));
4201
4202/** \brief Control the lock error generation.
4203 * \n
4204 * ResponseEvent: XL_MOST150_GEN_LOCK_ERROR
4205 * \param unlockTime [IN] duration of unlock in [ms]
4206 * \param lockTime [IN] duration of lock in [ms]
4207 * \param repeat [IN] number of error intervals
4208 * \return XLstatus general status information
4209 */
4210DECL_STDXL_FUNC( xlMost150GenerateLockError, XLFP_MOST150GENLOCKERROR, (DEFPARAMS, unsigned int unlockTime, unsigned int lockTime, unsigned int repeat));
4211
4212/** \brief Configures the receive buffer for control messages and packets of the INIC.
4213 * \n
4214 * ResponseEvent: XL_MOST150_CONFIGURE_RX_BUFFER
4215 * \param bufferType [IN] Bitmask for receive buffer type (control messages and/or packets (MDP/MEP)).
4216 * \param bufferMode [IN] Block or un-block receive buffer
4217 * \return XLstatus general status information
4218 */
4219DECL_STDXL_FUNC( xlMost150ConfigureRxBuffer, XLFP_MOST150CONFIGURERXBUFFER, (DEFPARAMS, unsigned int bufferType, unsigned int bufferMode));
4220
4221/** \brief Defines the control message which should be transmitted with xlMost150CtrlGenerateBusload().
4222 * ResponseEvent:
4223 * \param pCtrlBusLoad [IN] pointer to structure that contains the control message
4224 * \return XLstatus general status information
4225 */
4226DECL_STDXL_FUNC( xlMost150CtrlConfigureBusload, XLFP_MOST150CTRLCONFIGLOAD, (DEFPARAMS, XLmost150CtrlBusloadConfig *pCtrlBusLoad));
4227
4228/** \brief Starts or stops the control message busload by sending the control message defined with xlMost150CtrlConfigureBusload().
4229 * ResponseEvent: XL_MOST150_CTRL_BUSLOAD
4230 * \param numberCtrlFrames [IN] number of control messages to be sent
4231 * 0: stop sending
4232 * < 0xFFFFFFFF: number of messages to be sent
4233 * 0xFFFFFFFF: send continuously
4234 * \return XLstatus general status information
4235 */
4236DECL_STDXL_FUNC( xlMost150CtrlGenerateBusload, XLFP_MOST150CTRLGENLOAD, (DEFPARAMS, unsigned long numberCtrlFrames));
4237
4238/** \brief Define the data or ethernet packet that should be transmitted with xlMost150AsyncGenerateBusload().
4239 * ResponseEvent:
4240 * \param pAsyncBusLoad [IN] pointer to structure that contains either the data or the ethernet packet
4241 * \return XLstatus general status information
4242 */
4243DECL_STDXL_FUNC( xlMost150AsyncConfigureBusload, XLFP_MOST150ASYNCCONFIGLOAD, (DEFPARAMS, XLmost150AsyncBusloadConfig *pAsyncBusLoad));
4244
4245/** \brief Starts or stops the packet busload by sending either the data or ethernet packet defined with xlMost150AsyncConfigureBusload().
4246 * ResponseEvent: XL_MOST150_ASYNC_BUSLOAD
4247 * \param numberAsyncPackets [IN] number of data or ethernet packets to be sent
4248 * 0: stop sending
4249 * < 0xFFFFFFFF: number of packets to be sent
4250 * 0xFFFFFFFF: send continuously
4251 * \return XLstatus general status information
4252 */
4253DECL_STDXL_FUNC( xlMost150AsyncGenerateBusload, XLFP_MOST150ASYNCGENLOAD, (DEFPARAMS, unsigned long numberAsyncPackets));
4254
4255
4256/** \brief Set the ECL state.
4257 * ResponseEvent: XL_MOST150_ECL_LINE_CHANGED
4258 * \param eclLineState [IN] ecl state to be set: XL_MOST150_ECL_LINE_LOW, XL_MOST150_ECL_LINE_HIGH
4259 * \return XLstatus general status information
4260 */
4261DECL_STDXL_FUNC( xlMost150SetECLLine, XLFP_MOST150SETECLLINE, (DEFPARAMS, unsigned int eclLineState));
4262
4263
4264/** \brief Set the ECL termination resistor state.
4265 * ResponseEvent: XL_MOST150_ECL_TERMINATION_CHANGED
4266 * \param eclLineTermination [IN] ecl line termination resistor state to be set:
4267 * XL_MOST150_ECL_LINE_PULL_UP_NOT_ACTIVE, XL_MOST150_ECL_LINE_PULL_UP_ACTIVE
4268 * \return XLstatus general status information
4269 */
4270DECL_STDXL_FUNC( xlMost150SetECLTermination, XLFP_MOST150SETECLTERMINATION, (DEFPARAMS, unsigned int eclLineTermination));
4271
4272/** \brief Requests the current ECL state and settings.
4273 * This method is asynchronous and requests the event used to get the ECL line state, termination and glitch filter setting.
4274 * ResponseEvent: XL_MOST150_ECL_LINE_CHANGED, XL_MOST150_ECL_TERMINATION_CHANGED, XL_MOST150_ECL_GLITCH_FILTER
4275 * \return XLstatus general status information
4276 */
4277DECL_STDXL_FUNC( xlMost150GetECLInfo, XLFP_MOST150GETECLINFO, (DEFPARAMS));
4278
4279/** \brief Opens a stream (Rx / Tx) for routing synchronous data to or from the MOST bus (synchronous channel).
4280 * ResponseEvent: XL_MOST150_STREAM_STATE
4281 * \param portHandle [IN] handle to port from which the information is requested
4282 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4283 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4284 * if an event is received spontaneously
4285 * \param pStreamOpen [IN] structure containg the stream parameters -
4286 * it's storage has has to be supplied by the caller
4287 * \return XLstatus general status information
4288 */
4289DECL_STDXL_FUNC (xlMost150StreamOpen, XLFP_MOST150STREAMOPEN, (DEFPARAMS, XLmost150StreamOpen* pStreamOpen));
4290
4291
4292/** \brief Closes an opened a stream (Rx / Tx) used for routing synchronous data to or from the MOST bus (synchronous channel).
4293 * ResponseEvent: XL_MOST150_STREAM_STATE
4294 * \param portHandle [IN] handle to port from which the information is requested
4295 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4296 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4297 * if an event is received spontaneously
4298 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
4299 * \return XLstatus general status information
4300 */
4301DECL_STDXL_FUNC (xlMost150StreamClose, XLFP_MOST150STREAMCLOSE, (DEFPARAMS, unsigned int streamHandle));
4302
4303
4304/** \brief Starts the streaming (Rx / Tx) of synchronous data to or from the MOST bus (synchronous channel).
4305 * Attention: Has to be called after XL_MOST150_STREAM_STATE "Opened" was received.
4306 * ResponseEvent: XL_MOST150_STREAM_STATE
4307 * \param portHandle [IN] handle to port from which the information is requested
4308 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4309 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4310 * if an event is received spontaneously
4311 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
4312 * \param numConnLabels [IN] Number of connection labels to stream (only used for Rx streaming, max. 8 labels can be streamed!)
4313 * \param pConnLabels [IN] connection label(s) (only used for Rx streaming)
4314 * \return XLstatus general status information
4315 */
4316DECL_STDXL_FUNC (xlMost150StreamStart, XLFP_MOST150STREAMSTART, (DEFPARAMS, unsigned int streamHandle,
4317 unsigned int numConnLabels,
4318 unsigned int* pConnLabels));
4319
4320
4321/** \brief Stops the streaming (Rx / Tx) of synchronous data to or from the MOST bus (synchronous channel).
4322 * Attention: Has to be called after XL_MOST150_STREAM_STATE "Started" was received.
4323 * ResponseEvent: XL_MOST150_STREAM_STATE
4324 * \param portHandle [IN] handle to port from which the information is requested
4325 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4326 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4327 * if an event is received spontaneously
4328 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
4329 * \return XLstatus general status information
4330 */
4331DECL_STDXL_FUNC (xlMost150StreamStop, XLFP_MOST150STREAMSTOP, (DEFPARAMS, unsigned int streamHandle));
4332
4333/** \brief Provides further streaming data to be sent to the MOST bus (synchronous channel).
4334 * ResponseEvent: XL_MOST150_STREAM_TX_BUFFER as soon as further data is required.
4335 * \param portHandle [IN] handle to port from which the information is requested
4336 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4337 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4338 * if an event is received spontaneously
4339 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen
4340 * \param pBuffer [IN] pointer to the buffer used for streaming
4341 * \param pNumberOfBytes [IN]/[OUT] number of bytes contained in the buffer to be used for streaming.
4342 * In case of not all bytes could be stored, this parameters contains the adjusted
4343 * number of bytes stored and the function returs an error (XL_ERR_QUEUE_IS_FULL).
4344 * \return XLstatus general status information
4345 */
4346DECL_STDXL_FUNC (xlMost150StreamTransmitData, XLFP_MOST150STREAMTRANSMITDATA, (DEFPARAMS, unsigned int streamHandle, unsigned char* pBuffer, unsigned int* pNumberOfBytes));
4347
4348/** \brief Clears the content of the driver's Tx FIFO.
4349 * This method is used to clear the content of the driver's TX streaming FIFO which has not been sent yet.\n
4350 * ResponseEvent: None
4351 * \param portHandle [IN] handle to port from which the information is requested
4352 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4353 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4354 * if an event is received spontaneously
4355 * \param streamHandle [IN] stream handle returned by xlMostStreamOpen.
4356 * \return XLstatus general status information
4357 */
4358DECL_STDXL_FUNC (xlMost150StreamClearTxFifo, XLFP_MOST150STREAMCLEARTXFIFO, (DEFPARAMS, unsigned int streamHandle));
4359
4360/** \brief Retrieves the stream information.
4361 * This method is used to gather the recent stream state information.\n
4362 * ResponseEvent: None
4363 * \param portHandle [IN] handle to port from which the information is requested
4364 * \param accessMask [IN] mask specifying the port's channel from where to get the device's state
4365 * \param userHandle [IN] used to match the response of the driver to the requests of the application
4366 * if an event is received spontaneously
4367 * \param pStreamInfo [OUT] Pointer to the stream information.
4368 * \return XLstatus general status information
4369 */
4370DECL_STDXL_FUNC (xlMost150StreamGetInfo, XLFP_MOST150STREAMGETINFO, (DEFPARAMS, XLmost150StreamInfo* pStreamInfo));
4371
4372/** \brief Initializes the Rx Streaming FIFO.
4373 * This method is used to initialize the FIFO for storing the received streaming data.\n
4374 * ResponseEvent: None
4375 * \param portHandle [IN] handle to port from which the information is requested
4376 * \param accessMask [IN] mask specifying the port's channel
4377 * \return XLstatus general status information
4378 */
4379DECL_STDXL_FUNC (xlMost150StreamInitRxFifo, XLFP_MOST150STREAMINITRXFIFO, (XLportHandle portHandle, XLaccess accessMask));
4380
4381/** \brief Fetches streaming data from the driver queue.
4382 * This method is used to fetch received streaming data. The application is triggered by
4383 * a XL_MOST150_STREAM_RX_BUFFER event to call this method.
4384 * It is a synchronous mode and either delivers streaming data immediately, or
4385 * indicates an error condition with its return value.
4386 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
4387 * \param XLaccess accessMask: [IN] determines on which channel an API should work
4388 * \param pBuffer [IN] Pointer to a buffer to which the driver can copy
4389 * the streaming data of the receive queue
4390 * \param pBufferSize [IN] Determines the maximum buffer size
4391 * [OUT] The number of actually copied data bytes
4392 * \return XLstatus general status information
4393 */
4394DECL_STDXL_FUNC (xlMost150StreamReceiveData, XLFP_MOST150STREAMRECEIVEDATA, (XLportHandle portHandle, XLaccess accessMask,
4395 unsigned char* pBuffer, unsigned int* pBufferSize));
4396
4397/** \brief Controls the bypass stress generation.
4398 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
4399 * \param XLaccess accessMask: [IN] determines on which channel an API should work
4400 * \param XLuserHandle userHandle: [IN] used to match the response of the driver to the requests of the application
4401 * if an event is received spontaneously
4402 * \param bypassCloseTime [IN] duration of bypass close time in [ms] (minimum value: 10 ms)
4403 * \param bypassOpenTime [IN] duration of bypass open time in [ms] (minimum value: 10 ms)
4404 * \param repeat [IN] number of error intervals
4405 * \return XLstatus general status information
4406 */
4407DECL_STDXL_FUNC (xlMost150GenerateBypassStress, XLFP_MOST150GENERATEBYPASSSTRESS, (DEFPARAMS, unsigned int bypassCloseTime,
4408 unsigned int bypassOpenTime, unsigned int repeat));
4409
4410/** \brief Configures a sequence for the ECL.
4411 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
4412 * \param XLaccess accessMask: [IN] determines on which channel an API should work
4413 * \param XLuserHandle userHandle: [IN] used to match the response of the driver to the requests of the application
4414 * if an event is received spontaneously
4415 * \param numStates [IN] Number of states during the sequence (max. XL_MOST150_ECL_SEQ_NUM_STATES_MAX)
4416 * \param pEclStates [IN] Pointer to a buffer containing the ECL sequence states (1: High, 0: Low)
4417 * \param pEclStatesDuration [IN] Pointer to a buffer containing the ECL sequence states duration in multiple of 100 µs (max. value XL_MOST150_ECL_SEQ_DURATION_MAX)
4418 * NOTE: Both buffers have to have at least the size <numStates> DWORDS!
4419 * \return XLstatus general status information
4420 */
4421DECL_STDXL_FUNC (xlMost150EclConfigureSeq, XLFP_MOST150ECLCONFIGURESEQ, (DEFPARAMS, unsigned int numStates,
4422 unsigned int* pEclStates,
4423 unsigned int* pEclStatesDuration));
4424
4425/** \brief Starts or stops the previously configured ECL sequence.
4426 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
4427 * \param XLaccess accessMask: [IN] determines on which channel an API should work
4428 * \param XLuserHandle userHandle: [IN] used to match the response of the driver to the requests of the application
4429 * if an event is received spontaneously
4430 * \param start [IN] Starts (1) or stops (0) the configured ECL sequence
4431 * \return XLstatus general status information
4432 */
4433DECL_STDXL_FUNC (xlMost150EclGenerateSeq, XLFP_MOST150ECLGENERATESEQ, (DEFPARAMS, unsigned int start));
4434
4435/** \brief Configures the glitch filter for detecting ECL state changes.
4436 * \param XLportHandle portHandle: [IN] was previously fetched by xlOpenPort API
4437 * \param XLaccess accessMask: [IN] determines on which channel an API should work
4438 * \param XLuserHandle userHandle: [IN] used to match the response of the driver to the requests of the application
4439 * if an event is received spontaneously
4440 * \param duration [IN] Duration (in µs) of glitches to be filtered. Value range: 50 µs .. 50 ms (Default: 1 ms)
4441 * \return XLstatus general status information
4442 */
4443DECL_STDXL_FUNC (xlMost150SetECLGlitchFilter, XLFP_MOST150SETECLGLITCHFILTER, (DEFPARAMS, unsigned int duration));
4444
4445
4446
4447#if (__BORLANDC__ >= 0x0560)
4448#pragma pack(pop)
4449#else
4450#include <poppack.h>
4451#endif
4452
4453#ifdef __cplusplus
4454}
4455#endif // _cplusplus
4456
4457#endif // _V_XLAPI_H_
4458
4459
4460
4461
Note: See TracBrowser for help on using the repository browser.