11 #ifndef ENCODER_FUNCTIONS_H 
   12 #define ENCODER_FUNCTIONS_H 
   20 #include <sys/types.h> 
   22 #include <sys/ioctl.h> 
   30 #define ENCODER_NO_OP         0x00 
   31 #define ENCODER_RD_POS        0x10 
   32 #define ENCODER_SET_ZERO_PT   0x70 
   33 #define ENCODER_EEPROM_WR     0x80 
   34 #define ENCODER_EEPROM_RD     0x90 
   37 #define ENCODER_WAIT_RESP     0xA5 
   45 typedef struct enconder_data{
 
int enc_wait_for_ack(int spi_dev, uint8_t ack, int max_errors)
send command and delay between reads 
 
int enc_zero_set(int spi_dev)
SET ZERO POINT. 
 
unsigned short int position
 
unsigned short int position
 
int enc_read_pos(int spi_dev, unsigned short int *data)
READ POSITION.