root / branches / encoders / code / projects / libdragonfly / encoders.h @ 749
History | View | Annotate | Download (624 Bytes)
1 |
#ifndef __ENCODERS_H__
|
---|---|
2 |
#define __ENCODERS_H__
|
3 |
|
4 |
|
5 |
#define RIGHT 1 |
6 |
#ifndef LEFT
|
7 |
#define LEFT 0 |
8 |
#endif
|
9 |
#ifndef LEFT
|
10 |
#define LEFT 0 |
11 |
#endif
|
12 |
#define INVALID 1024 |
13 |
#define MAGNET_FAILURE 1025 |
14 |
|
15 |
//Data invalid flags (hardware failure):
|
16 |
#define OCF _BV(4) |
17 |
#define COF _BV(3) |
18 |
|
19 |
//Data invlalid alarm (May be invalid):
|
20 |
#define LIN _BV(2) |
21 |
|
22 |
#define MagINCn _BV(1) |
23 |
#define MagDECn _BV(0) |
24 |
|
25 |
#define BUFFER_SIZE 23 |
26 |
|
27 |
void encoders_init(void); |
28 |
int encoder_read(char encoder); |
29 |
char encoder_direction(char encoder); |
30 |
|
31 |
int encoder_get_dx(char encoder); |
32 |
void encoder_rst_dx(char encoder); |
33 |
int encoder_get_tc(void); |
34 |
void encoder_rst_tc(void); |
35 |
|
36 |
#endif
|