◆ PULSE_TYPE
This enumeration sets up the pin to either be an input or an output pin.
◆ PulsedGPIOPin()
| 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 |
|
) |
| |
This will setup a GPIO pin to be pulsed.
- Parameters
-
| number | This is the GPIO pin that is to be pulsed. |
| threadName | This si the name of the thread for the pin. |
| period | This is the period of the task that is to cause a pulse. |
| type | This is the type of the pulse, either One Shot, which fires once, or COntinuous, which will have a given pulse every period units of time. |
| dir | This si the direction for the pin - out for it to be meaningful. |
| val | This is the default pin state value, which tends to be low. |
◆ delayedToggleAndSleep()
This method will cause a sleep to occur and then delay after that period of time.
- Parameters
-
◆ setpulseDuration()
| void PulsedGPIOPin::setpulseDuration |
( |
int |
duration | ) |
|
|
virtual |
This method will set the pulse duration, or nhow long the pulse should be on.
- Parameters
-
| duration | This is the time on. |
◆ setValue()
This method will drive an output pin to the appropriate value.
- Parameters
-
| This | is the value that is to be written to the pin. |
◆ stopThreadExecution()
| void PulsedGPIOPin::stopThreadExecution |
( |
| ) |
|
|
virtual |
this method will stop the thread and its execution. In the case of this particular class, it will also shutdown the network socket.
Reimplemented from SWE4211RPi::RunnableClass.
◆ taskMethod()
| void PulsedGPIOPin::taskMethod |
( |
| ) |
|
|
virtual |
◆ initialValue
The initial value for the GPIO pin.
◆ pulseDuration
| int SWE4211RPi::PulsedGPIOPin::pulseDuration = 0 |
|
private |
The duration of each pulse.
◆ type
This defines the type of the pulse.
The documentation for this class was generated from the following files:
- /media/sf_lwshare/20262027SWE4211AllLabSolutions/Lab5/samplesolution/PiCode/src/gpio/provided/PulsedGPIOPin.h
- /media/sf_lwshare/20262027SWE4211AllLabSolutions/Lab5/samplesolution/PiCode/src/gpio/provided/PulsedGPIOPin.cpp