/*********************************************************************** File: jogdial.h Description: header file for one encoder handling Usage: include this file in any source file where you want to use encoder’s position Notice: function check_jogdial() should be called each 1 ms to enable proper speed detection and reaction time. In case of other timing please recalculate the constants speed1treshold and speed2treshold in the file jogdial.c! ***********************************************************************/ #ifndef _JOGDIAL #define _JOGDIAL #include "datatypes.h" /* Function check_jogdial() is the main state machine based handler. It is necessary to call it every 1 ms to ensure proper timings and accurate response time (see Notice in the file header). The result of encoder reading-out is available by calling jogdial_value() function. It can be set for any new value by function jogdial_set() and reset by software as well */ void check_jogdial( void ); /* Function jogdial_value() returns actual absolute position of the encoder */ u16 jogdial_value( void ); /* returns value relative to last reading */ int jogdial_relative( void ); /* Function set_jogdial( u16 new_value ) sets new_value as actual absolute position of the encoder */ void set_jogdial( u16 new_value ); /* Function reset_jogdial() sets encoder’s absolute position to zero */ void reset_jogdial( void ); /************************* End of file: jogdial.h ***************************/ #endif