DUDS
Distributed Update of Data from Something
duds::hardware::devices::instruments::ISL29125 Class Reference

A quick try at supporting ISL29125 RGB sensor; will change significantly in the future. More...

#include <ISL29125.hpp>

Inheritance diagram for duds::hardware::devices::instruments::ISL29125:
Collaboration diagram for duds::hardware::devices::instruments::ISL29125:

Public Member Functions

 ISL29125 (std::unique_ptr< duds::hardware::interface::I2c > &c)
 Prepares to communicate with the device, but does not initalize the device. More...
 
 ~ISL29125 ()
 Calls suspend(). More...
 
std::uint16_t blue () const
 
std::uint16_t green () const
 
void init (bool wide=true)
 Configures for continuous 16-bit sampling of all colors. More...
 
std::uint16_t red () const
 
void resume ()
 Resumes operation after a call to suspend(). More...
 
void sample ()
 The device takes about 101ms to produce a 16-bit sample per color. More...
 
void suspend ()
 Suspends operation by putting the device into a low-power mode. More...
 

Private Attributes

std::uint16_t b
 Blue brightness. More...
 
std::unique_ptr< duds::hardware::interface::I2ccom
 The I2C communication interface. More...
 
std::uint16_t g
 Green brightness. More...
 
duds::hardware::interface::Conversation initialize
 Output used to initialize the device. More...
 
duds::hardware::interface::Conversation input
 Used to read in the sampled data. More...
 
std::uint16_t r
 Red brightness. More...
 

Detailed Description

A quick try at supporting ISL29125 RGB sensor; will change significantly in the future.

Uses I2C to read six bytes in one call rather than three calls with SMBus. Seems to work well.

Author
Jeff Jackowski

Definition at line 24 of file ISL29125.hpp.

Constructor & Destructor Documentation

◆ ISL29125()

duds::hardware::devices::instruments::ISL29125::ISL29125 ( std::unique_ptr< duds::hardware::interface::I2c > &  c)

Prepares to communicate with the device, but does not initalize the device.

Default device address is 0x44.

Definition at line 16 of file ISL29125.cpp.

◆ ~ISL29125()

duds::hardware::devices::instruments::ISL29125::~ISL29125 ( )

Calls suspend().

Definition at line 25 of file ISL29125.cpp.

Member Function Documentation

◆ blue()

std::uint16_t duds::hardware::devices::instruments::ISL29125::blue ( ) const
inline

Definition at line 93 of file ISL29125.hpp.

◆ green()

std::uint16_t duds::hardware::devices::instruments::ISL29125::green ( ) const
inline

Definition at line 90 of file ISL29125.hpp.

◆ init()

void duds::hardware::devices::instruments::ISL29125::init ( bool  wide = true)

Configures for continuous 16-bit sampling of all colors.

All other options are left at default settings.

Parameters
wideTrue for 10000 lux range, false for 375 lux range.

Definition at line 29 of file ISL29125.cpp.

◆ red()

std::uint16_t duds::hardware::devices::instruments::ISL29125::red ( ) const
inline

Definition at line 87 of file ISL29125.hpp.

◆ resume()

void duds::hardware::devices::instruments::ISL29125::resume ( )

Resumes operation after a call to suspend().

Exceptions
DeviceUninitalizedinit() hasn't been called.

Definition at line 50 of file ISL29125.cpp.

◆ sample()

void duds::hardware::devices::instruments::ISL29125::sample ( )

The device takes about 101ms to produce a 16-bit sample per color.

Sampling faster than that will read old values, but not bad data.

Definition at line 57 of file ISL29125.cpp.

◆ suspend()

void duds::hardware::devices::instruments::ISL29125::suspend ( )

Suspends operation by putting the device into a low-power mode.

Definition at line 40 of file ISL29125.cpp.

Referenced by ~ISL29125().

Member Data Documentation

◆ b

std::uint16_t duds::hardware::devices::instruments::ISL29125::b
private

Blue brightness.

Definition at line 48 of file ISL29125.hpp.

Referenced by blue(), and sample().

◆ com

std::unique_ptr<duds::hardware::interface::I2c> duds::hardware::devices::instruments::ISL29125::com
private

The I2C communication interface.

Definition at line 28 of file ISL29125.hpp.

Referenced by init(), resume(), sample(), and suspend().

◆ g

std::uint16_t duds::hardware::devices::instruments::ISL29125::g
private

Green brightness.

Definition at line 44 of file ISL29125.hpp.

Referenced by green(), and sample().

◆ initialize

duds::hardware::interface::Conversation duds::hardware::devices::instruments::ISL29125::initialize
private

Output used to initialize the device.

Definition at line 32 of file ISL29125.hpp.

Referenced by init(), and resume().

◆ input

duds::hardware::interface::Conversation duds::hardware::devices::instruments::ISL29125::input
private

Used to read in the sampled data.

Definition at line 36 of file ISL29125.hpp.

Referenced by ISL29125(), and sample().

◆ r

std::uint16_t duds::hardware::devices::instruments::ISL29125::r
private

Red brightness.

Definition at line 40 of file ISL29125.hpp.

Referenced by red(), and sample().


The documentation for this class was generated from the following files: