Skip to content

Update comments and improve readability for the BusInOut class #10408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions drivers/BusInOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
namespace mbed {
/** \addtogroup drivers */

/** A digital input output bus, used for setting the state of a collection of pins
/** A digital input output bus, used for setting the state of a collection of pins.
* Implemented as an array of DigitalInOut pins, the bus can be constructed by any
* pins without restriction other than being capable of digital input or output
* capabilities
*
* @note Synchronization level: Thread safe
* @ingroup drivers
Expand All @@ -33,7 +36,7 @@ class BusInOut : private NonCopyable<BusInOut> {

public:

/** Create an BusInOut, connected to the specified pins
/** Create a BusInOut, connected to the specified pins
*
* @param p0 DigitalInOut pin to connect to bus bit
* @param p1 DigitalInOut pin to connect to bus bit
Expand Down Expand Up @@ -61,9 +64,11 @@ class BusInOut : private NonCopyable<BusInOut> {
PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);

/** Create an BusInOut, connected to the specified pins
/** Create a BusInOut, connected to the specified pins
*
* @param pins An array of pins to construct a BusInOut from
* @param pins An array of pins (PinName) to construct a BusInOut from. The maximum
* number of pins in the array is 16 and any pins that are unspecified or are not to be
* connected must be specified as NC in the array that is passed in
*/
BusInOut(PinName pins[16]);

Expand Down Expand Up @@ -111,7 +116,7 @@ class BusInOut : private NonCopyable<BusInOut> {
}

/** A shorthand for write()
* \sa BusInOut::write()
* \sa BusInOut::write()
*/
BusInOut &operator= (int v);
BusInOut &operator= (BusInOut &rhs);
Expand All @@ -125,8 +130,9 @@ class BusInOut : private NonCopyable<BusInOut> {
* \sa BusInOut::read()
*/
operator int();
#if !defined(DOXYGEN_ONLY)

protected:
#if !defined(DOXYGEN_ONLY)
virtual void lock();
virtual void unlock();
DigitalInOut *_pin[16];
Expand All @@ -138,7 +144,7 @@ class BusInOut : private NonCopyable<BusInOut> {
int _nc_mask;

PlatformMutex _mutex;
#endif
#endif //!defined(DOXYGEN_ONLY)
};

} // namespace mbed
Expand Down