FastLED 3.9.7
Loading...
Searching...
No Matches
Pin Class Reference

Detailed Description

Naive fallback solution for low level pin access.

Definition at line 47 of file fastpin.h.

#include <fastpin.h>

+ Inheritance diagram for Pin:

Public Types

typedef volatile RwReg * port_ptr_t
 type for a pin read/write register, volatile
 
typedef RwReg port_t
 type for a pin read/write register, non-volatile
 

Public Member Functions

 Pin (int pin)
 Constructor.
 
void setOutput ()
 Set the pin mode as OUTPUT
 
void setInput ()
 Set the pin mode as INPUT
 
void hi ()
 Set the pin state to HIGH
 
void lo ()
 Set the pin state to LOW
 
void strobe ()
 Toggle the pin twice to create a short pulse.
 
void toggle ()
 Toggle the pin.
 
void hi (FASTLED_REGISTER port_ptr_t port)
 Set the same pin on another port to HIGH
 
void lo (FASTLED_REGISTER port_ptr_t port)
 Set the same pin on another port to LOW
 
void set (FASTLED_REGISTER port_t val)
 Set the state of the output register.
 
void fastset (FASTLED_REGISTER port_ptr_t port, FASTLED_REGISTER port_t val)
 Set the state of a port.
 
port_t hival ()
 Gets the state of the port with this pin HIGH
 
port_t loval ()
 Gets the state of the port with this pin LOW
 
port_ptr_t port ()
 Get the output state of the port.
 
port_t mask ()
 Get the pin mask.
 
virtual void select ()
 Set the pin state to HIGH
 
virtual void release ()
 Set the pin state to LOW
 
virtual bool isSelected ()
 Checks if the pin is currently HIGH
 

Member Typedef Documentation

◆ port_ptr_t

typedef volatile RwReg* Pin::port_ptr_t

type for a pin read/write register, volatile

Definition at line 69 of file fastpin.h.

◆ port_t

typedef RwReg Pin::port_t

type for a pin read/write register, non-volatile

Definition at line 70 of file fastpin.h.

Constructor & Destructor Documentation

◆ Pin()

Pin::Pin ( int pin)
inline

Constructor.

Parameters
pinArduino digital pin number

Definition at line 64 of file fastpin.h.

◆ ~Pin()

virtual Pin::~Pin ( )
inlinevirtual

Definition at line 66 of file fastpin.h.

Member Function Documentation

◆ fastset()

void Pin::fastset ( FASTLED_REGISTER port_ptr_t port,
FASTLED_REGISTER port_t val )
inline

Set the state of a port.

Parameters
portthe port to modify
valthe state to set the port to

Definition at line 103 of file fastpin.h.

◆ hi() [1/2]

void Pin::hi ( )
inline

Set the pin state to HIGH

Definition at line 79 of file fastpin.h.

◆ hi() [2/2]

void Pin::hi ( FASTLED_REGISTER port_ptr_t port)
inline

Set the same pin on another port to HIGH

Parameters
portthe port to modify

Definition at line 91 of file fastpin.h.

◆ hival()

port_t Pin::hival ( )
inline

Gets the state of the port with this pin HIGH

Definition at line 106 of file fastpin.h.

◆ isSelected()

virtual bool Pin::isSelected ( )
inlinevirtual

Checks if the pin is currently HIGH

Implements Selectable.

Definition at line 119 of file fastpin.h.

◆ lo() [1/2]

void Pin::lo ( )
inline

Set the pin state to LOW

Definition at line 81 of file fastpin.h.

◆ lo() [2/2]

void Pin::lo ( FASTLED_REGISTER port_ptr_t port)
inline

Set the same pin on another port to LOW

Parameters
portthe port to modify

Definition at line 94 of file fastpin.h.

◆ loval()

port_t Pin::loval ( )
inline

Gets the state of the port with this pin LOW

Definition at line 108 of file fastpin.h.

◆ mask()

port_t Pin::mask ( )
inline

Get the pin mask.

Definition at line 112 of file fastpin.h.

◆ port()

port_ptr_t Pin::port ( )
inline

Get the output state of the port.

Definition at line 110 of file fastpin.h.

◆ release()

virtual void Pin::release ( )
inlinevirtual

Set the pin state to LOW

Implements Selectable.

Definition at line 117 of file fastpin.h.

◆ select()

virtual void Pin::select ( )
inlinevirtual

Set the pin state to HIGH

Implements Selectable.

Definition at line 115 of file fastpin.h.

◆ set()

void Pin::set ( FASTLED_REGISTER port_t val)
inline

Set the state of the output register.

Parameters
valthe state to set the output register to
Note
This function is not limited to the current pin! It modifies the entire register.

Definition at line 98 of file fastpin.h.

◆ setInput()

void Pin::setInput ( )
inline

Set the pin mode as INPUT

Definition at line 76 of file fastpin.h.

◆ setOutput()

void Pin::setOutput ( )
inline

Set the pin mode as OUTPUT

Definition at line 73 of file fastpin.h.

◆ strobe()

void Pin::strobe ( )
inline

Toggle the pin twice to create a short pulse.

Definition at line 84 of file fastpin.h.

◆ toggle()

void Pin::toggle ( )
inline

Toggle the pin.

If the pin was high, set it low. If was low, set it high.

Definition at line 87 of file fastpin.h.


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