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