Speeduino
Loading...
Searching...
No Matches
fastInputPin.h
Go to the documentation of this file.
1#pragma once
2#include "port_pin.h"
3
10{
11public:
13 void setPin(uint8_t pin, uint8_t mode = INPUT) noexcept {
14 _pin = port_pin_t(pin, mode);
15 }
16
18 bool isPinHigh(void) const noexcept {
19 return _pin.isPinHigh();
20 }
21
23 bool isPinLow(void) const noexcept {
24 return !isPinHigh();
25 }
26
28 bool isValid(void) const noexcept{
29 return _pin.isValid();
30 }
31
32#if !defined(UNIT_TEST)
33private:
34#endif
35 port_pin_t _pin;
36};
A class for input pin operations that is faster than standard Arduino digitalRead()
Definition fastInputPin.h:10
void setPin(uint8_t pin, uint8_t mode=INPUT) noexcept
Set the input pin.
Definition fastInputPin.h:13
bool isValid(void) const noexcept
Is the pin set?
Definition fastInputPin.h:28
bool isPinHigh(void) const noexcept
Check if the pin is set high.
Definition fastInputPin.h:18
bool isPinLow(void) const noexcept
Check if the pin is set low.
Definition fastInputPin.h:23
Definition array.h:14
A structure to support direct port manipulation.
Definition port_pin.h:23
bool isValid(void) const
Is the port register initialised?
Definition port_pin.h:30
bool isPinHigh(void) const noexcept
Check if the pin is set high.
Definition port_pin.h:36