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

Detailed Description

Naive fallback solution for low level pin access.

Definition at line 43 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 62 of file fastpin.h.

◆ port_t

typedef RwReg Pin::port_t

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

Definition at line 63 of file fastpin.h.

Constructor & Destructor Documentation

◆ Pin()

Pin::Pin ( int pin)
inline

Constructor.

Parameters
pinArduino digital pin number

Definition at line 60 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 96 of file fastpin.h.

◆ hi() [1/2]

void Pin::hi ( )
inline

Set the pin state to HIGH

Definition at line 72 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 84 of file fastpin.h.

◆ hival()

port_t Pin::hival ( )
inline

Gets the state of the port with this pin HIGH

Definition at line 99 of file fastpin.h.

◆ isSelected()

virtual bool Pin::isSelected ( )
inlinevirtual

Checks if the pin is currently HIGH

Implements Selectable.

Definition at line 112 of file fastpin.h.

◆ lo() [1/2]

void Pin::lo ( )
inline

Set the pin state to LOW

Definition at line 74 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 87 of file fastpin.h.

◆ loval()

port_t Pin::loval ( )
inline

Gets the state of the port with this pin LOW

Definition at line 101 of file fastpin.h.

◆ mask()

port_t Pin::mask ( )
inline

Get the pin mask.

Definition at line 105 of file fastpin.h.

◆ port()

port_ptr_t Pin::port ( )
inline

Get the output state of the port.

Definition at line 103 of file fastpin.h.

◆ release()

virtual void Pin::release ( )
inlinevirtual

Set the pin state to LOW

Implements Selectable.

Definition at line 110 of file fastpin.h.

◆ select()

virtual void Pin::select ( )
inlinevirtual

Set the pin state to HIGH

Implements Selectable.

Definition at line 108 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 91 of file fastpin.h.

◆ setInput()

void Pin::setInput ( )
inline

Set the pin mode as INPUT

Definition at line 69 of file fastpin.h.

◆ setOutput()

void Pin::setOutput ( )
inline

Set the pin mode as OUTPUT

Definition at line 66 of file fastpin.h.

◆ strobe()

void Pin::strobe ( )
inline

Toggle the pin twice to create a short pulse.

Definition at line 77 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 80 of file fastpin.h.


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