ads1115 only
Fork of mbed by
Diff: BusOut.h
- Revision:
- 44:24d45a770a51
- Parent:
- 43:e2ed12d17f06
- Child:
- 54:71b101360fb9
--- a/BusOut.h Fri Oct 26 17:40:46 2012 +0100 +++ b/BusOut.h Wed Nov 21 10:49:56 2012 +0000 @@ -1,21 +1,34 @@ -/* mbed Microcontroller Library - BusOut - * Copyright (c) 2007-2009 ARM Limited. All rights reserved. +/* mbed Microcontroller Library + * Copyright (c) 2006-2012 ARM Limited + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ - #ifndef MBED_BUSOUT_H #define MBED_BUSOUT_H -#include "platform.h" -#include "PinNames.h" -#include "PeripheralNames.h" -#include "Base.h" #include "DigitalOut.h" namespace mbed { /** A digital output bus, used for setting the state of a collection of pins */ -class BusOut : public Base { +class BusOut { public: @@ -24,26 +37,24 @@ * @param p<n> DigitalOut pin to connect to bus bit <n> (p5-p30, NC) * * @note - * It is only required to specify as many pin variables as is required - * for the bus; the rest will default to NC (not connected) - */ + * It is only required to specify as many pin variables as is required + * for the bus; the rest will default to NC (not connected) + */ 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, - const char *name = NULL); + PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC); - BusOut(PinName pins[16], const char *name = NULL); + BusOut(PinName pins[16]); virtual ~BusOut(); - + /** Write the value to the output bus * * @param value An integer specifying a bit to write for every corresponding DigitalOut pin */ void write(int value); - /** Read the value currently output on the bus * * @returns @@ -52,7 +63,6 @@ int read(); #ifdef MBED_OPERATORS - /** A shorthand for write() */ BusOut& operator= (int v); @@ -63,22 +73,10 @@ operator int(); #endif -#ifdef MBED_RPC - virtual const struct rpc_method *get_rpc_methods(); - static struct rpc_class *get_rpc_class(); -#endif - protected: - DigitalOut* _pin[16]; - -#ifdef MBED_RPC - static void construct(const char *arguments, char *res); -#endif - }; } // namespace mbed #endif -