Fast Digital I/O functions and template class.
set pin configuration
- Parameters
-
[in] | pin | Arduino pin number |
[in] | mode | mode INPUT or OUTPUT. |
[in] | level | If mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pullup. |
Definition at line 289 of file DigitalPin.h.
#define GPIO_PIN |
( |
|
reg, |
|
|
|
bit |
|
) |
| {&PIN##reg, &DDR##reg, &PORT##reg, 1 << bit} |
static void badPinCheck |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
Check for valid pin number
- Parameters
-
[in] | pin | Number of pin to be checked. |
Definition at line 54 of file DigitalPin.h.
void badPinNumber |
( |
void |
| ) |
|
generate bad pin number error
static volatile uint8_t* ddrReg |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
DDR register address
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- register address
Definition at line 65 of file DigitalPin.h.
static void fastBitWriteSafe |
( |
volatile uint8_t * |
address, |
|
|
uint8_t |
mask, |
|
|
bool |
level |
|
) |
| |
|
inlinestatic |
Fast write helper.
- Parameters
-
[in] | address | I/O register address |
[in] | mask | bit mask for pin |
[in] | level | value for bit |
Definition at line 106 of file DigitalPin.h.
static void fastDdrWrite |
( |
uint8_t |
pin, |
|
|
bool |
level |
|
) |
| |
|
inlinestatic |
Write the DDR register.
- Parameters
-
[in] | pin | Arduino pin number |
[in] | level | value to write |
Definition at line 162 of file DigitalPin.h.
static bool fastDigitalRead |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
Read pin value.
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- value read
Definition at line 127 of file DigitalPin.h.
static void fastDigitalToggle |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
Toggle a pin.
- Parameters
-
[in] | pin | Arduino pin number |
If the pin is in output mode toggle the pin level. If the pin is in input mode toggle the state of the 20K pullup.
Definition at line 138 of file DigitalPin.h.
static void fastDigitalWrite |
( |
uint8_t |
pin, |
|
|
bool |
level |
|
) |
| |
|
inlinestatic |
Set pin value.
- Parameters
-
[in] | pin | Arduino pin number |
[in] | level | value to write |
Definition at line 153 of file DigitalPin.h.
static void fastPinMode |
( |
uint8_t |
pin, |
|
|
uint8_t |
mode |
|
) |
| |
|
inlinestatic |
Set pin mode.
- Parameters
-
[in] | pin | Arduino pin number |
[in] | mode | INPUT, OUTPUT, or INPUT_PULLUP. |
The internal pullup resistors will be enabled if mode is INPUT_PULLUP and disabled if the mode is INPUT.
Definition at line 174 of file DigitalPin.h.
static uint8_t pinMask |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
Bit mask for pin
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- mask
Definition at line 75 of file DigitalPin.h.
static volatile uint8_t* pinReg |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
PIN register address
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- register address
Definition at line 85 of file DigitalPin.h.
static volatile uint8_t* portReg |
( |
uint8_t |
pin | ) |
|
|
inlinestatic |
PORT register address
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- register address
Definition at line 95 of file DigitalPin.h.