DUDS
Distributed Update of Data from Something
AMG88xx.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2018 Jeff Jackowski
9  */
12 #include <duds/data/Quantity.hpp>
13 
14 namespace duds { namespace hardware { namespace devices { namespace instruments {
15 
46 class AMG88xx : boost::noncopyable {
50  std::unique_ptr<duds::hardware::interface::I2c> com;
58  double img[8][8];
62  std::int16_t temp;
66  enum Mode {
85  };
86  struct {
90  unsigned int mode : 2;
94  unsigned int fps1Not10 : 1;
106  unsigned int misid : 1;
107  };
108 public:
116  AMG88xx(std::unique_ptr<duds::hardware::interface::I2c> &c);
121  ~AMG88xx();
127  void configure(bool fps1);
131  void oneFps() {
132  configure(true);
133  }
137  void tenFps() {
138  configure(false);
139  }
148  void start();
152  void resume() {
153  start();
154  }
159  void suspend();
168  void sample();
172  typedef double double8x8[8][8];
177  const double8x8 &image() const {
178  return img;
179  }
184 };
185 
186 } } } }
A container for a value and a unit to better describe the value.
Definition: Quantity.hpp:37
const double8x8 & image() const
Provides direct access to the most recent sample.
Definition: AMG88xx.hpp:177
void configure(bool fps1)
Configures the device.
Definition: AMG88xx.cpp:63
~AMG88xx()
Suspends the device operation (sleep mode) if a DeviceMisidentified error did not occur on the last s...
Definition: AMG88xx.cpp:57
void oneFps()
Configures the device for a 1Hz sampling rate.
Definition: AMG88xx.hpp:131
duds::data::Quantity temperature() const
Returns the temperature of the device as reported by its thermistor.
Definition: AMG88xx.cpp:132
void suspend()
Transitions the device to sleep mode.
Definition: AMG88xx.cpp:109
Support for the AMG88xx, a low resolution thermal camera.
Definition: AMG88xx.hpp:46
unsigned int mode
Current operating mode.
Definition: AMG88xx.hpp:90
void sample()
Reads a sample from the device.
Definition: AMG88xx.cpp:117
void start()
Transitions the device to normal operating mode so that it begins sampling.
Definition: AMG88xx.cpp:78
unsigned int fps1Not10
Frame rate setting.
Definition: AMG88xx.hpp:94
unsigned int misid
True when the last read of the operating mode failed on error, or provided a result that did not matc...
Definition: AMG88xx.hpp:106
Regular sampling at 1Hz or 10Hz.
Definition: AMG88xx.hpp:70
std::unique_ptr< duds::hardware::interface::I2c > com
The I2C communication interface.
Definition: AMG88xx.hpp:50
AMG88xx(std::unique_ptr< duds::hardware::interface::I2c > &c)
Attempts to reset the device and put it into sleep mode.
Definition: AMG88xx.cpp:19
double double8x8[8][8]
Image array type.
Definition: AMG88xx.hpp:172
void tenFps()
Configures the device for a 10Hz sampling rate.
Definition: AMG88xx.hpp:137
Header for Conversarion; includes ConversationVector.hpp and ConversationExternal.hpp.
std::int16_t temp
Thermistor temperature.
Definition: AMG88xx.hpp:62
No sampling ; reduced power usage.
Definition: AMG88xx.hpp:74
duds::hardware::interface::Conversation read
Used to read in sampled data from the device.
Definition: AMG88xx.hpp:54
Only mention in documentation is "Stand-by mode (60sec intermittence)".
Definition: AMG88xx.hpp:79
Only mention in documentation is "Stand-by mode (10sec intermittence)".
Definition: AMG88xx.hpp:84
double img[8][8]
Temperature image.
Definition: AMG88xx.hpp:58
Represents a two-way conversation with a device.