![]() |
Mbed OS Reference
|
A digital input/output, used for setting or reading a bi-directional pin. More...
#include <DigitalInOut.h>
Public Member Functions | |
DigitalInOut (PinName pin) | |
Create a DigitalInOut connected to the specified pin. More... | |
DigitalInOut (PinName pin, PinDirection direction, PinMode mode, int value) | |
Create a DigitalInOut 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... | |
void | output () |
Set as an output. More... | |
void | input () |
Set as an input. More... | |
void | mode (PinMode pull) |
Set the input pin mode. More... | |
int | is_connected () |
Return the output setting, represented as 0 or 1 (int) More... | |
DigitalInOut & | operator= (int value) |
A shorthand for write() More... | |
DigitalInOut & | operator= (DigitalInOut &rhs) |
A shorthand for write() using the assignment operator which copies the state from the DigitalInOut argument. More... | |
operator int () | |
A shorthand for read() More... | |
A digital input/output, used for setting or reading a bi-directional pin.
Definition at line 36 of file DigitalInOut.h.
DigitalInOut | ( | PinName | pin | ) |
Create a DigitalInOut connected to the specified pin.
pin | DigitalInOut pin to connect to |
Definition at line 47 of file DigitalInOut.h.
DigitalInOut | ( | PinName | pin, |
PinDirection | direction, | ||
PinMode | mode, | ||
int | value | ||
) |
Create a DigitalInOut connected to the specified pin.
pin | DigitalInOut pin to connect to |
direction | the initial direction of the pin |
mode | the initial mode of the pin |
value | the initial value of the pin if is an output |
Definition at line 60 of file DigitalInOut.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 71 of file DigitalInOut.h.
int read | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 83 of file DigitalInOut.h.
void output | ( | ) |
Set as an output.
void input | ( | ) |
Set as an input.
void mode | ( | PinMode | pull | ) |
Set the input pin mode.
pull | PullUp, PullDown, PullNone, OpenDrain |
int is_connected | ( | ) |
Return the output setting, represented as 0 or 1 (int)
Definition at line 109 of file DigitalInOut.h.
DigitalInOut & operator= | ( | int | value | ) |
A shorthand for write()
Definition at line 125 of file DigitalInOut.h.
DigitalInOut & operator= | ( | DigitalInOut & | rhs | ) |
A shorthand for write() using the assignment operator which copies the state from the DigitalInOut argument.
operator int | ( | ) |
A shorthand for read()
Definition at line 148 of file DigitalInOut.h.