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