projet_voilier/keil_project/Services/IncrEncoder.h
2020-11-15 18:21:34 +01:00

33 lines
1.1 KiB
C

/**
******************************************************************************
* @file IncrEncoder.h
* @author CAVAILLES, Kevin and GÜLDENSTEIN, Jasper
* @brief Service for reading the incremental encoder.
******************************************************************************
*/
#ifndef INCR_ENCODER_H
#define INCR_ENCODER_H
/**
* @brief Initialziation function for the RF_OUTPUT module.
* Peripherals used: TIM3, EXTI
* Pins used: PA5 (incremental encoder index, interrupt)
* PA6 (incremental encoder channel a, TIM3 channel 1)
* PA7 (incremental encoder channel b, TIM3 channel 2)
*/
void INCR_ENCODER_Init(void);
/**
* @brief Indicates whether the index has been passed at least once.
* If this is not the case, the reading is not absolute.
* @retval state (0 or 1)
*/
int INCR_ENCODER_IsAbsolute(void);
/**
* @brief Returns the angle reading of the incremental encoder
* @retval -180 to 180 where 0 is the incremental encoder pointing towards the back of the boat
*/
float INCR_ENCODER_GetAngle(void);
#endif