00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __COMEDI_PULSE_TRAIN_GENERATOR_HPP
00020 #define __COMEDI_PULSE_TRAIN_GENERATOR_HPP
00021
00022
00023 #include <rtt/dev/PulseTrainGeneratorInterface.hpp>
00024 #include "ComediDevice.hpp"
00025 #include <string>
00026 #include <rtt/Time.hpp>
00027
00028 namespace OCL
00029 {
00037 class ComediPulseTrainGenerator :
00038 public RTT::PulseTrainGeneratorInterface
00039 {
00040 public:
00048 ComediPulseTrainGenerator(ComediDevice * cd, unsigned int subd,
00049 const std::string& name);
00050
00057 ComediPulseTrainGenerator(ComediDevice * cd, unsigned int subd);
00058
00059 virtual ~ComediPulseTrainGenerator();
00060
00061
00062 virtual bool pulseWidthSet(RTT::psecs picos);
00063 virtual bool pulsePeriodSet(RTT::psecs picos);
00064 virtual bool start();
00065 virtual bool stop();
00066
00067 protected:
00068
00069 void init();
00071 unsigned int psecs_to_timebase(RTT::psecs picos);
00072
00073 ComediDevice * _myCard;
00074 unsigned int _subDevice;
00075
00076 RTT::psecs _pulse_width;
00077 RTT::psecs _pulse_period;
00078 RTT::psecs _clock_period;
00081 double _smallest_step;
00082 bool _running;
00083 };
00084
00085 };
00086
00087 #endif
00088