FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
gpio Namespace Reference

Defines all API to manipulate general-purpose digital input/output pins. More...

Classes

class  FastMaskedPort
 API that manipulates a part of a digital IO port. More...
 
class  FastPin
 API that manipulates one digital IO pin of a given port. More...
 
class  FastPinType
 API that manipulates a given digital IO pin of a the target MCU. More...
 
class  FastPort
 API that manipulates a whole digital IO port. More...
 

Typedefs

template<board::DigitalPin DPIN_>
using FAST_PIN = typename FastPinType< DPIN_ >::TYPE
 Useful alias type to the FastPin type matching a given board::DigitalPin. More...
 
template<board::InterruptPin IPIN_>
using FAST_INT_PIN = typename FastPinType< board::PCI_PIN< IPIN_ >()>::TYPE
 Useful alias type to the FastPin type matching a given board::InterruptPin. More...
 
template<board::ExternalInterruptPin EPIN_>
using FAST_EXT_PIN = typename FastPinType< board::EXT_PIN< EPIN_ >()>::TYPE
 Useful alias type to the FastPin type matching a given board::ExternalInterruptPin. More...
 

Enumerations

enum  PinMode : uint8_t {
  PinMode::INPUT,
  PinMode::INPUT_PULLUP,
  PinMode::OUTPUT
}
 Defines the configurable mode of a digital IO pin. More...
 

Detailed Description

Defines all API to manipulate general-purpose digital input/output pins.

Typedef Documentation

◆ FAST_PIN

template<board::DigitalPin DPIN_>
using gpio::FAST_PIN = typedef typename FastPinType<DPIN_>::TYPE

Useful alias type to the FastPin type matching a given board::DigitalPin.

The following snippet demonstrates usage of FAST_PIN to declare a FastPin instance for later use in a function:

void f()
{
led.clear();
...
led.set();
}
See also
FastPin
FastPinType
FAST_INT_PIN
FAST_EXT_PIN

Definition at line 688 of file gpio.h.

◆ FAST_INT_PIN

template<board::InterruptPin IPIN_>
using gpio::FAST_INT_PIN = typedef typename FastPinType<board::PCI_PIN<IPIN_>()>::TYPE

Useful alias type to the FastPin type matching a given board::InterruptPin.

The following snippet demonstrates usage of FAST_INT_PIN to declare a FastPin instance for later use in a function:

void f()
{
gpio::FAST_INT_PIN<board::InterruptPin::D0> input{gpio::PinMode::INPUT};
bool val = input.value();
...
}
See also
FastPin
FastPinType
FAST_PIN
FAST_EXT_PIN

Definition at line 711 of file gpio.h.

◆ FAST_EXT_PIN

template<board::ExternalInterruptPin EPIN_>
using gpio::FAST_EXT_PIN = typedef typename FastPinType<board::EXT_PIN<EPIN_>()>::TYPE

Useful alias type to the FastPin type matching a given board::ExternalInterruptPin.

The following snippet demonstrates usage of FAST_EXT_PIN to declare a FastPin instance for later use in a function:

void f()
{
bool val = input.value();
...
}
See also
FastPin
FastPinType
FAST_PIN
FAST_INT_PIN

Definition at line 734 of file gpio.h.

Enumeration Type Documentation

◆ PinMode

enum gpio::PinMode : uint8_t
strong

Defines the configurable mode of a digital IO pin.

Enumerator
INPUT 

Digital pin is configured as high-impedance (open drain) input.

INPUT_PULLUP 

Digital pin is configured as input with an internal pullup resistor.

OUTPUT 

Digital pin is configured as output.

Definition at line 59 of file gpio.h.

gpio::FAST_INT_PIN
typename FastPinType< board::PCI_PIN< IPIN_ >()>::TYPE FAST_INT_PIN
Useful alias type to the FastPin type matching a given board::InterruptPin.
Definition: gpio.h:711
gpio::FAST_PIN
typename FastPinType< DPIN_ >::TYPE FAST_PIN
Useful alias type to the FastPin type matching a given board::DigitalPin.
Definition: gpio.h:688
gpio::FAST_EXT_PIN
typename FastPinType< board::EXT_PIN< EPIN_ >()>::TYPE FAST_EXT_PIN
Useful alias type to the FastPin type matching a given board::ExternalInterruptPin.
Definition: gpio.h:734
gpio::PinMode::OUTPUT
@ OUTPUT
Digital pin is configured as output.