ADT7410 library

Dependents:   mbed_DEMO mbed_BLE

See https://developer.mbed.org/users/yasuyuki/notebook/ADT7410/

Committer:
yasuyuki
Date:
Wed Jun 03 01:27:12 2015 +0000
Revision:
2:f01d96ee8fda
Parent:
1:b13511ed5965
one shot

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yasuyuki 0:cebbc4e855af 1 //**********************
yasuyuki 0:cebbc4e855af 2 // ADT7410.h for mbed
yasuyuki 0:cebbc4e855af 3 //
yasuyuki 0:cebbc4e855af 4 // (C)Copyright 2014 All rights reserved by Y.Onodera
yasuyuki 0:cebbc4e855af 5 // http://einstlab.web.fc2.com
yasuyuki 0:cebbc4e855af 6 //**********************
yasuyuki 0:cebbc4e855af 7 #ifndef ADT7410_H_
yasuyuki 0:cebbc4e855af 8 #define ADT7410_H_
yasuyuki 0:cebbc4e855af 9
yasuyuki 0:cebbc4e855af 10 #define ADT7410_ADDR 0x90
yasuyuki 0:cebbc4e855af 11 #define ADT7410_TEMP_H 0x00
yasuyuki 0:cebbc4e855af 12 #define ADT7410_TEMP_L 0x01
yasuyuki 0:cebbc4e855af 13 #define ADT7410_STATUS 0x02
yasuyuki 0:cebbc4e855af 14 #define ADT7410_CONFIG 0x03
yasuyuki 0:cebbc4e855af 15 #define ADT7410_THIGH_H 0x04
yasuyuki 0:cebbc4e855af 16 #define ADT7410_THIGH_L 0x05
yasuyuki 0:cebbc4e855af 17 #define ADT7410_TLOW_H 0x06
yasuyuki 0:cebbc4e855af 18 #define ADT7410_TLOW_L 0x07
yasuyuki 0:cebbc4e855af 19 #define ADT7410_TCRIT_H 0x08
yasuyuki 0:cebbc4e855af 20 #define ADT7410_TCRIT_L 0x09
yasuyuki 0:cebbc4e855af 21 #define ADT7410_THYST_H 0x0A
yasuyuki 0:cebbc4e855af 22 #define ADT7410_ID 0x0B
yasuyuki 0:cebbc4e855af 23 #define ADT7410_RESET 0x2F
yasuyuki 0:cebbc4e855af 24
yasuyuki 0:cebbc4e855af 25 #include "mbed.h"
yasuyuki 0:cebbc4e855af 26 #include "typedef.h"
yasuyuki 0:cebbc4e855af 27
yasuyuki 0:cebbc4e855af 28 class ADT7410{
yasuyuki 0:cebbc4e855af 29 public:
yasuyuki 0:cebbc4e855af 30 ADT7410 (PinName sda, PinName scl);
yasuyuki 0:cebbc4e855af 31 ADT7410 (I2C& p_i2c);
yasuyuki 0:cebbc4e855af 32 void init();
yasuyuki 0:cebbc4e855af 33
yasuyuki 0:cebbc4e855af 34 void put(unsigned char a, unsigned char b);
yasuyuki 0:cebbc4e855af 35 void get(unsigned char a);
yasuyuki 1:b13511ed5965 36 short value();
yasuyuki 0:cebbc4e855af 37
yasuyuki 0:cebbc4e855af 38 protected:
yasuyuki 0:cebbc4e855af 39
yasuyuki 0:cebbc4e855af 40 I2C _i2c;
yasuyuki 0:cebbc4e855af 41
yasuyuki 0:cebbc4e855af 42 WORD_VAL temp;
yasuyuki 0:cebbc4e855af 43 char buf[2];
yasuyuki 0:cebbc4e855af 44
yasuyuki 0:cebbc4e855af 45 };
yasuyuki 0:cebbc4e855af 46
yasuyuki 0:cebbc4e855af 47 #endif /* ADT7410_H_ */
yasuyuki 0:cebbc4e855af 48
yasuyuki 0:cebbc4e855af 49