Initial commit
This commit is contained in:
26
Core/Inc/Encoder.h
Normal file
26
Core/Inc/Encoder.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef ENCODER_H
|
||||
#define ENCODER_H
|
||||
|
||||
#include "stm32g0xx_hal.h"
|
||||
|
||||
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 *PortSignal1, uint16_t PinSignal1, GPIO_TypeDef *PortSignal2, uint16_t PinSignal2);
|
||||
|
||||
void DS_EncoderUpdate(DS_Encoder *Encoder);
|
||||
|
||||
int8_t DS_EncoderGetState(DS_Encoder *Encoder);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user