A library that maps the functions used with the mbed microcontroller to be used on with the GPIO ports of a Raspberry pi.

Embed: (wiki syntax)

« Back to documentation index

DigitalIn Class Reference

DigitalIn Class Reference

The DigitalIn interface is used to read the value of a digital input pin. More...

#include <DigitalIn.h>

Inherits CPPToPigpio::CPPToPigpio.

Public Member Functions

 DigitalIn (PinName pin)
 Create a DigitalIn connected to the specified pin.
 DigitalIn (PinName pin, PinMode mode)
 Create a DigitalIn connected to the specified pin.
 DigitalIn (int pin)
 Create a DigitalIn connected to the specified pin.
 DigitalIn (int pin, PinMode mode)
 Create a DigitalIn connected to the specified pin.
int read ()
 Read the input, represented as 0 or 1 (int)
 operator int ()
 An operator shorthand for read()
void mode (PinMode mode)
 Set the input pin mode.
bool operator== (int)
 Check equality of pin to other DigitalIn pin.
bool operator== (DigitalIn &)
 Check equality of pin to other DigitalIn pin.
 ~DigitalIn ()
 Deconstructor.

Detailed Description

The DigitalIn interface is used to read the value of a digital input pin.

Definition at line 6 of file DigitalIn.h.


Constructor & Destructor Documentation

DigitalIn ( PinName  pin )

Create a DigitalIn connected to the specified pin.

Parameters:
pinDigitalIn pin to connect to

Definition at line 3 of file DigitalIn.cc.

DigitalIn ( PinName  pin,
PinMode  mode 
)

Create a DigitalIn connected to the specified pin.

Parameters:
pinDigitalIn pin to connect to
modethe initial mode of the pin

Definition at line 10 of file DigitalIn.cc.

DigitalIn ( int  pin )

Create a DigitalIn connected to the specified pin.

Parameters:
pinDigitalIn pin to connect to

Definition at line 17 of file DigitalIn.cc.

DigitalIn ( int  pin,
PinMode  mode 
)

Create a DigitalIn connected to the specified pin.

Parameters:
pinDigitalIn pin to connect to
modethe initial mode of the pin

Definition at line 22 of file DigitalIn.cc.

~DigitalIn (  )

Deconstructor.

Definition at line 61 of file DigitalIn.cc.


Member Function Documentation

void mode ( PinMode  mode )

Set the input pin mode.

Parameters:
pullPullUp, PullDown, PullNone, OpenDrain

Definition at line 37 of file DigitalIn.cc.

operator int (  )

An operator shorthand for read()

See also:
DigitalIn::read()

Definition at line 32 of file DigitalIn.cc.

bool operator== ( DigitalIn other )

Check equality of pin to other DigitalIn pin.

Definition at line 56 of file DigitalIn.cc.

bool operator== ( int  in )

Check equality of pin to other DigitalIn pin.

Definition at line 51 of file DigitalIn.cc.

int read (  )

Read the input, represented as 0 or 1 (int)

Returns:
An integer representing the state of the input pin, 0 for logical 0, 1 for logical 1

Definition at line 27 of file DigitalIn.cc.