Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
993 - 1
/*****************************************************************************
2
 *   Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net                  *
3
 *   based on the key handling by Peter Dannegger                            *
4
 *     see www.mikrocontroller.net                                           *
5
 *                                                                           *
6
 *   This program is free software; you can redistribute it and/or modify    *
7
 *   it under the terms of the GNU General Public License as published by    *
8
 *   the Free Software Foundation; either version 2 of the License.          *
9
 *                                                                           *
10
 *   This program is distributed in the hope that it will be useful,         *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
13
 *   GNU General Public License for more details.                            *
14
 *                                                                           *
15
 *   You should have received a copy of the GNU General Public License       *
16
 *   along with this program; if not, write to the                           *
17
 *   Free Software Foundation, Inc.,                                         *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
19
 *                                                                           *
20
 *****************************************************************************/
21
 
22
#ifndef _TIMER_H
23
#define _TIMER_H
24
 
25
#define KEY_PIN                 PINA
26
 
27
//#define KEY_ENTER             PA7
28
//#define KEY_ESC               PA6
29
//#define KEY_PLUS              PA5
30
//#define KEY_MINUS             PA4
31
 
32
#define KEY_ENTER               PA4
33
#define KEY_ESC                 PA5
34
#define KEY_PLUS                PA6
35
#define KEY_MINUS               PA7
36
 
37
#define KEY_ALL                 ((1 << KEY_PLUS) | (1 << KEY_MINUS) | (1 << KEY_ENTER) | (1 << KEY_ESC))
38
#define REPEAT_MASK     ((1 << KEY_PLUS) | (1 << KEY_MINUS) | (1 << KEY_ENTER) | (1 << KEY_ESC))        // repeat: MODE
39
 
40
#define REPEAT_START    50      // after 500ms
41
#define REPEAT_NEXT             10      // every 100ms
42
 
43
#define ABO_TIMEOUT 300 // 3 sec
44
extern volatile uint8_t Display_on;
45
 
46
extern volatile uint16_t timer;
47
extern volatile uint16_t abo_timer;
48
 
49
 
50
extern uint16_t minocr_a;
51
extern uint16_t maxocr_a;
52
extern uint16_t minocr_b;
53
extern uint16_t maxocr_b;
54
 
55
 
56
void TIMER0_Init (void);
57
void TIMER1_Init (void);
58
 
59
uint8_t get_key_press (uint8_t key_mask);
60
uint8_t get_key_rpt (uint8_t key_mask);
61
uint8_t get_key_short (uint8_t key_mask);
62
uint8_t get_key_long (uint8_t key_mask);
63
uint8_t get_key_long2 (uint8_t key_mask);
64
uint8_t get_key_long_rpt (uint8_t key_mask);
65
 
66
void set_pwm_a (uint16_t);
67
void set_pwm_b (uint8_t);
68
 
69
#endif