mbed-drivers
BusIn.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_BUSIN_H
18 #define MBED_BUSIN_H
19 
20 #include "platform.h"
21 #include "DigitalIn.h"
22 
23 namespace mbed {
24 
27 class BusIn {
28 
29 public:
30  /* Group: Configuration Methods */
31 
40  BusIn(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
41  PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
42  PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
43  PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
44 
45  BusIn(PinName pins[16]);
46 
47  virtual ~BusIn();
48 
54  int read();
55 
60  void mode(PinMode pull);
61 
62 #ifdef MBED_OPERATORS
63 
65  operator int();
66 #endif
67 
68 protected:
69  DigitalIn* _pin[16];
70 
71  /* disallow copy constructor and assignment operators */
72 private:
73  BusIn(const BusIn&);
74  BusIn & operator = (const BusIn&);
75 };
76 
77 } // namespace mbed
78 
79 #endif
Definition: BusIn.h:27
void mode(PinMode pull)
Definition: BusIn.cpp:53
BusIn(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: BusIn.cpp:21
Definition: DigitalIn.h:47
Definition: BusIn.cpp:19
int read()
Definition: BusIn.cpp:43