1-phase PV router
|
Some utility functions for pins manipulation. More...
#include <Arduino.h>
Go to the source code of this file.
Functions | |
template<typename T> | |
constexpr uint8_t | bit_clear (T &_dest, const uint8_t bit) |
Clear the specified bit. | |
template<typename T> | |
constexpr uint8_t | bit_read (const T &_src, const uint8_t bit) |
Read the specified bit. | |
template<typename T> | |
constexpr void | bit_set (T &_dest, const uint8_t bit) |
Set the specified bit to 1. | |
constexpr bool | getPinState (const uint8_t pin) |
Get the Pin State. | |
constexpr void | setPinOFF (const uint8_t pin) |
Set the Pin state to OFF for the specified pin. | |
constexpr void | setPinON (const uint8_t pin) |
Set the Pin state to ON for the specified pin. | |
void | setPinsAsInputPullup (const uint16_t pins) |
Set the pins as INPUT_PULLUP. | |
void | setPinsAsOutput (const uint16_t pins) |
Set the pins as OUTPUT. | |
void | setPinsOFF (const uint16_t pins) |
Set the Pins state to OFF. | |
void | setPinsON (const uint16_t pins) |
Set the Pins state to ON. | |
constexpr void | setPinState (const uint8_t pin, const bool bState) |
Set the Pin state for the specified pin. | |
constexpr void | togglePin (const uint8_t pin) |
Toggle the specified pin. | |
Variables | |
constexpr uint8_t | unused_pin { 0xff } |
Some utility functions for pins manipulation.
Definition in file utils_pins.h.
|
constexpr |
Clear the specified bit.
T | Type of the variable |
_dest | Integer variable to modify |
bit | Bit to clear in _src |
Definition at line 80 of file utils_pins.h.
Referenced by initializeProcessing(), and setPinOFF().
|
constexpr |
Read the specified bit.
T | Type of the variable |
_src | Integer variable to read |
bit | Bit to read in _src |
Definition at line 67 of file utils_pins.h.
Referenced by check_load_priorities(), check_pins(), getInputPins(), getOutputPins(), and getPinState().
|
constexpr |
Set the specified bit to 1.
T | Type of the variable |
_dest | Integer variable to modify |
bit | Bit to set in _dest |
Definition at line 54 of file utils_pins.h.
Referenced by check_load_priorities(), check_pins(), getInputPins(), getOutputPins(), initializeProcessing(), setPinON(), and togglePin().
|
inlineconstexpr |
Get the Pin State.
pin | The pin to read |
Definition at line 194 of file utils_pins.h.
References bit_read().
Referenced by checkDiversionOnOff(), forceFullPower(), proceedLoadPrioritiesAndOverriding(), and proceedLoadPrioritiesAndOverridingDualTariff().
|
inlineconstexpr |
Set the Pin state to OFF for the specified pin.
pin | pin to change [2..13] |
Definition at line 160 of file utils_pins.h.
References bit_clear().
Referenced by initializeOldPCBPins(), setPinState(), test_setPinOFF(), and relayOutput::try_turnOFF().
|
inlineconstexpr |
Set the Pin state to ON for the specified pin.
pin | pin to change [2..13] |
Definition at line 128 of file utils_pins.h.
References bit_set().
Referenced by setPinState(), test_setPinON(), and relayOutput::try_turnON().
|
inline |
Set the pins as INPUT_PULLUP.
pins | The pins to set as INPUT_PULLUP |
Definition at line 226 of file utils_pins.h.
Referenced by initializeProcessing().
|
inline |
Set the pins as OUTPUT.
pins | The pins to set as OUTPUT |
Definition at line 215 of file utils_pins.h.
Referenced by initializeProcessing().
|
inline |
Set the Pins state to OFF.
pins | The pins to change |
Definition at line 181 of file utils_pins.h.
Referenced by test_setPinsOFF(), and updatePortsStates().
|
inline |
Set the Pins state to ON.
pins | The pins to change |
Definition at line 149 of file utils_pins.h.
Referenced by test_setPinsON(), and updatePortsStates().
|
inlineconstexpr |
Set the Pin state for the specified pin.
pin | pin to change [2..13] |
bState | state to be set |
Definition at line 111 of file utils_pins.h.
References setPinOFF(), and setPinON().
Referenced by initializeDisplayHW(), initializeDisplaySW(), test_setPinState(), update7SegmentHWDisplay(), and update7SegmentSWDisplay().
|
inlineconstexpr |
Toggle the specified pin.
Definition at line 89 of file utils_pins.h.
References bit_set().
Referenced by handlePerSecondTasks(), and test_togglePin().
|
inlineconstexpr |
unused pin
Definition at line 17 of file utils_pins.h.