Initial release
This commit is contained in:
30
Inc/DS_Encoder.h
Normal file
30
Inc/DS_Encoder.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef DS_ENCODER_H
|
||||
#define DS_ENCODER_H
|
||||
|
||||
#ifdef STM32G030xx
|
||||
#include "stm32g0xx_hal.h"
|
||||
#endif
|
||||
|
||||
#ifdef STM32F030xx
|
||||
#include "stm32f0xx_hal.h"
|
||||
#endif
|
||||
|
||||
typedef struct DS_Encoder
|
||||
{
|
||||
GPIO_TypeDef *PortEncSignal1, *PortEncSignal2;
|
||||
uint16_t PinEncSignal1, PinEncSignal2;
|
||||
int8_t State;
|
||||
int8_t Direction;
|
||||
uint32_t PrevTick;
|
||||
|
||||
uint8_t ValueSignal1, ValueSignal2;
|
||||
}DS_Encoder;
|
||||
|
||||
|
||||
void DS_EncoderInit(DS_Encoder *Encoder, GPIO_TypeDef* PortEncSignal1, uint16_t PinEncSignal1, GPIO_TypeDef* PortEncSignal2, uint16_t PinEncSignal2);
|
||||
|
||||
void DS_EncoderUpdate(DS_Encoder *Encoder);
|
||||
|
||||
int8_t DS_EncoderGetState(DS_Encoder *Encoder);
|
||||
|
||||
#endif //DS_ENCODER_H
|
||||
Reference in New Issue
Block a user