]> cloudbase.mooo.com Git - z180-stamp.git/blame - avr/command_tbl.c
Create include directory
[z180-stamp.git] / avr / command_tbl.c
CommitLineData
d684c216
L
1
2#include "common.h"
3
4#include "command.h"
72f58822 5#include "cmd_mem.h"
d684c216
L
6
7
d0581f88
L
8extern command_ret_t do_help(cmd_tbl_t *, int, int, char * const []);
9extern command_ret_t do_echo(cmd_tbl_t *, int, int, char * const []);
10extern command_ret_t do_env_print(cmd_tbl_t *, int, int, char * const []);
11extern command_ret_t do_env_set(cmd_tbl_t *, int, int, char * const []);
12extern command_ret_t do_env_save(cmd_tbl_t *, int, int, char * const []);
13extern command_ret_t do_loadf(cmd_tbl_t *, int, int, char * const []);
14extern command_ret_t do_go(cmd_tbl_t *, int, int, char * const []);
15extern command_ret_t do_restart(cmd_tbl_t *, int, int, char * const []);
16extern command_ret_t do_dump_mem(cmd_tbl_t *, int, int, char * const []);
17extern command_ret_t do_eep_cp(cmd_tbl_t *, int, int, char * const []);
18extern command_ret_t do_busreq_pulse(cmd_tbl_t *, int, int, char * const []);
d684c216
L
19
20
21cmd_tbl_t cmd_tbl[] = {
22
323398b1
L
23#ifdef DEBUG
24CMD_TBL_ITEM(
f338df2a
L
25 !mdr, 3, 1, do_dump_mem,
26 "RAM dump",
27 "address [count]"
28),
29CMD_TBL_ITEM(
30 !mde, 3, 1, do_dump_mem,
323398b1
L
31 "EEPROM dump",
32 "address [count]"
33),
34CMD_TBL_ITEM(
f338df2a 35 !cpe, 4, 0, do_eep_cp,
323398b1
L
36 "EEPROM copy",
37 "source target count"
38),
39#endif
f338df2a
L
40CMD_TBL_ITEM(
41 mstep, 2, 1, do_busreq_pulse,
42 "execute one M cycle",
43 "[count]\n"
44 " - repeat count times"
45),
d684c216
L
46CMD_TBL_ITEM(
47 echo, CONFIG_SYS_MAXARGS, 1, do_echo,
48 "echo args to console",
49 "[args..]\n"
50 " - echo args to console; \\c suppresses newline"
51),
52CMD_TBL_ITEM_COMPLETE(
53 run, CONFIG_SYS_MAXARGS, 1, do_run,
54 "run commands in an environment variable",
55 "var [...]\n"
56 " - run the commands in the environment variable(s) 'var'",
57 var_complete
58),
59CMD_TBL_ITEM_COMPLETE(
60 printenv, CONFIG_SYS_MAXARGS, 1, do_env_print,
61 "print environment variables",
72f58822 62 "\n"
534e1dfc 63 " - print values of all environment variables\n"
d684c216
L
64 "printenv name ...\n"
65 " - print value of environment variable 'name'",
66 var_complete
67),
68CMD_TBL_ITEM_COMPLETE(
69 setenv, CONFIG_SYS_MAXARGS, 0, do_env_set,
70 "set environment variables",
72f58822
L
71 "name value ...\n"
72 " - set environment variable 'name' to 'value ...'\n"
73 "setenv name\n"
74 " - delete environment variable 'name'",
d684c216
L
75 var_complete
76),
323398b1
L
77CMD_TBL_ITEM(
78 saveenv, 1, 0, do_env_save,
79 "save environment variables to persistent storage",
80 ""
81),
72f58822 82
534e1dfc 83CMD_TBL_ITEM(
323398b1 84 loadf, 1, 0, do_loadf,
534e1dfc
L
85 "load srec_cat prepared image from controller flash",
86 ""
87),
88CMD_TBL_ITEM(
323398b1 89 go, 2, 0, do_go,
534e1dfc
L
90 "start application at address 'addr'",
91 "addr\n"
92 " - start application at address 'addr'"
93// "\n"
94// " passing 'arg' as arguments"
95),
96CMD_TBL_ITEM(
323398b1 97 reset, 1, 0, do_reset,
534e1dfc
L
98 "Keep CPU in RESET state",
99 ""
100),
101CMD_TBL_ITEM(
102 restart, 1, 0, do_restart,
103 "Perform RESET of the CPU",
104 ""
105),
106
72f58822
L
107CMD_TBL_ITEM(
108 md, 3, 1, do_mem_md,
109 "memory display",
110 "address [# of objects]"
111),
112CMD_TBL_ITEM(
113 mm, 2, 1, do_mem_mm,
114 "memory modify (auto-incrementing address)",
115 "address"
116),
117CMD_TBL_ITEM(
118 nm, 2, 1, do_mem_nm,
119 "memory modify (constant address)",
120 "address"
121),
122CMD_TBL_ITEM(
123 mw, 4, 1, do_mem_mw,
124 "memory write (fill)",
125 "address value [count]"
126),
127CMD_TBL_ITEM(
128 cp, 4, 1, do_mem_cp,
129 "memory copy",
130 "source target count"
131),
132CMD_TBL_ITEM(
133 cmp, 4, 1, do_mem_cmp,
134 "memory compare",
135 "addr1 addr2 count"
136),
137CMD_TBL_ITEM(
138 base, 2, 1, do_mem_base,
139 "print or set address offset",
140 "\n"
141 " - print address offset for memory commands\n"
142 "base offset\n"
143 " - set address offset for memory commands to 'offset'"
144),
145CMD_TBL_ITEM(
146 loop, 3, 1, do_mem_loop,
147 "infinite loop on address range",
148 "address number_of_bytes"
149),
150#ifdef CONFIG_LOOPW
151CMD_TBL_ITEM(
152 loopw, 4, 1, do_mem_loopw,
153 "infinite write loop on address range",
154 "address number_of_bytes data_to_write"
155),
156#endif /* CONFIG_LOOPW */
157
158#ifdef CONFIG_CMD_MEMTEST
159CMD_TBL_ITEM(
160 mtest, 5, 1, do_mem_mtest,
161 "simple RAM read/write test",
162 "[start [end [pattern [iterations]]]]"
163),
164#endif /* CONFIG_CMD_MEMTEST */
165
166#ifdef CONFIG_MX_CYCLIC
167CMD_TBL_ITEM(
168 mdc, 4, 1, do_mem_mdc,
169 "memory display cyclic",
170 "address count delay(ms)"
171),
172CMD_TBL_ITEM(
173 mwc, 4, 1, do_mem_mwc,
174 "memory write cyclic",
175 "address value delay(ms)"
176),
177#endif /* CONFIG_MX_CYCLIC */
178
179
d684c216
L
180CMD_TBL_ITEM(
181 help, CONFIG_SYS_MAXARGS, 1, do_help,
182 "print command description/usage",
183 "\n"
184 " - print brief description of all commands\n"
185 "help command ...\n"
186 " - print detailed usage of 'command'"
187),
188
72f58822 189/* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
d684c216
L
190 {FSTR("?"), CONFIG_SYS_MAXARGS, 1, do_help,
191 FSTR("alias for 'help'"),
192#ifdef CONFIG_SYS_LONGHELP
193 FSTR(""),
194#endif /* CONFIG_SYS_LONGHELP */
195#ifdef CONFIG_AUTO_COMPLETE
196 0,
197#endif
198},
199/* Mark end of table */
200{ 0 },
201};