]>
cloudbase.mooo.com Git - z180-stamp.git/blob - avr/command_tbl.c
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_env_print(cmd_tbl_t
*, int, int, char * const []);
11 extern command_ret_t
do_env_default(cmd_tbl_t
*, int, int, char * const []);
12 extern command_ret_t
do_env_set(cmd_tbl_t
*, int, int, char * const []);
13 extern command_ret_t
do_env_save(cmd_tbl_t
*, int, int, char * const []);
14 extern command_ret_t
do_loadf(cmd_tbl_t
*, int, int, char * const []);
15 extern command_ret_t
do_go(cmd_tbl_t
*, int, int, char * const []);
16 extern command_ret_t
do_restart(cmd_tbl_t
*, int, int, char * const []);
17 extern command_ret_t
do_dump_mem(cmd_tbl_t
*, int, int, char * const []);
18 extern command_ret_t
do_eep_cp(cmd_tbl_t
*, int, int, char * const []);
19 extern command_ret_t
do_busreq_pulse(cmd_tbl_t
*, int, int, char * const []);
20 extern command_ret_t
do_date(cmd_tbl_t
*, int, int, char * const []);
21 //extern command_ret_t do_clock(cmd_tbl_t *, int, int, char * const []);
22 //extern command_ret_t do_clock2(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"
66 CMD_TBL_ITEM_COMPLETE(
67 run
, CONFIG_SYS_MAXARGS
, 1, do_run
,
68 "run commands in an environment variable",
70 " - run the commands in the environment variable(s) 'var'",
73 CMD_TBL_ITEM_COMPLETE(
74 printenv
, CONFIG_SYS_MAXARGS
, 1, do_env_print
,
75 "print environment variables",
77 " - print values of all environment variables\n"
79 " - print value of environment variable 'name'",
82 CMD_TBL_ITEM_COMPLETE(
83 setenv
, CONFIG_SYS_MAXARGS
, 0, do_env_set
,
84 "set environment variables",
86 " - set environment variable 'name' to 'value ...'\n"
88 " - delete environment variable 'name'",
92 saveenv
, 1, 0, do_env_save
,
93 "save environment variables to persistent storage",
97 defaultenv
, 1, 0, do_env_default
,
98 "set all environment variables to their default values",
103 loadf
, 1, 0, do_loadf
,
104 "load srec_cat prepared image from controller flash",
109 "start application at address 'addr'",
111 " - start application at address 'addr'"
113 // " passing 'arg' as arguments"
116 reset
, 1, 0, do_reset
,
117 "Keep CPU in RESET state",
121 restart
, 1, 0, do_restart
,
122 "Perform RESET of the CPU",
128 clock
, 2, 0, do_clock
,
129 "Set or get CPU frequency",
131 " - print frequency or state of clock pin\n"
133 " - set frequency of clock pin to value\n"
135 " - set clock pin level high or low"
138 clk2
, 3, 0, do_clock2
,
139 "Set or get clk2 frequency",
141 " - print frequency or state of clk2 pin\n"
142 "clk2 [-d] value[K|M]\n"
143 " - set frequency of clk2 pin to value\n"
145 " - set clk2 pin level high or low"
150 pin
, CONFIG_SYS_MAXARGS
, 0, do_pin
,
151 "Set or query pin state",
153 " - print cofiguration and state or frequency of pins\n"
154 " print all pins, if argument is omitted\n"
155 "pin <pins> h[igh]|l[ow]\n"
156 " - config pins as output and set to level high or low\n"
157 "pin <pins> ts|i[n]|p[ullup]\n"
158 " - config pins as input/tristate or input with pullup\n"
159 "pin <pins> value[K|M][Hz]\n"
160 " - output a clock on pins\n"
161 " value is system clock divider or frequency, if 'Hz' is appended\n"
162 " divider is rounded down to next possible value (depends on pin)\n"
164 "<pins> is a comma separated list of numbers or ranges, i.e. \"0,9,3-6\"\n"
170 "address [# of objects]"
174 "memory modify (auto-incrementing address)",
179 "memory modify (constant address)",
184 "memory write (fill)",
185 "address value [count]"
190 "source target count"
193 cmp
, 4, 1, do_mem_cmp
,
198 base
, 2, 1, do_mem_base
,
199 "print or set address offset",
201 " - print address offset for memory commands\n"
203 " - set address offset for memory commands to 'offset'"
206 loop
, 3, 1, do_mem_loop
,
207 "infinite loop on address range",
208 "address number_of_bytes"
212 loopw
, 4, 1, do_mem_loopw
,
213 "infinite write loop on address range",
214 "address number_of_bytes data_to_write"
216 #endif /* CONFIG_LOOPW */
218 #ifdef CONFIG_CMD_MEMTEST
220 mtest
, 5, 1, do_mem_mtest
,
221 "simple RAM read/write test",
222 "[start [end [pattern [iterations]]]]"
224 #endif /* CONFIG_CMD_MEMTEST */
226 #ifdef CONFIG_MX_CYCLIC
228 mdc
, 4, 1, do_mem_mdc
,
229 "memory display cyclic",
230 "address count delay(ms)"
233 mwc
, 4, 1, do_mem_mwc
,
234 "memory write cyclic",
235 "address value delay(ms)"
237 #endif /* CONFIG_MX_CYCLIC */
241 help
, CONFIG_SYS_MAXARGS
, 1, do_help
,
242 "print command description/usage",
244 " - print brief description of all commands\n"
246 " - print detailed usage of 'command'"
249 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
250 {FSTR("?"), CONFIG_SYS_MAXARGS
, 1, do_help
,
251 FSTR("alias for 'help'"),
252 #ifdef CONFIG_SYS_LONGHELP
254 #endif /* CONFIG_SYS_LONGHELP */
255 #ifdef CONFIG_AUTO_COMPLETE
259 /* Mark end of table */