Speeduino
Loading...
Searching...
No Matches
Public Member Functions | List of all members
trackedOutputPin_t< TPin > Class Template Reference

An output pin that tracks it's state (HIGH/LOW) More...

#include <trackedOutputPin.h>

Public Member Functions

void setPin (uint8_t pin, uint8_t mode) noexcept
 Set the input pin.
 
bool isValid (void) const
 Is the pin set?
 
bool isPinHigh (void) const noexcept
 Check if the pin is set high.
 
bool isPinLow (void) const noexcept
 Check if the pin is set low.
 
void setPinHigh (void) noexcept
 Set the pin high.
 
void setPinLow (void) noexcept
 Set the pin low.
 

Detailed Description

template<class TPin>
class trackedOutputPin_t< TPin >

An output pin that tracks it's state (HIGH/LOW)

This is impossible to do across all platforms and boards using digitalRead():

  1. A pin can't be both INPUT and OUTPUT concurrently
  2. Swapping pin modes resets pin state on some platforms

Member Function Documentation

◆ isPinHigh()

template<class TPin >
bool trackedOutputPin_t< TPin >::isPinHigh ( void  ) const
inlinenoexcept

Check if the pin is set high.

◆ isPinLow()

template<class TPin >
bool trackedOutputPin_t< TPin >::isPinLow ( void  ) const
inlinenoexcept

Check if the pin is set low.

◆ isValid()

template<class TPin >
bool trackedOutputPin_t< TPin >::isValid ( void  ) const
inline

Is the pin set?

◆ setPin()

template<class TPin >
void trackedOutputPin_t< TPin >::setPin ( uint8_t  pin,
uint8_t  mode 
)
inlinenoexcept

Set the input pin.

◆ setPinHigh()

template<class TPin >
void trackedOutputPin_t< TPin >::setPinHigh ( void  )
inlinenoexcept

Set the pin high.

◆ setPinLow()

template<class TPin >
void trackedOutputPin_t< TPin >::setPinLow ( void  )
inlinenoexcept

Set the pin low.


The documentation for this class was generated from the following file: