Some utility functions for pins manipulation.
More...
#include <Arduino.h>
#include "utils_bits.h"
Go to the source code of this file.
|
| 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.
|
| |
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
- 2026-01-29
- Copyright
- Copyright (c) 2023-2026
Definition in file utils_pins.h.
◆ getPinState()
| bool getPinState |
( |
const uint8_t | pin | ) |
|
|
inlineconstexpr |
Get the Pin State.
- Parameters
-
- Returns
- true if HIGH
-
false if LOW
Definition at line 158 of file utils_pins.h.
◆ setPinOFF()
| void setPinOFF |
( |
const uint8_t | pin | ) |
|
|
inlineconstexpr |
Set the Pin state to OFF for the specified pin.
- Parameters
-
Definition at line 124 of file utils_pins.h.
◆ setPinON()
| void setPinON |
( |
const uint8_t | pin | ) |
|
|
inlineconstexpr |
Set the Pin state to ON for the specified pin.
- Parameters
-
Definition at line 92 of file utils_pins.h.
◆ setPinsAsInputPullup()
| void setPinsAsInputPullup |
( |
const uint16_t | pins | ) |
|
|
inline |
Set the pins as INPUT_PULLUP.
- Parameters
-
| pins | The pins to set as INPUT_PULLUP |
Definition at line 190 of file utils_pins.h.
◆ setPinsAsOutput()
| void setPinsAsOutput |
( |
const uint16_t | pins | ) |
|
|
inline |
Set the pins as OUTPUT.
- Parameters
-
| pins | The pins to set as OUTPUT |
Definition at line 179 of file utils_pins.h.
◆ setPinsOFF()
| void setPinsOFF |
( |
const uint16_t | pins | ) |
|
|
inline |
Set the Pins state to OFF.
- Parameters
-
Definition at line 145 of file utils_pins.h.
◆ setPinsON()
| void setPinsON |
( |
const uint16_t | pins | ) |
|
|
inline |
Set the Pins state to ON.
- Parameters
-
Definition at line 113 of file utils_pins.h.
◆ setPinState()
| void setPinState |
( |
const uint8_t | pin, |
|
|
const bool | bState ) |
|
inlineconstexpr |
Set the Pin state for the specified pin.
- Parameters
-
| pin | pin to change [2..13] |
| bState | state to be set |
Definition at line 75 of file utils_pins.h.
◆ togglePin()
| void constexpr togglePin |
( |
uint8_t | pin | ) |
|
|
inlineconstexpr |
◆ unused_pin
| uint8_t unused_pin { 0xff } |
|
inlineconstexpr |