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