yasuyuki onodera / ADT7410

Dependents:   mbed_DEMO mbed_BLE

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ADT7410.h Source File

ADT7410.h

00001 //**********************
00002 // ADT7410.h for mbed
00003 //
00004 // (C)Copyright 2014 All rights reserved by Y.Onodera
00005 // http://einstlab.web.fc2.com
00006 //**********************
00007 #ifndef ADT7410_H_
00008 #define ADT7410_H_
00009 
00010 #define ADT7410_ADDR    0x90
00011 #define ADT7410_TEMP_H  0x00
00012 #define ADT7410_TEMP_L  0x01
00013 #define ADT7410_STATUS  0x02
00014 #define ADT7410_CONFIG  0x03
00015 #define ADT7410_THIGH_H 0x04
00016 #define ADT7410_THIGH_L 0x05
00017 #define ADT7410_TLOW_H  0x06
00018 #define ADT7410_TLOW_L  0x07
00019 #define ADT7410_TCRIT_H 0x08
00020 #define ADT7410_TCRIT_L 0x09
00021 #define ADT7410_THYST_H 0x0A
00022 #define ADT7410_ID  0x0B
00023 #define ADT7410_RESET   0x2F
00024 
00025 #include "mbed.h"
00026 #include "typedef.h"
00027 
00028 class ADT7410{
00029 public:
00030     ADT7410 (PinName sda, PinName scl);
00031     ADT7410 (I2C& p_i2c);
00032     void init();
00033 
00034     void put(unsigned char a, unsigned char b);
00035     void get(unsigned char a);
00036     short value();
00037 
00038 protected:
00039     
00040     I2C _i2c;
00041 
00042     WORD_VAL temp;
00043     char buf[2];
00044 
00045 };
00046 
00047 #endif /* ADT7410_H_ */
00048 
00049