84 [[nodiscard]]
bool IsValid() const noexcept {
Unified GPIO base class for all digital GPIO implementations.
Platform-agnostic hardware type definitions for the HardFOC system.
Unified GPIO base class for all digital GPIO implementations.
Definition BaseGpio.h:294
DigitalOutputGuard class.
Definition DigitalOutputGuard.h:43
bool is_valid_
Whether the guard is in a valid state.
Definition DigitalOutputGuard.h:121
hf_gpio_err_t GetLastError() const noexcept
Get the last error that occurred during guard operations.
Definition DigitalOutputGuard.h:92
hf_gpio_err_t SetActive() noexcept
Manually set the GPIO to active state.
Definition DigitalOutputGuard.cpp:60
hf_gpio_err_t last_error_
Last error code from operations.
Definition DigitalOutputGuard.h:122
hf_gpio_state_t GetCurrentState() const noexcept
Get the current state of the managed GPIO.
Definition DigitalOutputGuard.cpp:98
hf_gpio_err_t SetInactive() noexcept
Manually set the GPIO to inactive state.
Definition DigitalOutputGuard.cpp:79
DigitalOutputGuard(DigitalOutputGuard &&) noexcept=default
~DigitalOutputGuard() noexcept
Destructor.
Definition DigitalOutputGuard.cpp:43
bool IsValid() const noexcept
Check if the guard was successfully initialized.
Definition DigitalOutputGuard.h:84
DigitalOutputGuard & operator=(const DigitalOutputGuard &)=delete
DigitalOutputGuard(const DigitalOutputGuard &)=delete
BaseGpio * gpio_
Pointer to the managed BaseGpio instance.
Definition DigitalOutputGuard.h:119
bool InitializeGuard(bool ensure_output_mode) noexcept
Internal helper to initialize the guard state.
Definition DigitalOutputGuard.cpp:110
bool was_output_mode_
Whether the GPIO was already in output mode.
Definition DigitalOutputGuard.h:120
DigitalOutputGuard(BaseGpio &gpio, bool ensure_output_mode=true) noexcept
Constructor with BaseGpio reference.
Definition DigitalOutputGuard.cpp:21
hf_gpio_err_t
HardFOC GPIO error codes.
Definition BaseGpio.h:108
hf_gpio_state_t
GPIO pin logical states.
Definition BaseGpio.h:138