Charith Dassanayake / CPPToPigpio
Embed: (wiki syntax)

« Back to documentation index

DigitalOut Class Reference

DigitalOut Class Reference

The DigitalOut interface is used to configure and control a digital output pin. More...

#include <DigitalOut.h>

Inherits CPPToPigpio::CPPToPigpio.

Public Member Functions

 DigitalOut (PinName pin)
 Create a DigitalOut connected to the specified pin.
 DigitalOut (PinName pin, int value)
 Create a DigitalOut connected to the specified pin.
 DigitalOut (int pin)
 Create a DigitalOut connected to the specified pin.
 DigitalOut (int pin, int value)
 Create a DigitalOut connected to the specified pin.
void write (int value)
 Set the output, specified as 0 or 1 (int)
int read ()
 Return the output setting, represented as 0 or 1 (int)
 operator int ()
 A shorthand for read()
DigitalOutoperator= (int)
 A shorthand for write()
DigitalOutoperator= (DigitalOut &rhs)
 A shorthand for write()
 ~DigitalOut ()
 Deconstructor.

Detailed Description

The DigitalOut interface is used to configure and control a digital output pin.

Definition at line 7 of file DigitalOut.h.


Constructor & Destructor Documentation

DigitalOut ( PinName  pin )

Create a DigitalOut connected to the specified pin.

Parameters:
pinDigitalOut pin to connect to

Definition at line 2 of file DigitalOut.cc.

DigitalOut ( PinName  pin,
int  value 
)

Create a DigitalOut connected to the specified pin.

Parameters:
pinDigitalOut pin to connect to
valuethe initial pin value

Definition at line 7 of file DigitalOut.cc.

DigitalOut ( int  pin )

Create a DigitalOut connected to the specified pin.

Parameters:
pinDigitalOut pin to connect to

Definition at line 14 of file DigitalOut.cc.

DigitalOut ( int  pin,
int  value 
)

Create a DigitalOut connected to the specified pin.

Parameters:
pinDigitalOut pin to connect to
valuethe initial pin value

Definition at line 19 of file DigitalOut.cc.

~DigitalOut (  )

Deconstructor.

Definition at line 54 of file DigitalOut.cc.


Member Function Documentation

operator int (  )

A shorthand for read()

See also:
DigitalOut::read()

Definition at line 37 of file DigitalOut.cc.

DigitalOut & operator= ( DigitalOut rhs )

A shorthand for write()

See also:
DigitalOut::write()

Definition at line 48 of file DigitalOut.cc.

DigitalOut & operator= ( int  value )

A shorthand for write()

See also:
DigitalOut::write()

Definition at line 42 of file DigitalOut.cc.

int read (  )

Return the output setting, represented as 0 or 1 (int)

Returns:
an integer representing the output setting of the pin, 0 for logical 0, 1 for logical 1

Definition at line 32 of file DigitalOut.cc.

void write ( int  value )

Set the output, specified as 0 or 1 (int)

Parameters:
valueAn integer specifying the pin output value, 0 for logical 0, 1 (or any other non-zero value) for logical 1

Definition at line 24 of file DigitalOut.cc.