ADT7410 library
Dependents: mbed_DEMO mbed_BLE
See https://developer.mbed.org/users/yasuyuki/notebook/ADT7410/
Diff: ADT7410.h
- Revision:
- 0:cebbc4e855af
- Child:
- 1:b13511ed5965
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ADT7410.h Sat Oct 04 12:01:32 2014 +0000 @@ -0,0 +1,49 @@ +//********************** +// ADT7410.h for mbed +// +// (C)Copyright 2014 All rights reserved by Y.Onodera +// http://einstlab.web.fc2.com +//********************** +#ifndef ADT7410_H_ +#define ADT7410_H_ + +#define ADT7410_ADDR 0x90 +#define ADT7410_TEMP_H 0x00 +#define ADT7410_TEMP_L 0x01 +#define ADT7410_STATUS 0x02 +#define ADT7410_CONFIG 0x03 +#define ADT7410_THIGH_H 0x04 +#define ADT7410_THIGH_L 0x05 +#define ADT7410_TLOW_H 0x06 +#define ADT7410_TLOW_L 0x07 +#define ADT7410_TCRIT_H 0x08 +#define ADT7410_TCRIT_L 0x09 +#define ADT7410_THYST_H 0x0A +#define ADT7410_ID 0x0B +#define ADT7410_RESET 0x2F + +#include "mbed.h" +#include "typedef.h" + +class ADT7410{ +public: + ADT7410 (PinName sda, PinName scl); + ADT7410 (I2C& p_i2c); + void init(); + + void put(unsigned char a, unsigned char b); + void get(unsigned char a); + int value(); + +protected: + + I2C _i2c; + + WORD_VAL temp; + char buf[2]; + +}; + +#endif /* ADT7410_H_ */ + +