22#ifndef _RotationSensor_H_
23#define _RotationSensor_H_
29#if defined(CONF_DSENSOR) && defined(CONF_DSENSOR_ROTATION)
58#ifdef CONF_DSENSOR_VELOCITY
60 rvelocity((port ==
S1) ? VELOCITY_1 :
61 (port ==
S2) ? VELOCITY_2 :
97#ifdef CONF_DSENSOR_VELOCITY
102 int velocity()
const {
return rvelocity;}
110#ifdef CONF_DSENSOR_VELOCITY
114 volatile int& rvelocity;
119#warning Enable CONF_DSENSOR && CONF_DSENSOR_ROTATION to use RotationSensor.H
C++ Sensor Class Interface.
Rotation-sensor interface (active mode).
~RotationSensor()
Destroy this instance.
void on() const
turn on rotation tracking
void pos(int position) const
set the current absolute postion
int pos() const
get the current absolute postion
void off() const
turn off rotation tracking
RotationSensor(const Port port, int position=0)
Create an instance of an active rotation sensor which is attached at {port}.
volatile int & rsensor
the raw sensor value
volatile unsigned int & sensor
The address of our sensor value.
Port
List of sensor identifiers (IDs).
kernel configuration file
#define ROTATION_3
rotation sensor on input 3
void ds_rotation_set(volatile unsigned *sensor, int pos)
set rotation to an absolute value
void ds_rotation_off(volatile unsigned *sensor)
stop tracking rotation sensor
#define ROTATION_1
rotation sensor on input 1
void ds_rotation_on(volatile unsigned *sensor)
start tracking rotation sensor
#define ROTATION_2
rotation sensor on input 2