e79562b170420c8fb53ee46f3398e985e521f946
[aversive.git] / commands.c
1 /*
2  *  Copyright Droids Corporation (2009)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id: commands.c,v 1.9 2009-11-08 17:24:33 zer0 Exp $
19  *
20  *  Olivier MATZ <zer0@droids-corp.org> 
21  */
22
23 #include <stdlib.h>
24 #include <aversive/pgmspace.h>
25 #include <parse.h>
26
27 /* commands_gen.c */
28 extern parse_pgm_inst_t cmd_reset;
29 extern parse_pgm_inst_t cmd_bootloader;
30 extern parse_pgm_inst_t cmd_encoders;
31 extern parse_pgm_inst_t cmd_pwm;
32 extern parse_pgm_inst_t cmd_adc;
33 extern parse_pgm_inst_t cmd_sensor;
34 extern parse_pgm_inst_t cmd_log;
35 extern parse_pgm_inst_t cmd_log_show;
36 extern parse_pgm_inst_t cmd_log_type;
37 extern parse_pgm_inst_t cmd_stack_space;
38 extern parse_pgm_inst_t cmd_scheduler;
39
40 /* commands_ax12.c */
41 extern parse_pgm_inst_t cmd_baudrate;
42 extern parse_pgm_inst_t cmd_uint16_read;
43 extern parse_pgm_inst_t cmd_uint16_write;
44 extern parse_pgm_inst_t cmd_uint8_read;
45 extern parse_pgm_inst_t cmd_uint8_write;
46
47 /* commands_cs.c */
48 extern parse_pgm_inst_t cmd_gain;
49 extern parse_pgm_inst_t cmd_gain_show;
50 extern parse_pgm_inst_t cmd_speed;
51 extern parse_pgm_inst_t cmd_speed_show;
52 extern parse_pgm_inst_t cmd_derivate_filter;
53 extern parse_pgm_inst_t cmd_derivate_filter_show;
54 extern parse_pgm_inst_t cmd_consign;
55 extern parse_pgm_inst_t cmd_maximum;
56 extern parse_pgm_inst_t cmd_maximum_show;
57 extern parse_pgm_inst_t cmd_quadramp;
58 extern parse_pgm_inst_t cmd_quadramp_show;
59 extern parse_pgm_inst_t cmd_cs_status;
60 extern parse_pgm_inst_t cmd_blocking_i;
61 extern parse_pgm_inst_t cmd_blocking_i_show;
62
63 /* commands_mainboard.c */
64 extern parse_pgm_inst_t cmd_event;
65 extern parse_pgm_inst_t cmd_spi_test;
66 extern parse_pgm_inst_t cmd_opponent;
67 extern parse_pgm_inst_t cmd_opponent_set;
68 extern parse_pgm_inst_t cmd_start;
69 extern parse_pgm_inst_t cmd_interact;
70 extern parse_pgm_inst_t cmd_color;
71 extern parse_pgm_inst_t cmd_rs;
72 extern parse_pgm_inst_t cmd_i2cdebug;
73 extern parse_pgm_inst_t cmd_cobboard_show;
74 extern parse_pgm_inst_t cmd_cobboard_setmode1;
75 extern parse_pgm_inst_t cmd_cobboard_setmode2;
76 extern parse_pgm_inst_t cmd_cobboard_setmode3;
77 extern parse_pgm_inst_t cmd_ballboard_show;
78 extern parse_pgm_inst_t cmd_ballboard_setmode1;
79 extern parse_pgm_inst_t cmd_ballboard_setmode2;
80 extern parse_pgm_inst_t cmd_ballboard_setmode3;
81 extern parse_pgm_inst_t cmd_beacon_start;
82 extern parse_pgm_inst_t cmd_servo_balls;
83 extern parse_pgm_inst_t cmd_clitoid;
84 extern parse_pgm_inst_t cmd_time_monitor;
85 extern parse_pgm_inst_t cmd_strat_event;
86 extern parse_pgm_inst_t cmd_test;
87
88 /* commands_traj.c */
89 extern parse_pgm_inst_t cmd_traj_speed;
90 extern parse_pgm_inst_t cmd_traj_speed_show;
91 extern parse_pgm_inst_t cmd_traj_acc;
92 extern parse_pgm_inst_t cmd_traj_acc_show;
93 extern parse_pgm_inst_t cmd_trajectory;
94 extern parse_pgm_inst_t cmd_trajectory_show;
95 extern parse_pgm_inst_t cmd_circle_coef;
96 extern parse_pgm_inst_t cmd_circle_coef_show;
97 extern parse_pgm_inst_t cmd_rs_gains;
98 extern parse_pgm_inst_t cmd_rs_gains_show;
99 extern parse_pgm_inst_t cmd_track;
100 extern parse_pgm_inst_t cmd_track_show;
101 extern parse_pgm_inst_t cmd_pt_list;
102 extern parse_pgm_inst_t cmd_pt_list_append;
103 extern parse_pgm_inst_t cmd_pt_list_del;
104 extern parse_pgm_inst_t cmd_pt_list_show;
105 extern parse_pgm_inst_t cmd_goto1;
106 extern parse_pgm_inst_t cmd_goto2;
107 extern parse_pgm_inst_t cmd_goto3;
108 extern parse_pgm_inst_t cmd_position;
109 extern parse_pgm_inst_t cmd_position_set;
110 extern parse_pgm_inst_t cmd_strat_db;
111 extern parse_pgm_inst_t cmd_strat_conf;
112 extern parse_pgm_inst_t cmd_strat_conf2;
113 extern parse_pgm_inst_t cmd_strat_conf3;
114 extern parse_pgm_inst_t cmd_strat_conf4;
115 extern parse_pgm_inst_t cmd_subtraj;
116
117 /* in progmem */
118 parse_pgm_ctx_t main_ctx[] = {
119
120         /* commands_gen.c */
121         (parse_pgm_inst_t *)&cmd_reset,
122         (parse_pgm_inst_t *)&cmd_bootloader,
123         (parse_pgm_inst_t *)&cmd_encoders,
124         (parse_pgm_inst_t *)&cmd_pwm,
125         (parse_pgm_inst_t *)&cmd_adc,
126         (parse_pgm_inst_t *)&cmd_sensor,
127         (parse_pgm_inst_t *)&cmd_log,
128         (parse_pgm_inst_t *)&cmd_log_show,
129         (parse_pgm_inst_t *)&cmd_log_type,
130         (parse_pgm_inst_t *)&cmd_stack_space,
131         (parse_pgm_inst_t *)&cmd_scheduler,
132
133         /* commands_ax12.c */
134         (parse_pgm_inst_t *)&cmd_baudrate,
135         (parse_pgm_inst_t *)&cmd_uint16_read,
136         (parse_pgm_inst_t *)&cmd_uint16_write,
137         (parse_pgm_inst_t *)&cmd_uint8_read,
138         (parse_pgm_inst_t *)&cmd_uint8_write,
139
140         /* commands_cs.c */
141         (parse_pgm_inst_t *)&cmd_gain,
142         (parse_pgm_inst_t *)&cmd_gain_show,
143         (parse_pgm_inst_t *)&cmd_speed,
144         (parse_pgm_inst_t *)&cmd_speed_show,
145         (parse_pgm_inst_t *)&cmd_consign,
146         (parse_pgm_inst_t *)&cmd_derivate_filter,
147         (parse_pgm_inst_t *)&cmd_derivate_filter_show,
148         (parse_pgm_inst_t *)&cmd_maximum,
149         (parse_pgm_inst_t *)&cmd_maximum_show,
150         (parse_pgm_inst_t *)&cmd_quadramp,
151         (parse_pgm_inst_t *)&cmd_quadramp_show,
152         (parse_pgm_inst_t *)&cmd_cs_status,
153         (parse_pgm_inst_t *)&cmd_blocking_i,
154         (parse_pgm_inst_t *)&cmd_blocking_i_show,
155
156         /* commands_mainboard.c */
157         (parse_pgm_inst_t *)&cmd_event,
158         (parse_pgm_inst_t *)&cmd_spi_test,
159         (parse_pgm_inst_t *)&cmd_opponent,
160         (parse_pgm_inst_t *)&cmd_opponent_set,
161         (parse_pgm_inst_t *)&cmd_start,
162         (parse_pgm_inst_t *)&cmd_interact,
163         (parse_pgm_inst_t *)&cmd_color,
164         (parse_pgm_inst_t *)&cmd_rs,
165         (parse_pgm_inst_t *)&cmd_i2cdebug,
166         (parse_pgm_inst_t *)&cmd_cobboard_show,
167         (parse_pgm_inst_t *)&cmd_cobboard_setmode1,
168         (parse_pgm_inst_t *)&cmd_cobboard_setmode2,
169         (parse_pgm_inst_t *)&cmd_cobboard_setmode3,
170         (parse_pgm_inst_t *)&cmd_ballboard_show,
171         (parse_pgm_inst_t *)&cmd_ballboard_setmode1,
172         (parse_pgm_inst_t *)&cmd_ballboard_setmode2,
173         (parse_pgm_inst_t *)&cmd_ballboard_setmode3,
174         (parse_pgm_inst_t *)&cmd_servo_balls,
175         (parse_pgm_inst_t *)&cmd_clitoid,
176         (parse_pgm_inst_t *)&cmd_time_monitor,
177         (parse_pgm_inst_t *)&cmd_strat_event,
178         (parse_pgm_inst_t *)&cmd_test,
179
180         /* commands_traj.c */
181         (parse_pgm_inst_t *)&cmd_traj_speed,
182         (parse_pgm_inst_t *)&cmd_traj_speed_show,
183         (parse_pgm_inst_t *)&cmd_traj_acc,
184         (parse_pgm_inst_t *)&cmd_traj_acc_show,
185         (parse_pgm_inst_t *)&cmd_trajectory,
186         (parse_pgm_inst_t *)&cmd_trajectory_show,
187         (parse_pgm_inst_t *)&cmd_circle_coef,
188         (parse_pgm_inst_t *)&cmd_circle_coef_show,
189         (parse_pgm_inst_t *)&cmd_rs_gains,
190         (parse_pgm_inst_t *)&cmd_rs_gains_show,
191         (parse_pgm_inst_t *)&cmd_track,
192         (parse_pgm_inst_t *)&cmd_track_show,
193         (parse_pgm_inst_t *)&cmd_pt_list,
194         (parse_pgm_inst_t *)&cmd_pt_list_append,
195         (parse_pgm_inst_t *)&cmd_pt_list_del,
196         (parse_pgm_inst_t *)&cmd_pt_list_show,
197         (parse_pgm_inst_t *)&cmd_goto1,
198         (parse_pgm_inst_t *)&cmd_goto2,
199         (parse_pgm_inst_t *)&cmd_position,
200         (parse_pgm_inst_t *)&cmd_position_set,
201         (parse_pgm_inst_t *)&cmd_strat_db,
202         (parse_pgm_inst_t *)&cmd_strat_conf,
203         (parse_pgm_inst_t *)&cmd_strat_conf2,
204         (parse_pgm_inst_t *)&cmd_strat_conf3,
205         (parse_pgm_inst_t *)&cmd_subtraj,
206         NULL,
207 };