C/C++ API Reference
Loading...
Searching...
No Matches
pw::digital_io::DigitalIn Class Reference
Inheritance diagram for pw::digital_io::DigitalIn:
pw::digital_io::DigitalIoOptional pw::digital_io::McuxpressoDigitalIn

Public Member Functions

Result< State > GetState ()
 
Result< bool > IsStateActive ()
 
- Public Member Functions inherited from pw::digital_io::DigitalIoOptional
constexpr bool provides_input () const
 
constexpr bool provides_output () const
 
constexpr bool provides_interrupt () const
 
Result< State > GetState ()
 
Status SetState (State state)
 
Result< bool > IsStateActive ()
 
Status SetStateActive ()
 
Status SetStateInactive ()
 
Status SetInterruptHandler (InterruptTrigger trigger, InterruptHandler &&handler)
 
Status ClearInterruptHandler ()
 
Status EnableInterruptHandler ()
 
Status DisableInterruptHandler ()
 
Status Enable ()
 
Status Disable ()
 

Private Member Functions

Status DoSetState (State) final
 
Status DoSetInterruptHandler (InterruptTrigger, InterruptHandler &&) final
 
Status DoEnableInterruptHandler (bool) final
 

Member Function Documentation

◆ 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
A Result containing the state on success or one of the following error codes on failure:
  • 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
A Result containing a boolean set to true if the line is active on success or one of the following error codes on failure:
  • 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: