/*! \file encoder.c \brief Quadrature Encoder reader/driver. */ //***************************************************************************** // // File Name : 'encoder.c' // Title : Quadrature Encoder reader/driver // Author : Pascal Stang - Copyright (C) 2003-2004 // Created : 2003.01.26 // Revised : 2004.06.25 // Version : 0.3 // Target MCU : Atmel AVR Series // Editor Tabs : 4 // // NOTE: This code is currently below version 1.0, and therefore is considered // to be lacking in some functionality or documentation, or may not be fully // tested. Nonetheless, you can expect most functions to work. // // This code is distributed under the GNU Public License // which can be found at http://www.gnu.org/licenses/gpl.txt // //***************************************************************************** #ifndef WIN32 #include #include #include #endif #include "global.h" #include "encoder.h" // Program ROM constants // Global variables volatile EncoderStateType EncoderState[NUM_ENCODERS]; // Functions // encoderInit() initializes hardware and encoder position readings // Run this init routine once before using any other encoder functions. void encoderInit(void) { u08 i; // initialize/clear encoder data for(i=0; i