QuadroCopter  0.1.4
quadro::pwm::pwmDevice Class Reference

#include <pwmDevice.h>

Inheritance diagram for quadro::pwm::pwmDevice:
quadro::IDevice quadro::pwm::pwmOverlay quadro::pwm::motors quadro::pwm::dji_2212

Public Types

enum  valType {
  Run, Duty, Period, Polarity,
  Power_Control, Power_RunTime_Active, Power_RunTime_Suspended
}
 

Public Member Functions

 pwmDevice ()
 
 pwmDevice (pinBlocks _block, PWMPins _pin) throw ( pwmSetupException& )
 
long get (valType _vt)
 
void set (valType _vt, long _val)
 
void setPinNum (PWMPins _pin)
 
void setBlockNum (pinBlocks _block)
 
- Public Member Functions inherited from quadro::IDevice
virtual ~IDevice ()
 

Public Attributes

pinBlocks blockNum
 stores the PWM device block num More...
 
PWMPins pinNum
 stores the PWM device pin num More...
 
string powerControlStr
 stores the current power setting string More...
 

Detailed Description

Base class for PWM devices IDevice, pwmOverlay

Member Enumeration Documentation

This is a list of types allowed when accessing PWM Values.

Enumerator
Run 

Run Value Type.

Duty 

Duty Value Type.

Period 

Period Value Type.

Polarity 

Polarity Value Type.

Power_Control 

Power_Control Value Type.

Power_RunTime_Active 

Power_RunTime_Active Value Type.

Power_RunTime_Suspended 

Power_RunTime_Suspended Value Type.

60  {
61  Run,
62  Duty,
63  Period,
64  Polarity,
68  };
Power_Control Value Type.
Definition: pwmDevice.h:65
Polarity Value Type.
Definition: pwmDevice.h:64
Power_RunTime_Active Value Type.
Definition: pwmDevice.h:66
Run Value Type.
Definition: pwmDevice.h:61
Period Value Type.
Definition: pwmDevice.h:63
Power_RunTime_Suspended Value Type.
Definition: pwmDevice.h:67
Duty Value Type.
Definition: pwmDevice.h:62

Constructor & Destructor Documentation

quadro::pwm::pwmDevice::pwmDevice ( )
inline

Base class for PWM devices IDevice, pwmOverlay

46 { };
pwmDevice::pwmDevice ( pinBlocks  _block,
PWMPins  _pin 
)
throw (pwmSetupException &
)

Alternative constructor, setting the pins on setup.

Exceptions
pwmSetupException
Parameters
pinBlocks_block
PWNPins_pin
23 {
24 
25  this->setBlockNum( _block );
26  this->setPinNum( _pin );
27 
28  if ( this->settings.overlayLoaded ) {
29  this->_pinOverlay = new pinOverlay( this->blockNum, this->pinNum );
30 
31  if ( this->_pinOverlay->settings.overlayLoaded )
32  this->setFilePaths();
33  }
34 
35 }
bool overlayLoaded
overlay Loaded switch
Definition: pwmOverlay.h:47
struct quadro::pwm::pwmOverlay::overlaySettings settings
struct quadro::overlays::pinOverlay::overlaySettings settings
Definition: pinOverlay.h:32
PWMPins pinNum
stores the PWM device pin num
Definition: pwmDevice.h:71
void setPinNum(PWMPins _pin)
Definition: pwmDevice.cpp:165
void setBlockNum(pinBlocks _block)
Definition: pwmDevice.cpp:167
pinBlocks blockNum
stores the PWM device block num
Definition: pwmDevice.h:70
bool overlayLoaded
Definition: pinOverlay.h:42

Member Function Documentation

long pwmDevice::get ( valType  _vt)

Use this method to get a pwm value as specified from valType

Parameters
_vt
Returns
109 { return this->getCurrentReading( _vt ); }
void pwmDevice::set ( valType  _vt,
long  _val 
)

Use this method to set a pwm value as specified by valType

Parameters
_vt
_val
111 { this->writeToDevice( _vt, _val ); }
void pwmDevice::setBlockNum ( pinBlocks  _block)

Sets the pwm block number - on the beaglebone black this will be 8 or 9 only

Parameters
pinBlocks_block
167 { this->blockNum = _block; }
pinBlocks blockNum
stores the PWM device block num
Definition: pwmDevice.h:70
void pwmDevice::setPinNum ( PWMPins  _pin)

Set PWM Pin num from available PWMPins

Parameters
_pin
165 { this->pinNum = _pin; }
PWMPins pinNum
stores the PWM device pin num
Definition: pwmDevice.h:71

Member Data Documentation

pinBlocks quadro::pwm::pwmDevice::blockNum

stores the PWM device block num

PWMPins quadro::pwm::pwmDevice::pinNum

stores the PWM device pin num

string quadro::pwm::pwmDevice::powerControlStr

stores the current power setting string


The documentation for this class was generated from the following files: