35 lines
994 B
C
35 lines
994 B
C
/*********************************************************
|
|
* @file cm_demo_uart.h
|
|
* @brief ML302 OpenCPU main header file
|
|
* Copyright (c) 2019 China Mobile IOT.
|
|
* All rights reserved.
|
|
* created by CaoChi 2020/12/10
|
|
********************************************************/
|
|
#ifndef __CM_UART_DEMO_H__
|
|
#define __CM_UART_DEMO_H__
|
|
#include "cm_os.h"
|
|
|
|
#define CM_PRT_INF(fmt,arg...) app_printf("[CM_INF]line %d in %s:"fmt,__LINE__,__FILE__,##arg)
|
|
#define CM_PRT_WRN(fmt,arg...) app_printf("[CM_WRN]line %d in %s:"fmt,__LINE__,__FILE__,##arg)
|
|
#define CM_PRT_ERR(fmt,arg...) app_printf("[CM_ERR]line %d in %s:"fmt,__LINE__,__FILE__,##arg)
|
|
|
|
/**
|
|
* \brief 串口接收数据结构体
|
|
*/
|
|
typedef struct
|
|
{
|
|
unsigned char buf[1024];
|
|
int len;
|
|
}cm_uart_recv_data_buf_t;
|
|
|
|
|
|
void app_uart_init(void);
|
|
|
|
// 发送数据
|
|
int8_t uart0_send_msg(uint8_t *msg_data, uint16_t msg_data_len, uint32_t timeout);
|
|
void uart0_printf(char *str, ...);
|
|
void app_printf (char *str, ...);
|
|
|
|
|
|
#endif
|