huangcm
2025-07-03 a76b2fadf6ad4adf86e241e3753a63efe03ef80c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
*********************************************************************************************************
*                                                AR100 System
*                                     AR100 Software System Develop Kits
*                                               Debugger Module
*
*                                    (c) Copyright 2012-2016, Sunny China
*                                             All Rights Reserved
*
* File    : debugger.h
* By      : Sunny
* Version : v1.0
* Date    : 2012-4-25
* Descript: debugger public header.
* Update  : date                auther      ver     notes
*           2012-4-25 16:19:40  Sunny       1.0     Create this file.
*********************************************************************************************************
*/
 
#ifndef __DEBUGGER_H__
#define __DEBUGGER_H__
 
/* extern u32 debug_level; */
 
#define ENOSYS 88
// #ifdef CFG_DEBUGGER_PRINTF
/*
*********************************************************************************************************
*                                           INITIALIZE DEBUGGER
*
* Description:  initialize debugger.
*
* Arguments  :  none.
*
* Returns    :  OK if initialize debugger succeeded, others if failed.
*********************************************************************************************************
*/
s32 debugger_init(void);
 
/*
*********************************************************************************************************
*                                           EXIT DEBUGGER
*
* Description:  exit debugger.
*
* Arguments  :  none.
*
* Returns    :  OK if exit debugger succeeded, others if failed.
*********************************************************************************************************
*/
s32 debugger_exit(void);
 
/*
*********************************************************************************************************
*                                           PUT A CHARSET
*
* Description:  put out a charset.
*
* Arguments  :  ch  : the charset which we want to put out.
*
* Returns    :  OK if put out charset succeeded, others if failed.
*********************************************************************************************************
*/
s32 debugger_putc(char ch);
 
/*
*********************************************************************************************************
*                                           GET A CHARSET
*
* Description:  get a charset.
*
* Arguments  :  none.
*
* Returns    :  the charset we read from uart.
*********************************************************************************************************
*/
u32 debugger_get(char *buf);
extern s32 debugger_puts(char *string);
 
/*
*********************************************************************************************************
*                                           FORMATTED PRINTF
*
* Description:  print out a formatted string, similar to ANSI-C function printf().
*               This function can support and only support the following conversion specifiers:
*               %d  signed decimal integer.
*               %u  unsigned decimal integer.
*               %x  unsigned hexadecimal integer, using hex digits 0x.
*               %c  single character.
*               %s  character string.
*
* Arguments  :  format  : format control.
*               ...     : arguments.
*
* Returns    :  the number of characters printed out.
*
* Note       :  the usage refer to ANSI-C function printf().
*********************************************************************************************************
*/
s32 debugger_printf(u32 level, const char *format, ...);
 
/*
*********************************************************************************************************
*                                           SET DEBUG LEVEL
*
* Description:  set debug level.
*
* Arguments  :  para level.
*
* Returns    :  OK if set the debug level succeeded.
*********************************************************************************************************
*/
s32 set_debug_level(u32 level);
 
 
#endif /* __DEBUGGER_H__ */