summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv/src/asserv/traj.h
blob: 8f9c28ac3d058d98d6886d03fd77d4a8dc852c1d (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
#ifndef traj_h
#define traj_h
/* traj.h */
/* asserv - Position & speed motor control on AVR. {{{
 *
 * Copyright (C) 2008 Nicolas Schodet
 *
 * 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.
 *
 * }}} */

#define TRAJ_BACKWARD 1
#define TRAJ_REVERT_OK 2

extern uint8_t traj_mode;
extern int16_t traj_eps;
extern int16_t traj_aeps;
extern uint16_t traj_angle_limit;

void
traj_init (void);

void
traj_update (void);

void
traj_angle_offset_start (int32_t angle, uint8_t seq);

void
traj_ftw_start (uint8_t backward, uint8_t seq);

void
traj_gtd_start (uint8_t seq);

void
traj_goto_start (uint32_t x, uint32_t y, uint8_t backward, uint8_t seq);

void
traj_goto_angle_start (uint32_t a, uint8_t seq);

void
traj_goto_xya_start (uint32_t x, uint32_t y, uint32_t a, uint8_t backward,
		     uint8_t seq);

void
traj_set_angle_limit (uint16_t a);

#endif /* traj_h */