diff --git a/drivers/AnalogIn.h b/drivers/AnalogIn.h index c9ccfa25a1..f634fa5ee0 100644 --- a/drivers/AnalogIn.h +++ b/drivers/AnalogIn.h @@ -114,7 +114,7 @@ public: } protected: - + #if !defined(DOXYGEN_ONLY) virtual void lock() { _mutex->lock(); @@ -127,6 +127,7 @@ protected: analogin_t _adc; static SingletonPtr _mutex; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed diff --git a/drivers/AnalogOut.h b/drivers/AnalogOut.h index 3945c580c4..2f49fef8bc 100644 --- a/drivers/AnalogOut.h +++ b/drivers/AnalogOut.h @@ -141,7 +141,7 @@ public: } protected: - + #if !defined(DOXYGEN_ONLY) virtual void lock() { _mutex.lock(); @@ -154,6 +154,7 @@ protected: dac_t _dac; PlatformMutex _mutex; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed diff --git a/drivers/DigitalIn.h b/drivers/DigitalIn.h index 1a2af01fa3..a5679b1225 100644 --- a/drivers/DigitalIn.h +++ b/drivers/DigitalIn.h @@ -108,6 +108,11 @@ public: /** An operator shorthand for read() * \sa DigitalIn::read() + * @code + * DigitalIn button(BUTTON1); + * DigitalOut led(LED1); + * led = button; // Equivalent to led.write(button.read()) + * @endcode */ operator int() { @@ -116,7 +121,9 @@ public: } protected: + #if !defined(DOXYGEN_ONLY) gpio_t gpio; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed diff --git a/drivers/DigitalInOut.h b/drivers/DigitalInOut.h index a11fcad2c0..74a5747f20 100644 --- a/drivers/DigitalInOut.h +++ b/drivers/DigitalInOut.h @@ -121,6 +121,13 @@ public: /** 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 @@ public: 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 @@ public: /** 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 @@ public: } protected: + #if !defined(DOXYGEN_ONLY) gpio_t gpio; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed diff --git a/drivers/DigitalOut.h b/drivers/DigitalOut.h index fb6d1be6c2..5758c2658c 100644 --- a/drivers/DigitalOut.h +++ b/drivers/DigitalOut.h @@ -104,6 +104,11 @@ public: /** 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 @@ public: 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 @@ public: /** 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 @@ public: } protected: + #if !defined(DOXYGEN_ONLY) gpio_t gpio; + #endif //!defined(DOXYGEN_ONLY) }; } // namespace mbed