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.

95 lines
3.8 KiB

1 year ago
//////////////////////////////////////////////////////////////////////////
/// COPYRIGHT NOTICE
/// Copyright (c) 2023 CCSENS
/// 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_uart4_Init
uart4_IRQHandler
L0_Usend_uc------UserDef
-----------------------------------------------------------------------------------------
********************************************************************************/
#ifndef _uart4_H
#define _uart4_H
#include "bsp_config.h"
//#include "tpc_modbus.h"
#include "msp_uartN.h"
#define D_UART4_ES_INT(x) (x) ? (BITN_1(IE2,ES4)) : (BITN_0(IE2,ES4))
#define L0_uart4_IntRI() (S4CON & S4RI)//BITN_G(SCON,U0RI)
#define L0_uart4_IntTI() (S4CON & S4TI)//BITN_G(SCON,U0TI)
#define L0_uart4_IntRIClear(); BITN_0(S4CON,S4RI)
#define L0_uart4_IntTIClear(); BITN_0(S4CON,S4TI)
#define L0_uart4_get() (S4BUF)
#define L0_uart4_set(x) (S4BUF = x)
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
extern void L0_uart4_buf_init(void);
#define L0_uart4_uc(X) L0_uartN_uc(D_UART4,X)
#define L0_uart4_us(X) L0_uartN_us(D_UART4,X)
#define L0_uart4_ul(X) L0_uartN_ul(D_UART4,X)
#define L0_uart4_0d0a() L0_uartN_0d0a(0)
#define L0_uart4_uchex(X) L0_uartN_uchex(D_UART4,X)
#define L0_uart4_ushex(X) L0_uartN_ushex(D_UART4,X)
#define L0_uart4_ulhex(X) L0_uartN_ulhex(D_UART4,X)
#define L0_uart4_sendstr(buf) L0_uartN_sendstr(D_UART4,buf)
#define L1_uart4_sendArray(buf,len) L0_uartN_sendArray(D_UART4,(buf),(len))
#define L1_uart4_sendArrayhex(buf,len) L0_uartN_uchexArray(D_UART4,(buf),(len))
#define L1_uart2_isFree(); ///L0_timer2_start();
#define L1_uart2_isFree_over(); //L0_timer2_stop();
#define L1_uart2_timer_isFree_init(); //L0_timer2_init();L0_timer2_stop();\
//L0_timer2_int_on();\
//ts_timer2.callback = L2_callback_uart2_free;ts_timer2.p = &s_uart2_rec;
extern void L2_uart4_overtime_callback(void);
#endif //#ifndef _uart4_H