This library provide a quick way for digital port manipulation - an alternative to pinMode
, digitalWrite
and digitalRead
- where speed is crucial.
This is FAST pin.
Copy FastPin folder to Arduino library folder
FastPin(byte id, bool isOutput = false, bool isHigh = false)
constructor, initializeFastPin
object withid
of the pin and initial states (optional).void changePin(byte id, bool isOutput = false, bool isHigh = false)
change pin.inline void input()
equavilent topinMode(pinId, INPUT)
.inline void output()
equavilent topinMode(pinId, OUTPUT)
.inline void high()
equavilent todigitalWrite(pinId, HIGH)
.inline void low()
equavilent todigitalWrite(pinId, LOW)
.inline byte read()
equavilent todigitalRead(pinId)
.byte pinId() const
get id of the pin.byte bitmask() const
get bitmask of the pin, is used with DDR, PORT and PIN.volatile byte * ddr() const
get DDR register of the pin.volatile byte * port() const
get PORT register of the pin.volatile byte * pin() const
get PIN register of the pin.