]> cloudbase.mooo.com Git - z180-stamp.git/blame - avr/command_tbl.c
Add memory commands (cmp, cp, md, mm, mw, nm)
[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 []);
12
13
14cmd_tbl_t cmd_tbl[] = {
15
16CMD_TBL_ITEM(
17 echo, CONFIG_SYS_MAXARGS, 1, do_echo,
18 "echo args to console",
19 "[args..]\n"
20 " - echo args to console; \\c suppresses newline"
21),
22CMD_TBL_ITEM_COMPLETE(
23 run, CONFIG_SYS_MAXARGS, 1, do_run,
24 "run commands in an environment variable",
25 "var [...]\n"
26 " - run the commands in the environment variable(s) 'var'",
27 var_complete
28),
29CMD_TBL_ITEM_COMPLETE(
30 printenv, CONFIG_SYS_MAXARGS, 1, do_env_print,
31 "print environment variables",
72f58822
L
32 "\n"
33 " - print [all] values of all environment variables\n"
d684c216
L
34 "printenv name ...\n"
35 " - print value of environment variable 'name'",
36 var_complete
37),
38CMD_TBL_ITEM_COMPLETE(
39 setenv, CONFIG_SYS_MAXARGS, 0, do_env_set,
40 "set environment variables",
72f58822
L
41 "name value ...\n"
42 " - set environment variable 'name' to 'value ...'\n"
43 "setenv name\n"
44 " - delete environment variable 'name'",
d684c216
L
45 var_complete
46),
72f58822
L
47
48CMD_TBL_ITEM(
49 md, 3, 1, do_mem_md,
50 "memory display",
51 "address [# of objects]"
52),
53CMD_TBL_ITEM(
54 mm, 2, 1, do_mem_mm,
55 "memory modify (auto-incrementing address)",
56 "address"
57),
58CMD_TBL_ITEM(
59 nm, 2, 1, do_mem_nm,
60 "memory modify (constant address)",
61 "address"
62),
63CMD_TBL_ITEM(
64 mw, 4, 1, do_mem_mw,
65 "memory write (fill)",
66 "address value [count]"
67),
68CMD_TBL_ITEM(
69 cp, 4, 1, do_mem_cp,
70 "memory copy",
71 "source target count"
72),
73CMD_TBL_ITEM(
74 cmp, 4, 1, do_mem_cmp,
75 "memory compare",
76 "addr1 addr2 count"
77),
78CMD_TBL_ITEM(
79 base, 2, 1, do_mem_base,
80 "print or set address offset",
81 "\n"
82 " - print address offset for memory commands\n"
83 "base offset\n"
84 " - set address offset for memory commands to 'offset'"
85),
86CMD_TBL_ITEM(
87 loop, 3, 1, do_mem_loop,
88 "infinite loop on address range",
89 "address number_of_bytes"
90),
91#ifdef CONFIG_LOOPW
92CMD_TBL_ITEM(
93 loopw, 4, 1, do_mem_loopw,
94 "infinite write loop on address range",
95 "address number_of_bytes data_to_write"
96),
97#endif /* CONFIG_LOOPW */
98
99#ifdef CONFIG_CMD_MEMTEST
100CMD_TBL_ITEM(
101 mtest, 5, 1, do_mem_mtest,
102 "simple RAM read/write test",
103 "[start [end [pattern [iterations]]]]"
104),
105#endif /* CONFIG_CMD_MEMTEST */
106
107#ifdef CONFIG_MX_CYCLIC
108CMD_TBL_ITEM(
109 mdc, 4, 1, do_mem_mdc,
110 "memory display cyclic",
111 "address count delay(ms)"
112),
113CMD_TBL_ITEM(
114 mwc, 4, 1, do_mem_mwc,
115 "memory write cyclic",
116 "address value delay(ms)"
117),
118#endif /* CONFIG_MX_CYCLIC */
119
120
d684c216
L
121CMD_TBL_ITEM(
122 help, CONFIG_SYS_MAXARGS, 1, do_help,
123 "print command description/usage",
124 "\n"
125 " - print brief description of all commands\n"
126 "help command ...\n"
127 " - print detailed usage of 'command'"
128),
129
72f58822 130/* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
d684c216
L
131 {FSTR("?"), CONFIG_SYS_MAXARGS, 1, do_help,
132 FSTR("alias for 'help'"),
133#ifdef CONFIG_SYS_LONGHELP
134 FSTR(""),
135#endif /* CONFIG_SYS_LONGHELP */
136#ifdef CONFIG_AUTO_COMPLETE
137 0,
138#endif
139},
140/* Mark end of table */
141{ 0 },
142};