FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.

Dependencies:   mbed FXOS8700CQ MODSERIAL

Committer:
jwhammel
Date:
Mon Apr 29 04:24:38 2019 +0000
Revision:
85:0cf65ceb4492
Parent:
84:fc8c9b39723a
We have added an alarm trigger that gets sent to AT&T Flow.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jwhammel 84:fc8c9b39723a 1 /* mbed Microcontroller Library
jwhammel 84:fc8c9b39723a 2 * Copyright (c) 2006-2013 ARM Limited
jwhammel 84:fc8c9b39723a 3 *
jwhammel 84:fc8c9b39723a 4 * Licensed under the Apache License, Version 2.0 (the "License");
jwhammel 84:fc8c9b39723a 5 * you may not use this file except in compliance with the License.
jwhammel 84:fc8c9b39723a 6 * You may obtain a copy of the License at
jwhammel 84:fc8c9b39723a 7 *
jwhammel 84:fc8c9b39723a 8 * http://www.apache.org/licenses/LICENSE-2.0
jwhammel 84:fc8c9b39723a 9 *
jwhammel 84:fc8c9b39723a 10 * Unless required by applicable law or agreed to in writing, software
jwhammel 84:fc8c9b39723a 11 * distributed under the License is distributed on an "AS IS" BASIS,
jwhammel 84:fc8c9b39723a 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
jwhammel 84:fc8c9b39723a 13 * See the License for the specific language governing permissions and
jwhammel 84:fc8c9b39723a 14 * limitations under the License.
jwhammel 84:fc8c9b39723a 15 */
jwhammel 84:fc8c9b39723a 16 #ifndef MBED_BUSIN_H
jwhammel 84:fc8c9b39723a 17 #define MBED_BUSIN_H
jwhammel 84:fc8c9b39723a 18
jwhammel 84:fc8c9b39723a 19 #include "platform.h"
jwhammel 84:fc8c9b39723a 20 #include "DigitalIn.h"
jwhammel 84:fc8c9b39723a 21
jwhammel 84:fc8c9b39723a 22 namespace mbed {
jwhammel 84:fc8c9b39723a 23
jwhammel 84:fc8c9b39723a 24 /** A digital input bus, used for reading the state of a collection of pins
jwhammel 84:fc8c9b39723a 25 */
jwhammel 84:fc8c9b39723a 26 class BusIn {
jwhammel 84:fc8c9b39723a 27
jwhammel 84:fc8c9b39723a 28 public:
jwhammel 84:fc8c9b39723a 29 /* Group: Configuration Methods */
jwhammel 84:fc8c9b39723a 30
jwhammel 84:fc8c9b39723a 31 /** Create an BusIn, connected to the specified pins
jwhammel 84:fc8c9b39723a 32 *
jwhammel 84:fc8c9b39723a 33 * @param <n> DigitalIn pin to connect to bus bit <n> (p5-p30, NC)
jwhammel 84:fc8c9b39723a 34 *
jwhammel 84:fc8c9b39723a 35 * @note
jwhammel 84:fc8c9b39723a 36 * It is only required to specify as many pin variables as is required
jwhammel 84:fc8c9b39723a 37 * for the bus; the rest will default to NC (not connected)
jwhammel 84:fc8c9b39723a 38 */
jwhammel 84:fc8c9b39723a 39 BusIn(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
jwhammel 84:fc8c9b39723a 40 PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
jwhammel 84:fc8c9b39723a 41 PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
jwhammel 84:fc8c9b39723a 42 PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
jwhammel 84:fc8c9b39723a 43
jwhammel 84:fc8c9b39723a 44 BusIn(PinName pins[16]);
jwhammel 84:fc8c9b39723a 45
jwhammel 84:fc8c9b39723a 46 virtual ~BusIn();
jwhammel 84:fc8c9b39723a 47
jwhammel 84:fc8c9b39723a 48 /** Read the value of the input bus
jwhammel 84:fc8c9b39723a 49 *
jwhammel 84:fc8c9b39723a 50 * @returns
jwhammel 84:fc8c9b39723a 51 * An integer with each bit corresponding to the value read from the associated DigitalIn pin
jwhammel 84:fc8c9b39723a 52 */
jwhammel 84:fc8c9b39723a 53 int read();
jwhammel 84:fc8c9b39723a 54
jwhammel 84:fc8c9b39723a 55 /** Set the input pin mode
jwhammel 84:fc8c9b39723a 56 *
jwhammel 84:fc8c9b39723a 57 * @param mode PullUp, PullDown, PullNone
jwhammel 84:fc8c9b39723a 58 */
jwhammel 84:fc8c9b39723a 59 void mode(PinMode pull);
jwhammel 84:fc8c9b39723a 60
jwhammel 84:fc8c9b39723a 61 #ifdef MBED_OPERATORS
jwhammel 84:fc8c9b39723a 62 /** A shorthand for read()
jwhammel 84:fc8c9b39723a 63 */
jwhammel 84:fc8c9b39723a 64 operator int();
jwhammel 84:fc8c9b39723a 65 #endif
jwhammel 84:fc8c9b39723a 66
jwhammel 84:fc8c9b39723a 67 protected:
jwhammel 84:fc8c9b39723a 68 DigitalIn* _pin[16];
jwhammel 84:fc8c9b39723a 69
jwhammel 84:fc8c9b39723a 70 /* disallow copy constructor and assignment operators */
jwhammel 84:fc8c9b39723a 71 private:
jwhammel 84:fc8c9b39723a 72 BusIn(const BusIn&);
jwhammel 84:fc8c9b39723a 73 BusIn & operator = (const BusIn&);
jwhammel 84:fc8c9b39723a 74 };
jwhammel 84:fc8c9b39723a 75
jwhammel 84:fc8c9b39723a 76 } // namespace mbed
jwhammel 84:fc8c9b39723a 77
jwhammel 84:fc8c9b39723a 78 #endif
jwhammel 84:fc8c9b39723a 79