/**
 * @file        encoder.h
 */

/* Define to prevent recursive inclusion **************************************/
#ifndef INC_ENCODER_H
#define INC_ENCODER_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes *******************************************************************/

/* Defines ********************************************************************/
#define ENCODER_MAX         20000
#define ENCODER_OFFSET      5000
#define ENCODER_LOWLIMIT    ENCODER_OFFSET
#define ENCODER_HIGHLIMIT   (ENCODER_MAX-ENCODER_OFFSET)

/* Public Functions ***********************************************************/

/**
 * @brief   Encoder_Handler
 *          This functions must be called from the super-loop. It handles the
 *          total rotations count
 */
void Encoder_Handler(void);
void Encoder_Init(void);
void Encoder_Update(void);
uint16_t Encoder_GetCount(void);
int16_t Encoder_GetRevolutions(void);

/** @} */

#ifdef __cplusplus
}
#endif

#endif /* INC_ENCODER_H */
