|
ELEC-C7222
Libraries for ELEC C7222 Course Work
|
GPIO output-only wrapper with output configuration and drive strength. More...
#include <gpio.hpp>


Classes | |
| struct | Config |
| Configuration structure for output GPIO setup. More... | |
Public Member Functions | |
| GpioOut (uint32_t pin) | |
| Create a GPIO output with default configuration. | |
| virtual | ~GpioOut () |
| Destructor. | |
| GpioOut (uint32_t pin, const Config &config) | |
| Create a GPIO output with the given configuration. | |
| void | Configure (const Config &config) |
| Apply a new configuration. | |
| void | Write (bool value) |
| Write an output value. | |
| void | Toggle () |
| Toggle the pin output. | |
| uint32_t | GetPin () const |
| Return the GPIO number. | |
| Config | GetConfig () const |
| Return the cached configuration. | |
Public Member Functions inherited from c7222::NonCopyable | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
| NonCopyable (NonCopyable &&)=default | |
| NonCopyable & | operator= (NonCopyable &&)=default |
Public Member Functions inherited from c7222::NonMovable | |
| NonMovable (const NonMovable &)=default | |
| NonMovable & | operator= (const NonMovable &)=default |
| NonMovable (NonMovable &&)=delete | |
| NonMovable & | operator= (NonMovable &&)=delete |
Protected Member Functions | |
| void | ApplyConfig () |
| Apply internal configuration to the hardware. | |
Protected Member Functions inherited from c7222::NonCopyableNonMovable | |
| NonCopyableNonMovable ()=default | |
| ~NonCopyableNonMovable ()=default | |
Protected Member Functions inherited from c7222::NonCopyable | |
| NonCopyable ()=default | |
| ~NonCopyable ()=default | |
Protected Member Functions inherited from c7222::NonMovable | |
| NonMovable ()=default | |
| ~NonMovable ()=default | |
Protected Attributes | |
| uint32_t | pin_ |
| GPIO pin number managed by this instance. | |
| Config | config_ |
| Cached configuration used to (re)apply platform settings. | |
GPIO output-only wrapper with output configuration and drive strength.
This class owns an output pin configuration and exposes Write()/Toggle(). Output configuration includes output type (push-pull vs. open-drain), pull mode, drive strength, and the initial output state.
|
inlineexplicit |
Create a GPIO output with default configuration.
|
virtual |
Destructor.
Platform backends may use this to unregister the pin from internal maps.
|
explicit |
Create a GPIO output with the given configuration.
| pin | GPIO number. |
| config | Initial configuration. |
|
protected |
Apply internal configuration to the hardware.
Implemented by the platform backend.
| void c7222::GpioOut::Configure | ( | const Config & | config | ) |
Apply a new configuration.
| config | New configuration. |
|
inline |
Return the cached configuration.
|
inline |
Return the GPIO number.
| void c7222::GpioOut::Toggle | ( | ) |
Toggle the pin output.
| void c7222::GpioOut::Write | ( | bool | value | ) |
Write an output value.
| value | Logic level to drive. |
|
protected |
Cached configuration used to (re)apply platform settings.
|
protected |
GPIO pin number managed by this instance.