there is a problem. i cant send data continuously.

Dependencies:   EthernetNetIf mbed HMC6352 ITG3200 ADXL345 IMUfilter

Committer:
fyazgan
Date:
Sun Jul 24 19:49:51 2011 +0000
Revision:
0:711905e937b9

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fyazgan 0:711905e937b9 1 /**
fyazgan 0:711905e937b9 2 * @section LICENSE
fyazgan 0:711905e937b9 3 * This program is free software; you can redistribute it and/or modify
fyazgan 0:711905e937b9 4 * it under the terms of the GNU General Public License as published by
fyazgan 0:711905e937b9 5 * the Free Software Foundation; either version 2 of the License, or
fyazgan 0:711905e937b9 6 * (at your option) any later version.
fyazgan 0:711905e937b9 7 *
fyazgan 0:711905e937b9 8 * This program is distributed in the hope that it will be useful, but
fyazgan 0:711905e937b9 9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
fyazgan 0:711905e937b9 10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fyazgan 0:711905e937b9 11 * for more details.
fyazgan 0:711905e937b9 12 *
fyazgan 0:711905e937b9 13 * You should have received a copy of the GNU General Public License along
fyazgan 0:711905e937b9 14 * with this program; if not, write to the Free Software Foundation, Inc.,
fyazgan 0:711905e937b9 15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fyazgan 0:711905e937b9 16 *
fyazgan 0:711905e937b9 17 * @section DESCRIPTION
fyazgan 0:711905e937b9 18 * Library to interface with the SCP1000 pressure and temperature sensor.
fyazgan 0:711905e937b9 19 */
fyazgan 0:711905e937b9 20
fyazgan 0:711905e937b9 21 #ifndef _SCP1000_H
fyazgan 0:711905e937b9 22 #define _SCP1000_H
fyazgan 0:711905e937b9 23
fyazgan 0:711905e937b9 24 #include "mbed.h"
fyazgan 0:711905e937b9 25
fyazgan 0:711905e937b9 26 /**
fyazgan 0:711905e937b9 27 * Class to interface with the SCP1000 pressure and temperature sensor.
fyazgan 0:711905e937b9 28 */
fyazgan 0:711905e937b9 29 class SCP1000 {
fyazgan 0:711905e937b9 30 public:
fyazgan 0:711905e937b9 31 /**
fyazgan 0:711905e937b9 32 * Constructor.
fyazgan 0:711905e937b9 33 *
fyazgan 0:711905e937b9 34 * @param mosi SPI MOSI pin
fyazgan 0:711905e937b9 35 * @param miso SPI MISO pin
fyazgan 0:711905e937b9 36 * @param sclk SPI SCLK pin
fyazgan 0:711905e937b9 37 * @param cs Chip select pin
fyazgan 0:711905e937b9 38 */
fyazgan 0:711905e937b9 39 SCP1000(PinName mosi, PinName miso, PinName sclk, PinName cs);
fyazgan 0:711905e937b9 40
fyazgan 0:711905e937b9 41 ~SCP1000() { /* empty */ };
fyazgan 0:711905e937b9 42
fyazgan 0:711905e937b9 43 /**
fyazgan 0:711905e937b9 44 * Read the pressure.
fyazgan 0:711905e937b9 45 *
fyazgan 0:711905e937b9 46 * @returns The pressure in pascals.
fyazgan 0:711905e937b9 47 */
fyazgan 0:711905e937b9 48 unsigned long readPressure();
fyazgan 0:711905e937b9 49
fyazgan 0:711905e937b9 50 /**
fyazgan 0:711905e937b9 51 * Read the temperature.
fyazgan 0:711905e937b9 52 *
fyazgan 0:711905e937b9 53 * @returns The temperature in Celsius.
fyazgan 0:711905e937b9 54 */
fyazgan 0:711905e937b9 55 float readTemperature();
fyazgan 0:711905e937b9 56
fyazgan 0:711905e937b9 57
fyazgan 0:711905e937b9 58 private:
fyazgan 0:711905e937b9 59 static const char PRESSURE = 0x1F; //Pressure 3 MSB
fyazgan 0:711905e937b9 60 static const char PRESSURE_LSB = 0x20; //Pressure 16 LSB
fyazgan 0:711905e937b9 61 static const char TEMP = 0x21; //16 bit temp
fyazgan 0:711905e937b9 62 SPI m_spi;
fyazgan 0:711905e937b9 63 DigitalOut m_cs;
fyazgan 0:711905e937b9 64
fyazgan 0:711905e937b9 65 char read_register(char register_name);
fyazgan 0:711905e937b9 66 void write_register(char register_name, char register_value);
fyazgan 0:711905e937b9 67 float read_register16(char register_name);
fyazgan 0:711905e937b9 68
fyazgan 0:711905e937b9 69 };
fyazgan 0:711905e937b9 70
fyazgan 0:711905e937b9 71 #endif // _SCP1000_H