@@ -169,10 +169,58 @@ class XLcanFdConf(ctypes.Structure):
169
169
("sjwDbr" , ctypes .c_uint ),
170
170
("tseg1Dbr" , ctypes .c_uint ),
171
171
("tseg2Dbr" , ctypes .c_uint ),
172
- ("reserved" , ctypes .c_uint * 2 ),
172
+ ("reserved" , ctypes .c_ubyte ),
173
+ ("options" , ctypes .c_ubyte ),
174
+ ("reserved1" , ctypes .c_ubyte * 2 ),
175
+ ("reserved2" , ctypes .c_ubyte ),
176
+ ]
177
+
178
+
179
+ # channel configuration structures
180
+ class s_xl_bus_params_data_can (ctypes .Structure ):
181
+ _fields_ = [
182
+ ("bitRate" , ctypes .c_uint ),
183
+ ("sjw" , ctypes .c_ubyte ),
184
+ ("tseg1" , ctypes .c_ubyte ),
185
+ ("tseg2" , ctypes .c_ubyte ),
186
+ ("sam" , ctypes .c_ubyte ),
187
+ ("outputMode" , ctypes .c_ubyte ),
188
+ ("reserved" , ctypes .c_ubyte * 7 ),
189
+ ("canOpMode" , ctypes .c_ubyte ),
190
+ ]
191
+
192
+
193
+ class s_xl_bus_params_data_canfd (ctypes .Structure ):
194
+ _fields_ = [
195
+ ("arbitrationBitRate" , ctypes .c_uint ),
196
+ ("sjwAbr" , ctypes .c_ubyte ),
197
+ ("tseg1Abr" , ctypes .c_ubyte ),
198
+ ("tseg2Abr" , ctypes .c_ubyte ),
199
+ ("samAbr" , ctypes .c_ubyte ),
200
+ ("outputMode" , ctypes .c_ubyte ),
201
+ ("sjwDbr" , ctypes .c_ubyte ),
202
+ ("tseg1Dbr" , ctypes .c_ubyte ),
203
+ ("tseg2Dbr" , ctypes .c_ubyte ),
204
+ ("dataBitRate" , ctypes .c_uint ),
205
+ ("canOpMode" , ctypes .c_ubyte ),
173
206
]
174
207
175
208
209
+ class s_xl_bus_params_data (ctypes .Union ):
210
+ _fields_ = [
211
+ ("can" , s_xl_bus_params_data_can ),
212
+ ("canFD" , s_xl_bus_params_data_canfd ),
213
+ ("most" , ctypes .c_ubyte * 12 ),
214
+ ("flexray" , ctypes .c_ubyte * 12 ),
215
+ ("ethernet" , ctypes .c_ubyte * 12 ),
216
+ ("a429" , ctypes .c_ubyte * 28 ),
217
+ ]
218
+
219
+
220
+ class XLbusParams (ctypes .Structure ):
221
+ _fields_ = [("busType" , ctypes .c_uint ), ("data" , s_xl_bus_params_data )]
222
+
223
+
176
224
class XLchannelConfig (ctypes .Structure ):
177
225
_pack_ = 1
178
226
_fields_ = [
@@ -189,7 +237,7 @@ class XLchannelConfig(ctypes.Structure):
189
237
("channelBusCapabilities" , ctypes .c_uint ),
190
238
("isOnBus" , ctypes .c_ubyte ),
191
239
("connectedBusType" , ctypes .c_uint ),
192
- ("busParams" , ctypes . c_ubyte * 32 ),
240
+ ("busParams" , XLbusParams ),
193
241
("_doNotUse" , ctypes .c_uint ),
194
242
("driverVersion" , ctypes .c_uint ),
195
243
("interfaceVersion" , ctypes .c_uint ),
0 commit comments