14 namespace duds {
namespace hardware {
namespace devices {
namespace instruments {
21 namespace TSL2591_internal {
79 using namespace TSL2591_internal;
88 com->converse(firstcon);
100 (std::int8_t)(
Reset);
103 com->converse(firstcon);
128 if ((gain < 0) || (gain > 3)) {
131 if (integration >= 100) {
132 integration = (integration / 100) - 1;
134 if ((integration < 0) || (integration > 5)) {
145 (std::int8_t)(integration | (gain <<
GainShift));
148 scale = (double)(integration + 1);
A container for a value and a unit to better describe the value.
TSL2591(std::unique_ptr< duds::hardware::interface::I2c > &c)
Attempts to identify the device, then performs a reset.
constexpr Unit Meter(DUDS_UNIT_VALUE(0, 0, 0, 0, 1, 0, 0, 0, 0))
void clear()
Makes the conversation empty.
void sample()
The device will update samples after it has completed integration.
An invalid integration time was specified.
void resume()
Resumes operation after a call to suspend().
boost::error_info< struct Info_i2cdevaddr, int > I2cDeviceAddr
Provides the device (slave) address along with an error.
std::uint16_t broad
The values supplied by the device.
void suspend()
Suspends operation by putting the device into a low-power mode.
ConversationVector & addInputVector(std::size_t len)
Creates a new ConversationVector for fixed length input and initializes it with the given length...
EnableFlags
Flags used to enable various features.
Regs
The device's registers.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
~TSL2591()
Calls suspend().
The device did not respond to its address (NACK).
static std::uint16_t gainSettings[4]
The set of selectable gain factors.
duds::hardware::interface::Conversation input
The conversation used to query the brightness values.
An attempt was made to use a device prior to running a required initialization step.
An invalid gain value was specified.
CmdFlags
The flags refered to as commands in the documentation.
std::unique_ptr< duds::hardware::interface::I2c > com
The I2C communication interface.
static std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > conv
String converter; UTF-8 to/from UTF-32.
constexpr Unit Watt(DUDS_UNIT_VALUE(0, 0, 0, 1, 2, 0, -3, 0, 0))
duds::data::Quantity brightnessIr() const
Brightness mostly in infrared.
ControlFlags
More configuration flags.
double scale
A scalar value used to partially convert the counts supplied by the device into a value in Watts per ...
void init(int gain, int integration)
Configures the device.
An attempt was made to use a device that seems to exist, but the responding device is not the type th...
ConversationVector & addOutputVector()
Creates a new ConversationVector for output and returns it for modification.
bool empty() const
Returns true if the conversation has no parts.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
duds::data::Quantity brightness() const
Broad spectrum brightness.
duds::hardware::interface::Conversation initialize
The conversation used to initialize the device.
Represents a two-way conversation with a device.