The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
171:3a7713b1edbc
Parent:
170:e95d10626187
Child:
172:65be27845400
--- a/drivers/DigitalOut.h	Thu Sep 06 13:39:34 2018 +0100
+++ b/drivers/DigitalOut.h	Thu Nov 08 11:45:42 2018 +0000
@@ -104,6 +104,11 @@
 
     /** A shorthand for write()
      * \sa DigitalOut::write()
+     * @code
+     *      DigitalIn  button(BUTTON1);
+     *      DigitalOut led(LED1);
+     *      led = button;   // Equivalent to led.write(button.read())
+     * @endcode
      */
     DigitalOut &operator= (int value)
     {
@@ -112,7 +117,8 @@
         return *this;
     }
 
-    /** A shorthand for write()
+    /** A shorthand for write() using the assignment operator which copies the
+     * state from the DigitalOut argument.
      * \sa DigitalOut::write()
      */
     DigitalOut &operator= (DigitalOut &rhs)
@@ -125,6 +131,11 @@
 
     /** A shorthand for read()
      * \sa DigitalOut::read()
+     * @code
+     *      DigitalIn  button(BUTTON1);
+     *      DigitalOut led(LED1);
+     *      led = button;   // Equivalent to led.write(button.read())
+     * @endcode
      */
     operator int()
     {
@@ -133,7 +144,9 @@
     }
 
 protected:
+    #if !defined(DOXYGEN_ONLY)
     gpio_t gpio;
+    #endif //!defined(DOXYGEN_ONLY)
 };
 
 } // namespace mbed