summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/top.h
blob: 986035e8d459b89621beb5dc087ddc66dcb07faa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef top_h
#define top_h
/* top.h */
/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
 *
 * Copyright (C) 2009 Nicolas Haller
 *
 * APBTeam:
 *        Web: http://apbteam.org/
 *      Email: team AT apbteam DOT org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * }}} */

#include "asserv.h"

/**
 * Initialize top module.
 */
void
top_init (void);

/**
 * Get the next position to get pucks on the ground.
 * About the @p restart parameter, you need to set to 1 when for example, you
 * have unload some pucks and restart the procedure to get new one.
 * @param position the next position computed.
 * @param restart set it to 1 when you restart a procedure.
 * @return  0 if there is no more position.
 */
uint8_t
top_get_next_position_to_get_puck_on_the_ground (asserv_position_t *position,
						 uint8_t restart);

/**
 * Get the next position to get pucks from the distributor.
 * @param clean_position the position to clean the distributor.
 * @param front_position the position in front of the distributor to fuck it.
 */
void
top_get_next_position_to_get_distributor (asserv_position_t *clean_position,
					  asserv_position_t *front_position);

/**
 * Get the next position to get an unload position.
 * @param position the next unloading position.
 */
void
top_get_next_position_to_unload_puck (asserv_position_t *position);

/**
 * Count number of pucks we have taken during a match.
 */
extern uint8_t top_total_puck_taken;

/**
 * Number of pucks inside the bot.
 */
extern uint8_t top_puck_inside_bot;

#endif /* top_h */