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_BUSOUT_H
jwhammel 84:fc8c9b39723a 17 #define MBED_BUSOUT_H
jwhammel 84:fc8c9b39723a 18
jwhammel 84:fc8c9b39723a 19 #include "DigitalOut.h"
jwhammel 84:fc8c9b39723a 20
jwhammel 84:fc8c9b39723a 21 namespace mbed {
jwhammel 84:fc8c9b39723a 22
jwhammel 84:fc8c9b39723a 23 /** A digital output bus, used for setting the state of a collection of pins
jwhammel 84:fc8c9b39723a 24 */
jwhammel 84:fc8c9b39723a 25 class BusOut {
jwhammel 84:fc8c9b39723a 26
jwhammel 84:fc8c9b39723a 27 public:
jwhammel 84:fc8c9b39723a 28
jwhammel 84:fc8c9b39723a 29 /** Create an BusOut, connected to the specified pins
jwhammel 84:fc8c9b39723a 30 *
jwhammel 84:fc8c9b39723a 31 * @param p<n> DigitalOut pin to connect to bus bit <n> (p5-p30, NC)
jwhammel 84:fc8c9b39723a 32 *
jwhammel 84:fc8c9b39723a 33 * @note
jwhammel 84:fc8c9b39723a 34 * It is only required to specify as many pin variables as is required
jwhammel 84:fc8c9b39723a 35 * for the bus; the rest will default to NC (not connected)
jwhammel 84:fc8c9b39723a 36 */
jwhammel 84:fc8c9b39723a 37 BusOut(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
jwhammel 84:fc8c9b39723a 38 PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
jwhammel 84:fc8c9b39723a 39 PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
jwhammel 84:fc8c9b39723a 40 PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
jwhammel 84:fc8c9b39723a 41
jwhammel 84:fc8c9b39723a 42 BusOut(PinName pins[16]);
jwhammel 84:fc8c9b39723a 43
jwhammel 84:fc8c9b39723a 44 virtual ~BusOut();
jwhammel 84:fc8c9b39723a 45
jwhammel 84:fc8c9b39723a 46 /** Write the value to the output bus
jwhammel 84:fc8c9b39723a 47 *
jwhammel 84:fc8c9b39723a 48 * @param value An integer specifying a bit to write for every corresponding DigitalOut pin
jwhammel 84:fc8c9b39723a 49 */
jwhammel 84:fc8c9b39723a 50 void write(int value);
jwhammel 84:fc8c9b39723a 51
jwhammel 84:fc8c9b39723a 52 /** Read the value currently output on the bus
jwhammel 84:fc8c9b39723a 53 *
jwhammel 84:fc8c9b39723a 54 * @returns
jwhammel 84:fc8c9b39723a 55 * An integer with each bit corresponding to associated DigitalOut pin setting
jwhammel 84:fc8c9b39723a 56 */
jwhammel 84:fc8c9b39723a 57 int read();
jwhammel 84:fc8c9b39723a 58
jwhammel 84:fc8c9b39723a 59 #ifdef MBED_OPERATORS
jwhammel 84:fc8c9b39723a 60 /** A shorthand for write()
jwhammel 84:fc8c9b39723a 61 */
jwhammel 84:fc8c9b39723a 62 BusOut& operator= (int v);
jwhammel 84:fc8c9b39723a 63 BusOut& operator= (BusOut& rhs);
jwhammel 84:fc8c9b39723a 64
jwhammel 84:fc8c9b39723a 65 /** A shorthand for read()
jwhammel 84:fc8c9b39723a 66 */
jwhammel 84:fc8c9b39723a 67 operator int();
jwhammel 84:fc8c9b39723a 68 #endif
jwhammel 84:fc8c9b39723a 69
jwhammel 84:fc8c9b39723a 70 protected:
jwhammel 84:fc8c9b39723a 71 DigitalOut* _pin[16];
jwhammel 84:fc8c9b39723a 72
jwhammel 84:fc8c9b39723a 73 /* disallow copy constructor and assignment operators */
jwhammel 84:fc8c9b39723a 74 private:
jwhammel 84:fc8c9b39723a 75 BusOut(const BusOut&);
jwhammel 84:fc8c9b39723a 76 BusOut & operator = (const BusOut&);
jwhammel 84:fc8c9b39723a 77 };
jwhammel 84:fc8c9b39723a 78
jwhammel 84:fc8c9b39723a 79 } // namespace mbed
jwhammel 84:fc8c9b39723a 80
jwhammel 84:fc8c9b39723a 81 #endif
jwhammel 84:fc8c9b39723a 82