⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comdef.h

📁 DVD
💻 H
字号:
// **********************************************************************
//  This file is a part of MaBreakers
//  MTK RS232 Communication package
// **********************************************************************
//
//  Copyright (C) 2006 MaBreaker
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
//  02110-1301, USA.
//
// **********************************************************************
#ifndef ComDefH
#define ComDefH
// **********************************************************************

//---------------------------------------------------------------------------
// COM Settings
//---------------------------------------------------------------------------

#define COM_DELAY            1
#define COM_RETRY            3

#define COM_PORT             "COM1"
#define COM_BAUD             115200
#define COM_PARITY           NOPARITY // 'N'
#define COM_DATA             8
#define COM_STOP             ONESTOPBIT // 1

#define XON_LIMIT            512
#define XOFF_LIMIT           512
#define WRITE_BUFFER         2048
#define READ_BUFFER          2048
#define READ_INTERVAL        1
#define READ_CONSTANT        COM_DELAY
#define READ_MULTIPLIER      1
#define WRITE_CONSTANT       COM_DELAY
#define WRITE_MULTIPLIER     1

//---------------------------------------------------------------------------
// MEDIATEK RS-232 Commands
//---------------------------------------------------------------------------


#define COM_NUL              0x00
#define COM_SOH              0x01
#define COM_STX              0x02
#define COM_ETX              0x03
#define COM_EOT              0x04
#define COM_ENQ              0x05
#define COM_ACK              0x06
#define COM_BEL              0x07
#define COM_BS               0x08
#define COM_HT               0x09
#define COM_NL               0x0A
#define COM_VT               0x0B
#define COM_NP               0x0C
#define COM_CR               0x0D
#define COM_SO               0x0E
#define COM_SI               0x0F
#define COM_DLE              0x10
#define COM_XON              0x11
#define COM_DC2              0x12
#define COM_XOFF             0x13
#define COM_DC4              0x14
#define COM_NAK              0x15
#define COM_SYN              0x16
#define COM_ETB              0x17
#define COM_CAN              0x18
#define COM_EM               0x19
#define COM_SUB              0x1A
#define COM_ESC              0x1B
#define COM_FS               0x1C
#define COM_GS               0x1D
#define COM_RS               0x1E
#define COM_US               0x1F

//---------------------------------------------------------------------------
// COM return ID
//---------------------------------------------------------------------------

#define COM_ID_SUCCESS          0

#define COM_ID_OPEN_ALRDY       1
#define COM_ID_CLOSE_ALRDY      2
#define COM_ID_START_ALRDY      3
#define COM_ID_STOP_ALRDY       4
#define COM_ID_ZERO_LENGTH      5

#define COM_ID_ERROR            -1
#define COM_ID_OPEN_ERROR       -2
#define COM_ID_CLOSE_ERROR      -3
#define COM_ID_READ_ERROR       -4
#define COM_ID_WRITE_ERROR      -5
#define COM_ID_PURGE_ERROR      -6
#define COM_ID_SETUP_ERROR      -7
#define COM_ID_GETSTATE_ERROR   -8
#define COM_ID_SETSTATE_ERROR   -9
#define COM_ID_GETTIMEOUT_ERROR -10
#define COM_ID_SETTIMEOUT_ERROR -11

//---------------------------------------------------------------------------
// MEDIATEK RS-232 MTK Incoming data
//---------------------------------------------------------------------------
// Should be moved to Mediatek file
#define COM_BYTES            0xA0
#define COM_CHARS            0xB0

//---------------------------------------------------------------------------
// MEDIATEK RS-232 Buffers
//---------------------------------------------------------------------------

#define MTK_SEND_BUFFER      13
#define MTK_READ_BUFFER      30

// **********************************************************************
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -