Remote Sensing demo. This is the code that runs on mbed to interface with the Remote Sensing Applet Demo

Dependencies:   EthernetNetIf mbed TMP102 HTTPServer ADJD-S371_ColourSens

Committer:
MichaelW
Date:
Fri Feb 04 11:10:22 2011 +0000
Revision:
2:1cc34c25b99d
Updated RPCInterface Library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MichaelW 2:1cc34c25b99d 1 /**
MichaelW 2:1cc34c25b99d 2 * @section LICENSE
MichaelW 2:1cc34c25b99d 3 *Copyright (c) 2010 ARM Ltd.
MichaelW 2:1cc34c25b99d 4 *
MichaelW 2:1cc34c25b99d 5 *Permission is hereby granted, free of charge, to any person obtaining a copy
MichaelW 2:1cc34c25b99d 6 *of this software and associated documentation files (the "Software"), to deal
MichaelW 2:1cc34c25b99d 7 *in the Software without restriction, including without limitation the rights
MichaelW 2:1cc34c25b99d 8 *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
MichaelW 2:1cc34c25b99d 9 *copies of the Software, and to permit persons to whom the Software is
MichaelW 2:1cc34c25b99d 10 *furnished to do so, subject to the following conditions:
MichaelW 2:1cc34c25b99d 11 *
MichaelW 2:1cc34c25b99d 12 *The above copyright notice and this permission notice shall be included in
MichaelW 2:1cc34c25b99d 13 *all copies or substantial portions of the Software.
MichaelW 2:1cc34c25b99d 14 *
MichaelW 2:1cc34c25b99d 15 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
MichaelW 2:1cc34c25b99d 16 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
MichaelW 2:1cc34c25b99d 17 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
MichaelW 2:1cc34c25b99d 18 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
MichaelW 2:1cc34c25b99d 19 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
MichaelW 2:1cc34c25b99d 20 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
MichaelW 2:1cc34c25b99d 21 *THE SOFTWARE.
MichaelW 2:1cc34c25b99d 22 *
MichaelW 2:1cc34c25b99d 23 *
MichaelW 2:1cc34c25b99d 24 * @section DESCRIPTION
MichaelW 2:1cc34c25b99d 25 * Library for using the SCP1000-D01 MEMS Pressure sensor
MichaelW 2:1cc34c25b99d 26 *
MichaelW 2:1cc34c25b99d 27 */
MichaelW 2:1cc34c25b99d 28
MichaelW 2:1cc34c25b99d 29 #ifndef SCP1000_D01_H_
MichaelW 2:1cc34c25b99d 30 #define SCP1000_D01_H_
MichaelW 2:1cc34c25b99d 31 /**
MichaelW 2:1cc34c25b99d 32 * Includes
MichaelW 2:1cc34c25b99d 33 */
MichaelW 2:1cc34c25b99d 34 #include "mbed.h"
MichaelW 2:1cc34c25b99d 35 /**
MichaelW 2:1cc34c25b99d 36 * Class to allow reading of the SCP1000-D01 mems pressure sensor (SPI mode). The class currently only supports High resolution mode.
MichaelW 2:1cc34c25b99d 37 * This means that the sensor can be read at a maximum rate of 1.8Hz.
MichaelW 2:1cc34c25b99d 38 */
MichaelW 2:1cc34c25b99d 39 class SCP1000{
MichaelW 2:1cc34c25b99d 40 public:
MichaelW 2:1cc34c25b99d 41 /**
MichaelW 2:1cc34c25b99d 42 *Constructor
MichaelW 2:1cc34c25b99d 43 *
MichaelW 2:1cc34c25b99d 44 * @param mosi The MOSI pin for the SPI interface
MichaelW 2:1cc34c25b99d 45 * @param miso The MISO pin for the SPI interface
MichaelW 2:1cc34c25b99d 46 * @param CSB The Chip select on the SCP1000
MichaelW 2:1cc34c25b99d 47 */
MichaelW 2:1cc34c25b99d 48 SCP1000(PinName mosi, PinName miso, PinName sck, PinName CSB);
MichaelW 2:1cc34c25b99d 49
MichaelW 2:1cc34c25b99d 50 /**
MichaelW 2:1cc34c25b99d 51 * Read the current Pressure.
MichaelW 2:1cc34c25b99d 52 * This blocks until the sensor has completed a reading
MichaelW 2:1cc34c25b99d 53 *
MichaelW 2:1cc34c25b99d 54 * @returns The pressure in pascals (N/m2)
MichaelW 2:1cc34c25b99d 55 */
MichaelW 2:1cc34c25b99d 56 float read();
MichaelW 2:1cc34c25b99d 57 /**
MichaelW 2:1cc34c25b99d 58 * Reads the temperature as measured by the SCP1000.
MichaelW 2:1cc34c25b99d 59 * This blocks until the sensor has completed a reading
MichaelW 2:1cc34c25b99d 60 *
MichaelW 2:1cc34c25b99d 61 *@returns The temperature in degrees celsius
MichaelW 2:1cc34c25b99d 62 */
MichaelW 2:1cc34c25b99d 63 float readTemperature();
MichaelW 2:1cc34c25b99d 64
MichaelW 2:1cc34c25b99d 65
MichaelW 2:1cc34c25b99d 66
MichaelW 2:1cc34c25b99d 67 private:
MichaelW 2:1cc34c25b99d 68 /**
MichaelW 2:1cc34c25b99d 69 * Method which blocks until the sensor is ready to be read.
MichaelW 2:1cc34c25b99d 70 * @returns 1 when successful.
MichaelW 2:1cc34c25b99d 71 */
MichaelW 2:1cc34c25b99d 72 int _waitReady();
MichaelW 2:1cc34c25b99d 73 //Interfaces
MichaelW 2:1cc34c25b99d 74 SPI _spi;
MichaelW 2:1cc34c25b99d 75 DigitalOut _CSB;
MichaelW 2:1cc34c25b99d 76
MichaelW 2:1cc34c25b99d 77 //Pins that woudl be required to use SCP1000 in different modes
MichaelW 2:1cc34c25b99d 78 // DigitalIn _DRDY; //Interrupt data ready - also need to be able to attach a function to this class
MichaelW 2:1cc34c25b99d 79 // DigitalOut _TRIG; //Trigger
MichaelW 2:1cc34c25b99d 80 // DigitalOut _PD; //Power Down
MichaelW 2:1cc34c25b99d 81
MichaelW 2:1cc34c25b99d 82
MichaelW 2:1cc34c25b99d 83 };
MichaelW 2:1cc34c25b99d 84 #endif