1 Star 6 Fork 1

Gyroxp/USB_CAN_Example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ControlCAN.py 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
Gyroxp 提交于 2017-06-12 10:48 . 20170612 commit
# -*- coding: utf-8 -*-
from ctypes import *
class VCI_BOARD_INFO(Structure):
_fields_ = [
("hw_Version", c_ushort),
("fw_Version", c_ushort),
("dr_Version", c_ushort),
("in_Version", c_ushort),
("irq_Num", c_ushort),
("can_Num", c_byte),
("str_Serial_Num", c_char * 20),
("str_hw_Type", c_char * 40),
("Reserved", c_ushort * 4)
]
class VCI_CAN_OBJ(Structure):
_fields_ = [
("ID", c_uint),
("TimeStamp", c_uint),
("TimeFlag", c_ubyte),
("SendType", c_ubyte),
("RemoteFlag", c_ubyte),
("ExternFlag", c_ubyte),
("DataLen", c_ubyte),
("Data", c_ubyte * 8),
("Reserved", c_ubyte * 3)
]
class VCI_CAN_STATUS(Structure):
_fields_ = [
("ErrInterrupt", c_char),
("regMode", c_char),
("regStatus", c_char),
("regALCapture", c_char),
("regECCapture", c_char),
("regEWLimit", c_char),
("regRECounter", c_char),
("regTECounter", c_char),
("Reserved", c_int)
]
class VCI_ERR_INFO(Structure):
_fields_ = [
("ErrCode", c_uint),
("Passive_ErrData", c_byte * 3),
("ArLost_ErrData", c_byte)
]
class VCI_INIT_CONFIG(Structure):
_fields_ = [
("AccCode", c_int),
("AccMask", c_int),
("Reserved", c_int),
("Filter", c_ubyte),
("Timing0", c_ubyte),
("Timing1", c_ubyte),
("Mode", c_ubyte)
]
class VCI_FILTER_RECORD(Structure):
_fields_ = [
("ExtFrame", c_int),
("Start", c_int),
("End", c_int)
]
#其他
class VCI_BOARD_INFO1(Structure):
_fields_ = [
("hw_Version", c_ushort),
("fw_Version", c_ushort),
("dr_Version", c_ushort),
("in_Version", c_ushort),
("irq_Num", c_ushort),
("can_Num", c_byte),
("Reserved", c_byte),
("str_Serial_Num", c_char * 8),
("str_hw_Type", c_char * 16),
("str_Usb_Serial", c_char * 16)
]
class VCI_BOARD_INFO2(Structure):
_fields_ = [
("hw_Version", c_ushort),
("fw_Version", c_ushort),
("dr_Version", c_ushort),
("in_Version", c_ushort),
("irq_Num", c_ushort),
("can_Num", c_byte),
("Reserved", c_byte),
("str_Serial_Num", c_char * 8),
("str_hw_Type", c_char * 16),
("str_Usb_Serial", c_char * 40)
]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Gyroxp/usb_can_example.git
git@gitee.com:Gyroxp/usb_can_example.git
Gyroxp
usb_can_example
USB_CAN_Example
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385