DigitalOut¶
- class
Mono variant of mbed::DigitalOut class, adding setMode() method.
This class is an extension of mbed’s
DigitalOut
class, adding an additional contructor and public method.The additional function is the possibility to change the pin drive mode, such that it does not need to be strong drive (CMOS). This class allows you to set the mode to
PullUp
/PullDown
/OpenDrain
.To see how you use the
DigitalOut
class, please refer to the mbed documentation pagePublic Functions
-
DigitalOut::
DigitalOut
(PinName pin, int value, PinMode mode)¶ Construct a output pin with a specific output mode, other than the default strong drive (CMOS).
WARNING: The mode is set AFTER the pin value. You should account for this possible hazard, by setting a sound initial value.
- Parameters
pin
-The pin identifier
value
-the initial value of the pin.
mode
-the initial drive mode of the pin
-
void
DigitalOut::
setMode
(PinMode mode)¶ Set the pins drive mode.
Use this method to enable resistive pull up/down or open drain modes.
- Parameters
mode
-The pin drive mode to use
-