Arduino Pin Library  v4.2.0
An easy to use Arduino library for fast and simultaneous operations on Arduino I/O pins.
PinGroup Class Reference

Class for simultaneous operations on Arduino I/O pins. More...

#include <PinGroup.h>

Public Member Functions

template<size_t N>
 PinGroup (Pin(&pins)[N])
 
bool operator== (uint8_t value)
 Compare the value of the pin. More...
 
bool operator!= (uint8_t value)
 Compare the value of the pin. More...
 
PinGroupoperator= (uint8_t state)
 Set the pin state. More...
 
uint8_t * getNumbers ()
 Get the pin numbers. More...
 
uint8_t getOffset ()
 Get the pin offset. More...
 
uint8_t getInverseOffset ()
 Get the inverse pin offset. More...
 
volatile uint8_t * getPIN ()
 Get a pointer to the PIN register. More...
 
volatile uint8_t * getPORT ()
 Get a pointer to the PORT register. More...
 
volatile uint8_t * getDDR ()
 Get a pointer to the DDR register. More...
 
uint8_t getMode ()
 Get the mode of the pin from the DDR register. More...
 
uint8_t getState ()
 Get the state of the pin from the PORT register. More...
 
uint8_t getValue ()
 Get the value of the pin from the PIN register. More...
 
bool isValid ()
 Check the group to ensure all pins use the same registers. More...
 
void set (uint8_t mode, uint8_t state)
 Set the pin mode and pin state. More...
 
void setMode (uint8_t mode)
 Set the pin mode. More...
 
void setState (uint8_t state)
 Set the pin state. More...
 
void setInput ()
 Set the pin mode to input. More...
 
void setPullupOn ()
 Set the pin pullup resistor to on. More...
 
void setPullupOff ()
 Set the pin pullup resistor to off. More...
 
void setInputPullupOn ()
 Set the pin mode to input and the pin pullup resistor to on. More...
 
void setInputPullupOff ()
 Set the pin mode to input and the pin pullup resistor to off. More...
 
void setOutput ()
 Set the pin mode to output. More...
 
void setHigh ()
 Set the pin output to HIGH. More...
 
void setLow ()
 Set the pin output to LOW. More...
 
void setOutputHigh ()
 Set the pin mode to output and the pin output to HIGH. More...
 
void setOutputLow ()
 Set the pin mode to output and the pin output to LOW. More...
 
void toggleMode ()
 Toggle the pin mode (OUTPUT -> INPUT, INPUT -> OUTPUT) More...
 
void toggleState ()
 Toggle the pin state (HIGH -> LOW, LOW -> HIGH) More...
 

Detailed Description

Class for simultaneous operations on Arduino I/O pins.

Author
Alec Fenichel
Examples:
Pin-Group.ino.

Definition at line 18 of file PinGroup.h.

Constructor & Destructor Documentation

§ PinGroup()

template<size_t N>
PinGroup::PinGroup ( Pin(&)  pins[N])
inline

Definition at line 22 of file PinGroup.h.

Here is the call graph for this function:

Member Function Documentation

§ getDDR()

volatile uint8_t* PinGroup::getDDR ( )
inline

Get a pointer to the DDR register.

Returns
pointer to the DDR register

Definition at line 148 of file PinGroup.h.

§ getInverseOffset()

uint8_t PinGroup::getInverseOffset ( )
inline

Get the inverse pin offset.

Returns
inverse pin offset

Definition at line 121 of file PinGroup.h.

§ getMode()

uint8_t PinGroup::getMode ( )
inline

Get the mode of the pin from the DDR register.

Returns
mode of the pin (OUTPUT, INPUT, -1)

Definition at line 157 of file PinGroup.h.

§ getNumbers()

uint8_t* PinGroup::getNumbers ( )
inline

Get the pin numbers.

Returns
array of pin numbers

Definition at line 103 of file PinGroup.h.

§ getOffset()

uint8_t PinGroup::getOffset ( )
inline

Get the pin offset.

Returns
pin offset

Definition at line 112 of file PinGroup.h.

§ getPIN()

volatile uint8_t* PinGroup::getPIN ( )
inline

Get a pointer to the PIN register.

Returns
pointer to the PIN register

Definition at line 130 of file PinGroup.h.

§ getPORT()

volatile uint8_t* PinGroup::getPORT ( )
inline

Get a pointer to the PORT register.

Returns
pointer to the PORT register

Definition at line 139 of file PinGroup.h.

§ getState()

uint8_t PinGroup::getState ( )
inline

Get the state of the pin from the PORT register.

Returns
state of the pin (HIGH, LOW, -1)

Definition at line 173 of file PinGroup.h.

§ getValue()

uint8_t PinGroup::getValue ( )
inline

Get the value of the pin from the PIN register.

Returns
value of the pin (HIGH, LOW, -1)

Definition at line 189 of file PinGroup.h.

§ isValid()

bool PinGroup::isValid ( )
inline

Check the group to ensure all pins use the same registers.

Returns
true if the pins in the group all use the same registers, false otherwise
Examples:
Pin-Group.ino.

Definition at line 205 of file PinGroup.h.

§ operator!=()

bool PinGroup::operator!= ( uint8_t  value)
inline

Compare the value of the pin.

Parameters
valuethe state of the pin (HIGH, LOW)
Returns
true if the value of all of the pins are not equal to the value passed in, false otherwise

Definition at line 67 of file PinGroup.h.

§ operator=()

PinGroup& PinGroup::operator= ( uint8_t  state)
inline

Set the pin state.

Parameters
statethe state of the pin (HIGH, LOW)

Definition at line 83 of file PinGroup.h.

§ operator==()

bool PinGroup::operator== ( uint8_t  value)
inline

Compare the value of the pin.

Parameters
valuethe state of the pin (HIGH, LOW)
Returns
true if the value of all of the pins are equal to the value passed in, false otherwise

Definition at line 49 of file PinGroup.h.

§ set()

void PinGroup::set ( uint8_t  mode,
uint8_t  state 
)
inline

Set the pin mode and pin state.

Parameters
modethe mode of the pin (OUTPUT, INPUT)
statethe state of the pin (HIGH, LOW)

Definition at line 220 of file PinGroup.h.

§ setHigh()

void PinGroup::setHigh ( )
inline

Set the pin output to HIGH.

Definition at line 337 of file PinGroup.h.

§ setInput()

void PinGroup::setInput ( )
inline

Set the pin mode to input.

Definition at line 273 of file PinGroup.h.

§ setInputPullupOff()

void PinGroup::setInputPullupOff ( )
inline

Set the pin mode to input and the pin pullup resistor to off.

Definition at line 314 of file PinGroup.h.

§ setInputPullupOn()

void PinGroup::setInputPullupOn ( )
inline

Set the pin mode to input and the pin pullup resistor to on.

Definition at line 303 of file PinGroup.h.

§ setLow()

void PinGroup::setLow ( )
inline

Set the pin output to LOW.

Definition at line 347 of file PinGroup.h.

§ setMode()

void PinGroup::setMode ( uint8_t  mode)
inline

Set the pin mode.

Parameters
modethe mode of the pin (OUTPUT, INPUT)

Definition at line 241 of file PinGroup.h.

§ setOutput()

void PinGroup::setOutput ( )
inline

Set the pin mode to output.

Examples:
Pin-Group.ino.

Definition at line 327 of file PinGroup.h.

§ setOutputHigh()

void PinGroup::setOutputHigh ( )
inline

Set the pin mode to output and the pin output to HIGH.

Definition at line 357 of file PinGroup.h.

§ setOutputLow()

void PinGroup::setOutputLow ( )
inline

Set the pin mode to output and the pin output to LOW.

Definition at line 368 of file PinGroup.h.

§ setPullupOff()

void PinGroup::setPullupOff ( )
inline

Set the pin pullup resistor to off.

Definition at line 293 of file PinGroup.h.

§ setPullupOn()

void PinGroup::setPullupOn ( )
inline

Set the pin pullup resistor to on.

Definition at line 283 of file PinGroup.h.

§ setState()

void PinGroup::setState ( uint8_t  state)
inline

Set the pin state.

Parameters
statethe state of the pin (HIGH, LOW)

Definition at line 257 of file PinGroup.h.

§ toggleMode()

void PinGroup::toggleMode ( )
inline

Toggle the pin mode (OUTPUT -> INPUT, INPUT -> OUTPUT)

Definition at line 384 of file PinGroup.h.

§ toggleState()

void PinGroup::toggleState ( )
inline

Toggle the pin state (HIGH -> LOW, LOW -> HIGH)

Examples:
Pin-Group.ino.

Definition at line 394 of file PinGroup.h.


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