heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
timer.h
Go to the documentation of this file.
1 #ifndef __TIMER_H__
2 #define __TIMER_H__
3 
4 #include "types.h"
8 #define T0_TOP 255
9 
12 #define T0_RELOAD 0xb1
13 
16 #define T0_INC20 25 //78
17 
20 #define IV_1S 1202 //50
21 
24 #define BTN_DN (PINB & _BV(PINB2)) //PINB.2
25 
28 #define BTN_UP (PINB & _BV(PINB1)) //PINB.1
29 
32 #define DEBOUNCED_S 130//10
33 
36 #define DEBOUNCED_L 8 * DEBOUNCED_S
37 
40 #define BTN_TEMP_DELTA 100
41 
44 #define ENG_RUN_CW PORTB |= _BV(PB4)
45 
48 #define ENG_STOP_CW PORTB &= ~_BV(PB4)
49 
52 #define ENG_RUN_CCW PORTB |= _BV(PB3)
53 
56 #define ENG_STOP_CCW PORTB &= ~_BV(PB3)
57 
60 #define OVM_MSR 8
61 
62 
63 void TimerInit(void);
64 ISR(TIMER0_COMPA_vect);
66 UCHAR GetTenthSec(void);
67 UCHAR gMov(void);
68 void sMov(UCHAR mov);
69 
70 #endif
71 
BTN_CODE
Definition: types.h:299
UCHAR GetTenthSec(void)
interface to get the global tenth seconds
Definition: timer.c:192
void sMov(UCHAR mov)
set minute overflow counter
Definition: timer.c:208
#define UCHAR
Definition: types.h:73
ISR(TIMER0_COMPA_vect)
compare match interrupt service for OCR0A
Definition: timer.c:72
void TimerInit(void)
initialize timer resource period: 32µs
Definition: timer.c:38
UCHAR gMov(void)
return minute overflow counter
Definition: timer.c:200
BTN_CODE DecodeButton(void)
identify whether a (and which) button is pressed or not
Definition: timer.c:119