Marco Oehler / Mbed 2 deprecated Lab2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

EncoderCounter Class Reference

EncoderCounter Class Reference

This class implements a driver to read the quadrature encoder counter of the STM32 microcontroller. More...

#include <EncoderCounter.h>

Public Member Functions

 EncoderCounter (PinName a, PinName b)
 Creates and initialises the driver to read the quadrature encoder counter of the STM32 microcontroller.
virtual ~EncoderCounter ()
 Deletes this EncoderCounter object.
void reset ()
 Resets the counter value to zero.
void reset (short offset)
 Resets the counter value to a given offset value.
short read ()
 Reads the quadrature encoder counter value.
 operator short ()
 The empty operator is a shorthand notation of the read() method.

Detailed Description

This class implements a driver to read the quadrature encoder counter of the STM32 microcontroller.

Definition at line 17 of file EncoderCounter.h.


Constructor & Destructor Documentation

EncoderCounter ( PinName  a,
PinName  b 
)

Creates and initialises the driver to read the quadrature encoder counter of the STM32 microcontroller.

Parameters:
athe input pin for the channel A.
bthe input pin for the channel B.

Definition at line 17 of file EncoderCounter.cpp.

~EncoderCounter (  ) [virtual]

Deletes this EncoderCounter object.

Definition at line 147 of file EncoderCounter.cpp.


Member Function Documentation

operator short (  )

The empty operator is a shorthand notation of the read() method.

Definition at line 178 of file EncoderCounter.cpp.

short read (  )

Reads the quadrature encoder counter value.

Returns:
the quadrature encoder counter as a signed 16-bit integer value.

Definition at line 170 of file EncoderCounter.cpp.

void reset (  )

Resets the counter value to zero.

Definition at line 152 of file EncoderCounter.cpp.

void reset ( short  offset )

Resets the counter value to a given offset value.

Parameters:
offsetthe offset value to reset the counter to.

Definition at line 161 of file EncoderCounter.cpp.