SdFat
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | List of all members
DigitalPin< PinNumber > Class Template Reference

Fast digital port I/O. More...

#include <DigitalPin.h>

Public Member Functions

void config (bool mode, bool level)
 
 DigitalPin ()
 
 DigitalPin (bool pinMode)
 
 DigitalPin (bool mode, bool level)
 
void high ()
 
void low ()
 
void mode (bool pinMode)
 
 operator bool () const
 
DigitalPinoperator= (bool value)
 
bool read () const
 
void toggle ()
 
void write (bool value)
 

Detailed Description

template<uint8_t PinNumber>
class DigitalPin< PinNumber >

Fast digital port I/O.

Constructor & Destructor Documentation

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

Constructor

template<uint8_t PinNumber>
DigitalPin< PinNumber >::DigitalPin ( bool  pinMode)
inlineexplicit

Constructor

Parameters
[in]pinModeif true set output mode else input mode.
template<uint8_t PinNumber>
DigitalPin< PinNumber >::DigitalPin ( bool  mode,
bool  level 
)
inline

Constructor

Parameters
[in]modeIf true set output mode else input mode
[in]levelIf mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pull-up.

Member Function Documentation

template<uint8_t PinNumber>
void DigitalPin< PinNumber >::config ( bool  mode,
bool  level 
)
inline

set pin configuration

Parameters
[in]modeIf true set output mode else input mode
[in]levelIf mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pull-up.
template<uint8_t PinNumber>
void DigitalPin< PinNumber >::high ( )
inline

Set pin level high if output mode or enable 20K pull-up if input mode.

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

Set pin level low if output mode or disable 20K pull-up if input mode.

template<uint8_t PinNumber>
void DigitalPin< PinNumber >::mode ( bool  pinMode)
inline

Set pin mode

Parameters
[in]pinModeif true set output mode else input mode.

mode() does not enable or disable the 20K pull-up for input mode.

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

Parenthesis operator

Returns
Pin's level
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.
template<uint8_t PinNumber>
bool DigitalPin< PinNumber >::read ( ) const
inline
Returns
Pin's level
template<uint8_t PinNumber>
void DigitalPin< PinNumber >::toggle ( )
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 pull-up.

template<uint8_t PinNumber>
void DigitalPin< PinNumber >::write ( bool  value)
inline

Write the pin's level.

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

The documentation for this class was generated from the following file: