Rleg  2
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Data Structures | Macros | Functions
encoder_functions.h File Reference

Rev 0 - 18/06/2013 RLEG project - 2013. More...

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
Include dependency graph for encoder_functions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ENC_DATA_STRUCT
 
struct  ENC_DATA_STRUCT::calibrate
 

Macros

#define SUCCESS   1
 
#define FAILURE   -1
 
#define ENCODER_NO_OP   0x00
 
#define ENCODER_RD_POS   0x10
 
#define ENCODER_SET_ZERO_PT   0x70
 
#define ENCODER_EEPROM_WR   0x80
 
#define ENCODER_EEPROM_RD   0x90
 
#define ENCODER_WAIT_RESP   0xA5
 
#define INT_MAX   5
 

Functions

int enc_read_pos (int spi_dev, unsigned short int *data)
 READ POSITION. More...
 
int enc_zero_set (int spi_dev)
 SET ZERO POINT. More...
 
int enc_wait_for_ack (int spi_dev, uint8_t ack, int max_errors)
 send command and delay between reads More...
 

Detailed Description

Rev 0 - 18/06/2013 RLEG project - 2013.

main commmands of the AMT 203 encoder

Author
Claudia Ochoa
Date
2012-2013

Definition in file encoder_functions.h.

Macro Definition Documentation

#define ENCODER_EEPROM_RD   0x90

Definition at line 34 of file encoder_functions.h.

#define ENCODER_EEPROM_WR   0x80

Definition at line 33 of file encoder_functions.h.

Referenced by enc_zero_set().

#define ENCODER_NO_OP   0x00

Definition at line 30 of file encoder_functions.h.

Referenced by enc_read_pos(), and enc_wait_for_ack().

#define ENCODER_RD_POS   0x10

Definition at line 31 of file encoder_functions.h.

Referenced by enc_read_pos().

#define ENCODER_SET_ZERO_PT   0x70

Definition at line 32 of file encoder_functions.h.

Referenced by enc_zero_set().

#define ENCODER_WAIT_RESP   0xA5

Definition at line 37 of file encoder_functions.h.

Referenced by enc_wait_for_ack().

#define FAILURE   -1

Definition at line 27 of file encoder_functions.h.

#define INT_MAX   5

Definition at line 39 of file encoder_functions.h.

Referenced by enc_read_pos(), and enc_zero_set().

#define SUCCESS   1

Definition at line 26 of file encoder_functions.h.