| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- /******************************************************************************
- 版权所有:
- 文件名称: rt_printf.h
- 文件版本: 01.01
- 创建作者: sunxi
- 创建日期: 2020-06-18
- 功能说明: 实时微系统调试输出接口
- 其它说明:
- 修改记录:
- */
- #ifndef _RT_PRINTF_H
- #define _RT_PRINTF_H
- /*------------------------------- 头文件 --------------------------------------
- */
- #include <time.h>
- #include <stdio.h>
- /*------------------------------- 宏定义 --------------------------------------
- */
- #define RT_PRINTF_POSITION() rt_printf("%s:%d\r\n",__FUNCTION__,__LINE__)
- /*------------------------------ 类型结构 -------------------------------------
- */
- //sunxi for history
- typedef struct
- {
- unsigned ms:16;
- unsigned min:6;
- unsigned :2;
- unsigned hour:5;
- unsigned :3;
- unsigned day:5;
- unsigned week:3;
- unsigned month:4;
- unsigned :4;
- unsigned year:7;
- unsigned :1;
- }CP56_TIME2A_T;
- typedef union
- {
- unsigned char a_time[7];
- CP56_TIME2A_T time_t;
- }CP56_TIME2A;
- /*------------------------------ 函数声明 -------------------------------------
- */
- // sunxi 20200810 int rt_printf_init(void);
- // sunxi 20200810 int rt_printf_exit(void);
- int rt_printf_fifo_get(int is_net);
- //int rt_printf_time(const char *fmt, ...);
- void rt_printf_time2(struct timespec ts);
- void print_mem(char *name,void * addr,unsigned int len);
- void print_mem_time(char *name,void * addr,unsigned int len);
- void print_msg(char *name,void * addr,unsigned int len);
- int myprintf(const char *fmt, ...);
- void co_printf(const char *fp,const int line);
- #define rt_printf_time(fmt,...)\
- co_printf(__FILE__,__LINE__);\
- myprintf(fmt,##__VA_ARGS__);\
- int rt_printf(const char *fmt, ...);
- /******************************************************************************
- 函数名称: rt_printf_init
- 函数版本: 01.01
- 创建作者: sunxi
- 创建日期: 2022-5-31
- 函数说明: 初始化.
- 参数说明:
- 无
- 返回值: 成功返回0, 失败返回-1
- 修改记录:
- */
- int rt_printf_init(void);
- /******************************************************************************
- 函数名称: rt_printf_exit
- 函数版本: 01.01
- 创建作者: sunxi
- 创建日期: 2022-5-31
- 函数说明: 反初始化.
- 参数说明:
- 无
- 返回值: 总是返回0.
- 修改记录:
- */
- int rt_printf_exit(void);
- /*------------------------------ 文件结束 -------------------------------------
- */
- #endif // sunxi 20180627
|