📄 ht1302ce.h
字号:
// HT1302CE.h : main header file for the HT1302CE DLL
//
#if !defined(AFX_HT1302CE_H__2384BFFE_7C19_456F_95A8_4B884C5C6F32__INCLUDED_)
#define AFX_HT1302CE_H__2384BFFE_7C19_456F_95A8_4B884C5C6F32__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CHT1302CEApp
// See HT1302CE.cpp for the implementation of this class
//
class CHT1302CEApp : public CWinApp
{
public:
CHT1302CEApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHT1302CEApp)
//}}AFX_VIRTUAL
//{{AFX_MSG(CHT1302CEApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
typedef struct _CAN_A_STRUCT {
UCHAR control;
UCHAR acc_code;
UCHAR acc_mask;
UCHAR bus_time0;
UCHAR bus_time1;
UCHAR outp_ctrl;
} CAN_A_STRUCT;
typedef struct _CAN_B_STRUCT {
UCHAR command;
UCHAR interrupt;
UCHAR bus_time0;
UCHAR bus_time1;
UCHAR outp_ctrl;
UCHAR err_limit;
UCHAR acc_code[4];
UCHAR acc_mask[4];
} CAN_B_STRUCT;
typedef struct _CAN_A_MSG {
UCHAR id;
UCHAR length; /* length = bytes of send data length */
UCHAR rtr; /* rtr =0 : data frame ; rtr =1 : remote frame */
UCHAR data[8];
} CAN_A_MSG;
typedef struct _CAN_B_MSG {
UCHAR frm_info; /* frm_info=0 : SFF frame style ; frm_info=1 : EFF frame style */
UCHAR length; /* the bytes of send frame data length */
UCHAR rtr; /* rtr =0 : data frame ; rtr =1 : remote frame */
UCHAR id[4];
UCHAR data[8];
} CAN_B_MSG;
__declspec(dllexport) UCHAR ReadChar(HANDLE hstr,USHORT offset);
__declspec(dllexport) USHORT ReadWord(HANDLE hstr,USHORT offset);
__declspec(dllexport) bool WriteWord(HANDLE hstr,USHORT offset,USHORT data);
__declspec(dllexport) bool WriteChar(HANDLE hstr,USHORT offset,UCHAR data);
__declspec(dllexport) bool CANInitA(HANDLE hndFile, UCHAR port ,CAN_A_STRUCT *pcan);
__declspec(dllexport) bool CANInitB(HANDLE hndFile, UCHAR port ,CAN_B_STRUCT *pcan);
__declspec(dllexport) bool CANSendA(HANDLE hndFile, UCHAR port ,CAN_A_MSG *pcan_msg);
__declspec(dllexport) bool CANSendB(HANDLE hndFile, UCHAR port ,CAN_B_MSG *pcan_msg);
__declspec(dllexport) bool CANReceiveA(HANDLE hndFile, UCHAR port ,CAN_A_MSG *pcan_msg);
__declspec(dllexport) bool CANReceiveB(HANDLE hndFile, UCHAR port ,CAN_B_MSG *pcan_msg);
__declspec(dllexport) HANDLE GetHandle(int DevName );
__declspec(dllexport) bool CloseHnd(HANDLE hndFile);
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_HT1302CE_H__2384BFFE_7C19_456F_95A8_4B884C5C6F32__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -