24
24
namespace mbed {
25
25
/* * \addtogroup drivers */
26
26
27
- /* * A digital input output bus, used for setting the state of a collection of pins
27
+ /* * A digital input output bus, used for setting the state of a collection of pins.
28
+ * Implemented as an array of DigitalInOut pins, the bus can be constucted by any
29
+ * pins without restriction other than being capable of digitial input or output
30
+ * capabilities
28
31
*
29
32
* @note Synchronization level: Thread safe
30
33
* @ingroup drivers
@@ -33,7 +36,7 @@ class BusInOut : private NonCopyable<BusInOut> {
33
36
34
37
public:
35
38
36
- /* * Create an BusInOut, connected to the specified pins
39
+ /* * Create a BusInOut, connected to the specified pins
37
40
*
38
41
* @param p0 DigitalInOut pin to connect to bus bit
39
42
* @param p1 DigitalInOut pin to connect to bus bit
@@ -61,9 +64,11 @@ class BusInOut : private NonCopyable<BusInOut> {
61
64
PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
62
65
PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
63
66
64
- /* * Create an BusInOut, connected to the specified pins
67
+ /* * Create a BusInOut, connected to the specified pins
65
68
*
66
- * @param pins An array of pins to construct a BusInOut from
69
+ * @param pins An array of pins (PinName) to construct a BusInOut from. The maximum
70
+ * number of pins in the array is 16 and any pins that are unspecified or are not to be
71
+ * connected must be specified as NC in the array that is passed in
67
72
*/
68
73
BusInOut (PinName pins[16 ]);
69
74
@@ -111,7 +116,7 @@ class BusInOut : private NonCopyable<BusInOut> {
111
116
}
112
117
113
118
/* * A shorthand for write()
114
- * \sa BusInOut::write()
119
+ * \sa BusInOut::write()
115
120
*/
116
121
BusInOut &operator = (int v);
117
122
BusInOut &operator = (BusInOut &rhs);
@@ -125,8 +130,9 @@ class BusInOut : private NonCopyable<BusInOut> {
125
130
* \sa BusInOut::read()
126
131
*/
127
132
operator int ();
128
- # if !defined(DOXYGEN_ONLY)
133
+
129
134
protected:
135
+ #if !defined(DOXYGEN_ONLY)
130
136
virtual void lock ();
131
137
virtual void unlock ();
132
138
DigitalInOut *_pin[16 ];
@@ -138,7 +144,7 @@ class BusInOut : private NonCopyable<BusInOut> {
138
144
int _nc_mask;
139
145
140
146
PlatformMutex _mutex;
141
- #endif
147
+ #endif // !defined(DOXYGEN_ONLY)
142
148
};
143
149
144
150
} // namespace mbed
0 commit comments