17#if defined(__DOXYGEN__)
18inline constexpr void togglePin(
const uint8_t pin);
20inline constexpr void setPinON(
const uint8_t pin);
23inline constexpr void setPinOFF(
const uint8_t pin);
28inline constexpr void togglePin(
const uint8_t pin) __attribute__((always_inline));
30inline constexpr void setPinON(
const uint8_t pin) __attribute__((always_inline));
33inline constexpr void setPinOFF(
const uint8_t pin) __attribute__((always_inline));
36inline bool getPinState(
const uint8_t pin) __attribute__((always_inline));
46template<
typename T >
constexpr void bit_set(T& _dest,
const uint8_t bit)
48 _dest |= (T)0x01 << bit;
59template<
typename T >
constexpr uint8_t
bit_read(
const T& _src,
const uint8_t bit)
61 return (_src >> bit) & (T)0x01;
72template<
typename T >
constexpr uint8_t
bit_clear(T& _dest,
const uint8_t bit)
74 return _dest &= ~((T)0x01 << bit);
99inline constexpr void setPinState(
const uint8_t pin,
const bool bState)
135 PORTD |= lowByte(pins);
136 PORTB |= highByte(pins);
163 PORTD &= ~lowByte(pins);
164 PORTB &= ~highByte(pins);
176 return (pin < 8) ? bitRead(PIND, pin) : bitRead(PINB, pin - 8);
constexpr void bit_set(T &_dest, const uint8_t bit)
Set the specified bit to 1.
void setPinsOFF(const uint16_t pins)
Set the Pins state to OFF.
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.
constexpr uint8_t bit_read(const T &_src, const uint8_t bit)
Read the specified bit.
constexpr void setPinON(const uint8_t pin)
Set the Pin state to ON for the specified pin.
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.
void setPinsON(const uint16_t pins)
Set the Pins state to ON.
constexpr uint8_t bit_clear(T &_dest, const uint8_t bit)
Clear the specified bit.