|
PiImageStreamer
|
A continuously pulsed GPIO pin whose pulse width is set as a duty cycle. More...
#include <PWMGPIOPin.h>


Public Member Functions | |
| PWMGPIOPin (int number, std::string threadName, uint32_t period) | |
| virtual | ~PWMGPIOPin () |
| void | setDutyCycle (int dc) |
Public Member Functions inherited from SWE4211RPi::PulsedGPIOPin | |
| PulsedGPIOPin (int number, std::string threadName, uint32_t period, PULSE_TYPE type=CONTINUOUS, GPIO::DIRECTION dir=GPIO::GPIO_OUT, GPIO::VALUE val=GPIO::GPIO_LOW) | |
| virtual | ~PulsedGPIOPin () |
| virtual void | setValue (GPIO::VALUE value) |
| virtual void | setpulseDuration (int duration) |
| virtual void | taskMethod () |
| void | stopThreadExecution () |
Public Member Functions inherited from SWE4211RPi::PeriodicTask | |
| PeriodicTask (std::string threadName, uint32_t period, int priority=1) | |
| virtual | ~PeriodicTask () |
| virtual void | setTaskPeriod (uint32_t period) final |
| virtual uint32_t | getTaskPeriod () final |
| void | run () final |
| virtual void | printInformation () |
| virtual double | getCPUUsageInfo () |
| virtual void | resetThreadDiagnostics () |
Public Member Functions inherited from SWE4211RPi::RunnableClass | |
| RunnableClass (std::string threadName, int priority=0) | |
| virtual | ~RunnableClass () |
| virtual pid_t | getThreadID () |
| virtual void | start () final |
| virtual void | setPriority (int priority) final |
| virtual int | getPriority () final |
| virtual bool | isShutdown () final |
| virtual bool | isStarted () final |
| virtual void | waitForShutdown () |
Private Attributes | |
| int | dutyCycle |
Additional Inherited Members | |
Public Types inherited from SWE4211RPi::PulsedGPIOPin | |
| enum | PULSE_TYPE { ONE_SHOT , CONTINUOUS } |
Static Public Member Functions inherited from SWE4211RPi::RunnableClass | |
| static void | printThreads () |
| static void | resetAllThreadInformation () |
Protected Member Functions inherited from SWE4211RPi::PeriodicTask | |
| virtual void | startChildRunnables () final |
| virtual void | stopChildRunnables () final |
| virtual void | startChildTasks () |
| virtual void | stopChildTasks () |
Protected Attributes inherited from SWE4211RPi::PeriodicTask | |
| uint32_t | taskPeriod = 100000 |
Protected Attributes inherited from SWE4211RPi::RunnableClass | |
| std::thread * | myThread = NULL |
| pthread_t | executingThread = 0 |
| pid_t | myOSThreadID = 0 |
| std::string | myName |
| std::atomic< bool > | keepGoing {true} |
| std::atomic< bool > | runCompleted {false} |
| std::atomic< bool > | runStarted {false} |
| int | priority = -1 |
Static Protected Attributes inherited from SWE4211RPi::RunnableClass | |
| static std::list< RunnableClass * > | runningThreads |
A continuously pulsed GPIO pin whose pulse width is set as a duty cycle.
| PWMGPIOPin::PWMGPIOPin | ( | int | number, |
| std::string | threadName, | ||
| uint32_t | period | ||
| ) |
This method will instantiate a new instance of this class.
| number | This is the GPIO pin that is to be pulsed. |
| threadName | This is the name of the thread for this PIN. |
| period | This is the period for the PWM signal, in microseconds. |

|
virtual |
This is the destructor for the class.
This is the destructor for the class. There is nothing to clean up.
| void PWMGPIOPin::setDutyCycle | ( | int | dc | ) |
This method will set the duty cycle.
| dc | This is the duty cycle in .1% increments. Must be between 0 and 1000 or no change will occur. |
1.0 If the duty cycle value is in range.
1.1.0 Set the internal value.
1.2.0 Calculate the pulse duration as the duty cycle * taskPeriod / 1000, in microseconds.
1.3.0 Set the pulse duration.


|
private |
This is the duty cycle for the given pin. The value can range between 0 and 1000.