Initial commit
[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
52 #ifdef CFG_TFTLCD
53 void cmd_button(uint8_t argc, char **argv);
54 void cmd_circle(uint8_t argc, char **argv);
55 void cmd_clear(uint8_t argc, char **argv);
56 void cmd_line(uint8_t argc, char **argv);
57 void cmd_rectangle(uint8_t argc, char **argv);
58 void cmd_pixel(uint8_t argc, char **argv);
59 void cmd_progress(uint8_t argc, char **argv);
60 void cmd_getpixel(uint8_t argc, char **argv);
61 void cmd_gettext(uint8_t argc, char **argv);
62 void cmd_calibrate(uint8_t argc, char **argv);
63 void cmd_orientation(uint8_t argc, char **argv);
64 void cmd_text(uint8_t argc, char **argv);
65 void cmd_textw(uint8_t argc, char **argv);
66 void cmd_tsthreshhold(uint8_t argc, char **argv);
67 void cmd_tswait(uint8_t argc, char **argv);
68 #ifdef CFG_SDCARD
69 void cmd_bmp(uint8_t argc, char **argv);
70 #endif
71 #endif
72
73 #ifdef CFG_CHIBI
74 void cmd_chibi_addr(uint8_t argc, char **argv);
75 void cmd_chibi_tx(uint8_t argc, char **argv);
76 #endif
77
78 #ifdef CFG_I2CEEPROM
79 void cmd_i2ceeprom_read(uint8_t argc, char **argv);
80 void cmd_i2ceeprom_write(uint8_t argc, char **argv);
81 void cmd_uart(uint8_t argc, char **argv);
82 #endif
83
84 #ifdef CFG_LM75B
85 void cmd_lm75b_gettemp(uint8_t argc, char **argv);
86 #endif
87
88 #ifdef CFG_SDCARD
89 void cmd_sd_dir(uint8_t argc, char **argv);
90 #endif
91
92 #define CMD_NOPARAMS "This command has no parameters"
93
94 /**************************************************************************/
95 /*!
96 Command list for the command-line interpreter and the name of the
97 corresponding method that handles the command.
98
99 Note that a trailing ',' is required on the last entry, which will
100 cause a NULL entry to be appended to the end of the table.
101 */
102 /**************************************************************************/
103 cmd_t cmd_tbl[] =
104 {
105 // command name, min args, max args, hidden, function name, command description, syntax
106 { "?", 0, 0, 0, cmd_help , "Help" , CMD_NOPARAMS },
107 { "V", 0, 0, 0, cmd_sysinfo , "System Info" , CMD_NOPARAMS },
108
109 #ifdef CFG_I2CEEPROM
110 { "e", 1, 1, 0, cmd_i2ceeprom_read , "EEPROM Read" , "'e <addr>'" },
111 { "w", 2, 2, 0, cmd_i2ceeprom_write , "EEPROM Write" , "'w <addr> <val>'" },
112 { "U", 0, 1, 0, cmd_uart , "UART baud rate" , "'U [<val>]'" },
113 #endif
114
115 #ifdef CFG_TFTLCD
116 { "b", 7, 99, 0, cmd_button , "Button" , "'b <x> <y> <w> <h> <brdrclr> <fillclr> <fontclr> [<txt>]'" },
117 #ifdef CFG_SDCARD
118 { "B", 3, 3, 0, cmd_bmp , "Bitmap (SD Card)" , "'B <x> <y> <file>'" },
119 #endif
120 { "c", 4, 6, 0, cmd_circle , "Circle" , "'c <x> <y> <radius> <color> [<filled[0|1]> <bcolor>]'" },
121 { "C", 0, 0, 0, cmd_calibrate , "Calibrate Touch Screen" , CMD_NOPARAMS },
122 { "F", 0, 1, 0, cmd_clear , "Fill" , "'F [<color>]'" },
123 { "l", 5, 7, 0, cmd_line , "Line" , "'l <x1> <y1> <x2> <y2> <color> [<empty> <solid>]'" },
124 { "o", 0, 1, 0, cmd_orientation , "LCD Orientation" , "'o [<0|1>]'" },
125 { "p", 3, 3, 0, cmd_pixel , "Draw Pixel" , "'p <x> <y> <color>'" },
126 { "P", 9, 9, 0, cmd_progress , "Progress Bar" , "'P <x> <y> <w> <h> <%> <bclr> <bfillclr> <pbrdclr> <pfillclr>'" },
127 { "r", 5, 7, 0, cmd_rectangle , "Rectangle" , "'r <x1> <y1> <x2> <y2> <color> [<filled[0|1]> <bcolor>]'" },
128 { "R", 2, 2, 0, cmd_getpixel , "Read Pixel" , "'R <x> <y>'" },
129 { "s", 2, 99, 0, cmd_textw , "Text Width" , "'s <font#> <msg>'" },
130 { "t", 5, 99, 0, cmd_text , "Text" , "'t <x> <y> <color> <font#> <msg>'" },
131 { "T", 0, 0, 0, cmd_gettext , "Text Dialogue" , CMD_NOPARAMS },
132 { "W", 0, 1, 0, cmd_tswait , "Wait for Touch" , "'W [<ms>]'" },
133 { "x", 0, 1, 0, cmd_tsthreshhold , "Touch Threshold" , "'x [<0..254>]'" },
134 #endif
135
136 #ifdef CFG_CHIBI
137 { "A", 0, 1, 0, cmd_chibi_addr , "Get/Set Node Address" , "'A [<0x0..0xFFFE>]'" },
138 { "S", 2, 99, 0, cmd_chibi_tx , "Send Message" , "'S <destaddr> <msg>'" },
139 #endif
140
141 #ifdef CFG_LM75B
142 { "m", 0, 0, 0, cmd_lm75b_gettemp , "Temp (C)" , CMD_NOPARAMS },
143 #endif
144
145 #ifdef CFG_SDCARD
146 { "d", 0, 1, 0, cmd_sd_dir , "Dir (SD Card)" , "'d [<path>]'" },
147 #endif
148 };
149
150 #endif
This page took 0.090736 seconds and 5 git commands to generate.