Fast digital port I/O.
More...
#include <softspi.h>
template<uint8_t PinNumber>
class DigitalPin< PinNumber >
Fast digital port I/O.
◆ DigitalPin() [1/3]
template<uint8_t PinNumber>
◆ DigitalPin() [2/3]
template<uint8_t PinNumber>
Constructor
- Parameters
-
[in] | pinMode | if true set output mode else input mode. |
◆ DigitalPin() [3/3]
template<uint8_t PinNumber>
Constructor
- Parameters
-
[in] | mode | If true set output mode else input mode |
[in] | level | If mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pullup. |
◆ operator=()
template<uint8_t PinNumber>
Assignment operator
- Parameters
-
[in] | value | If true set the pin's level high else set the pin's level low. |
- Returns
- This DigitalPin instance.
595 {
write(value);
return *
this; }
◆ operator bool()
template<uint8_t PinNumber>
Parentheses operator
- Returns
- Pin's level
◆ config()
template<uint8_t PinNumber>
Set pin configuration
- Parameters
-
[in] | mode | If true set output mode else input mode |
[in] | level | If mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pullup. |
◆ high()
template<uint8_t PinNumber>
Set pin level high if output mode or enable 20K pullup if input mode.
◆ low()
template<uint8_t PinNumber>
Set pin level low if output mode or disable 20K pullup if input mode.
◆ mode()
template<uint8_t PinNumber>
Set pin mode
- Parameters
-
[in] | pinMode | if true set output mode else input mode. |
mode() does not enable or disable the 20K pullup for input mode.
◆ read()
template<uint8_t PinNumber>
◆ toggle()
template<uint8_t PinNumber>
Toggle a pin If the pin is in output mode toggle the pin's level. If the pin is in input mode toggle the state of the 20K pullup.
◆ write()
template<uint8_t PinNumber>
Write the pin's level.
- Parameters
-
[in] | value | If true set the pin's level high else set the pin's level low. |