altos: Add bit-bang i2c driver
[fw/altos] / src / kernel / ao_flight.h
1 /*
2  * Copyright © 2012 Keith Packard <keithp@keithp.com>
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, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18
19 #ifndef _AO_FLIGHT_H_
20 #define _AO_FLIGHT_H_
21
22
23 /*
24  * ao_flight.c
25  */
26
27 enum ao_flight_state {
28         ao_flight_startup = 0,
29         ao_flight_idle = 1,
30         ao_flight_pad = 2,
31         ao_flight_boost = 3,
32         ao_flight_fast = 4,
33         ao_flight_coast = 5,
34         ao_flight_drogue = 6,
35         ao_flight_main = 7,
36         ao_flight_landed = 8,
37         ao_flight_invalid = 9,
38         ao_flight_test = 10
39 };
40
41 extern enum ao_flight_state     ao_flight_state;
42 extern uint16_t                 ao_boost_tick;
43 extern uint16_t                 ao_launch_tick;
44 extern uint16_t                 ao_motor_number;
45
46 extern uint16_t                 ao_launch_time;
47 extern uint8_t                  ao_flight_force_idle;
48
49 /* Flight thread */
50 void
51 ao_flight(void);
52
53 /* Initialize flight thread */
54 void
55 ao_flight_init(void);
56
57 /*
58  * ao_flight_nano.c
59  */
60
61 void
62 ao_flight_nano_init(void);
63
64 #endif /* _AO_FLIGHT_H_ */