Merge branch 'master' of gitlab:wintermute/hackover2013-badge-firmware
[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 #ifdef CFG_PWM
97 void cmd_pwm(uint8_t argc, char **argv);
98 #endif
99
100 #define CMD_NOPARAMS "This command has no parameters"
101
102 /**************************************************************************/
103 /*!
104 Command list for the command-line interpreter and the name of the
105 corresponding method that handles the command.
106
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.
109 */
110 /**************************************************************************/
111 cmd_t cmd_tbl[] =
112 {
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 },
117
118 #ifdef CFG_I2CEEPROM
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>]'" },
122 #endif
123
124 #ifdef CFG_TFTLCD
125 { "b", 5, 99, 0, cmd_button , "Button" , "'b <x> <y> <w> <h> <fontclr> [<txt>]'" },
126 #ifdef CFG_SDCARD
127 { "B", 3, 3, 0, cmd_bmp , "Bitmap (SD Card)" , "'B <x> <y> <file>'" },
128 #endif
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>]'" },
146 #endif
147
148 #ifdef CFG_CHIBI
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>'" },
151 #endif
152
153 #ifdef CFG_LM75B
154 { "m", 0, 0, 0, cmd_lm75b_gettemp , "Temp (C)" , CMD_NOPARAMS },
155 #endif
156
157 #ifdef CFG_SDCARD
158 { "d", 0, 1, 0, cmd_sd_dir , "Dir (SD Card)" , "'d [<path>]'" },
159 #endif
160
161 #ifdef CFG_PWM
162 { "M", 2, 2, 0, cmd_pwm , "PWM Control" , "'M [<dutycycle(%)>] [<frequency(ticks)>]'" },
163 #endif
164 };
165
166 #endif
This page took 0.057031 seconds and 5 git commands to generate.