MySensors Library & Examples  2.3.2-62-ge298769
Public Member Functions | Public Attributes | List of all members
DigitalPin< PinNumber > Class Template Reference

Detailed Description

template<uint8_t PinNumber>
class DigitalPin< PinNumber >

Fast digital port I/O.

Definition at line 318 of file DigitalPin.h.

#include <DigitalPin.h>

+ Collaboration diagram for DigitalPin< PinNumber >:

Public Member Functions

 DigitalPin ()
 
DigitalPinoperator= (bool value) __attribute__((always_inline))
 
 operator bool () const __attribute__((always_inline))
 
 __attribute__ ((always_inline)) void config(uint8_t mode
 
 __attribute__ ((always_inline)) void high()
 
 __attribute__ ((always_inline)) void low()
 
 __attribute__ ((always_inline)) void mode(uint8_t mode)
 
 __attribute__ ((always_inline)) bool read() const
 
 __attribute__ ((always_inline)) void toggle()
 
 __attribute__ ((always_inline)) void write(bool value)
 

Public Attributes

bool level
 

Constructor & Destructor Documentation

◆ DigitalPin()

template<uint8_t PinNumber>
DigitalPin< PinNumber >::DigitalPin ( )
inline

Constructor

Definition at line 323 of file DigitalPin.h.

Member Function Documentation

◆ __attribute__() [1/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  ) const
inline
Returns
Pin's level.

Definition at line 388 of file DigitalPin.h.

◆ __attribute__() [2/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

Set pin configuration.

Parameters
[in]modeINPUT or OUTPUT.
[in]levelIf mode is OUTPUT, set level high/low. If mode is INPUT, enable or disable the pin's 20K pullup.

◆ __attribute__() [3/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

Set pin level high if output mode or enable 20K pullup if input mode.

Definition at line 359 of file DigitalPin.h.

◆ __attribute__() [4/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

Set pin level low if output mode or disable 20K pullup if input mode.

Definition at line 368 of file DigitalPin.h.

◆ __attribute__() [5/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

Set pin mode.

Parameters
[in]modeINPUT, 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 381 of file DigitalPin.h.

◆ __attribute__() [6/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

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.

Definition at line 399 of file DigitalPin.h.

◆ __attribute__() [7/7]

template<uint8_t PinNumber>
DigitalPin< PinNumber >::__attribute__ ( (always_inline)  )
inline

Write the pin's level.

Parameters
[in]valueIf true set the pin's level high else set the pin's level low.

Definition at line 409 of file DigitalPin.h.

◆ operator bool()

template<uint8_t PinNumber>
DigitalPin< PinNumber >::operator bool ( ) const
inline

Parenthesis operator.

Returns
Pin's level

Definition at line 340 of file DigitalPin.h.

◆ operator=()

template<uint8_t PinNumber>
DigitalPin& DigitalPin< PinNumber >::operator= ( bool  value)
inline

Asignment operator.

Parameters
[in]valueIf true set the pin's level high else set the pin's level low.
Returns
This DigitalPin instance.

Definition at line 331 of file DigitalPin.h.

Member Data Documentation

◆ level

template<uint8_t PinNumber>
bool DigitalPin< PinNumber >::level
Initial value:
{
fastPinConfig(PinNumber, mode, level)

Definition at line 352 of file DigitalPin.h.


The documentation for this class was generated from the following file:
fastPinConfig
#define fastPinConfig(pin, mode, level)
Definition: DigitalPin.h:310