mbed-drivers
BusInOut.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_BUSINOUT_H
18 #define MBED_BUSINOUT_H
19 
20 #include "DigitalInOut.h"
21 
22 namespace mbed {
23 
26 class BusInOut {
27 
28 public:
29 
38  BusInOut(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  BusInOut(PinName pins[16]);
44 
45  virtual ~BusInOut();
46 
47  /* Group: Access Methods */
48 
53  void write(int value);
54 
55 
61  int read();
62 
65  void output();
66 
69  void input();
70 
75  void mode(PinMode pull);
76 
77 #ifdef MBED_OPERATORS
78 
80  BusInOut& operator= (int v);
82 
85  operator int();
86 #endif
87 
88 protected:
89  DigitalInOut* _pin[16];
90 
91  /* disallow copy constructor and assignment operators */
92 private:
93  BusInOut(const BusInOut&);
94  BusInOut & operator = (const BusInOut&);
95 };
96 
97 } // namespace mbed
98 
99 #endif
int read()
Definition: BusInOut.cpp:51
Definition: BusInOut.h:26
void input()
Definition: BusInOut.cpp:69
Definition: DigitalInOut.h:28
BusInOut & operator=(int v)
Definition: BusInOut.cpp:86
void write(int value)
Definition: BusInOut.cpp:43
void output()
Definition: BusInOut.cpp:61
void mode(PinMode pull)
Definition: BusInOut.cpp:77
BusInOut(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: BusInOut.cpp:21
Definition: BusIn.cpp:19