BlackLib::BlackCorePWM Class Referenceabstract

Preparation phase of Beaglebone Black, to use PWM. More...

#include <BlackPWM.h>

Inheritance diagram for BlackLib::BlackCorePWM:

Public Member Functions

 BlackCorePWM (pwmName pwm)
 Constructor of BlackCorePWM class. More...
 
virtual ~BlackCorePWM ()
 Destructor of BlackCorePWM class. More...
 
virtual std::string getValue ()=0
 First declaration of this function. More...
 

Protected Member Functions

std::string getPeriodFilePath ()
 Exports pwm period file name to derived class. More...
 
std::string getDutyFilePath ()
 Exports pwm duty file name to derived class. More...
 
std::string getRunFilePath ()
 Exports pwm run file name to derived class. More...
 
std::string getPolarityFilePath ()
 Exports pwm polarity file name to derived class. More...
 
errorCorePWMgetErrorsFromCorePWM ()
 Exports errorCorePWM struct to derived class. More...
 

Private Member Functions

bool loadDeviceTree ()
 Loads PWM overlays to device tree. More...
 
std::string findPwmTestName (pwmName pwm)
 Finds full name of pwm_test. More...
 
- Private Member Functions inherited from BlackLib::BlackCore
 BlackCore ()
 Constructor of BlackCore class. More...
 
virtual ~BlackCore ()
 Destructor of BlackCore class. More...
 
std::string searchDirectoryOcp (BlackCore::ocpSearch searchThis)
 Searches ocp directory to find specified file/directory. More...
 
errorCoregetErrorsFromCore ()
 Exports errorCore struct to derived class. More...
 
std::string getCapeMgrName ()
 Exports capemgr name to derived class. More...
 
std::string getOcpName ()
 Exports ocp name to derived class. More...
 
std::string getSlotsFilePath ()
 Exports slots file path to derived class. More...
 

Private Attributes

errorCorePWMpwmCoreErrors
 is used to hold the errors of BlackCorePWM class More...
 
std::string pwmTestPath
 is used to hold the pwm_test (pwm device driver) path More...
 
pwmName pwmPinName
 is used to hold the selected pwm pin name More...
 

Additional Inherited Members

- Private Types inherited from BlackLib::BlackCore
enum  ocpSearch {
  ADC_helper = 0,
  PWM_P8_13 = 1,
  PWM_P8_19 = 2,
  PWM_P9_14 = 3,
  PWM_P9_16 = 4,
  PWM_P9_21 = 5,
  PWM_P9_22 = 6,
  PWM_P9_42 = 7,
  SPI0 = 8,
  SPI1 = 9
}
 

Detailed Description

Preparation phase of Beaglebone Black, to use PWM.

This class is core of the BlackPWM class. It includes private functions which are doing base processes for using pwms and protected functions which are using for exporting private variables to derived class(es).

Constructor & Destructor Documentation

BlackLib::BlackCorePWM::BlackCorePWM ( pwmName  pwm)

Constructor of BlackCorePWM class.

This function initializes errorCorePWM struct and calls device tree loading and pwm test name finding functions.

See also
BlackCorePWM::loadDeviceTree()
BlackCorePWM::findPwmTestName()
pwmName
BlackLib::BlackCorePWM::~BlackCorePWM ( )
virtual

Destructor of BlackCorePWM class.

This function deletes errorCorePWM struct pointer.

Member Function Documentation

std::string BlackLib::BlackCorePWM::findPwmTestName ( pwmName  pwm)
private

Finds full name of pwm_test.

This function searches "ocp.X" directory to find directory starts with "pwm_test_?_?." by using searchDirectoryOcp() protected function at BlackCore class.

Returns
Full name of pwm_test directory if successfull, else BlackLib::PWM_TEST_NAME_NOT_FOUND string.
See also
BlackCore::searchDirectoryOcp()
std::string BlackLib::BlackCorePWM::getDutyFilePath ( )
protected

Exports pwm duty file name to derived class.

Returns
Pwm duty file name.
errorCorePWM * BlackLib::BlackCorePWM::getErrorsFromCorePWM ( )
protected

Exports errorCorePWM struct to derived class.

Returns
errorCorePWM struct pointer.
std::string BlackLib::BlackCorePWM::getPeriodFilePath ( )
protected

Exports pwm period file name to derived class.

Returns
Pwm period file name.
std::string BlackLib::BlackCorePWM::getPolarityFilePath ( )
protected

Exports pwm polarity file name to derived class.

Returns
Pwm polarity file name.
std::string BlackLib::BlackCorePWM::getRunFilePath ( )
protected

Exports pwm run file name to derived class.

Returns
Pwm run file name.
virtual std::string BlackLib::BlackCorePWM::getValue ( )
pure virtual

First declaration of this function.

Implemented in BlackLib::BlackPWM.

bool BlackLib::BlackCorePWM::loadDeviceTree ( )
privatevirtual

Loads PWM overlays to device tree.

This function loads "am33xx_pwm" and "bone_pwm_P?_?" overlay to device tree. Question marks at the second overlay, represents port and pin numbers of selected PWM output. This overlays perform pinmuxing and generate device drivers.

Returns
True if successful, else false.

Implements BlackLib::BlackCore.

Member Data Documentation

errorCorePWM* BlackLib::BlackCorePWM::pwmCoreErrors
private

is used to hold the errors of BlackCorePWM class

pwmName BlackLib::BlackCorePWM::pwmPinName
private

is used to hold the selected pwm pin name

std::string BlackLib::BlackCorePWM::pwmTestPath
private

is used to hold the pwm_test (pwm device driver) path


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