mbed library sources with internal temperature sensor for nucleo f401

Committer:
elessair
Date:
Sat Jan 17 18:03:58 2015 +0000
Revision:
0:7e2bd16f80af
nucleo f401re internal temperature added

Who changed what in which revision?

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