3-phase PV router
Loading...
Searching...
No Matches
Functions
utils_pins.h File Reference

Some utility functions for pins manipulation. More...

#include <Arduino.h>
Include dependency graph for utils_pins.h:
This graph shows which files directly or indirectly include this file:

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.
 
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 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.
 

Detailed Description

Some utility functions for pins manipulation.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
0.1
Date
2023-05-05

Definition in file utils_pins.h.

Function Documentation

◆ bit_clear()

template<typename T >
constexpr uint8_t bit_clear ( T &  _dest,
const uint8_t  bit 
)
constexpr

Clear the specified bit.

Template Parameters
TType of the variable
Parameters
_destInteger variable to modify
bitBit to clear in _src
Returns
constexpr uint8_t

Definition at line 72 of file utils_pins.h.

Here is the caller graph for this function:

◆ bit_read()

template<typename T >
constexpr uint8_t bit_read ( const T &  _src,
const uint8_t  bit 
)
constexpr

Read the specified bit.

Template Parameters
TType of the variable
Parameters
_srcInteger variable to read
bitBit to read in _src
Returns
constexpr uint8_t

Definition at line 59 of file utils_pins.h.

Here is the caller graph for this function:

◆ bit_set()

template<typename T >
constexpr void bit_set ( T &  _dest,
const uint8_t  bit 
)
constexpr

Set the specified bit to 1.

Template Parameters
TType of the variable
Parameters
_destInteger variable to modify
bitBit to set in _dest

Definition at line 46 of file utils_pins.h.

Here is the caller graph for this function:

◆ getPinState()

bool getPinState ( const uint8_t  pin)
inline

Get the Pin State.

Parameters
pinThe pin to read
Returns
true if HIGH
false if LOW

Definition at line 174 of file utils_pins.h.

Here is the caller graph for this function:

◆ setPinOFF()

constexpr void setPinOFF ( const uint8_t  pin)
inlineconstexpr

Set the Pin state to OFF for the specified pin.

Parameters
pinpin to change [2..13]

Definition at line 144 of file utils_pins.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPinON()

constexpr void setPinON ( const uint8_t  pin)
inlineconstexpr

Set the Pin state to ON for the specified pin.

Parameters
pinpin to change [2..13]

Definition at line 116 of file utils_pins.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPinsOFF()

void setPinsOFF ( const uint16_t  pins)
inline

Set the Pins state to OFF.

Parameters
pinsThe pins to change

Definition at line 161 of file utils_pins.h.

Here is the caller graph for this function:

◆ setPinsON()

void setPinsON ( const uint16_t  pins)
inline

Set the Pins state to ON.

Parameters
pinsThe pins to change

Definition at line 133 of file utils_pins.h.

Here is the caller graph for this function:

◆ setPinState()

constexpr void setPinState ( const uint8_t  pin,
const bool  bState 
)
inlineconstexpr

Set the Pin state for the specified pin.

Parameters
pinpin to change [2..13]
bStatestate to be set

Definition at line 99 of file utils_pins.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ togglePin()

void constexpr togglePin ( const uint8_t  pin)
inlineconstexpr

Toggle the specified pin.

Definition at line 81 of file utils_pins.h.

Here is the call graph for this function:
Here is the caller graph for this function: