USB2XXX 1.2
USB2XXX接口函数说明文档
载入中...
搜索中...
未找到
usb2bmm_lin.h
1
9#ifndef __USB2BMM_LIN_H_
10#define __USB2BMM_LIN_H_
11
12#include <stdint.h>
13#ifdef _WIN32
14#include <Windows.h>
15#else
16#include <unistd.h>
17#ifndef WINAPI
18#define WINAPI
19#endif
20#endif
32#define BMM_LIN_SUCCESS (0)
33#define BMM_LIN_ERR_NOT_SUPPORT (-1)
34#define BMM_LIN_ERR_USB_WRITE_FAIL (-2)
35#define BMM_LIN_ERR_USB_READ_FAIL (-3)
36#define BMM_LIN_ERR_CMD_FAIL (-4)
37#define BMM_LIN_ERR_CH_NO_INIT (-5)
38#define BMM_LIN_ERR_READ_DATA (-6)
39#define BMM_LIN_ERR_PARAMETER (-7)
40#define BMM_LIN_ERR_WRITE (-8)
41#define BMM_LIN_ERR_READ (-9)
42#define BMM_LIN_ERR_RESP (-10)
43#define BMM_LIN_ERR_CHECK (-11)
46#ifdef __cplusplus
47extern "C"
48{
49#endif
59int WINAPI BMM_LIN_Init(int DevHandle,unsigned char LINIndex,int BaudRate);
60
72int WINAPI BMM_LIN_SetPara(int DevHandle, unsigned char LINIndex, unsigned char BreakBits, int InterByteSpaceUs, int BreakSpaceUs);
73
84int WINAPI BMM_LIN_WriteData(int DevHandle,unsigned char LINIndex,unsigned char *pData,unsigned int Len);
85
96int WINAPI BMM_LIN_ReadData(int DevHandle,unsigned char LINIndex,unsigned char *pData);
97
108int WINAPI BMM_LIN_WaitDataNum(int DevHandle,unsigned char LINIndex,unsigned int DataNum,int TimeOutMs);
109
110#ifdef __cplusplus
111}
112#endif
113
115#endif
116
int WINAPI BMM_LIN_ReadData(int DevHandle, unsigned char LINIndex, unsigned char *pData)
读取LIN总线上收到的数据,调用 BMM_LIN_WriteData 函数后,调用此函数会返回成功发送到总线上的数据
int WINAPI BMM_LIN_SetPara(int DevHandle, unsigned char LINIndex, unsigned char BreakBits, int InterByteSpaceUs, int BreakSpaceUs)
设置自定义LIN发送数据时序相关参数
int WINAPI BMM_LIN_Init(int DevHandle, unsigned char LINIndex, int BaudRate)
自定义LIN协议初始化,使用该功能必须调用此函数
int WINAPI BMM_LIN_WaitDataNum(int DevHandle, unsigned char LINIndex, unsigned int DataNum, int TimeOutMs)
等待LIN总线接收到指定字节数,若在超时时间内收到了指定字节数数据则直接返回,否则会等待超时时间到
int WINAPI BMM_LIN_WriteData(int DevHandle, unsigned char LINIndex, unsigned char *pData, unsigned int Len)
发送自定义LIN数据