vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git] / projects / microb2009 / tests / arm_test / main.h
1 /*  
2  *  Copyright Droids Corporation (2008)
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: main.h,v 1.3 2009-03-15 20:08:51 zer0 Exp $
19  *
20  */
21
22 #define LED1_ON()       sbi(PORTE, 2)
23 #define LED1_OFF()      cbi(PORTE, 2)
24
25 #define LED2_ON()       sbi(PORTE, 3)
26 #define LED2_OFF()      cbi(PORTE, 3)
27
28 #define ARM_MOT_PWM     (&arm.pwm1B)
29 #define SCANNER_MOT_PWM (&arm.pwm1A)
30
31
32 #define ARM_ENC         ((void *)0)
33 #define SCANNER_ENC         ((void *)1)
34
35 #define CS_PERIOD 5000L
36 #define LED_PRIO           170
37 #define TIME_PRIO          160
38 #define CS_PRIO            150
39
40 struct arm {
41 #define CS_ON 1
42         uint8_t flags;
43         struct cs cs_mot;
44         struct pid_filter pid_mot;
45         struct quadramp_filter qr_mot;
46         struct pwm_ng pwm1A;
47         struct pwm_ng pwm1B;
48         struct pwm_ng pwm3C;
49         struct pwm_ng pwm2;
50 };
51
52 #define MAX_SAMPLE (1200L)
53  /* was 1000 */
54
55 extern struct arm arm;
56 extern struct arm scanner;
57
58 extern uint8_t sample_tab[MAX_SAMPLE];
59
60 extern int32_t last_tour_n;
61 extern int32_t last_tour_pos;
62
63 //64*14*4 (+1?)
64 #define SCANNER_STEP_TOUR (3532L)
65
66 extern float offset_a;