19#if defined(__DOXYGEN__)
20inline constexpr void togglePin(uint8_t pin);
22inline constexpr void setPinON(uint8_t pin);
25inline constexpr void setPinOFF(uint8_t pin);
33inline constexpr void togglePin(uint8_t pin) __attribute__((always_inline));
35inline constexpr void setPinON(uint8_t pin) __attribute__((always_inline));
36inline void setPinsON(uint16_t pins) __attribute__((always_inline));
38inline constexpr void setPinOFF(uint8_t pin) __attribute__((always_inline));
39inline void setPinsOFF(uint16_t pins) __attribute__((always_inline));
41inline constexpr bool getPinState(uint8_t pin) __attribute__((always_inline));
43inline void setPinsAsOutput(uint16_t pins) __attribute__((always_inline));
54template<
typename T >
constexpr void bit_set(T& _dest,
const uint8_t bit)
56 _dest |= (T)0x01 << bit;
67template<
typename T >
constexpr uint8_t
bit_read(
const T& _src,
const uint8_t bit)
69 return (_src >> bit) & (T)0x01;
80template<
typename T >
constexpr uint8_t
bit_clear(T& _dest,
const uint8_t bit)
82 return _dest &= ~((T)0x01 << bit);
111inline constexpr void setPinState(
const uint8_t pin,
const bool bState)
151 PORTD |= lowByte(pins);
152 PORTB |= highByte(pins);
183 PORTD &= ~lowByte(pins);
184 PORTB &= ~highByte(pins);
196 return (pin < 8) ?
bit_read(PIND, pin) : (pin < 14) ?
bit_read(PINB, pin - 8)
207 DDRD |= lowByte(pins);
208 DDRB |= highByte(pins);
219 DDRD &= ~lowByte(pins);
220 DDRB &= ~highByte(pins);
223 PORTD |= lowByte(pins);
224 PORTB |= highByte(pins);
constexpr void bit_set(T &_dest, const uint8_t bit)
Set the specified bit to 1.
constexpr bool getPinState(uint8_t pin)
Get the Pin State.
void setPinsOFF(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(uint8_t pin)
Toggle the specified pin.
constexpr uint8_t bit_read(const T &_src, const uint8_t bit)
Read the specified bit.
void setPinsAsInputPullup(uint16_t pins)
Set the pins as INPUT_PULLUP.
constexpr void setPinON(uint8_t pin)
Set the Pin state to ON for the specified pin.
void setPinsAsOutput(uint16_t pins)
Set the pins as OUTPUT.
constexpr void setPinOFF(uint8_t pin)
Set the Pin state to OFF for the specified pin.
void setPinsON(uint16_t pins)
Set the Pins state to ON.
constexpr uint8_t bit_clear(T &_dest, const uint8_t bit)
Clear the specified bit.
constexpr uint8_t unused_pin