5d49e785077659a0f2afe80564366305e7e989f0
[aversive.git] / projects / microb2010 / mainboard / 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_beacon_start;
78 extern parse_pgm_inst_t cmd_test;
79
80 /* commands_traj.c */
81 extern parse_pgm_inst_t cmd_traj_speed;
82 extern parse_pgm_inst_t cmd_traj_speed_show;
83 extern parse_pgm_inst_t cmd_trajectory;
84 extern parse_pgm_inst_t cmd_trajectory_show;
85 extern parse_pgm_inst_t cmd_circle_coef;
86 extern parse_pgm_inst_t cmd_circle_coef_show;
87 extern parse_pgm_inst_t cmd_rs_gains;
88 extern parse_pgm_inst_t cmd_rs_gains_show;
89 extern parse_pgm_inst_t cmd_track;
90 extern parse_pgm_inst_t cmd_track_show;
91 extern parse_pgm_inst_t cmd_pt_list;
92 extern parse_pgm_inst_t cmd_pt_list_append;
93 extern parse_pgm_inst_t cmd_pt_list_del;
94 extern parse_pgm_inst_t cmd_pt_list_show;
95 extern parse_pgm_inst_t cmd_goto1;
96 extern parse_pgm_inst_t cmd_goto2;
97 extern parse_pgm_inst_t cmd_goto3;
98 extern parse_pgm_inst_t cmd_position;
99 extern parse_pgm_inst_t cmd_position_set;
100 extern parse_pgm_inst_t cmd_strat_infos;
101 extern parse_pgm_inst_t cmd_strat_conf;
102 extern parse_pgm_inst_t cmd_strat_conf2;
103 extern parse_pgm_inst_t cmd_strat_conf3;
104 extern parse_pgm_inst_t cmd_strat_conf4;
105 extern parse_pgm_inst_t cmd_subtraj;
106
107 /* in progmem */
108 parse_pgm_ctx_t main_ctx[] = {
109
110         /* commands_gen.c */
111         (parse_pgm_inst_t *)&cmd_reset,
112         (parse_pgm_inst_t *)&cmd_bootloader,
113         (parse_pgm_inst_t *)&cmd_encoders,
114         (parse_pgm_inst_t *)&cmd_pwm,
115         (parse_pgm_inst_t *)&cmd_adc,
116         (parse_pgm_inst_t *)&cmd_sensor,
117         (parse_pgm_inst_t *)&cmd_log,
118         (parse_pgm_inst_t *)&cmd_log_show,
119         (parse_pgm_inst_t *)&cmd_log_type,
120         (parse_pgm_inst_t *)&cmd_stack_space,
121         (parse_pgm_inst_t *)&cmd_scheduler,
122
123         /* commands_ax12.c */
124         (parse_pgm_inst_t *)&cmd_baudrate,
125         (parse_pgm_inst_t *)&cmd_uint16_read,
126         (parse_pgm_inst_t *)&cmd_uint16_write,
127         (parse_pgm_inst_t *)&cmd_uint8_read,
128         (parse_pgm_inst_t *)&cmd_uint8_write,
129
130         /* commands_cs.c */
131         (parse_pgm_inst_t *)&cmd_gain,
132         (parse_pgm_inst_t *)&cmd_gain_show,
133         (parse_pgm_inst_t *)&cmd_speed,
134         (parse_pgm_inst_t *)&cmd_speed_show,
135         (parse_pgm_inst_t *)&cmd_consign,
136         (parse_pgm_inst_t *)&cmd_derivate_filter,
137         (parse_pgm_inst_t *)&cmd_derivate_filter_show,
138         (parse_pgm_inst_t *)&cmd_maximum,
139         (parse_pgm_inst_t *)&cmd_maximum_show,
140         (parse_pgm_inst_t *)&cmd_quadramp,
141         (parse_pgm_inst_t *)&cmd_quadramp_show,
142         (parse_pgm_inst_t *)&cmd_cs_status,
143         (parse_pgm_inst_t *)&cmd_blocking_i,
144         (parse_pgm_inst_t *)&cmd_blocking_i_show,
145
146         /* commands_mainboard.c */
147         (parse_pgm_inst_t *)&cmd_event,
148         (parse_pgm_inst_t *)&cmd_spi_test,
149         (parse_pgm_inst_t *)&cmd_opponent,
150         (parse_pgm_inst_t *)&cmd_opponent_set,
151         (parse_pgm_inst_t *)&cmd_start,
152         (parse_pgm_inst_t *)&cmd_interact,
153         (parse_pgm_inst_t *)&cmd_color,
154         (parse_pgm_inst_t *)&cmd_rs,
155         (parse_pgm_inst_t *)&cmd_i2cdebug,
156         (parse_pgm_inst_t *)&cmd_cobboard_show,
157         (parse_pgm_inst_t *)&cmd_cobboard_setmode1,
158         (parse_pgm_inst_t *)&cmd_cobboard_setmode2,
159         (parse_pgm_inst_t *)&cmd_cobboard_setmode3,
160         (parse_pgm_inst_t *)&cmd_test,
161
162         /* commands_traj.c */
163         (parse_pgm_inst_t *)&cmd_traj_speed,
164         (parse_pgm_inst_t *)&cmd_traj_speed_show,
165         (parse_pgm_inst_t *)&cmd_trajectory,
166         (parse_pgm_inst_t *)&cmd_trajectory_show,
167         (parse_pgm_inst_t *)&cmd_circle_coef,
168         (parse_pgm_inst_t *)&cmd_circle_coef_show,
169         (parse_pgm_inst_t *)&cmd_rs_gains,
170         (parse_pgm_inst_t *)&cmd_rs_gains_show,
171         (parse_pgm_inst_t *)&cmd_track,
172         (parse_pgm_inst_t *)&cmd_track_show,
173         (parse_pgm_inst_t *)&cmd_pt_list,
174         (parse_pgm_inst_t *)&cmd_pt_list_append,
175         (parse_pgm_inst_t *)&cmd_pt_list_del,
176         (parse_pgm_inst_t *)&cmd_pt_list_show,
177         (parse_pgm_inst_t *)&cmd_goto1,
178         (parse_pgm_inst_t *)&cmd_goto2,
179         (parse_pgm_inst_t *)&cmd_position,
180         (parse_pgm_inst_t *)&cmd_position_set,
181         (parse_pgm_inst_t *)&cmd_strat_infos,
182         (parse_pgm_inst_t *)&cmd_strat_conf,
183         (parse_pgm_inst_t *)&cmd_strat_conf2,
184         (parse_pgm_inst_t *)&cmd_strat_conf3,
185         (parse_pgm_inst_t *)&cmd_subtraj,
186         NULL,
187 };