1 /**************************************************************************/
4 @author K. Townsend (microBuilder.eu)
8 Software License Agreement (BSD License)
10 Copyright (c) 2010, microBuilder SARL
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 1. Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 2. Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 3. Neither the name of the copyright holders nor the
21 names of its contributors may be used to endorse or promote products
22 derived from this software without specific prior written permission.
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
25 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
28 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /**************************************************************************/
40 #define CMD_COUNT (sizeof(cmd_tbl)/sizeof(cmd_t))
44 #ifdef CFG_INTERFACE_UART
45 #include "core/uart/uart.h"
48 // Function prototypes for the command table
49 void cmd_help(uint8_t argc
, char **argv
); // handled by core/cmd/cmd.c
50 void cmd_sysinfo(uint8_t argc
, char **argv
);
51 void cmd_reset(uint8_t argc
, char **argv
);
54 void cmd_backlight(uint8_t argc
, char **argv
);
55 void cmd_button(uint8_t argc
, char **argv
);
56 void cmd_circle(uint8_t argc
, char **argv
);
57 void cmd_clear(uint8_t argc
, char **argv
);
58 void cmd_line(uint8_t argc
, char **argv
);
59 void cmd_rectangle(uint8_t argc
, char **argv
);
60 void cmd_rectangleround(uint8_t argc
, char **argv
);
61 void cmd_pixel(uint8_t argc
, char **argv
);
62 void cmd_progress(uint8_t argc
, char **argv
);
63 void cmd_getpixel(uint8_t argc
, char **argv
);
64 void cmd_calibrate(uint8_t argc
, char **argv
);
65 void cmd_orientation(uint8_t argc
, char **argv
);
66 void cmd_roundedcorner(uint8_t argc
, char **argv
);
67 void cmd_text(uint8_t argc
, char **argv
);
68 void cmd_textw(uint8_t argc
, char **argv
);
69 void cmd_triangle(uint8_t argc
, char **argv
);
70 void cmd_tsthreshhold(uint8_t argc
, char **argv
);
71 void cmd_tswait(uint8_t argc
, char **argv
);
73 void cmd_bmp(uint8_t argc
, char **argv
);
78 void cmd_chibi_addr(uint8_t argc
, char **argv
);
79 void cmd_chibi_tx(uint8_t argc
, char **argv
);
83 void cmd_i2ceeprom_read(uint8_t argc
, char **argv
);
84 void cmd_i2ceeprom_write(uint8_t argc
, char **argv
);
85 void cmd_uart(uint8_t argc
, char **argv
);
89 void cmd_lm75b_gettemp(uint8_t argc
, char **argv
);
93 void cmd_sd_dir(uint8_t argc
, char **argv
);
97 void cmd_pwm(uint8_t argc
, char **argv
);
100 #define CMD_NOPARAMS "This command has no parameters"
102 /**************************************************************************/
104 Command list for the command-line interpreter and the name of the
105 corresponding method that handles the command.
107 Note that a trailing ',' is required on the last entry, which will
108 cause a NULL entry to be appended to the end of the table.
110 /**************************************************************************/
113 // command name, min args, max args, hidden, function name, command description, syntax
114 { "?", 0, 0, 0, cmd_help
, "Help" , CMD_NOPARAMS
},
115 { "V", 0, 0, 0, cmd_sysinfo
, "System Info" , CMD_NOPARAMS
},
116 { "Z", 0, 0, 0, cmd_reset
, "Reset" , CMD_NOPARAMS
},
119 { "e", 1, 1, 0, cmd_i2ceeprom_read
, "EEPROM Read" , "'e <addr>'" },
120 { "w", 2, 2, 0, cmd_i2ceeprom_write
, "EEPROM Write" , "'w <addr> <val>'" },
121 { "U", 0, 1, 0, cmd_uart
, "UART baud rate" , "'U [<val>]'" },
125 { "b", 5, 99, 0, cmd_button
, "Button" , "'b <x> <y> <w> <h> <fontclr> [<txt>]'" },
127 { "B", 3, 3, 0, cmd_bmp
, "Bitmap (SD Card)" , "'B <x> <y> <file>'" },
129 { "c", 4, 6, 0, cmd_circle
, "Circle" , "'c <x> <y> <radius> <color> [<filled[0|1]> <bcolor>]'" },
130 { "C", 0, 0, 0, cmd_calibrate
, "Calibrate Touch Screen" , CMD_NOPARAMS
},
131 { "F", 0, 1, 0, cmd_clear
, "Fill" , "'F [<color>]'" },
132 { "g", 2, 2, 0, cmd_getpixel
, "Get Pixel" , "'g <x> <y>'" },
133 { "l", 5, 7, 0, cmd_line
, "Line" , "'l <x1> <y1> <x2> <y2> <color> [<empty> <solid>]'" },
134 { "L", 1, 1, 0, cmd_backlight
, "Backlight" , "'L <0|1>'" },
135 { "n", 5, 5, 0, cmd_roundedcorner
, "Rounded Corner" , "'n <x> <y> <radius> <corner> <color>'" },
136 { "o", 0, 1, 0, cmd_orientation
, "LCD Orientation" , "'o [<0|1>]'" },
137 { "p", 3, 3, 0, cmd_pixel
, "Draw Pixel" , "'p <x> <y> <color>'" },
138 { "P", 6, 6, 0, cmd_progress
, "Progress Bar" , "'P <x> <y> <w> <h> <%> <barclr>'" },
139 { "r", 5, 7, 0, cmd_rectangle
, "Rectangle" , "'r <x1> <y1> <x2> <y2> <color> [<filled[0|1]> <bcolor>]'" },
140 { "R", 7, 9, 0, cmd_rectangleround
, "Rounded Rectangle" , "'R <x1> <y1> <x2> <y2> <color> <radius> <corners> [<filled[0|1]> <bcolor>]'" },
141 { "s", 2, 99, 0, cmd_textw
, "Text Width" , "'s <font#> <msg>'" },
142 { "t", 6, 99, 0, cmd_text
, "Text" , "'t <x> <y> <bgcolor> <fontcolor> <font#> <msg>'" },
143 { "v", 7, 8, 0, cmd_triangle
, "Triangle" , "'v <x1> <y1> <x2> <y2> <x3> <y3> <color> [<filled[0|1]>]'" },
144 { "W", 0, 1, 0, cmd_tswait
, "Wait for Touch" , "'W [<ms>]'" },
145 { "x", 0, 1, 0, cmd_tsthreshhold
, "Touch Threshold" , "'x [<0..254>]'" },
149 { "A", 0, 1, 0, cmd_chibi_addr
, "Get/Set Node Address" , "'A [<0x0..0xFFFE>]'" },
150 { "S", 2, 99, 0, cmd_chibi_tx
, "Send Message" , "'S <destaddr> <msg>'" },
154 { "m", 0, 0, 0, cmd_lm75b_gettemp
, "Temp (C)" , CMD_NOPARAMS
},
158 { "d", 0, 1, 0, cmd_sd_dir
, "Dir (SD Card)" , "'d [<path>]'" },
162 { "M", 2, 2, 0, cmd_pwm
, "PWM Control" , "'M [<dutycycle(%)>] [<frequency(ticks)>]'" },
This page took 0.050571 seconds and 5 git commands to generate.