00001
00018 #ifndef __ENCODERS_H__
00019 #define __ENCODERS_H__
00020
00021
00022 #ifndef LEFT
00023
00024 #define LEFT 0
00025 #endif
00026 #ifndef RIGHT
00027
00028 #define RIGHT 1
00029 #endif
00030
00032 #define ENCODER_MAGNET_FAILURE 1025
00033
00034 #define ENCODER_MISALIGNED 1027
00035
00036 #define ENCODER_DATA_NOT_READY 1026
00037
00039 #define ENCODER_DELAY 20
00040
00041
00042 #define OCF _BV(4)
00043 #define COF _BV(3)
00044
00045
00046 #define LIN _BV(2)
00047
00048 #define MagINCn _BV(1)
00049 #define MagDECn _BV(0)
00050
00052 #define BUFFER_SIZE 23
00053
00055 void encoders_init(void);
00057 int encoder_read(char encoder);
00058
00060 int encoder_get_dx(char encoder);
00062 void encoder_rst_dx(char encoder);
00064 int encoder_get_tc(void);
00066 void encoder_rst_tc(void);
00067
00069 void encoder_wait( int nReadings );
00070
00072
00073 #endif