◆ GetState()
Result< State > pw::digital_io::DigitalIoOptional::GetState |
( |
| ) |
|
|
inline |
Gets the state of the line.
- Warning
- This method is not thread-safe and cannot be used in interrupt handlers.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Returns an active or inactive state.
*
* FAILED_PRECONDITION: The line has not been enabled.
*
* Returns Other status codes as defined by the backend.
*
*
◆ IsStateActive()
Result< bool > pw::digital_io::DigitalIoOptional::IsStateActive |
( |
| ) |
|
|
inline |
Checks if the line is in the active state.
The line is in the active state when GetState()
returns State::kActive
.
- Warning
- This method is not thread-safe and cannot be used in interrupt handlers.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: ``true`` if the line is in the active state, otherwise ``false``.
*
* FAILED_PRECONDITION: The line has not been enabled.
*
* Returns other status codes as defined by the backend.
*
*
The documentation for this class was generated from the following file: