dlcs.h

来自「在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LE」· C头文件 代码 · 共 103 行

H
103
字号
/****************************************************************
**                                                              *
**  FILE         :  DLCS.H                                      *
**  COPYRIGHT    :  (c) 2001 .Xiamen Yaxon NetWork CO.LTD       *
**                                                              *
**                                                              *
**  By : CCH 2002.11.26                                         *
****************************************************************/
#ifndef DEF_DLCS
#define DEF_DLCS

#include "tools.h"



/*
********************************************************************************
*                  DEFINE DEBUG CONFIG
********************************************************************************
*/
#if DEBUG_UARTNo_DLC <= 3
#define DEBUG_DLC_AT_SEND                   1
#define DEBUG_DLC_AT_RECV                   1
#define DEBUG_DLC_STATUS                    1
#define DEBUG_DLC_IO                        1

#else

#define DEBUG_DLC_AT_SEND                   0	 
#define DEBUG_DLC_AT_RECV                   0
#define DEBUG_DLC_STATUS                    0
#define DEBUG_DLC_IO                        0
#endif


/*
********************************************************************************
*                  DEFINE CONFIG PARAMETERS
********************************************************************************
*/
#define UART_GSMIO                          0
#if GSM_BENQ
#define DLC_ESCAPE_OCT                      0x7D
#define DLC_FLAG                            0x7E
#else
#define DLC_FLAG                            0xF9
#endif

#define DLC_BAUD                            "19200"

#define InitDLCIO()                         uarts_init(UART_GSMIO, AsciiToDec((INT8U *)DLC_BAUD, strlen(DLC_BAUD)))
#define ReadDLCIO()                         uarts_read(UART_GSMIO)
#define WriteDLCIO(ch)                      uarts_write(UART_GSMIO, ch)
#define LeftDLCIO()                         uarts_ready(UART_GSMIO)


/*
********************************************************************************
*                  DEFINE DLCS_STRUCT SIGNALS
********************************************************************************
*/
#define SIG_FCS_S                           0x01            /* data set flow control */
#define SIG_FCS_T                           0x02            /* data terminal flow control */
#define SIG_DTR                             0x04            /* signal DTR */
#define SIG_RTS                             0x08            /* signal RTS */
#define SIG_DSR                             0x10            /* signal DSR */
#define SIG_CTS                             0x20            /* signal CTS */
#define SIG_RI                              0x40            /* signal RI */
#define SIG_DCD                             0x80            /* signal DCD */



void    InitDLCS(void);
void    ResetDLCS(void);

void    HdlDLCRecv(void);
void    WriteDLCRecvRound(INT8U dlci, INT8U data);

INT8S   GetShieldedDLC(void);
BOOLEAN EstablishDLC(INT8U dlci, BOOLEAN shielded, void (*informer)(INT8U dlci, INT8U reason));
BOOLEAN ReleaseDLC(INT8U dlci, void (*informer)(INT8U dlci, INT8U reason));
BOOLEAN ControlDLCSignal(INT8U dlci, INT8U signal);
INT8U   GetDLCSignal(INT8U dlci);

BOOLEAN DLCIsOpen(INT8U dlci);
BOOLEAN DLCIsClose(INT8U dlci);
BOOLEAN SetDLCDataMode(INT8U dlci);
BOOLEAN ClearDLCDataMode(INT8U dlci);

/* functions for DATA mode */
BOOLEAN PushDatatoDLC(INT8U dlci, INT8U *data, INT16U len);
BOOLEAN WriteDatatoDLC(INT8U dlci, INT8U *data, INT16U len);
BOOLEAN WriteBytetoDLC(INT8U dlci, INT8U data);
BOOLEAN CanWriteDLC(INT8U dlci);
INT16S  ReadBytefromDLC(INT8U dlci);
void    DLCSEntry(void);
void MSCCtrDTROff(void);
void MSCCtrDTROn(void);
BOOLEAN GetDCD_VALID(INT8U dlci);


#endif

⌨️ 快捷键说明

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