平车主控板(运维板)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.5 KiB

//////////////////////////////////////////////////////////////////////////
/// COPYRIGHT NOTICE
/// Copyright (c) 2015, 传控科技
/// All rights reserved.
///
/// @file main.c
/// @brief main app
///
///(本文件实现的功能的详述)
///
/// @version 1.1 CCsens technology
/// @author CC
/// @date 20150102
///
///
/// 修订说明:最初版本
/// Modified by:
/// Modified date:
/// Version:
/// Descriptions:
//////////////////////////////////////////////////////////////////////////
/*****************************************************************************
update by cc @201700110
.
clib/clib.c:
(线),
(lcd等固屏输出的)使
void Lc_print(void (*L0pf_send_uc)(char ww), char *dat,...)
-----------------------------------------------------------------------------------------
uartcom/Uprotocol2app
uart口来对应
typedef struct _ts_lcm_pro_; ? LCM的协议------------
L3_UARTcom0_exp_protocol
-----------------------------------------------------------------------------------------
uartcom/urec2protocol:
struct _s_uart_rec_ ()------struct _s_uart_rec_
void L1_uart_2buf(struct _s_uart_rec_ *p)
--------------------------------------------------------------------------------------------
msp/uartx.c cpu相关
L0_UART0_Init
UART0_IRQHandler
L0_Usend_uc------UserDef
-----------------------------------------------------------------------------------------
********************************************************************************/
#ifndef _uart3_H
#define _uart3_H
#include "../bsp/bsp_config.h"
//#include "../bsp/type_hs.h"
//#include "../debug/debug_drv.h"
//#include "../uartcom/urec2protocol.h"
//?include "../uartcom/uprotocol2app.h"
#include "../tpc/tpc_uart.h"
#include "../ctask/task.h"
#include "../clib/Clib.h"
//extern struct _s_PH1_FX_ s_uart3_rec;
#define D_s_uart3_rec_close(); s_uart3_rec.ok = 2;// 关闭串口协议解析
#define D_s_uart3_rec_open(); s_uart3_rec.ok = 0;// 关闭串口协议解析
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#define D_send3_buf_max 64 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms
/// 19200bps = 20000bps = 2000Bps = 2Byte/ms = 1Byte/0.5ms
/// 128Bytes = 128*0.5ms = 64ms
struct _s_uart3_send_buf_
{//8byte
U8 num; //接收到的数目注意数据长度的范围
U8 *p;
U8 now; /// 当前buf所在的位置 0------(max-1)
U8 max; /// 当前buf的最大值,也就是需要发送的长度
U8 buf[D_send3_buf_max + 1];//buffer 的第一位是 长度
};
extern struct _s_uart3_send_buf_ s_uart3_send_shop;
extern struct _s_uart3_send_buf_ s_uart3_send_depot;
//#define S4SM0 BITN7
#define D_uart3_ES_INT_CLOSE() BITN_0(IE2,ES3)
#define D_uart3_ES_INT_OPEN() BITN_1(IE2,ES3)
#define L0_uart3_IntRI() (S3CON & S3RI)//BITN_G(SCON,U0RI)
#define L0_uart3_IntTI() (S3CON & S3TI)//BITN_G(SCON,U0TI)
#define L0_uart3_IntRIClear(); BITN_0(S3CON,S3RI)
#define L0_uart3_IntTIClear(); BITN_0(S3CON,S3TI)
#define L0_uart3_set(x) S3BUF = (x);
#define L0_uart3_get() (S3BUF)
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
void L1_uart3_buf_init(void);
extern void L0_uart3_init(void);
extern void L0_uart3_uchex(U8 ww);
extern void L0_uart3_ulhex(vU32 ww);
extern void L0_uart3_ul(vU32 ww);
extern void L0_uart3_sendstr(U8 *str);
extern void L0_uart3_0d0a(void);
extern void L0_uart3_uc(U8 ww);
///////////////////////////////////////////////////////////////
extern void L0_uart3_sendArray(U8 *buf,U8 len);
extern void L0_uart3_sendbuf(void);
#endif //#ifndef _uart3_H