Cleanup for 1.0.0
[hackover2013-badge-firmware.git] / project / cmd_tbl.h
1 /**************************************************************************/
2 /*!
3 @file cmd_tbl.h
4 @author K. Townsend (microBuilder.eu)
5
6 @section LICENSE
7
8 Software License Agreement (BSD License)
9
10 Copyright (c) 2010, microBuilder SARL
11 All rights reserved.
12
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.
23
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.
34 */
35 /**************************************************************************/
36
37 #ifndef __CMD_TBL_H__
38 #define __CMD_TBL_H__
39
40 #define CMD_COUNT (sizeof(cmd_tbl)/sizeof(cmd_t))
41
42 #include <stdio.h>
43
44 #ifdef CFG_INTERFACE_UART
45 #include "core/uart/uart.h"
46 #endif
47
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);
52
53 #ifdef CFG_TFTLCD
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);
72 #ifdef CFG_SDCARD
73 void cmd_bmp(uint8_t argc, char **argv);
74 #endif
75 #endif
76
77 #ifdef CFG_CHIBI
78 void cmd_chibi_addr(uint8_t argc, char **argv);
79 void cmd_chibi_tx(uint8_t argc, char **argv);
80 #endif
81
82 #ifdef CFG_I2CEEPROM
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);
86 #endif
87
88 #ifdef CFG_LM75B
89 void cmd_lm75b_gettemp(uint8_t argc, char **argv);
90 #endif
91
92 #ifdef CFG_SDCARD
93 void cmd_sd_dir(uint8_t argc, char **argv);
94 #endif
95
96 #define CMD_NOPARAMS "This command has no parameters"
97
98 /**************************************************************************/
99 /*!
100 Command list for the command-line interpreter and the name of the
101 corresponding method that handles the command.
102
103 Note that a trailing ',' is required on the last entry, which will
104 cause a NULL entry to be appended to the end of the table.
105 */
106 /**************************************************************************/
107 cmd_t cmd_tbl[] =
108 {
109 // command name, min args, max args, hidden, function name, command description, syntax
110 { "?", 0, 0, 0, cmd_help , "Help" , CMD_NOPARAMS },
111 { "V", 0, 0, 0, cmd_sysinfo , "System Info" , CMD_NOPARAMS },
112 { "Z", 0, 0, 0, cmd_reset , "Reset" , CMD_NOPARAMS },
113
114 #ifdef CFG_I2CEEPROM
115 { "e", 1, 1, 0, cmd_i2ceeprom_read , "EEPROM Read" , "'e <addr>'" },
116 { "w", 2, 2, 0, cmd_i2ceeprom_write , "EEPROM Write" , "'w <addr> <val>'" },
117 { "U", 0, 1, 0, cmd_uart , "UART baud rate" , "'U [<val>]'" },
118 #endif
119
120 #ifdef CFG_TFTLCD
121 { "b", 7, 99, 0, cmd_button , "Button" , "'b <x> <y> <w> <h> <brdrclr> <fillclr> <fontclr> [<txt>]'" },
122 #ifdef CFG_SDCARD
123 { "B", 3, 3, 0, cmd_bmp , "Bitmap (SD Card)" , "'B <x> <y> <file>'" },
124 #endif
125 { "c", 4, 6, 0, cmd_circle , "Circle" , "'c <x> <y> <radius> <color> [<filled[0|1]> <bcolor>]'" },
126 { "C", 0, 0, 0, cmd_calibrate , "Calibrate Touch Screen" , CMD_NOPARAMS },
127 { "F", 0, 1, 0, cmd_clear , "Fill" , "'F [<color>]'" },
128 { "g", 2, 2, 0, cmd_getpixel , "Get Pixel" , "'g <x> <y>'" },
129 { "l", 5, 7, 0, cmd_line , "Line" , "'l <x1> <y1> <x2> <y2> <color> [<empty> <solid>]'" },
130 { "L", 1, 1, 0, cmd_backlight , "Backlight" , "'L <0|1>'" },
131 { "n", 5, 5, 0, cmd_roundedcorner , "Rounded Corner" , "'n <x> <y> <radius> <corner> <color>'" },
132 { "o", 0, 1, 0, cmd_orientation , "LCD Orientation" , "'o [<0|1>]'" },
133 { "p", 3, 3, 0, cmd_pixel , "Draw Pixel" , "'p <x> <y> <color>'" },
134 { "P", 9, 9, 0, cmd_progress , "Progress Bar" , "'P <x> <y> <w> <h> <%> <bclr> <bfillclr> <pbrdclr> <pfillclr>'" },
135 { "r", 5, 7, 0, cmd_rectangle , "Rectangle" , "'r <x1> <y1> <x2> <y2> <color> [<filled[0|1]> <bcolor>]'" },
136 { "R", 7, 7, 0, cmd_rectangleround , "Rounded Rectangle" , "'R <x1> <y1> <x2> <y2> <color> <radius> <corners>'" },
137 { "s", 2, 99, 0, cmd_textw , "Text Width" , "'s <font#> <msg>'" },
138 { "t", 5, 99, 0, cmd_text , "Text" , "'t <x> <y> <color> <font#> <msg>'" },
139 { "v", 7, 8, 0, cmd_triangle , "Triangle" , "'v <x1> <y1> <x2> <y2> <x3> <y3> <color> [<filled[0|1]>]'" },
140 { "W", 0, 1, 0, cmd_tswait , "Wait for Touch" , "'W [<ms>]'" },
141 { "x", 0, 1, 0, cmd_tsthreshhold , "Touch Threshold" , "'x [<0..254>]'" },
142 #endif
143
144 #ifdef CFG_CHIBI
145 { "A", 0, 1, 0, cmd_chibi_addr , "Get/Set Node Address" , "'A [<0x0..0xFFFE>]'" },
146 { "S", 2, 99, 0, cmd_chibi_tx , "Send Message" , "'S <destaddr> <msg>'" },
147 #endif
148
149 #ifdef CFG_LM75B
150 { "m", 0, 0, 0, cmd_lm75b_gettemp , "Temp (C)" , CMD_NOPARAMS },
151 #endif
152
153 #ifdef CFG_SDCARD
154 { "d", 0, 1, 0, cmd_sd_dir , "Dir (SD Card)" , "'d [<path>]'" },
155 #endif
156 };
157
158 #endif
This page took 0.051952 seconds and 5 git commands to generate.