A digital output, used for setting the state of a pin. More...
#include <DigitalOut.h>
Public Member Functions | |
DigitalOut (PinName pin) | |
Create a DigitalOut connected to the specified pin. More... | |
DigitalOut (PinName pin, int value) | |
Create a DigitalOut connected to the specified pin. More... | |
void | write (int value) |
Set the output, specified as 0 or 1 (int) More... | |
int | read () |
Return the output setting, represented as 0 or 1 (int) More... | |
int | is_connected () |
Return the output setting, represented as 0 or 1 (int) More... | |
DigitalOut & | operator= (int value) |
A shorthand for write() More... | |
DigitalOut & | operator= (DigitalOut &rhs) |
A shorthand for write() using the assignment operator which copies the state from the DigitalOut argument. More... | |
operator int () | |
A shorthand for read() More... | |
A digital output, used for setting the state of a pin.
Example:
Definition at line 47 of file DigitalOut.h.
DigitalOut | ( | PinName | pin | ) |
Create a DigitalOut connected to the specified pin.
pin | DigitalOut pin to connect to |
Definition at line 54 of file DigitalOut.h.
DigitalOut | ( | PinName | pin, |
int | value | ||
) |
Create a DigitalOut connected to the specified pin.
pin | DigitalOut pin to connect to |
value | the initial pin value |
Definition at line 65 of file DigitalOut.h.
int is_connected | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 100 of file DigitalOut.h.
operator int | ( | ) |
A shorthand for read()
Definition at line 141 of file DigitalOut.h.
DigitalOut& operator= | ( | int | value | ) |
A shorthand for write()
Definition at line 114 of file DigitalOut.h.
DigitalOut& operator= | ( | DigitalOut & | rhs | ) |
A shorthand for write() using the assignment operator which copies the state from the DigitalOut argument.
Definition at line 125 of file DigitalOut.h.
int read | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 88 of file DigitalOut.h.
void write | ( | int | value | ) |
Set the output, specified as 0 or 1 (int)
value | An integer specifying the pin output value, 0 for logical 0, 1 (or any other non-zero value) for logical 1 |
Definition at line 76 of file DigitalOut.h.