Added encoder operation via timer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef DS_ENCODER_H
|
||||
#define DS_ENCODER_H
|
||||
#ifndef ENCODER_H
|
||||
#define ENCODER_H
|
||||
|
||||
#ifdef STM32G030xx
|
||||
#include "stm32g0xx_hal.h"
|
||||
@@ -18,8 +18,10 @@ typedef struct DS_Encoder
|
||||
uint32_t PrevTick;
|
||||
|
||||
uint8_t ValueSignal1, ValueSignal2;
|
||||
TIM_HandleTypeDef *hTim;
|
||||
}DS_Encoder;
|
||||
|
||||
void DS_EncoderInitTim(DS_Encoder *Encoder, TIM_HandleTypeDef *hTim);
|
||||
|
||||
void DS_EncoderInit(DS_Encoder *Encoder, GPIO_TypeDef* PortEncSignal1, uint16_t PinEncSignal1, GPIO_TypeDef* PortEncSignal2, uint16_t PinEncSignal2);
|
||||
|
||||
@@ -27,4 +29,4 @@ void DS_EncoderUpdate(DS_Encoder *Encoder);
|
||||
|
||||
int8_t DS_EncoderGetState(DS_Encoder *Encoder);
|
||||
|
||||
#endif //DS_ENCODER_H
|
||||
#endif //ENCODER_H
|
||||
Reference in New Issue
Block a user