SCP1000
Fork of SCP1000 by
SCP1000.h
- Committer:
- YSB
- Date:
- 2013-07-05
- Revision:
- 10:53f432e521a4
- Parent:
- 9:47d6f205890b
File content as of revision 10:53f432e521a4:
#ifndef _SCP1000_H #define _SCP1000_H #include "mbed.h" class SCP1000 { public: SCP1000(PinName mosi, PinName miso, PinName sclk, PinName cs); ~SCP1000() { /* empty */ }; unsigned long readPressure(); float readTemperature(); void init_scp1000(); private: static const char PRESSURE = 0x1F; //Pressure 3 MSB static const char PRESSURE_LSB = 0x20; //Pressure 16 LSB static const char TEMP = 0x21; //16 bit temp SPI m_spi; DigitalOut m_cs; char read_register(char register_name); void write_register(char register_name, char register_value); float read_register16(char register_name); }; #endif // _SCP1000_H