mbed-drivers
BusOut.h
1 /*
2  * Copyright (c) 2006-2016, ARM Limited, All Rights Reserved
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may
6  * not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef MBED_BUSOUT_H
18 #define MBED_BUSOUT_H
19 
20 #include "DigitalOut.h"
21 
22 namespace mbed {
23 
26 class BusOut {
27 
28 public:
29 
38  BusOut(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
39  PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
40  PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
41  PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
42 
43  BusOut(PinName pins[16]);
44 
45  virtual ~BusOut();
46 
51  void write(int value);
52 
58  int read();
59 
60 #ifdef MBED_OPERATORS
61 
63  BusOut& operator= (int v);
64  BusOut& operator= (BusOut& rhs);
65 
68  operator int();
69 #endif
70 
71 protected:
72  DigitalOut* _pin[16];
73 
74  /* disallow copy constructor and assignment operators */
75 private:
76  BusOut(const BusOut&);
77  BusOut & operator = (const BusOut&);
78 };
79 
80 } // namespace mbed
81 
82 #endif
int read()
Definition: BusOut.cpp:51
BusOut & operator=(int v)
Definition: BusOut.cpp:62
void write(int value)
Definition: BusOut.cpp:43
BusOut(PinName p0, PinName p1=NC, PinName p2=NC, PinName p3=NC, PinName p4=NC, PinName p5=NC, PinName p6=NC, PinName p7=NC, PinName p8=NC, PinName p9=NC, PinName p10=NC, PinName p11=NC, PinName p12=NC, PinName p13=NC, PinName p14=NC, PinName p15=NC)
Definition: BusOut.cpp:21
Definition: DigitalOut.h:42
Definition: BusOut.h:26
Definition: BusIn.cpp:19