Algorithmus

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EncoderCounter.h Source File

EncoderCounter.h

00001 /*
00002  * EncoderCounter.h
00003  * Copyright (c) 2018, ZHAW
00004  * All rights reserved.
00005  */
00006 
00007 #ifndef ENCODER_COUNTER_H_
00008 #define ENCODER_COUNTER_H_
00009 
00010 #include <cstdlib>
00011 #include <mbed.h>
00012 
00013 /**
00014  * This class implements a driver to read the quadrature
00015  * encoder counter of the STM32 microcontroller.
00016  */
00017 class EncoderCounter {
00018     
00019     public:
00020         
00021                     EncoderCounter(PinName a, PinName b);
00022         virtual     ~EncoderCounter();
00023         void        reset();
00024         void        reset(short offset);
00025         short       read();
00026                     operator short();
00027         
00028     private:
00029         
00030         TIM_TypeDef*    TIM;
00031 };
00032 
00033 #endif /* ENCODER_COUNTER_H_ */