Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion can/interfaces/vector/xlclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class s_xl_chip_state(ctypes.Structure):
]


class s_xl_sync_pulse(ctypes.Structure):
_fields_ = [
("pulseCode", ctypes.c_ubyte),
("time", XLuint64),
]


class s_xl_can_ev_chip_state(ctypes.Structure):
_fields_ = [
("busStatus", ctypes.c_ubyte),
Expand All @@ -65,7 +72,11 @@ class s_xl_can_ev_sync_pulse(ctypes.Structure):

# BASIC bus message structure
class s_xl_tag_data(ctypes.Union):
_fields_ = [("msg", s_xl_can_msg), ("chipState", s_xl_chip_state)]
_fields_ = [
("msg", s_xl_can_msg),
("chipState", s_xl_chip_state),
("syncPulse", s_xl_sync_pulse),
]


# CAN FD messages
Expand Down
8 changes: 7 additions & 1 deletion can/interfaces/vector/xldefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class XL_BusTypes(IntFlag):
XL_BUS_TYPE_A429 = 8192 # =0x00002000


class XL_CANFD_BusParams_CanOpMode(IntEnum):
class XL_CANFD_BusParams_CanOpMode(IntFlag):
XL_BUS_PARAMS_CANOPMODE_CAN20 = 1
XL_BUS_PARAMS_CANOPMODE_CANFD = 2
XL_BUS_PARAMS_CANOPMODE_CANFD_NO_ISO = 8
Expand Down Expand Up @@ -318,3 +318,9 @@ class XL_HardwareType(IntEnum):
XL_HWTYPE_VX1161A = 114
XL_HWTYPE_VX1161B = 115
XL_MAX_HWTYPE = 120


class XL_SyncPulseSource(IntEnum):
XL_SYNC_PULSE_EXTERNAL = 0
XL_SYNC_PULSE_OUR = 1
XL_SYNC_PULSE_OUR_SHARED = 2
15 changes: 15 additions & 0 deletions can/interfaces/vector/xldriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,18 @@ def check_status_initialization(result, function, arguments):
xlCanGetEventString = _xlapi_dll.xlCanGetEventString
xlCanGetEventString.argtypes = [ctypes.POINTER(xlclass.XLcanRxEvent)]
xlCanGetEventString.restype = xlclass.XLstringType

xlGetReceiveQueueLevel = _xlapi_dll.xlGetReceiveQueueLevel
xlGetReceiveQueueLevel.argtypes = [xlclass.XLportHandle, ctypes.POINTER(ctypes.c_int)]
xlGetReceiveQueueLevel.restype = xlclass.XLstatus
xlGetReceiveQueueLevel.errcheck = check_status_operation

xlGenerateSyncPulse = _xlapi_dll.xlGenerateSyncPulse
xlGenerateSyncPulse.argtypes = [xlclass.XLportHandle, xlclass.XLaccess]
xlGenerateSyncPulse.restype = xlclass.XLstatus
xlGenerateSyncPulse.errcheck = check_status_operation

xlFlushReceiveQueue = _xlapi_dll.xlFlushReceiveQueue
xlFlushReceiveQueue.argtypes = [xlclass.XLportHandle]
xlFlushReceiveQueue.restype = xlclass.XLstatus
xlFlushReceiveQueue.errcheck = check_status_operation