Arrow / TMP06
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TMP06.h Source File

TMP06.h

00001 /* Copyright (C) 2020 Arrow Electronics */
00002 
00003 #ifndef _TMP06_H_
00004 #define _TMP06_H_
00005 
00006 #include "mbed.h"
00007 
00008 #define SUCCESS 0
00009 #define FAILURE 1
00010 #define SEM_TIMEOUT_MS 250 
00011 
00012 class TMP06 {
00013     public:
00014         TMP06(PinName pin);
00015         ~TMP06();
00016         int read(float *temperature);
00017 
00018     private:
00019         void on_rise();
00020         void on_fall();
00021         
00022         InterruptIn _pwm_pin;
00023         Timer _timer1;
00024         Timer _timer2;
00025         Semaphore _semaphore;
00026         bool _first_run;
00027         bool _started;
00028 };
00029 
00030 #endif /* _TMP06_H_ */