]>
cloudbase.mooo.com Git - z180-stamp.git/blob - avr/command_tbl.c
336c608b326c72a530a99e824ecaa4b52ce63a24
8 extern command_ret_t
do_help(cmd_tbl_t
*, int, int, char * const []);
9 extern command_ret_t
do_echo(cmd_tbl_t
*, int, int, char * const []);
10 extern command_ret_t
do_sleep(cmd_tbl_t
*, int, int, char * const []);
11 extern command_ret_t
do_env_print(cmd_tbl_t
*, int, int, char * const []);
12 extern command_ret_t
do_env_default(cmd_tbl_t
*, int, int, char * const []);
13 extern command_ret_t
do_env_set(cmd_tbl_t
*, int, int, char * const []);
14 extern command_ret_t
do_env_save(cmd_tbl_t
*, int, int, char * const []);
15 extern command_ret_t
do_loadf(cmd_tbl_t
*, int, int, char * const []);
16 extern command_ret_t
do_go(cmd_tbl_t
*, int, int, char * const []);
17 extern command_ret_t
do_restart(cmd_tbl_t
*, int, int, char * const []);
18 extern command_ret_t
do_console(cmd_tbl_t
*, int, int, char * const []);
19 extern command_ret_t
do_dump_mem(cmd_tbl_t
*, int, int, char * const []);
20 extern command_ret_t
do_eep_cp(cmd_tbl_t
*, int, int, char * const []);
21 extern command_ret_t
do_busreq_pulse(cmd_tbl_t
*, int, int, char * const []);
22 extern command_ret_t
do_date(cmd_tbl_t
*, int, int, char * const []);
23 extern command_ret_t
do_pin(cmd_tbl_t
*, int, int, char * const []);
26 cmd_tbl_t cmd_tbl
[] = {
30 "get/set/reset date & time",
31 "[MMDDhhmm[[CC]YY][.ss]]\ndate reset\n"
32 " - without arguments: print date & time\n"
33 " - with numeric argument: set the system date & time\n"
34 " - with 'reset' argument: reset the RTC"
39 !mdr
, 3, 1, do_dump_mem
,
44 !mde
, 3, 1, do_dump_mem
,
49 !cpe
, 4, 0, do_eep_cp
,
55 mstep
, 2, 1, do_busreq_pulse
,
56 "execute one M cycle",
58 " - repeat count times"
61 echo
, CONFIG_SYS_MAXARGS
, 1, do_echo
,
62 "echo args to console",
64 " - echo args to console; \\c suppresses newline"
67 sleep
, 2, 1, do_sleep
,
68 "delay execution for some time",
70 " - delay execution for decimal N (milli) seconds"
72 CMD_TBL_ITEM_COMPLETE(
73 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
74 "run commands in an environment variable",
76 " - run the commands in the environment variable(s) 'var'",
79 CMD_TBL_ITEM_COMPLETE(
80 printenv
, CONFIG_SYS_MAXARGS
, 1, do_env_print
,
81 "print environment variables",
83 " - print values of all environment variables\n"
85 " - print value of environment variable 'name'",
88 CMD_TBL_ITEM_COMPLETE(
89 setenv
, CONFIG_SYS_MAXARGS
, 0, do_env_set
,
90 "set environment variables",
92 " - set environment variable 'name' to 'value ...'\n"
94 " - delete environment variable 'name'",
98 saveenv
, 1, 0, do_env_save
,
99 "save environment variables to persistent storage",
103 defaultenv
, 1, 0, do_env_default
,
104 "set all environment variables to their default values",
109 loadf
, 1, 0, do_loadf
,
110 "load srec_cat prepared image from controller flash",
115 "start application at address 'addr'",
117 " - start application at address 'addr'"
119 // " passing 'arg' as arguments"
122 reset
, 1, 0, do_reset
,
123 "Keep CPU in RESET state",
127 restart
, 1, 1, do_restart
,
128 "Perform RESET of the CPU",
132 connect
, 1, 1, do_console
,
133 "Connect to CPU console i/o",
139 clock
, 2, 0, do_clock
,
140 "Set or get CPU frequency",
142 " - print frequency or state of clock pin\n"
144 " - set frequency of clock pin to value\n"
146 " - set clock pin level high or low"
149 clk2
, 3, 0, do_clock2
,
150 "Set or get clk2 frequency",
152 " - print frequency or state of clk2 pin\n"
153 "clk2 [-d] value[K|M]\n"
154 " - set frequency of clk2 pin to value\n"
156 " - set clk2 pin level high or low"
161 pin
, CONFIG_SYS_MAXARGS
, 0, do_pin
,
162 "Set or query pin state",
164 " - print cofiguration and state or frequency of pins\n"
165 " print all pins, if argument is omitted\n"
166 "pin <pins> h[igh]|l[ow]\n"
167 " - config pins as output and set to level high or low\n"
168 "pin <pins> ts|i[n]|p[ullup]\n"
169 " - config pins as input/tristate or input with pullup\n"
170 "pin <pins> value[K|M][Hz]\n"
171 " - output a clock on pins\n"
172 " value is system clock divider or frequency, if 'Hz' is appended\n"
173 " divider is rounded down to next possible value (depends on pin)\n"
175 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
181 "address [# of objects]"
185 "memory modify (auto-incrementing address)",
190 "memory modify (constant address)",
195 "memory write (fill)",
196 "address value [count]"
201 "source target count"
204 cmp
, 4, 1, do_mem_cmp
,
209 base
, 2, 1, do_mem_base
,
210 "print or set address offset",
212 " - print address offset for memory commands\n"
214 " - set address offset for memory commands to 'offset'"
217 loop
, 3, 1, do_mem_loop
,
218 "infinite loop on address range",
219 "address number_of_bytes"
223 loopw
, 4, 1, do_mem_loopw
,
224 "infinite write loop on address range",
225 "address number_of_bytes data_to_write"
227 #endif /* CONFIG_LOOPW */
229 #ifdef CONFIG_CMD_MEMTEST
231 mtest
, 5, 1, do_mem_mtest
,
232 "simple RAM read/write test",
233 "[start [end [pattern [iterations]]]]"
235 #endif /* CONFIG_CMD_MEMTEST */
237 #ifdef CONFIG_MX_CYCLIC
239 mdc
, 4, 1, do_mem_mdc
,
240 "memory display cyclic",
241 "address count delay(ms)"
244 mwc
, 4, 1, do_mem_mwc
,
245 "memory write cyclic",
246 "address value delay(ms)"
248 #endif /* CONFIG_MX_CYCLIC */
252 help
, CONFIG_SYS_MAXARGS
, 1, do_help
,
253 "print command description/usage",
255 " - print brief description of all commands\n"
257 " - print detailed usage of 'command'"
260 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
261 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
262 FSTR("alias for 'help'"),
263 #ifdef CONFIG_SYS_LONGHELP
265 #endif /* CONFIG_SYS_LONGHELP */
266 #ifdef CONFIG_AUTO_COMPLETE
270 /* Mark end of table */