mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: drivers/DigitalInOut.h
- Revision:
- 188:bcfe06ba3d64
- Parent:
- 187:0387e8f68319
- Child:
- 189:f392fc9709a3
--- a/drivers/DigitalInOut.h Thu Sep 06 13:40:20 2018 +0100 +++ b/drivers/DigitalInOut.h Thu Nov 08 11:46:34 2018 +0000 @@ -121,6 +121,13 @@ /** A shorthand for write() * \sa DigitalInOut::write() + * @code + * DigitalInOut inout(PIN); + * DigitalIn button(BUTTON1); + * inout.output(); + * + * inout = button; // Equivalent to inout.write(button.read()) + * @endcode */ DigitalInOut &operator= (int value) { @@ -129,7 +136,8 @@ return *this; } - /** A shorthand for write() + /**A shorthand for write() using the assignment operator which copies the + * state from the DigitalInOut argument. * \sa DigitalInOut::write() */ DigitalInOut &operator= (DigitalInOut &rhs) @@ -142,6 +150,13 @@ /** A shorthand for read() * \sa DigitalInOut::read() + * @code + * DigitalInOut inout(PIN); + * DigitalOut led(LED1); + * + * inout.input(); + * led = inout; // Equivalent to led.write(inout.read()) + * @endcode */ operator int() { @@ -150,7 +165,9 @@ } protected: + #if !defined(DOXYGEN_ONLY) gpio_t gpio; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed